Plugin Directory

source: cloudflare/trunk/cloudflare.php

Last change on this file was 3606604, checked in by cloudflarespeedteam, 10 days ago

Update to version 4.14.4 from GitHub

File size: 2.0 KB
Line 
1<?php
2/*
3Plugin Name: Cloudflare
4Plugin URI: https://blog.cloudflare.com/new-wordpress-plugin/
5Description: Cloudflare speeds up and protects your WordPress site.
6Version: 4.14.4
7Requires PHP: 7.4
8Author: Cloudflare, Inc.
9License: BSD-3-Clause
10*/
11
12// The following constants are available. Add them to wp-config.php to enable.
13
14// To configure Cloudflare credentials via environment vars (defined elsewhere)
15// define('CLOUDFLARE_EMAIL', $_ENV['CLOUDFLARE_EMAIL']);
16// define('CLOUDFLARE_API_KEY', $_ENV['CLOUDFLARE_API_KEY']);
17// define('CLOUDFLARE_DOMAIN_NAME', $_ENV['CLOUDFLARE_DOMAIN_NAME']);
18
19// To enable HTTP/2 Server Push feature:
20// define('CLOUDFLARE_HTTP2_SERVER_PUSH_ACTIVE', true);
21
22// Cloudflare has a limit of how many resources can be pushed by HTTP/2 Server Push
23// (3 KiB by default). Add the following to change that amount:
24// define('CLOUDFLARE_HTTP2_SERVER_PUSH_HEADER_SIZE', 3072);
25
26// To enable error logging when HTTP/2 Server Push header size is exceeded:
27// define('CLOUDFLARE_HTTP2_SERVER_PUSH_LOG', true);
28
29// Exit if accessed directly
30if (!defined('ABSPATH')) {
31 exit;
32}
33
34define('CLOUDFLARE_MIN_PHP_VERSION', '7.4');
35define('CLOUDFLARE_MIN_WP_VERSION', '3.4');
36define('CLOUDFLARE_PLUGIN_DIR', plugin_dir_path(__FILE__));
37
38// PHP version check has to go here because the below code uses namespaces
39if (version_compare(PHP_VERSION, CLOUDFLARE_MIN_PHP_VERSION, '<')) {
40 // We need to load "plugin.php" manually to call "deactivate_plugins"
41 require_once ABSPATH . 'wp-admin/includes/plugin.php';
42
43 deactivate_plugins(plugin_basename(__FILE__), true);
44 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));
45}
46
47// Plugin uses namespaces. To support old PHP version which doesn't support
48// namespaces we load everything in "cloudflare.loader.php"
49require_once CLOUDFLARE_PLUGIN_DIR . 'cloudflare.loader.php';
Note: See TracBrowser for help on using the repository browser.