Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wearerequired/wp-requirements-check
Simple drop-in library for WordPress plugins to check for PHP and WordPress version requirements
https://github.com/wearerequired/wp-requirements-check
wordpress wordpress-plugin
Last synced: 3 days ago
JSON representation
Simple drop-in library for WordPress plugins to check for PHP and WordPress version requirements
- Host: GitHub
- URL: https://github.com/wearerequired/wp-requirements-check
- Owner: wearerequired
- Created: 2016-05-01T19:09:42.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-03-11T11:17:46.000Z (over 5 years ago)
- Last Synced: 2024-10-21T03:03:58.276Z (27 days ago)
- Topics: wordpress, wordpress-plugin
- Language: PHP
- Homepage:
- Size: 20.5 KB
- Stars: 13
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# WP Requirements Check
Simple drop-in class to check minimum PHP and WordPress version requirements in your plugin.
## Usage
1. Run `composer require wearerequired/wp-requirements-check`
2. In your main plugin file, instantiate the class using something like this:```php
$requirements_check = new WP_Requirements_Check( array(
'title' => 'My awesome plugin',
'php' => '7.0',
'wp' => '4.7',
'file' => __FILE__,
'i18n' => array(
/* translators: 1: plugin name. 2: minimum PHP version. */
'php' => __( '“%1$s” requires PHP %2$s or higher. Please upgrade.', 'my-plugin' ),
/* translators: 1: plugin name. 2: minimum WordPress version. */
'wp' => __( '“%1$s” requires WordPress %2$s or higher. Please upgrade.', 'my-plugin' ),
),
) );if ( $requirements_check->passes() ) {
// Proceed.
}
```## Credits
Thanks to Mark Jaquith for his [grunt-wp-plugin](https://github.com/markjaquith/grunt-wp-plugin) template which contains similar code.