{"id":15679730,"url":"https://github.com/varunsridharan/wp-dependencies","last_synced_at":"2025-05-07T09:36:01.215Z","repository":{"id":52419848,"uuid":"163239676","full_name":"varunsridharan/wp-dependencies","owner":"varunsridharan","description":"Provides Function To Check if a plugin is active/inactive \u0026 function to compare versions.","archived":false,"fork":false,"pushed_at":"2021-04-29T19:35:51.000Z","size":114,"stargazers_count":10,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-18T05:44:34.198Z","etag":null,"topics":["dependencies","vsp-libs","wordpress","wordpress-dependencies","wordpress-development","wordpress-library","wordpress-php-library","wordpress-plugin","wordpress-plugin-development","wordpress-plugin-library","wordpress-plugins","wordpress-theme","wordpress-theme-development","wordpress-theme-library","wp","wp-addon","wp-dependencies","wp-library","wp-plugin","wp-theme"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/varunsridharan/wp-dependencies","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/varunsridharan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-27T02:54:26.000Z","updated_at":"2024-10-01T00:34:08.000Z","dependencies_parsed_at":"2022-08-17T21:35:04.180Z","dependency_job_id":null,"html_url":"https://github.com/varunsridharan/wp-dependencies","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varunsridharan%2Fwp-dependencies","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varunsridharan%2Fwp-dependencies/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varunsridharan%2Fwp-dependencies/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varunsridharan%2Fwp-dependencies/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/varunsridharan","download_url":"https://codeload.github.com/varunsridharan/wp-dependencies/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252851902,"owners_count":21814241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dependencies","vsp-libs","wordpress","wordpress-dependencies","wordpress-development","wordpress-library","wordpress-php-library","wordpress-plugin","wordpress-plugin-development","wordpress-plugin-library","wordpress-plugins","wordpress-theme","wordpress-theme-development","wordpress-theme-library","wp","wp-addon","wp-dependencies","wp-library","wp-plugin","wp-theme"],"created_at":"2024-10-03T16:35:01.751Z","updated_at":"2025-05-07T09:36:01.184Z","avatar_url":"https://github.com/varunsridharan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WP Dependencies\nProvides Function To Check if a plugin is active/inactive \u0026 function to compare versions.\n\n[![Latest Stable Version](https://poser.pugx.org/varunsridharan/wp-dependencies/version)](https://packagist.org/packages/varunsridharan/wp-dependencies)\n[![Latest Unstable Version](https://poser.pugx.org/varunsridharan/wp-dependencies/v/unstable)](https://packagist.org/packages/varunsridharan/wp-dependencies)\n[![Total Downloads](https://poser.pugx.org/varunsridharan/wp-dependencies/downloads)](https://packagist.org/packages/varunsridharan/wp-dependencies)\n[![Latest Unstable Version](https://poser.pugx.org/varunsridharan/wp-dependencies/v/unstable)](//packagist.org/packages/varunsridharan/wp-dependencies)\n[![WP](https://img.shields.io/badge/WordPress-Standar-1abc9c.svg)](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/)\n[![License](https://poser.pugx.org/varunsridharan/wp-dependencies/license)](https://packagist.org/packages/varunsridharan/wp-dependencies)\n[![composer.lock available](https://poser.pugx.org/varunsridharan/wp-dependencies/composerlock)](https://packagist.org/packages/varunsridharan/wp-dependencies)\n\n## Installation\nThe preferred way to install this extension is through [Composer](http://getcomposer.org/download/).\n\nTo install **VSP_Framework library**, simply:\n\n    $ composer require varunsridharan/wp-dependencies\n\nThe previous command will only install the necessary files, if you prefer to **download the entire source code** you can use:\n\n    $ composer require varunsridharan/wp-dependencies --prefer-source\n\nYou can also **clone the complete repository** with Git:\n\n    $ git clone https://github.com/varunsridharan/wp-dependencies.git\n\nOr **install it manually**:\n\n   [Download Dependencies.php](https://raw.githubusercontent.com/varunsridharan/wp-dependencies/master/src/dependencies.php):\n    \n    $ wget https://raw.githubusercontent.com/varunsridharan/wp-dependencies/master/src/dependencies.php\n   \n   [Download Functions.php](https://raw.githubusercontent.com/varunsridharan/wp-dependencies/master/src/functions.php):\n    \n    $ wget https://raw.githubusercontent.com/varunsridharan/wp-dependencies/master/src/functions.php\n\n## Usage\n\n```php\ninclude __DIR__.'/dependencies.php';\n```\n\n### `wp_is_plugin_active( $plugin_file )`\nThis function can be used to check if the given plugin is active for the Current WP Install (It can be a network / single site)\n```php\n/**\n * You Need To Pass Main Plugin File To Check If Its Active.\n */\n$is_wc_active        = wp_is_plugin_active( 'woocommerce/woocommerce.php' );\n$is_gutenberg_active = wp_is_plugin_active( 'gutenberg/gutenberg.php' );\n```\n\n### `wp_is_plugin_network_active( $plugin_file )`\nThis function can be used to check if the given plugin is active network wide (Usefull Only If its a WP Network Install)\n```php\n/**\n * You Need To Pass Main Plugin File To Check If Its Active.\n */\n$is_wc_active        = wp_is_plugin_network_active( 'woocommerce/woocommerce.php' );\n$is_gutenberg_active = wp_is_plugin_network_active( 'gutenberg/gutenberg.php' );\n```\n\n### `wp_is_site_plugin_active( $plugin_file )`\nThis 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)\n```php\n/**\n * You Need To Pass Main Plugin File To Check If Its Active.\n */\n$is_wc_active        = wp_is_site_plugin_active( 'woocommerce/woocommerce.php' );\n$is_gutenberg_active = wp_is_site_plugin_active( 'gutenberg/gutenberg.php' );\n```\n\n### `wp_is_plugin_inactive( $plugin_file )`\nThis function can be used to check if given plugin is inactive for the current WP install.\n```php\n/**\n * You Need To Pass Main Plugin File To Check If Its InActive.\n */\n$is_wc_inactive        = wp_is_plugin_inactive( 'woocommerce/woocommerce.php' );\n$is_gutenberg_inactive = wp_is_plugin_inactive( 'gutenberg/gutenberg.php' );\n```\n\n### `plugin_version( $plugin_file )`\nPassing a plugin's main file will return the plugin's version.\n```php\n$wc_version = plugin_version( 'woocommerce/woocommerce.php' );\n\nif($wc_version === '3.0.1'){\n    // Do your stuff.\n}\n```\n\n### `plugin_version_gt( $plugin_file, $compare_version )`\nUse this function to check if the plugin's version is greater than then version you pass.\n\n**Alias Name:** `is_version_gt( $plugin_file, $compare_version )`\n\n```php\n$wc_version = plugin_version_gt( 'woocommerce/woocommerce.php', '3.0.1' );\n\nif( true === $wc_version ){\n    // Do your stuff.\n}\n```\n\n### `plugin_version_gte( $plugin_file, $compare_version )`\nUse this function to check if the plugin's version is greater than or equal to the version you pass.\n\n**Alias Name:** `is_version_gte( $plugin_file, $compare_version )`\n\n```php\n$wc_version = plugin_version_gte( 'woocommerce/woocommerce.php', '3.0.1' );\n\nif( true === $wc_version ){\n    // Do your stuff.\n}\n```\n\n### `plugin_version_lt( $plugin_file, $compare_version )`\nUse this function to check if the plugin's version is less than to the version you pass.\n\n**Alias Name:** `is_version_lt( $plugin_file, $compare_version )`\n\n```php\n$wc_version = plugin_version_lt( 'woocommerce/woocommerce.php', '3.0.1' );\n\nif( true === $wc_version ){\n    // Do your stuff.\n}\n```\n\n### `plugin_version_lte( $plugin_file, $compare_version )`\nUse this function to check if the plugin's version is less than or equal to the version you pass.\n\n**Alias Name:** `is_version_lte( $plugin_file, $compare_version )`\n\n```php\n$wc_version = plugin_version_lte( 'woocommerce/woocommerce.php', '3.0.1' );\n\nif( true === $wc_version ){\n    // Do your stuff.\n}\n```\n\n### Software Versions\n```php\n$is_wp_5_0 = is_version_gte('wordpress','5.0');\n$is_php_5_0 = is_version_gte('php','5.0');\n$is_mysql_5_0 = is_version_gte('mysql','5.0');\n```\n\n\n---\n\n\u003c!-- START common-footer.mustache  --\u003e\n## 📝 Changelog\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n[Checkout CHANGELOG.md](https://github.com/varunsridharan/wp-dependencies/blob/main/CHANGELOG.md)\n\n\n## 🤝 Contributing\nIf you would like to help, please take a look at the list of [issues](https://github.com/varunsridharan/wp-dependencies/issues/).\n\n\n## 📜  License \u0026 Conduct\n- [**GNU General Public License v3.0**](https://github.com/varunsridharan/wp-dependencies/blob/main/LICENSE) © [Varun Sridharan](website)\n- [Code of Conduct](https://github.com/varunsridharan/.github/blob/main/CODE_OF_CONDUCT.md)\n\n\n## 📣 Feedback\n- ⭐ This repository if this project helped you! :wink:\n- Create An [🔧 Issue](https://github.com/varunsridharan/wp-dependencies/issues/) if you need help / found a bug\n\n\n## 💰 Sponsor\n[I][twitter] fell in love with open-source in 2013 and there has been no looking back since! You can read more about me [here][website].\nIf 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.\n\n- ☕ How about we get to know each other over coffee? Buy me a cup for just [**$9.99**][buymeacoffee]\n- ☕️☕️ How about buying me just 2 cups of coffee each month? You can do that for as little as [**$9.99**][buymeacoffee]\n- 🔰         We love bettering open-source projects. Support 1-hour of open-source maintenance for [**$24.99 one-time?**][paypal]\n- 🚀         Love open-source tools? Me too! How about supporting one hour of open-source development for just [**$49.99 one-time ?**][paypal]\n\n\u003c!-- Personl Links --\u003e\n[paypal]: https://sva.onl/paypal\n[buymeacoffee]: https://sva.onl/buymeacoffee\n[twitter]: https://sva.onl/twitter/\n[website]: https://sva.onl/website/\n\n\n## Connect \u0026 Say 👋\n- **Follow** me on [👨‍💻 Github][github] and stay updated on free and open-source software\n- **Follow** me on [🐦 Twitter][twitter] to get updates on my latest open source projects\n- **Message** me on [📠 Telegram][telegram]\n- **Follow** my pet on [Instagram][sofythelabrador] for some _dog-tastic_ updates!\n\n\u003c!-- Personl Links --\u003e\n[sofythelabrador]: https://www.instagram.com/sofythelabrador/\n[github]: https://sva.onl/github/\n[twitter]: https://sva.onl/twitter/\n[telegram]: https://sva.onl/telegram/\n\n\n---\n\n\u003cp align=\"center\"\u003e\n\u003ci\u003eBuilt With ♥ By \u003ca href=\"https://sva.onl/twitter\"  target=\"_blank\" rel=\"noopener noreferrer\"\u003eVarun Sridharan\u003c/a\u003e \u003ca href=\"https://en.wikipedia.org/wiki/India\"\u003e\n   \u003cimg src=\"https://cdn.svarun.dev/flag-india.jpg\" width=\"20px\"/\u003e\u003c/a\u003e \u003c/i\u003e \u003cbr/\u003e\u003cbr/\u003e\n   \u003cimg src=\"https://cdn.svarun.dev/codeispoetry.png\"/\u003e\n\u003c/p\u003e\n\n---\n\n\n\u003c!-- END common-footer.mustache  --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvarunsridharan%2Fwp-dependencies","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvarunsridharan%2Fwp-dependencies","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvarunsridharan%2Fwp-dependencies/lists"}