WP Fastest Cache - Version 1.0.5

Version Description

  • to fix E_NOTICE: Undefined variable: path in wpFastestCache.php on line 2142
  • to add excluding feature for Buffer Callback Filter [Details]
Download this release

Release Info

Developer emrevona
Plugin Icon 128x128 WP Fastest Cache
Version 1.0.5
Comparing to
See all releases

Code changes from version 1.0.4 to 1.0.5

Files changed (3) hide show
  1. inc/cache.php +58 -55
  2. readme.txt +8 -22
  3. wpFastestCache.php +14 -10
inc/cache.php CHANGED
@@ -700,6 +700,18 @@
700
 
701
  $buffer = preg_replace('/<\!--WPFC_PAGE_TYPE_[a-z]+-->/i', '', $buffer);
702
 
 
 
 
 
 
 
 
 
 
 
 
 
703
  if($this->exclude_current_page_text){
704
  return $buffer.$this->exclude_current_page_text;
705
  }else if($this->is_json() && (!defined('WPFC_CACHE_JSON') || (defined('WPFC_CACHE_JSON') && WPFC_CACHE_JSON !== true))){
@@ -1060,71 +1072,62 @@
1060
  }
1061
  }
1062
 
1063
- if($create){
1064
- if (!is_user_logged_in() && !$this->isCommenter()){
1065
- if(!is_dir($cachFilePath)){
1066
- if(is_writable($this->getWpContentDir()) || ((is_dir($this->getWpContentDir("/cache"))) && (is_writable($this->getWpContentDir("/cache"))))){
1067
- if (@mkdir($cachFilePath, 0755, true)){
1068
-
1069
- $buffer = (string) apply_filters('wpfc_buffer_callback_filter', $buffer, $extension);
1070
-
1071
- file_put_contents($cachFilePath."/".$file_name.$extension, $buffer);
1072
-
1073
- if(class_exists("WpFastestCacheStatics")){
1074
- if($update_db_statistic && !preg_match("/After\sCache\sTimeout/i", $_SERVER['HTTP_USER_AGENT'])){
1075
- if(preg_match("/wpfc\-mobile\-cache/", $cachFilePath)){
1076
- $extension = "mobile";
1077
- }
1078
-
1079
- $cache_statics = new WpFastestCacheStatics($extension, strlen($buffer));
1080
- $cache_statics->update_db();
1081
- }
1082
- }
1083
-
1084
- if($extension == "html"){
1085
- if(!file_exists($this->getWpContentDir("/cache/index.html"))){
1086
- @file_put_contents($this->getWpContentDir("/cache/index.html"), "");
1087
- }
1088
- }else{
1089
 
1090
- if(!file_exists($this->getWpContentDir("/cache/wpfc-minified/index.html"))){
1091
- if(!is_dir($this->getWpContentDir("/cache/wpfc-minified/"))){
1092
- @mkdir($this->getWpContentDir("/cache/wpfc-minified/"), 0755, true);
1093
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1094
 
1095
- if(is_dir($this->getWpContentDir("/cache/wpfc-minified/"))){
1096
- @file_put_contents($this->getWpContentDir("/cache/wpfc-minified/index.html"), "");
1097
- }
1098
- }
1099
 
1100
- }
 
 
1101
 
1102
- }else{
1103
- }
1104
- }else{
1105
 
 
 
1106
  }
1107
- }else{
1108
- if(file_exists($cachFilePath."/".$file_name.$extension)){
1109
 
1110
- }else{
1111
- $buffer = (string) apply_filters('wpfc_buffer_callback_filter', $buffer, $extension);
1112
-
1113
- file_put_contents($cachFilePath."/".$file_name.$extension, $buffer);
1114
-
1115
- if(class_exists("WpFastestCacheStatics")){
1116
- if($update_db_statistic && !preg_match("/After\sCache\sTimeout/i", $_SERVER['HTTP_USER_AGENT'])){
1117
- if(preg_match("/wpfc\-mobile\-cache/", $cachFilePath)){
1118
- $extension = "mobile";
1119
- }
1120
-
1121
- $cache_statics = new WpFastestCacheStatics($extension, strlen($buffer));
1122
- $cache_statics->update_db();
1123
  }
1124
- }
1125
- }
 
 
 
 
1126
  }
 
1127
  }
 
1128
  }elseif($extension == "html"){
1129
  $this->err = "Buffer is empty so the cache cannot be created";
1130
  }
700
 
701
  $buffer = preg_replace('/<\!--WPFC_PAGE_TYPE_[a-z]+-->/i', '', $buffer);
702
 
703
+
704
+ if($this->is_html()){
705
+ $tmp_buffer = (string) apply_filters('wpfc_buffer_callback_filter', $buffer, "html", $this->cacheFilePath);
706
+
707
+ if(!$tmp_buffer){
708
+ return $buffer;
709
+ }else{
710
+ $buffer = $tmp_buffer;
711
+ }
712
+ }
713
+
714
+
715
  if($this->exclude_current_page_text){
716
  return $buffer.$this->exclude_current_page_text;
717
  }else if($this->is_json() && (!defined('WPFC_CACHE_JSON') || (defined('WPFC_CACHE_JSON') && WPFC_CACHE_JSON !== true))){
1072
  }
1073
  }
1074
 
1075
+ if (is_user_logged_in() || $this->isCommenter()){
1076
+ $create = false;
1077
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1078
 
1079
+ if($create){
1080
+
1081
+ if(!is_dir($cachFilePath)){
1082
+ if(is_writable($this->getWpContentDir()) || ((is_dir($this->getWpContentDir("/cache"))) && (is_writable($this->getWpContentDir("/cache"))))){
1083
+ if (@mkdir($cachFilePath, 0755, true)){
1084
+
1085
+ if($extension == "html"){
1086
+ if(!file_exists($this->getWpContentDir("/cache/index.html"))){
1087
+ @file_put_contents($this->getWpContentDir("/cache/index.html"), "");
1088
+ }
1089
+ }else{
1090
+
1091
+ if(!file_exists($this->getWpContentDir("/cache/wpfc-minified/index.html"))){
1092
+ if(!is_dir($this->getWpContentDir("/cache/wpfc-minified/"))){
1093
+ @mkdir($this->getWpContentDir("/cache/wpfc-minified/"), 0755, true);
1094
+ }
1095
+
1096
+ if(is_dir($this->getWpContentDir("/cache/wpfc-minified/"))){
1097
+ @file_put_contents($this->getWpContentDir("/cache/wpfc-minified/index.html"), "");
1098
+ }
1099
+ }
1100
 
1101
+ }
 
 
 
1102
 
1103
+ }
1104
+ }
1105
+ }
1106
 
1107
+ if(is_dir($cachFilePath)){
1108
+ if(!file_exists($cachFilePath."/".$file_name.$extension)){
 
1109
 
1110
+ if($extension != "html"){
1111
+ $buffer = (string) apply_filters('wpfc_buffer_callback_filter', $buffer, $extension, $cachFilePath);
1112
  }
 
 
1113
 
1114
+ file_put_contents($cachFilePath."/".$file_name.$extension, $buffer);
1115
+
1116
+ if(class_exists("WpFastestCacheStatics")){
1117
+ if($update_db_statistic && !preg_match("/After\sCache\sTimeout/i", $_SERVER['HTTP_USER_AGENT'])){
1118
+ if(preg_match("/wpfc\-mobile\-cache/", $cachFilePath)){
1119
+ $extension = "mobile";
 
 
 
 
 
 
 
1120
  }
1121
+
1122
+ $cache_statics = new WpFastestCacheStatics($extension, strlen($buffer));
1123
+ $cache_statics->update_db();
1124
+ }
1125
+ }
1126
+
1127
  }
1128
+
1129
  }
1130
+
1131
  }elseif($extension == "html"){
1132
  $this->err = "Buffer is empty so the cache cannot be created";
1133
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://profiles.wordpress.org/emrevona/
4
  Tags: cache, Optimize, performance, wp-cache, core web vitals
5
  Requires at least: 3.3
6
  Tested up to: 6.0
7
- Stable tag: 1.0.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -75,6 +75,8 @@ The free version is enough to speed up your site but in the premium version ther
75
 
76
  It is very inconvenient to use multiple caching plugins at the same time. That's why you need to disable plugins such as LiteSpeed Cache, WP-Optimize, W3 Total Cache, WP Super Cache, SiteGround Optimizer, Breeze while using WP Fastest Cache.
77
 
 
 
78
  <h4>Supported languages: </h4>
79
 
80
  * 中文 (by suifengtec)
@@ -129,6 +131,10 @@ It is very inconvenient to use multiple caching plugins at the same time. That's
129
 
130
  == Changelog ==
131
 
 
 
 
 
132
  = 1.0.4 =
133
  * to add avif extensions for cdn
134
  * to add WPFC_SERVE_ONLY_VIA_CACHE [<a target="_blank" href="https://www.wpfastestcache.com/tutorial/how-to-serve-cache-only-via-php/">Details</a>]
@@ -353,38 +359,18 @@ Yes, it is compatible with Adsense 100%.
353
  = Is this plugin compatible with CloudFlare? =
354
  Yes, it is but you need to read the details. <a href="http://www.wpfastestcache.com/tutorial/wp-fastest-cache-cloudflarecloudfront/">Click</a>
355
 
356
- = Is this plugin compatible with WP-Polls? =
357
- Yes, it is compatible with WP-Polls 100%.
358
-
359
- = Is this plugin compatible with Bulletproof Security? =
360
- Yes, it is compatible with Bulletproof Security 100%.
361
-
362
- = Is this plugin compatible with Wordfence Security? =
363
- Yes, it is compatible with Wordfence Security 100%.
364
-
365
  = Is this plugin compatible with qTranslate? =
366
  Yes, it is compatible with qTranslate 100%.
367
 
368
- = Is this plugin compatible with WPtouch Mobile? =
369
- Yes, it is compatible with WPtouch Mobile.
370
-
371
- = Is this plugin compatible with WP-PostRatings? =
372
- Yes, it is compatible with WP-PostRatings.
373
-
374
- = Is this plugin compatible with AdRotate? =
375
- No, it is NOT compatible with AdRotate.
376
-
377
  = Is this plugin compatible with WP Hide & Security Enhancer? =
378
  Yes, it is compatible with WP Hide & Security Enhancer.
379
 
380
  = Is this plugin compatible with WP-PostViews? =
381
  Yes, it is compatible with WP-PostViews. The current post views appear on the admin panel. The visitors cannot see the current post views. The developer of WP-PostViews needs to fix this issue.
382
 
383
- = Is this plugin compatible with MobilePress? =
384
- No, it is NOT compatible with MobilePress. We advise WPtouch Mobile.
385
-
386
  = Is this plugin compatible with WooCommerce Themes? =
387
  Yes, it is compatible with WooCommerce Themes 100%.
388
 
 
389
  == Upgrade notice ==
390
  ....
4
  Tags: cache, Optimize, performance, wp-cache, core web vitals
5
  Requires at least: 3.3
6
  Tested up to: 6.0
7
+ Stable tag: 1.0.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
75
 
76
  It is very inconvenient to use multiple caching plugins at the same time. That's why you need to disable plugins such as LiteSpeed Cache, WP-Optimize, W3 Total Cache, WP Super Cache, SiteGround Optimizer, Breeze while using WP Fastest Cache.
77
 
78
+ WP Fastest Cache is compatible with most popular plugins such as Contact Form 7, Yoast SEO, Elementor Website Builder, Classic Editor, Akismet Spam Protection, WooCommerce, Contact Form by WPForms, Really Simple SSL, All-in-One WP Migration, Yoast Duplicate Post, Wordfence Security – Firewall & Malware Scan, WordPress Importer, UpdraftPlus WordPress Backup Plugin, MonsterInsights, All in One SEO, WP Mail SMTP by WPForms.
79
+
80
  <h4>Supported languages: </h4>
81
 
82
  * 中文 (by suifengtec)
131
 
132
  == Changelog ==
133
 
134
+ = 1.0.5 =
135
+ * to fix E_NOTICE: Undefined variable: path in wpFastestCache.php on line 2142
136
+ * to add excluding feature for Buffer Callback Filter [<a target="_blank" href="https://www.wpfastestcache.com/tutorial/buffer-callback-filter/#exclude">Details</a>]
137
+
138
  = 1.0.4 =
139
  * to add avif extensions for cdn
140
  * to add WPFC_SERVE_ONLY_VIA_CACHE [<a target="_blank" href="https://www.wpfastestcache.com/tutorial/how-to-serve-cache-only-via-php/">Details</a>]
359
  = Is this plugin compatible with CloudFlare? =
360
  Yes, it is but you need to read the details. <a href="http://www.wpfastestcache.com/tutorial/wp-fastest-cache-cloudflarecloudfront/">Click</a>
361
 
 
 
 
 
 
 
 
 
 
362
  = Is this plugin compatible with qTranslate? =
363
  Yes, it is compatible with qTranslate 100%.
364
 
 
 
 
 
 
 
 
 
 
365
  = Is this plugin compatible with WP Hide & Security Enhancer? =
366
  Yes, it is compatible with WP Hide & Security Enhancer.
367
 
368
  = Is this plugin compatible with WP-PostViews? =
369
  Yes, it is compatible with WP-PostViews. The current post views appear on the admin panel. The visitors cannot see the current post views. The developer of WP-PostViews needs to fix this issue.
370
 
 
 
 
371
  = Is this plugin compatible with WooCommerce Themes? =
372
  Yes, it is compatible with WooCommerce Themes 100%.
373
 
374
+
375
  == Upgrade notice ==
376
  ....
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: 1.0.4
7
  Author: Emre Vona
8
  Author URI: http://tr.linkedin.com/in/emrevona
9
  Text Domain: wp-fastest-cache
@@ -2139,19 +2139,23 @@ GNU General Public License for more details.
2139
  $path = preg_replace("/.+\/wp-includes\/(.+)/", ABSPATH."wp-includes/"."$1", $url);
2140
  }
2141
 
2142
- if(@file_exists($path)){
2143
- $filesize = filesize($path);
 
2144
 
2145
- if($filesize > 0){
2146
- $myfile = fopen($path, "r") or die("Unable to open file!");
2147
- $data = fread($myfile, $filesize);
2148
- fclose($myfile);
2149
 
2150
- return $data;
2151
- }else{
2152
- return false;
 
2153
  }
2154
  }
 
 
2155
  }
2156
 
2157
  return false;
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: 1.0.5
7
  Author: Emre Vona
8
  Author URI: http://tr.linkedin.com/in/emrevona
9
  Text Domain: wp-fastest-cache
2139
  $path = preg_replace("/.+\/wp-includes\/(.+)/", ABSPATH."wp-includes/"."$1", $url);
2140
  }
2141
 
2142
+ if(isset($path)){
2143
+ if(@file_exists($path)){
2144
+ $filesize = filesize($path);
2145
 
2146
+ if($filesize > 0){
2147
+ $myfile = fopen($path, "r") or die("Unable to open file!");
2148
+ $data = fread($myfile, $filesize);
2149
+ fclose($myfile);
2150
 
2151
+ return $data;
2152
+ }else{
2153
+ return false;
2154
+ }
2155
  }
2156
  }
2157
+
2158
+
2159
  }
2160
 
2161
  return false;