Version Description
- to fix Notice: Undefined variable: order_arr in preload.php on line 161
- to fix Notice: Undefined property: stdClass::$go in preload.php on line 440
- to start using the API Token system instead of Global API for CLoudflare [Details]
- to fix removing backslashes issue in the pre tag
- to disable cache for the IP based urls on the bitnami servers
- to disable cdn if the query string contains wc-api
Download this release
Release Info
Developer | emrevona |
Plugin | WP Fastest Cache |
Version | 0.9.1.6 |
Comparing to | |
See all releases |
Code changes from version 0.9.1.5 to 0.9.1.6
- inc/admin.php +2 -1
- inc/cache.php +25 -5
- inc/cdn.php +28 -31
- inc/preload.php +2 -2
- readme.txt +11 -3
- templates/cdn/cloudflare.php +5 -5
- wpFastestCache.php +2 -2
inc/admin.php
CHANGED
@@ -228,6 +228,7 @@
|
|
228 |
public function addJavaScript(){
|
229 |
wp_enqueue_script("jquery-ui-draggable");
|
230 |
wp_enqueue_script("jquery-ui-position");
|
|
|
231 |
wp_enqueue_script("wpfc-dialog", plugins_url("wp-fastest-cache/js/dialog.js"), array(), time(), false);
|
232 |
wp_enqueue_script("wpfc-dialog-new", plugins_url("wp-fastest-cache/js/dialog_new.js"), array(), time(), false);
|
233 |
|
@@ -381,7 +382,7 @@
|
|
381 |
|
382 |
|
383 |
if(!get_option('permalink_structure')){
|
384 |
-
return array("You have to set <strong><u><a href='
|
385 |
}else if($res = $this->checkSuperCache($path, $htaccess)){
|
386 |
return $res;
|
387 |
}else if($this->isPluginActive('fast-velocity-minify/fvm.php')){
|
228 |
public function addJavaScript(){
|
229 |
wp_enqueue_script("jquery-ui-draggable");
|
230 |
wp_enqueue_script("jquery-ui-position");
|
231 |
+
wp_enqueue_script("jquery-ui-sortable");
|
232 |
wp_enqueue_script("wpfc-dialog", plugins_url("wp-fastest-cache/js/dialog.js"), array(), time(), false);
|
233 |
wp_enqueue_script("wpfc-dialog-new", plugins_url("wp-fastest-cache/js/dialog_new.js"), array(), time(), false);
|
234 |
|
382 |
|
383 |
|
384 |
if(!get_option('permalink_structure')){
|
385 |
+
return array("You have to set <strong><u><a target='_blank' href='https://www.wpfastestcache.com/tutorial/how-to-change-default-permalink-in-wordpress/'>permalinks</a></u></strong>", "error");
|
386 |
}else if($res = $this->checkSuperCache($path, $htaccess)){
|
387 |
return $res;
|
388 |
}else if($this->isPluginActive('fast-velocity-minify/fvm.php')){
|
inc/cache.php
CHANGED
@@ -288,6 +288,8 @@
|
|
288 |
//
|
289 |
}else if(defined('WPFC_CACHE_QUERYSTRING') && WPFC_CACHE_QUERYSTRING){
|
290 |
//
|
|
|
|
|
291 |
}else{
|
292 |
ob_start(array($this, "cdn_rewrite"));
|
293 |
|
@@ -336,6 +338,14 @@
|
|
336 |
}
|
337 |
}
|
338 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
339 |
if(preg_match("/www\./i", get_option("home")) && !preg_match("/www\./i", $_SERVER['HTTP_HOST'])){
|
340 |
return 0;
|
341 |
}
|
@@ -864,14 +874,24 @@
|
|
864 |
|
865 |
if(isset($pre_content[0]) && isset($pre_content[0][0])){
|
866 |
foreach ($pre_content[0] as $key => $value){
|
867 |
-
/*
|
868 |
-
location ~ / {
|
869 |
-
set $path /path/$1/index.html;
|
870 |
-
}
|
871 |
-
*/
|
872 |
if(isset($pre_buffer[0][$key])){
|
|
|
|
|
|
|
|
|
|
|
873 |
$pre_buffer[0][$key] = preg_replace('/\$(\d)/', '\\\$$1', $pre_buffer[0][$key]);
|
874 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
875 |
$content = preg_replace("/".preg_quote($value, "/")."/", $pre_buffer[0][$key], $content);
|
876 |
}
|
877 |
}
|
288 |
//
|
289 |
}else if(defined('WPFC_CACHE_QUERYSTRING') && WPFC_CACHE_QUERYSTRING){
|
290 |
//
|
291 |
+
}else if(isset($_GET["wc-api"]) && $_GET["wc-api"]){
|
292 |
+
//
|
293 |
}else{
|
294 |
ob_start(array($this, "cdn_rewrite"));
|
295 |
|
338 |
}
|
339 |
}
|
340 |
|
341 |
+
if(isset($_SERVER["DOCUMENT_ROOT"]) && preg_match("/bitnami/", $_SERVER["DOCUMENT_ROOT"])){
|
342 |
+
// to disable cache for the IP based urls on the bitnami servers
|
343 |
+
// /opt/bitnami/apps/wordpress/htdocs
|
344 |
+
if(preg_match("/(?:[0-9]{1,3}\.){3}[0-9]{1,3}/", get_option("home"))){
|
345 |
+
return 0;
|
346 |
+
}
|
347 |
+
}
|
348 |
+
|
349 |
if(preg_match("/www\./i", get_option("home")) && !preg_match("/www\./i", $_SERVER['HTTP_HOST'])){
|
350 |
return 0;
|
351 |
}
|
874 |
|
875 |
if(isset($pre_content[0]) && isset($pre_content[0][0])){
|
876 |
foreach ($pre_content[0] as $key => $value){
|
|
|
|
|
|
|
|
|
|
|
877 |
if(isset($pre_buffer[0][$key])){
|
878 |
+
/*
|
879 |
+
location ~ / {
|
880 |
+
set $path /path/$1/index.html;
|
881 |
+
}
|
882 |
+
*/
|
883 |
$pre_buffer[0][$key] = preg_replace('/\$(\d)/', '\\\$$1', $pre_buffer[0][$key]);
|
884 |
|
885 |
+
/*
|
886 |
+
\\\
|
887 |
+
*/
|
888 |
+
$pre_buffer[0][$key] = preg_replace('/\\\\\\\\\\\/', '\\\\\\\\\\\\\\', $pre_buffer[0][$key]);
|
889 |
+
|
890 |
+
/*
|
891 |
+
\\
|
892 |
+
*/
|
893 |
+
$pre_buffer[0][$key] = preg_replace('/\\\\\\\\/', '\\\\\\\\\\', $pre_buffer[0][$key]);
|
894 |
+
|
895 |
$content = preg_replace("/".preg_quote($value, "/")."/", $pre_buffer[0][$key], $content);
|
896 |
}
|
897 |
}
|
inc/cdn.php
CHANGED
@@ -1,11 +1,28 @@
|
|
1 |
<?php
|
2 |
class CdnWPFC{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
public static function cloudflare_clear_cache($email = false, $key = false, $zoneid = false){
|
4 |
if(isset($GLOBALS["wpfc_cloudflare_purge_cache_executed"])){
|
5 |
return;
|
6 |
}
|
7 |
|
8 |
-
if(!$
|
9 |
if($cdn_values = get_option("WpFastestCacheCDN")){
|
10 |
$std_obj = json_decode($cdn_values);
|
11 |
|
@@ -17,7 +34,7 @@
|
|
17 |
}
|
18 |
}
|
19 |
|
20 |
-
if($
|
21 |
$zone = self::cloudflare_get_zone_id($email, $key, false);
|
22 |
|
23 |
if($zone["success"]){
|
@@ -27,13 +44,9 @@
|
|
27 |
}
|
28 |
}
|
29 |
|
30 |
-
if($
|
31 |
$header = array("method" => "DELETE",
|
32 |
-
'headers' =>
|
33 |
-
"X-Auth-Email" => $email,
|
34 |
-
"X-Auth-Key" => $key,
|
35 |
-
"Content-Type" => "application/json"
|
36 |
-
),
|
37 |
"body" => '{"purge_everything":true}'
|
38 |
);
|
39 |
|
@@ -54,14 +67,10 @@
|
|
54 |
}
|
55 |
|
56 |
public static function cloudflare_disable_rocket_loader($email = false, $key = false, $zoneid = false){
|
57 |
-
if($
|
58 |
$header = array("method" => "PATCH",
|
59 |
'timeout' => 10,
|
60 |
-
'headers' =>
|
61 |
-
"X-Auth-Email" => $email,
|
62 |
-
"X-Auth-Key" => $key,
|
63 |
-
"Content-Type" => "application/json"
|
64 |
-
),
|
65 |
'body' => '{"value":"off"}'
|
66 |
);
|
67 |
|
@@ -87,14 +96,10 @@
|
|
87 |
|
88 |
|
89 |
public static function cloudflare_set_browser_caching($email = false, $key = false, $zoneid = false){
|
90 |
-
if($
|
91 |
$header = array("method" => "PATCH",
|
92 |
'timeout' => 10,
|
93 |
-
'headers' =>
|
94 |
-
"X-Auth-Email" => $email,
|
95 |
-
"X-Auth-Key" => $key,
|
96 |
-
"Content-Type" => "application/json"
|
97 |
-
),
|
98 |
'body' => '{"value":16070400}'
|
99 |
);
|
100 |
|
@@ -119,14 +124,10 @@
|
|
119 |
}
|
120 |
|
121 |
public static function cloudflare_disable_minify($email = false, $key = false, $zoneid = false){
|
122 |
-
if($
|
123 |
$header = array("method" => "PATCH",
|
124 |
'timeout' => 10,
|
125 |
-
'headers' =>
|
126 |
-
"X-Auth-Email" => $email,
|
127 |
-
"X-Auth-Key" => $key,
|
128 |
-
"Content-Type" => "application/json"
|
129 |
-
),
|
130 |
'body' => '{"value":{"css":"off","html":"off","js":"off"}}'
|
131 |
);
|
132 |
|
@@ -167,11 +168,7 @@
|
|
167 |
}
|
168 |
|
169 |
$header = array("method" => "GET",
|
170 |
-
'headers' =>
|
171 |
-
"X-Auth-Email" => $email,
|
172 |
-
"X-Auth-Key" => $key,
|
173 |
-
"Content-Type" => "application/json"
|
174 |
-
),
|
175 |
);
|
176 |
|
177 |
/*
|
1 |
<?php
|
2 |
class CdnWPFC{
|
3 |
+
public static function cloudflare_generate_header($email, $key){
|
4 |
+
if($email == "wpfc"){
|
5 |
+
$header = array(
|
6 |
+
"Authorization" => "Bearer ".$key,
|
7 |
+
"Content-Type" => "application/json"
|
8 |
+
);
|
9 |
+
}else{
|
10 |
+
$header = array(
|
11 |
+
"X-Auth-Email" => $email,
|
12 |
+
"X-Auth-Key" => $key,
|
13 |
+
"Content-Type" => "application/json"
|
14 |
+
);
|
15 |
+
}
|
16 |
+
|
17 |
+
return $header;
|
18 |
+
}
|
19 |
+
|
20 |
public static function cloudflare_clear_cache($email = false, $key = false, $zoneid = false){
|
21 |
if(isset($GLOBALS["wpfc_cloudflare_purge_cache_executed"])){
|
22 |
return;
|
23 |
}
|
24 |
|
25 |
+
if(!$key && !$zoneid){
|
26 |
if($cdn_values = get_option("WpFastestCacheCDN")){
|
27 |
$std_obj = json_decode($cdn_values);
|
28 |
|
34 |
}
|
35 |
}
|
36 |
|
37 |
+
if($key){
|
38 |
$zone = self::cloudflare_get_zone_id($email, $key, false);
|
39 |
|
40 |
if($zone["success"]){
|
44 |
}
|
45 |
}
|
46 |
|
47 |
+
if($key && $zoneid){
|
48 |
$header = array("method" => "DELETE",
|
49 |
+
'headers' => self::cloudflare_generate_header($email, $key),
|
|
|
|
|
|
|
|
|
50 |
"body" => '{"purge_everything":true}'
|
51 |
);
|
52 |
|
67 |
}
|
68 |
|
69 |
public static function cloudflare_disable_rocket_loader($email = false, $key = false, $zoneid = false){
|
70 |
+
if($key && $zoneid){
|
71 |
$header = array("method" => "PATCH",
|
72 |
'timeout' => 10,
|
73 |
+
'headers' => self::cloudflare_generate_header($email, $key),
|
|
|
|
|
|
|
|
|
74 |
'body' => '{"value":"off"}'
|
75 |
);
|
76 |
|
96 |
|
97 |
|
98 |
public static function cloudflare_set_browser_caching($email = false, $key = false, $zoneid = false){
|
99 |
+
if($key && $zoneid){
|
100 |
$header = array("method" => "PATCH",
|
101 |
'timeout' => 10,
|
102 |
+
'headers' => self::cloudflare_generate_header($email, $key),
|
|
|
|
|
|
|
|
|
103 |
'body' => '{"value":16070400}'
|
104 |
);
|
105 |
|
124 |
}
|
125 |
|
126 |
public static function cloudflare_disable_minify($email = false, $key = false, $zoneid = false){
|
127 |
+
if($key && $zoneid){
|
128 |
$header = array("method" => "PATCH",
|
129 |
'timeout' => 10,
|
130 |
+
'headers' => self::cloudflare_generate_header($email, $key),
|
|
|
|
|
|
|
|
|
131 |
'body' => '{"value":{"css":"off","html":"off","js":"off"}}'
|
132 |
);
|
133 |
|
168 |
}
|
169 |
|
170 |
$header = array("method" => "GET",
|
171 |
+
'headers' => self::cloudflare_generate_header($email, $key)
|
|
|
|
|
|
|
|
|
172 |
);
|
173 |
|
174 |
/*
|
inc/preload.php
CHANGED
@@ -158,7 +158,7 @@
|
|
158 |
}
|
159 |
}
|
160 |
|
161 |
-
if(is_array($order_arr)){
|
162 |
foreach ($order_arr as $o_key => $o_value){
|
163 |
if($o_value == "order" || $o_value == "number"){
|
164 |
unset($order_arr[$o_key]);
|
@@ -437,7 +437,7 @@
|
|
437 |
}
|
438 |
|
439 |
|
440 |
-
if($pre_load->$current_order == -1){
|
441 |
array_shift($order_arr);
|
442 |
|
443 |
if(isset($order_arr[0])){
|
158 |
}
|
159 |
}
|
160 |
|
161 |
+
if(isset($order_arr) && is_array($order_arr)){
|
162 |
foreach ($order_arr as $o_key => $o_value){
|
163 |
if($o_value == "order" || $o_value == "number"){
|
164 |
unset($order_arr[$o_key]);
|
437 |
}
|
438 |
|
439 |
|
440 |
+
if(isset($pre_load->$current_order) && $pre_load->$current_order == -1){
|
441 |
array_shift($order_arr);
|
442 |
|
443 |
if(isset($order_arr[0])){
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: emrevona
|
|
3 |
Donate link: http://profiles.wordpress.org/emrevona/
|
4 |
Tags: cache, caching, performance, wp-cache, total cache, super cache, cdn
|
5 |
Requires at least: 3.3
|
6 |
-
Tested up to: 5.
|
7 |
-
Stable tag: 0.9.1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -125,9 +125,17 @@ The free version is enough to speed up your site but in the premium version ther
|
|
125 |
|
126 |
== Changelog ==
|
127 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
= 0.9.1.5 =
|
129 |
* <strong>[FEATURE]</strong> to add Re-Order feture for Preload [<a target="_blank" href="https://www.wpfastestcache.com/features/re-order-preload/">Details</a>]
|
130 |
-
* to add WPFC_DISABLE_CLEARING_CACHE_AFTER_WOOCOMMERCE_CHECKOUT_ORDER_PROCESSED
|
131 |
|
132 |
= 0.9.1.4 =
|
133 |
* to fix saving "Update Post" settings issue
|
3 |
Donate link: http://profiles.wordpress.org/emrevona/
|
4 |
Tags: cache, caching, performance, wp-cache, total cache, super cache, cdn
|
5 |
Requires at least: 3.3
|
6 |
+
Tested up to: 5.7
|
7 |
+
Stable tag: 0.9.1.6
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
125 |
|
126 |
== Changelog ==
|
127 |
|
128 |
+
= 0.9.1.6 =
|
129 |
+
* to fix Notice: Undefined variable: order_arr in preload.php on line 161
|
130 |
+
* to fix Notice: Undefined property: stdClass::$go in preload.php on line 440
|
131 |
+
* to start using the API Token system instead of Global API for CLoudflare [<a target="_blank" href="https://www.wpfastestcache.com/tutorial/wp-fastest-cache-cloudflare/">Details</a>]
|
132 |
+
* to fix removing backslashes issue in the pre tag
|
133 |
+
* to disable cache for the IP based urls on the bitnami servers
|
134 |
+
* to disable cdn if the query string contains wc-api
|
135 |
+
|
136 |
= 0.9.1.5 =
|
137 |
* <strong>[FEATURE]</strong> to add Re-Order feture for Preload [<a target="_blank" href="https://www.wpfastestcache.com/features/re-order-preload/">Details</a>]
|
138 |
+
* to add WPFC_DISABLE_CLEARING_CACHE_AFTER_WOOCOMMERCE_CHECKOUT_ORDER_PROCESSED [<a target="_blank" href="https://www.wpfastestcache.com/tutorial/woocommerce-settings/#after-order">Details</a>]
|
139 |
|
140 |
= 0.9.1.4 =
|
141 |
* to fix saving "Update Post" settings issue
|
templates/cdn/cloudflare.php
CHANGED
@@ -33,15 +33,15 @@
|
|
33 |
<div wpfc-cdn-page="2" class="wiz-cont" style="display:none">
|
34 |
<h1>Enter API Keys</h1>
|
35 |
<p>Please enter your <strong>API Key</strong> below to to access Cloudflare APIs.</p>
|
36 |
-
<div class="wiz-input-cont">
|
37 |
-
<label class="mc-input-label" for="cdn-url" style="padding-right: 19px;">Email:</label><input type="text" name="" value="" class="api-key" id="cdn-url">
|
38 |
-
<div id="cdn-url-loading"></div>
|
39 |
<label class="wiz-error-msg"></label>
|
40 |
</div>
|
41 |
<div class="wiz-input-cont">
|
42 |
-
<label style="padding-right: 5px;" class="mc-input-label" for="origin-url">API
|
43 |
-
<
|
44 |
</div>
|
|
|
45 |
</div>
|
46 |
<div wpfc-cdn-page="3" class="wiz-cont" style="display:none">
|
47 |
<h1>Disable Auto Minify</h1>
|
33 |
<div wpfc-cdn-page="2" class="wiz-cont" style="display:none">
|
34 |
<h1>Enter API Keys</h1>
|
35 |
<p>Please enter your <strong>API Key</strong> below to to access Cloudflare APIs.</p>
|
36 |
+
<div class="wiz-input-cont" style="display: none;">
|
37 |
+
<label class="mc-input-label" for="cdn-url" style="padding-right: 19px;">Email:</label><input type="text" name="" value="wpfc" class="api-key" id="cdn-url">
|
|
|
38 |
<label class="wiz-error-msg"></label>
|
39 |
</div>
|
40 |
<div class="wiz-input-cont">
|
41 |
+
<label style="padding-right: 5px;" class="mc-input-label" for="origin-url">API Token:</label><input type="text" name="" value="" class="api-key" id="origin-url">
|
42 |
+
<div id="cdn-url-loading"></div>
|
43 |
</div>
|
44 |
+
<p class="wpfc-bottom-note" style="margin-bottom:-10px;"><a target="_blank" href="https://www.wpfastestcache.com/tutorial/wp-fastest-cache-cloudflare/">Note: Please read How to Integrate Cloudflare into WP Fastest Cache</a></p>
|
45 |
</div>
|
46 |
<div wpfc-cdn-page="3" class="wiz-cont" style="display:none">
|
47 |
<h1>Disable Auto Minify</h1>
|
wpFastestCache.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WP Fastest Cache
|
4 |
Plugin URI: http://wordpress.org/plugins/wp-fastest-cache/
|
5 |
Description: The simplest and fastest WP Cache system
|
6 |
-
Version: 0.9.1.
|
7 |
Author: Emre Vona
|
8 |
Author URI: http://tr.linkedin.com/in/emrevona
|
9 |
Text Domain: wp-fastest-cache
|
@@ -21,7 +21,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
21 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22 |
GNU General Public License for more details.
|
23 |
*/
|
24 |
-
|
25 |
if (!defined('WPFC_WP_CONTENT_BASENAME')) {
|
26 |
if (!defined('WPFC_WP_PLUGIN_DIR')) {
|
27 |
if(preg_match("/(\/trunk\/|\/wp-fastest-cache\/)$/", plugin_dir_path( __FILE__ ))){
|
3 |
Plugin Name: WP Fastest Cache
|
4 |
Plugin URI: http://wordpress.org/plugins/wp-fastest-cache/
|
5 |
Description: The simplest and fastest WP Cache system
|
6 |
+
Version: 0.9.1.6
|
7 |
Author: Emre Vona
|
8 |
Author URI: http://tr.linkedin.com/in/emrevona
|
9 |
Text Domain: wp-fastest-cache
|
21 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22 |
GNU General Public License for more details.
|
23 |
*/
|
24 |
+
|
25 |
if (!defined('WPFC_WP_CONTENT_BASENAME')) {
|
26 |
if (!defined('WPFC_WP_PLUGIN_DIR')) {
|
27 |
if(preg_match("/(\/trunk\/|\/wp-fastest-cache\/)$/", plugin_dir_path( __FILE__ ))){
|