https://github.com/wp-forge/wp-plugin-check
Check if a WordPress plugin is compatible with the current environment.
https://github.com/wp-forge/wp-plugin-check
wordpress-library
Last synced: about 1 year ago
JSON representation
Check if a WordPress plugin is compatible with the current environment.
- Host: GitHub
- URL: https://github.com/wp-forge/wp-plugin-check
- Owner: wp-forge
- License: gpl-2.0
- Created: 2020-04-20T16:49:49.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-21T00:22:47.000Z (about 6 years ago)
- Last Synced: 2025-03-25T03:11:10.425Z (over 1 year ago)
- Topics: wordpress-library
- Language: PHP
- Size: 9.77 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# WordPress Plugin Check
Check if a WordPress plugin is compatible with the current environment. If not, it will automatically deactivate the plugin and show a message to the user letting them know what they can do about it.
__Note:__ Only supports checking PHP 5.2+.
## Installation
```bash
composer require wp-forge/wp-plugin-check
```
## Usage
This is how the code should be used:
```php
min_php_version = '5.6';
$plugin_check->min_wp_version = '5.0';
$plugin_check->req_php_extensions = array( 'json', 'SimpleXML' );
$plugin_check->check_plugin_requirements();
}
require dirname( __FILE__ ) . '/includes/bootstrap.php';
```
Alter the WordPress version, PHP version, and required PHP extensions as needed.
__Important:__ _Don't load any other code in your main plugin file!_ PHP parses all code in a file before running it, so incompatible PHP code added after this check will negate the ability to properly perform compatibility checks.