cloudflare/Cloudflare-WordPress
Publicmirrored fromhttps://github.com/cloudflare/Cloudflare-WordPress
cloudflare.php
31lines · modecode
9 years ago
| 1 | <?php |
| 2 | /* |
| 3 | Plugin Name: CloudFlare |
| 4 | Plugin URI: http://www.cloudflare.com/wiki/CloudFlareWordPressPlugin |
| 5 | Description: CloudFlare integrates your blog with the CloudFlare platform. |
| 6 | Version: 3.0.5 |
| 7 | Author: John Wineman, Furkan Yilmaz, Junade Ali (CloudFlare Team) |
| 8 | License: BSD-3-Clause |
| 9 | */ |
| 10 | |
| 11 | // Exit if accessed directly |
| 12 | if (!defined('ABSPATH')) { |
| 13 | exit; |
| 14 | } |
| 15 | |
| 16 | define('CLOUDFLARE_MIN_PHP_VERSION', '5.3.10'); |
| 17 | define('CLOUDFLARE_MIN_WP_VERSION', '3.4'); |
| 18 | define('CLOUDFLARE_PLUGIN_DIR', plugin_dir_path(__FILE__)); |
| 19 | |
| 20 | // PHP version check has to go here because the below code uses namespaces |
| 21 | if (version_compare(PHP_VERSION, CLOUDFLARE_MIN_PHP_VERSION, '<')) { |
| 22 | // We need to load "plugin.php" manually to call "deactivate_plugins" |
| 23 | require_once ABSPATH.'wp-admin/includes/plugin.php'; |
| 24 | |
| 25 | deactivate_plugins(plugin_basename(__FILE__), true); |
| 26 | wp_die('<p>The CloudFlare plugin requires a php version of at least '.CLOUDFLARE_MIN_PHP_VERSION.' you have '.PHP_VERSION.'.</p>', 'Plugin Activation Error', array('response' => 200, 'back_link' => true)); |
| 27 | } |
| 28 | |
| 29 | // Plugin uses namespaces. To support old PHP version which doesn't support |
| 30 | // namespaces we load everything in "cloudflare.loader.php" |
| 31 | require_once CLOUDFLARE_PLUGIN_DIR.'cloudflare.loader.php'; |