PHPackages                             varunsridharan/wp-dependencies - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. varunsridharan/wp-dependencies

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

varunsridharan/wp-dependencies
==============================

Provides Function To Check if a plugin is active/inactive &amp; function to compare versions.

1.6.2(5y ago)1032.5k5[1 PRs](https://github.com/varunsridharan/wp-dependencies/pulls)1GPL-3.0-or-laterPHP

Since Dec 31Pushed 5y ago2 watchersCompare

[ Source](https://github.com/varunsridharan/wp-dependencies)[ Packagist](https://packagist.org/packages/varunsridharan/wp-dependencies)[ Docs](https://github.com/varunsridharan/wp-dependencies/)[ Fund](https://paypal.me/varunsridharan23)[ Fund](https://www.buymeacoffee.com/varunsridharan)[ RSS](/packages/varunsridharan-wp-dependencies/feed)WikiDiscussions main Synced yesterday

READMEChangelog (9)DependenciesVersions (11)Used By (1)

WP Dependencies
===============

[](#wp-dependencies)

Provides Function To Check if a plugin is active/inactive &amp; function to compare versions.

[![Latest Stable Version](https://camo.githubusercontent.com/54504d519dcd0f20be5b1841a231b76115e7f972e7cbe5f60028210944c5688b/68747470733a2f2f706f7365722e707567782e6f72672f766172756e73726964686172616e2f77702d646570656e64656e636965732f76657273696f6e)](https://packagist.org/packages/varunsridharan/wp-dependencies)[![Latest Unstable Version](https://camo.githubusercontent.com/9151309243140968c11899f951c55f7ea18efa525592fa1c30f8b0e44e88b1d2/68747470733a2f2f706f7365722e707567782e6f72672f766172756e73726964686172616e2f77702d646570656e64656e636965732f762f756e737461626c65)](https://packagist.org/packages/varunsridharan/wp-dependencies)[![Total Downloads](https://camo.githubusercontent.com/61f0d40813fa3ab4dda94b2907f7b0de34642baf5f03b2fd4b23a8ec4798107e/68747470733a2f2f706f7365722e707567782e6f72672f766172756e73726964686172616e2f77702d646570656e64656e636965732f646f776e6c6f616473)](https://packagist.org/packages/varunsridharan/wp-dependencies)[![Latest Unstable Version](https://camo.githubusercontent.com/9151309243140968c11899f951c55f7ea18efa525592fa1c30f8b0e44e88b1d2/68747470733a2f2f706f7365722e707567782e6f72672f766172756e73726964686172616e2f77702d646570656e64656e636965732f762f756e737461626c65)](//packagist.org/packages/varunsridharan/wp-dependencies)[![WP](https://camo.githubusercontent.com/ffba221a69a414072e7c2cb0bc46e849eddee342fbc151dd967cea940155c2b8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f576f726450726573732d5374616e6461722d3161626339632e737667)](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/)[![License](https://camo.githubusercontent.com/cdfa553e84710ec7c48e642d21b1aeda1e7a7af8955e5261f4de4994ab272d45/68747470733a2f2f706f7365722e707567782e6f72672f766172756e73726964686172616e2f77702d646570656e64656e636965732f6c6963656e7365)](https://packagist.org/packages/varunsridharan/wp-dependencies)[![composer.lock available](https://camo.githubusercontent.com/4d1ab0a8418ab74fa9d460b98c643871285746113e01a425b9a5fea2b9c9db6f/68747470733a2f2f706f7365722e707567782e6f72672f766172756e73726964686172616e2f77702d646570656e64656e636965732f636f6d706f7365726c6f636b)](https://packagist.org/packages/varunsridharan/wp-dependencies)

Installation
------------

[](#installation)

The preferred way to install this extension is through [Composer](http://getcomposer.org/download/).

To install **VSP\_Framework library**, simply:

```
$ composer require varunsridharan/wp-dependencies

```

The previous command will only install the necessary files, if you prefer to **download the entire source code** you can use:

```
$ composer require varunsridharan/wp-dependencies --prefer-source

```

You can also **clone the complete repository** with Git:

```
$ git clone https://github.com/varunsridharan/wp-dependencies.git

```

Or **install it manually**:

[Download Dependencies.php](https://raw.githubusercontent.com/varunsridharan/wp-dependencies/master/src/dependencies.php):

```
$ wget https://raw.githubusercontent.com/varunsridharan/wp-dependencies/master/src/dependencies.php

```

[Download Functions.php](https://raw.githubusercontent.com/varunsridharan/wp-dependencies/master/src/functions.php):

```
$ wget https://raw.githubusercontent.com/varunsridharan/wp-dependencies/master/src/functions.php

```

Usage
-----

[](#usage)

```
include __DIR__.'/dependencies.php';
```

### `wp_is_plugin_active( $plugin_file )`

[](#wp_is_plugin_active-plugin_file-)

This function can be used to check if the given plugin is active for the Current WP Install (It can be a network / single site)

```
/**
 * You Need To Pass Main Plugin File To Check If Its Active.
 */
$is_wc_active        = wp_is_plugin_active( 'woocommerce/woocommerce.php' );
$is_gutenberg_active = wp_is_plugin_active( 'gutenberg/gutenberg.php' );
```

### `wp_is_plugin_network_active( $plugin_file )`

[](#wp_is_plugin_network_active-plugin_file-)

This function can be used to check if the given plugin is active network wide (Usefull Only If its a WP Network Install)

```
/**
 * You Need To Pass Main Plugin File To Check If Its Active.
 */
$is_wc_active        = wp_is_plugin_network_active( 'woocommerce/woocommerce.php' );
$is_gutenberg_active = wp_is_plugin_network_active( 'gutenberg/gutenberg.php' );
```

### `wp_is_site_plugin_active( $plugin_file )`

[](#wp_is_site_plugin_active-plugin_file-)

This function can be used to check if the given plugin is active only in the current site (Usefull only if its a WP Network Install)

```
/**
 * You Need To Pass Main Plugin File To Check If Its Active.
 */
$is_wc_active        = wp_is_site_plugin_active( 'woocommerce/woocommerce.php' );
$is_gutenberg_active = wp_is_site_plugin_active( 'gutenberg/gutenberg.php' );
```

### `wp_is_plugin_inactive( $plugin_file )`

[](#wp_is_plugin_inactive-plugin_file-)

This function can be used to check if given plugin is inactive for the current WP install.

```
/**
 * You Need To Pass Main Plugin File To Check If Its InActive.
 */
$is_wc_inactive        = wp_is_plugin_inactive( 'woocommerce/woocommerce.php' );
$is_gutenberg_inactive = wp_is_plugin_inactive( 'gutenberg/gutenberg.php' );
```

### `plugin_version( $plugin_file )`

[](#plugin_version-plugin_file-)

Passing a plugin's main file will return the plugin's version.

```
$wc_version = plugin_version( 'woocommerce/woocommerce.php' );

if($wc_version === '3.0.1'){
    // Do your stuff.
}
```

### `plugin_version_gt( $plugin_file, $compare_version )`

[](#plugin_version_gt-plugin_file-compare_version-)

Use this function to check if the plugin's version is greater than then version you pass.

**Alias Name:** `is_version_gt( $plugin_file, $compare_version )`

```
$wc_version = plugin_version_gt( 'woocommerce/woocommerce.php', '3.0.1' );

if( true === $wc_version ){
    // Do your stuff.
}
```

### `plugin_version_gte( $plugin_file, $compare_version )`

[](#plugin_version_gte-plugin_file-compare_version-)

Use this function to check if the plugin's version is greater than or equal to the version you pass.

**Alias Name:** `is_version_gte( $plugin_file, $compare_version )`

```
$wc_version = plugin_version_gte( 'woocommerce/woocommerce.php', '3.0.1' );

if( true === $wc_version ){
    // Do your stuff.
}
```

### `plugin_version_lt( $plugin_file, $compare_version )`

[](#plugin_version_lt-plugin_file-compare_version-)

Use this function to check if the plugin's version is less than to the version you pass.

**Alias Name:** `is_version_lt( $plugin_file, $compare_version )`

```
$wc_version = plugin_version_lt( 'woocommerce/woocommerce.php', '3.0.1' );

if( true === $wc_version ){
    // Do your stuff.
}
```

### `plugin_version_lte( $plugin_file, $compare_version )`

[](#plugin_version_lte-plugin_file-compare_version-)

Use this function to check if the plugin's version is less than or equal to the version you pass.

**Alias Name:** `is_version_lte( $plugin_file, $compare_version )`

```
$wc_version = plugin_version_lte( 'woocommerce/woocommerce.php', '3.0.1' );

if( true === $wc_version ){
    // Do your stuff.
}
```

### Software Versions

[](#software-versions)

```
$is_wp_5_0 = is_version_gte('wordpress','5.0');
$is_php_5_0 = is_version_gte('php','5.0');
$is_mysql_5_0 = is_version_gte('mysql','5.0');
```

---

📝 Changelog
-----------

[](#-changelog)

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

[Checkout CHANGELOG.md](https://github.com/varunsridharan/wp-dependencies/blob/main/CHANGELOG.md)

🤝 Contributing
--------------

[](#-contributing)

If you would like to help, please take a look at the list of [issues](https://github.com/varunsridharan/wp-dependencies/issues/).

📜 License &amp; Conduct
-----------------------

[](#--license--conduct)

- [**GNU General Public License v3.0**](https://github.com/varunsridharan/wp-dependencies/blob/main/LICENSE) © [Varun Sridharan](website)
- [Code of Conduct](https://github.com/varunsridharan/.github/blob/main/CODE_OF_CONDUCT.md)

📣 Feedback
----------

[](#-feedback)

- ⭐ This repository if this project helped you! 😉
- Create An [🔧 Issue](https://github.com/varunsridharan/wp-dependencies/issues/) if you need help / found a bug

💰 Sponsor
---------

[](#-sponsor)

[I](https://sva.onl/twitter/) fell in love with open-source in 2013 and there has been no looking back since! You can read more about me [here](https://sva.onl/website/). If you, or your company, use any of my projects or like what I’m doing, kindly consider backing me. I'm in this for the long run.

- ☕ How about we get to know each other over coffee? Buy me a cup for just [**$9.99**](https://sva.onl/buymeacoffee)
- ☕️☕️ How about buying me just 2 cups of coffee each month? You can do that for as little as [**$9.99**](https://sva.onl/buymeacoffee)
- 🔰 We love bettering open-source projects. Support 1-hour of open-source maintenance for [**$24.99 one-time?**](https://sva.onl/paypal)
- 🚀 Love open-source tools? Me too! How about supporting one hour of open-source development for just [**$49.99 one-time ?**](https://sva.onl/paypal)

Connect &amp; Say 👋
-------------------

[](#connect--say-)

- **Follow** me on [👨‍💻 Github](https://sva.onl/github/) and stay updated on free and open-source software
- **Follow** me on [🐦 Twitter](https://sva.onl/twitter/) to get updates on my latest open source projects
- **Message** me on [📠 Telegram](https://sva.onl/telegram/)
- **Follow** my pet on [Instagram](https://www.instagram.com/sofythelabrador/) for some *dog-tastic* updates!

---

*Built With ♥ By [Varun Sridharan](https://sva.onl/twitter) [ ![](https://camo.githubusercontent.com/ac180da7a81f72a639abce09c4827e7bacfdd3b82586b657387a7f84430c7b7f/68747470733a2f2f63646e2e73766172756e2e6465762f666c61672d696e6469612e6a7067)](https://en.wikipedia.org/wiki/India)*

 [![](https://camo.githubusercontent.com/51991d58f40dac784a0c08b9c5c16c66c59ef5bdf083e3d49e4f617ef98e03ee/68747470733a2f2f63646e2e73766172756e2e6465762f636f64656973706f657472792e706e67)](https://camo.githubusercontent.com/51991d58f40dac784a0c08b9c5c16c66c59ef5bdf083e3d49e4f617ef98e03ee/68747470733a2f2f63646e2e73766172756e2e6465762f636f64656973706f657472792e706e67)

---

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~104 days

Recently: every ~182 days

Total

9

Last Release

1858d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/522dc9d037e4b0517ee9b76cd63d75a6331b0e578afa9b27fee84b02863ace80?d=identicon)[varunsridharan](/maintainers/varunsridharan)

---

Top Contributors

[![varunsridharan](https://avatars.githubusercontent.com/u/1884287?v=4)](https://github.com/varunsridharan "varunsridharan (17 commits)")

---

Tags

dependenciesvsp-libswordpresswordpress-dependencieswordpress-developmentwordpress-librarywordpress-php-librarywordpress-pluginwordpress-plugin-developmentwordpress-plugin-librarywordpress-pluginswordpress-themewordpress-theme-developmentwordpress-theme-librarywpwp-addonwp-dependencieswp-librarywp-pluginwp-themewordpresswpwordpress plugindependencieswordpress-themewordpress-libraryWP Pluginwordpress-developmentwordpress-pluginswp themewordpress plugin developmentwordpress-plugin-librarywordpress-theme-librarywordpress-theme-developmentwordpress-php-libraryvsp-libswp-librarywp-addonwp-dependencieswordpress-dependencies

### Embed Badge

![Health badge](/badges/varunsridharan-wp-dependencies/health.svg)

```
[![Health](https://phpackages.com/badges/varunsridharan-wp-dependencies/health.svg)](https://phpackages.com/packages/varunsridharan-wp-dependencies)
```

###  Alternatives

[freemius/wordpress-sdk

Freemius WordPress SDK

303101.4k4](/packages/freemius-wordpress-sdk)[justcoded/wordpress-theme-boilerplate

WordPress theme boilerplate with better code structure and OOP support.

563.9k1](/packages/justcoded-wordpress-theme-boilerplate)[renakdup/simple-dic

Simple DI Container with autowiring for your WordPress application with NO dependencies.

101.8k1](/packages/renakdup-simple-dic)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
