wpdesk / wp-basic-requirements
There is no license information available for the latest version (3.6.3) of this package.
3.6.3
2024-04-16 08:22 UTC
Requires
- php: >=5.3
Requires (Dev)
- php: >=5.5
- 10up/wp_mock: *
- mockery/mockery: *
- phpunit/phpunit: ^8
- wimg/php-compatibility: ^8
- wpdesk/wp-code-sniffer: ^1.2
- dev-master
- 3.6.3
- 3.6.2
- 3.6.1
- 3.6.0
- 3.6.0-beta3
- 3.6.0-beta2
- 3.6.0-beta1
- 3.5.2
- 3.5.1
- 3.5.0
- 3.4.0
- 3.3.0
- 3.2.8
- 3.2.7
- 3.2.6
- 3.2.5
- 3.2.4
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.0
- 3.0.5
- 3.0.4
- 3.0.3.1
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0
- 2.4.0
- 2.3.1
- 2.3.0
- 2.2
- 2.1.1
- 2.1
- 2.0
- 1.0.5
- 1.0.2
- 1.0.1-alpha
- dev-bugfix/prevent-error-notice
- dev-remove-arrow
- dev-feature/update-message
- dev-feature/minimum-plugin-version-check-demo1
- dev-feature/plugin-name
This package is auto-updated.
Last update: 2024-11-16 09:34:32 UTC
README
WP Basic Requirements
wp-basic-requirements is a simple library for WordPress plugins allowing to verify if the target environment meets the defined requirements. If not, it can be also used to display the notice to the users containing the proper information.
The library has to be compatible with PHP 5.2.x since it's the oldest acceptable version for WordPress to be run.
Available requirements to be defined:
- Minimal PHP version
- Minimal WordPress version
- Minimal WooCommerce version
- Required PHP module
- Required PHP setting
- OpenSSL version
Requirements
PHP 5.2 or later.
Installation via Composer
In order to install the bindings via Composer run the following command:
composer require wpdesk/wp-basic-requirements
Example usage
Use the following code in WordPress plugin's main .php file:
<?php
$requirements_checker = ( new WPDesk_Basic_Requirement_Checker_Factory )->create_from_requirement_array(
__FILE__,
'Example plugin name',
[
'php' => '7.0',
'wp' => '6.0',
'plugins' => [
[
'name' => 'woocommerce/woocommerce.php',
'nice_name' => 'WooCommerce',
],
],
]
);
if ( $requirements_checker->are_requirements_met() ) {
// plugin stuff goes here
} else {
$requirements_checker->render_notices();
}