Title: Better Compatibility Checking
Last modified: August 20, 2016

---

# Better Compatibility Checking

 *  [mtinsley](https://wordpress.org/support/users/mtinsley/)
 * (@mtinsley)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/better-compatibility-checking/)
 * I think it would be great if there were a way for plugin developers to specify
   compatibility requirements beyond the WordPress version. For instance, if the
   plugin requires a higher version of PHP or a particular extension or function,
   plugin authors should be able to specify the requirements in the readme:
 * >  === Plugin Name ===
   >  . . . Requires at least: 2.0.2 Tested up to: 2.1 Stable
   > tag: 4.3 Minimum PHP Verison: 5.3 Required Extensions: IMAP Required Functions:
   > json_ encode
 * It would only take a couple of simple checks ([extension_loaded](http://php.net/manual/en/function.extension-loaded.php),
   [function_exists](http://us3.php.net/manual/en/function.function-exists.php),
   [phpversion](http://php.net/manual/en/function.phpversion.php)) to see if you
   meet the requirements (when using the plugin browser within WordPress).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [14 years, 6 months ago](https://wordpress.org/support/topic/better-compatibility-checking/#post-2405498)
 * That can be coded into your plugin, to check for PHP version, WP version, etc
   etc. Since there are so many different implementations of PHP, however, it would
   be a pretty tall order to put that into Core. Right now, it’s up to the plugin
   devs.
 *  Thread Starter [mtinsley](https://wordpress.org/support/users/mtinsley/)
 * (@mtinsley)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/better-compatibility-checking/#post-2405543)
 * > That can be coded into your plugin, to check for PHP version, WP version, etc
   > etc.
 * I just thought it would be more convenient if the plugin browser notified users
   of any compatibility issues prior to installing the plugin. This would take some
   of the burden off of plugin developers.
 * > Since there are so many different implementations of PHP, however, it would
   > be a pretty tall order to put that into Core.
 * I’m not sure I get your meaning. Once the data is incorporated into the plugin
   api it would be fairly simple to add a few more checks in addition to the existing
   WordPress compatibility checks.
 * For example, this is the code where the wordpress version is checked (plugin-
   install.php line 341):
 *     ```
       if ( !empty($api->tested) && version_compare( substr($GLOBALS['wp_version'], 0, strlen($api->tested)), $api->tested, '>') )<br />
       			echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been tested</strong> with your current version of WordPress.') . '</p></div>';</p>
       <p>		else if ( !empty($api->requires) && version_compare( substr($GLOBALS['wp_version'], 0, strlen($api->requires)), $api->requires, '<') )<br />
       			echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been marked as compatible</strong> with your version of WordPress.') . '</p></div>';
       ```
   
 * Assuming the api is updated to include a minimum php version data point you would
   just need to add the following to check if you meet the requirement:
 *     ```
       <br />
       if ( !empty($api->min_php) && version_compare( phpversion(), $api->min_php, '<') )<br />
       			echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been marked as compatible</strong> with your version of PHP.') . '</p></div>';<br />
       ```
   
 * Unless there is something I’m not understanding it seems like the biggest challenge
   would be to update the plugin api to include the additional data from the readme,
   not wordpress itself.
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [14 years, 6 months ago](https://wordpress.org/support/topic/better-compatibility-checking/#post-2405647)
 * I meant with regards to php-addons, sorry, I’m gonna blame how ganked I was Friday
   😉
 * A quick check for PHP minimum version, sure, that could work.
 *  Thread Starter [mtinsley](https://wordpress.org/support/users/mtinsley/)
 * (@mtinsley)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/better-compatibility-checking/#post-2405678)
 * > I meant with regards to php-addons, sorry, I’m gonna blame how ganked I was
   > Friday 😉
 * I know the feeling 😀
 * Even with extensions and functions it’s a simple check. The only difference with
   the code I posted above is that you would have to iterate over each of the required
   functions or extensions in the readme file, and call function_exists or extension_loaded.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Better Compatibility Checking’ is closed to new replies.

## Tags

 * [compatibility](https://wordpress.org/support/topic-tag/compatibility/)

 * In: [Requests and Feedback](https://wordpress.org/support/forum/requests-and-feedback/)
 * 4 replies
 * 2 participants
 * Last reply from: [mtinsley](https://wordpress.org/support/users/mtinsley/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/better-compatibility-checking/#post-2405678)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
