Cloudflare - Version 3.0.5

Version Description

  • 2016-09-28 =

Fixed

  • Fixed bug where refactored Flexible SSL fix was causing the settings page hook not to load.
Download this release

Release Info

Developer furkan811
Plugin Icon 128x128 Cloudflare
Version 3.0.5
Comparing to
See all releases

Code changes from version 3.0.4 to 3.0.5

Files changed (6) hide show
  1. cloudflare.loader.php +0 -2
  2. cloudflare.php +1 -1
  3. composer.json +1 -1
  4. config.js +1 -1
  5. proxy.php +0 -102
  6. readme.txt +7 -1
cloudflare.loader.php CHANGED
@@ -12,8 +12,6 @@ if ($is_cf) {
12
  // Fixes Flexible SSL
13
  if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
14
  $_SERVER['HTTPS'] = 'on';
15
-
16
- return true;
17
  }
18
  }
19
 
12
  // Fixes Flexible SSL
13
  if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
14
  $_SERVER['HTTPS'] = 'on';
 
 
15
  }
16
  }
17
 
cloudflare.php CHANGED
@@ -3,7 +3,7 @@
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.4
7
  Author: John Wineman, Furkan Yilmaz, Junade Ali (CloudFlare Team)
8
  License: BSD-3-Clause
9
  */
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
  */
composer.json CHANGED
@@ -26,5 +26,5 @@
26
  ],
27
  "test": "vendor/bin/phpunit"
28
  },
29
- "version": "3.0.4"
30
  }
26
  ],
27
  "test": "vendor/bin/phpunit"
28
  },
29
+ "version": "3.0.5"
30
  }
config.js CHANGED
@@ -38,5 +38,5 @@
38
  ]
39
  },
40
  "useHostAPILogin": false,
41
- "version": "3.0.4"
42
  }
38
  ]
39
  },
40
  "useHostAPILogin": false,
41
+ "version": "3.0.5"
42
  }
proxy.php DELETED
@@ -1,102 +0,0 @@
1
- <?php
2
-
3
- if (!defined('ABSPATH')) { // Exit if accessed directly
4
- exit;
5
- }
6
-
7
- header('Content-Type: application/json');
8
-
9
- $config = new CF\Integration\DefaultConfig(file_get_contents('config.js', true));
10
- $logger = new CF\Integration\DefaultLogger($config->getValue('debug'));
11
- $dataStore = new CF\WordPress\DataStore($logger);
12
- $wordpressAPI = new CF\WordPress\WordPressAPI($dataStore);
13
- $wordpressIntegration = new CF\Integration\DefaultIntegration($config, $wordpressAPI, $dataStore, $logger);
14
-
15
- $requestRouter = new \CF\Router\RequestRouter($wordpressIntegration);
16
- $requestRouter->addRouter('\CF\WordPress\WordPressClientAPI', \CF\WordPress\ClientRoutes::$routes);
17
- $requestRouter->addRouter('\CF\API\Plugin', \CF\WordPress\PluginRoutes::getRoutes(\CF\API\PluginRoutes::$routes));
18
-
19
- // Check if domain name needs to cached
20
- $wpDomain = $wordpressAPI->getOriginalDomain();
21
- $cachedDomainList = $wordpressAPI->getDomainList();
22
- $cachedDomain = $cachedDomainList[0];
23
- if (CF\WordPress\Utils::getRegistrableDomain($wpDomain) !== $cachedDomain) {
24
- $wordPressClientAPI = new \CF\WordPress\WordPressClientAPI($wordpressIntegration);
25
-
26
- // Since we may not be logged in yet we need to check the credentials being set
27
- if ($wordPressClientAPI->isCrendetialsSet()) {
28
- // If it's not a subdomain cache the current domain
29
- $domainName = $wpDomain;
30
-
31
- // Get cloudflare zones to find if the current domain is a subdomain
32
- // of any cloudflare zones registered
33
- $response = $wordPressClientAPI->getZones();
34
- $validDomainName = $wordpressAPI->checkIfValidCloudflareSubdomain($response, $wpDomain);
35
-
36
- // Check if it's a subdomain, if it is cache the zone instead of the
37
- // subdomain
38
- if ($wordPressClientAPI->responseOK($response) && $validDomainName) {
39
- $domainName = CF\WordPress\Utils::getRegistrableDomain($wpDomain);
40
- }
41
-
42
- $wordpressAPI->setDomainNameCache($domainName);
43
- }
44
- }
45
-
46
- $method = $_SERVER['REQUEST_METHOD'];
47
- $parameters = $_GET;
48
- $body = json_decode(file_get_contents('php://input'), true);
49
- $path = null;
50
- if (strtoupper($method === 'GET')) {
51
- if ($_GET['proxyURLType'] === 'CLIENT') {
52
- $path = \CF\API\Client::ENDPOINT.$_GET['proxyURL'];
53
- } elseif ($_GET['proxyURLType'] === 'PLUGIN') {
54
- $path = \CF\API\Plugin::ENDPOINT.$_GET['proxyURL'];
55
- }
56
- } else {
57
- $path = $body['proxyURL'];
58
- }
59
-
60
- unset($parameters['proxyURLType']);
61
- unset($parameters['proxyURL']);
62
- unset($body['proxyURL']);
63
- $request = new CF\API\Request($method, $path, $parameters, $body);
64
-
65
- $response = null;
66
- if (isCloudFlareCSRFTokenValid($request)) {
67
- $response = $requestRouter->route($request);
68
- } else {
69
- $message = 'CSRF Token not valid.';
70
- $response = array(
71
- 'result' => null,
72
- 'success' => false,
73
- 'errors' => array(
74
- array(
75
- 'code' => '',
76
- 'message' => $message,
77
- ),
78
- ),
79
- 'messages' => array(),
80
- );
81
- }
82
-
83
- /**
84
- * https://codex.wordpress.org/Function_Reference/wp_verify_nonce
85
- *
86
- * Boolean false if the nonce is invalid. Otherwise, returns an integer with the value of:
87
- * 1 – if the nonce has been generated in the past 12 hours or less.
88
- * 2 – if the nonce was generated between 12 and 24 hours ago.
89
- *
90
- * @param CF\API\Request $request
91
- * @return bool
92
- */
93
- function isCloudFlareCSRFTokenValid($request) {
94
- if($request->getMethod() === 'GET') {
95
- return true;
96
- }
97
- $body = $request->getBody();
98
- return (wp_verify_nonce($body['cfCSRFToken'], CF\WordPress\WordPressAPI::API_NONCE) !== false);
99
- }
100
-
101
- //die is how wordpress ajax keeps the rest of the app from loading during an ajax request
102
- die(json_encode($response));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: jwineman, furkan811, IcyApril
3
  Tags: cloudflare, seo, ssl, ddos, speed, security, cdn, performance, free
4
  Requires at least: 3.4
5
  Tested up to: 4.6
6
- Stable tag: 3.0.4
7
  License: BSD-3-Clause
8
 
9
  All of CloudFlare’s performance and security benefits in a simple one-click install of recommended settings specifically developed for WordPress.
@@ -84,6 +84,12 @@ Make sure that the php5-curl extension is installed on your system.
84
 
85
  == Changelog ==
86
 
 
 
 
 
 
 
87
  = 3.0.4 - 2016-09-27 =
88
 
89
  *Added*
3
  Tags: cloudflare, seo, ssl, ddos, speed, security, cdn, performance, free
4
  Requires at least: 3.4
5
  Tested up to: 4.6
6
+ Stable tag: 3.0.5
7
  License: BSD-3-Clause
8
 
9
  All of CloudFlare’s performance and security benefits in a simple one-click install of recommended settings specifically developed for WordPress.
84
 
85
  == Changelog ==
86
 
87
+ = 3.0.5 - 2016-09-28 =
88
+
89
+ *Fixed*
90
+
91
+ * Fixed bug where refactored Flexible SSL fix was causing the settings page hook not to load.
92
+
93
  = 3.0.4 - 2016-09-27 =
94
 
95
  *Added*