Download the PHP package dsawardekar/wp-requirements without Composer

On this page you can find all versions of the php package dsawardekar/wp-requirements. 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-requirements

WP Requirements Build Status Scrutinizer Code Quality

A small library to easily handle detection of minimum system requirements in WordPress plugins.

Screenshot

Features

Getting Started

The library comes with a WP_Min_Requirements class that can be used to detect some basic system requirements like WordPress and PHP versions.

First we create a new instance of the class and call it's satisfied method in a conditional. If the condition is satisfied you can instantiate your plugin inside it.

Next we need to handle the case when the minimum requirements are not satisfied. The library comes with a WP_Faux_Plugin that does this by notifying the user that the minimum requirements are not satisfied.

All you need to do is create it and passing it the name of your plugin and the results object from the requirements.

When the requirements are not met, users will see a message like shown above.

Detecting Specific Versions of PHP & WordPress

To create custom requirements you extend the WP_Requirements class and provide a custom getRequirements method. It should return an array of requirement objects.

Below is the WP_Min_Requirements class that matches against PHP 5.3.2 and WordPress 3.5.

Custom Requirements

You can also customize the requirements specific to your plugin. First you need to create a custom Requirement class with 2 methods, check and message.

Your check method should perform your custom detection and return true or false. And the message method should return the message to display to the user if the requirement is not met.

For example to check if the Akismet plugin is in use,

Then wrap this up into a new class that extends the WP_Requirements class and put this requirement into use.

Other Requirements

Use the WP_Modern_Requirements class to ensure that PHP 5.5 and required extensions are present.

To test the requirements message, use the WP_Failing_Requirements class instead.

Usage

The library and all it's classes are bundled inside the Requirements.php file.

  1. Copy the Requirements.php file into your project.
  2. Use require_once to include this file into your plugin's main file.
  3. Instantiate the Requirements object and call it's satisfied method as described above.

Making Changes

Please send pull requests instead of changing the requirements file directly inside your project.

If you must make modifications to the Requirements.php do so my renaming the WP_ prefix to something unique like your company name.

Eg:- Acme_Requirements. A find and replace for WP_ to Acme_ will do the trick.

Examples

  1. Sample plugin using MinRequirements.
  2. Sample WooCommerce plugin.

Thanks

Contributing

Please include your system and environment details for faster resolution of bug reports. Failing tests alongside bug reports are awesome!

Pull Requests are Welcome!

The project comes with a test suite that is integrated with Travis. Please ensure that the test suite passes before submitting PRs. Also try to include tests alongside any major changes.

Also note, this project uses the git flow branching model. PRs should be made against the develop branch.

License

MIT License. Copyright © 2014 Darshan Sawardekar


All versions of wp-requirements with dependencies

PHP Build Version
Package Version
No informations.
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 dsawardekar/wp-requirements contains the following files

Loading the files please wait ....