PHP code example of elhardoum / wp-php-compat-check

1. Go to this page and download the library: Download elhardoum/wp-php-compat-check library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

elhardoum / wp-php-compat-check example snippets




CompatCheckWP::check(
    // ... arguments
)->then(function(){
    // [ ... ] Your plugin code goes here.
});


/*
Plugin Name: Tweak MailChimp Feeds RSS
Plugin URI: https://samelh.com/blog
Description: Tweak MailChimp RSS Feeds to add the featured image, excerpt and a read more button.
Author: Samuel Elh
Version: 0.1
Author URI: https://go.samelh.com/buy-me-a-coffee
*/

defined ( 'ABSPATH' ) || exit ( 'Direct access not allowed.' . PHP_EOL );

       // [...]
    }

    // [...]
});


/*
Plugin Name: My Plugin
Plugin URI: https://samelh.com/blog
Description: My Plugin.
Author: Samuel Elh
Version: 0.1
Author URI: https://go.samelh.com/buy-me-a-coffee
*/

function my_plugin_runs_here() {
    // [ ... ] my plugin code..
}


$is_compatible = CompatCheckWP::check(array(
    'php_version' => 7.0,
    'deactivate_incompatible' => true,
    'wp_version' => 4.2,
))->isCompatible();

if ( $is_compatible ) { /* ... */ }
bash
composer