Download the PHP package elhardoum/wp-php-compat-check without Composer

On this page you can find all versions of the php package elhardoum/wp-php-compat-check. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wp-php-compat-check

Compatibility Check helper for WordPress plugins

Helps check PHP and WordPress compatibility before running the plugin.

You can wrap your main WordPress plugin code in this helper, and specify which minimum PHP version your plugin should run on, and also optionally which WordPress version to require as a minimum, and then the plugin should work with no fatal errors if all checks are met and the environment is compatible.

This helper requires PHP 5.0 at least, and should be working for multisite environments as well.

Usage:

In your main plugin file, e.g wp-content/plugins/my-plugin/my-plugin.php, require this compat class:

For composer users:

Then, make sure to copy all of your main file code (except the plugin header comments of course) into the then method:

Here's an example:

Here's another example, this time without using closures since they're supported as of PHP 5.3:

One last example, if you don't want to use then method, there's isCompatible to get you covered:

Options:

The following are called options, which you can pass to the check method of the CompatCheckWP class (CompatCheckWP::check( array( ...options ) )):

php_version: The minimum PHP version your plugin should work with, if needed.

wp_version: The minimum WordPress version your plugin should work with, if needed.

deactivate_incompatible: Deactivate the plugin right away if not compatible. Otherwise keep it active but the plugin code will not be running.

error_message: Customize the incompatibility error message. It defaults to: The following plugin could not be activated due to a compatibility error: plugin-name/plugin-name.php. [PHP >= XX: ✓, WP >= XX: ×]

plugin_file: Optional, pass a string of the plugin file in the format of this function return: plugin_basename (e.g 'plugin_file' => plugin_basename(MY_PLUGIN_FILE) ). If you are calling the class from the main plugin file and not passing this argument, then the plugin file will be programatically extracted from the debug backtrace, otherwise if calling from another file then it would certainly fail and you'll want to pass in this argument.

php_version_operator: The operator by default is >= for checking the PHP version requirement.

wp_version_operator: The operator by default is >= for checking WP version requirement.


All versions of wp-php-compat-check with dependencies

PHP Build Version
Package Version
Requires php Version >=5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package elhardoum/wp-php-compat-check contains the following files

Loading the files please wait ....