cloudflare/Cloudflare-WordPress

Public

mirrored fromhttps://github.com/cloudflare/Cloudflare-WordPress

CodeCommitsIssuesPull requestsActionsInsightsSecurity
385c04958fce1c8b275072a274e73d94e74e1e7e

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

cloudflare.php

31lines · modecode

1<?php
2/*
3Plugin Name: CloudFlare
4Plugin URI: http://www.cloudflare.com/wiki/CloudFlareWordPressPlugin
5Description: CloudFlare integrates your blog with the CloudFlare platform.
6Version: 3.0.5
7Author: John Wineman, Furkan Yilmaz, Junade Ali (CloudFlare Team)
8License: BSD-3-Clause
9*/
10
11// Exit if accessed directly
12if (!defined('ABSPATH')) {
13 exit;
14}
15
16define('CLOUDFLARE_MIN_PHP_VERSION', '5.3.10');
17define('CLOUDFLARE_MIN_WP_VERSION', '3.4');
18define('CLOUDFLARE_PLUGIN_DIR', plugin_dir_path(__FILE__));
19
20// PHP version check has to go here because the below code uses namespaces
21if (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"
31require_once CLOUDFLARE_PLUGIN_DIR.'cloudflare.loader.php';