WP Fastest Cache - Version 0.8.9.4

Version Description

  • to clear cache of parent categories after clearing category cache [Details]
  • to fix PHP Notice: Undefined variable: preg_match_rule in preload.php on line 418
  • to show cloudflare integration warning if it has not been added
  • to fix Preload visiting page urls without end slashes problem [Details]
  • [FEATURE] to add Buffer Callback Filter [Details]
  • to add application/x-font-opentype and application/x-font-truetype for browser caching
  • [FEATURE] Widget Cache is compatible with WPML Multilingual Plugin
  • to fix 403 forbidden error when the cdn-url is checking
Download this release

Release Info

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

Code changes from version 0.8.9.3 to 0.8.9.4

inc/admin.php CHANGED
@@ -543,9 +543,10 @@
543
 
544
 
545
  $data = "# BEGIN LBCWpFastestCache"."\n".
546
- '<FilesMatch "\.(webm|ogg|mp4|ico|pdf|flv|jpg|jpeg|png|gif|webp|js|css|swf|x-html|css|xml|js|woff|woff2|ttf|svg|eot)(\.gz)?$">'."\n".
547
  '<IfModule mod_expires.c>'."\n".
548
  'AddType application/font-woff2 .woff2'."\n".
 
549
  'ExpiresActive On'."\n".
550
  'ExpiresDefault A0'."\n".
551
  'ExpiresByType video/webm A10368000'."\n".
@@ -563,6 +564,8 @@
563
  'ExpiresByType application/javascript A10368000'."\n".
564
  'ExpiresByType application/x-javascript A10368000'."\n".
565
  'ExpiresByType application/font-woff2 A10368000'."\n".
 
 
566
  '</IfModule>'."\n".
567
  '<IfModule mod_headers.c>'."\n".
568
  'Header set Expires "max-age=A10368000, public"'."\n".
@@ -2089,17 +2092,29 @@
2089
 
2090
  <?php include_once(WPFC_MAIN_PATH."templates/permission_error.html"); ?>
2091
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2092
 
2093
-
2094
-
2095
-
2096
-
2097
-
2098
-
2099
-
2100
-
2101
-
2102
-
2103
  </div>
2104
 
2105
  <div class="omni_admin_sidebar">
543
 
544
 
545
  $data = "# BEGIN LBCWpFastestCache"."\n".
546
+ '<FilesMatch "\.(webm|ogg|mp4|ico|pdf|flv|jpg|jpeg|png|gif|webp|js|css|swf|x-html|css|xml|js|woff|woff2|otf|ttf|svg|eot)(\.gz)?$">'."\n".
547
  '<IfModule mod_expires.c>'."\n".
548
  'AddType application/font-woff2 .woff2'."\n".
549
+ 'AddType application/x-font-opentype .otf'."\n".
550
  'ExpiresActive On'."\n".
551
  'ExpiresDefault A0'."\n".
552
  'ExpiresByType video/webm A10368000'."\n".
564
  'ExpiresByType application/javascript A10368000'."\n".
565
  'ExpiresByType application/x-javascript A10368000'."\n".
566
  'ExpiresByType application/font-woff2 A10368000'."\n".
567
+ 'ExpiresByType application/x-font-opentype A10368000'."\n".
568
+ 'ExpiresByType application/x-font-truetype A10368000'."\n".
569
  '</IfModule>'."\n".
570
  '<IfModule mod_headers.c>'."\n".
571
  'Header set Expires "max-age=A10368000, public"'."\n".
2092
 
2093
  <?php include_once(WPFC_MAIN_PATH."templates/permission_error.html"); ?>
2094
 
2095
+ <?php
2096
+ if(isset($this->options->wpFastestCacheStatus)){
2097
+ if(isset($_SERVER["HTTP_CDN_LOOP"]) && $_SERVER["HTTP_CDN_LOOP"] && $_SERVER["HTTP_CDN_LOOP"] == "cloudflare"){
2098
+ $cloudflare_integration_exist = false;
2099
+ $cdn_values = get_option("WpFastestCacheCDN");
2100
+
2101
+ if($cdn_values){
2102
+ $std_obj = json_decode($cdn_values);
2103
+
2104
+ foreach($std_obj as $key => $value){
2105
+ if($value->id == "cloudflare"){
2106
+ $cloudflare_integration_exist = true;
2107
+ break;
2108
+ }
2109
+ }
2110
+ }
2111
 
2112
+ if(!$cloudflare_integration_exist){
2113
+ include_once(WPFC_MAIN_PATH."templates/cloudflare_warning.html");
2114
+ }
2115
+ }
2116
+ }
2117
+ ?>
 
 
 
 
2118
  </div>
2119
 
2120
  <div class="omni_admin_sidebar">
inc/cache.php CHANGED
@@ -722,22 +722,14 @@
722
  }
723
  }
724
 
725
-
726
  $content = $this->cdn_rewrite($content);
727
 
728
-
729
- // WP Hide & Security Enhancer
730
- if($this->isPluginActive('wp-hide-security-enhancer/wp-hide.php')){
731
- global $wph;
732
- $content = $wph->functions->content_urls_replacement($content, $wph->functions->get_replacement_list());
733
- }
734
-
735
  $content = $this->fix_pre_tag($content, $buffer);
736
 
737
  if($this->cacheFilePath){
 
738
  $this->createFolder($this->cacheFilePath, $content);
739
 
740
-
741
  do_action('wpfc_is_cacheable_action');
742
  }
743
 
@@ -906,6 +898,8 @@
906
  if(is_writable($this->getWpContentDir()) || ((is_dir($this->getWpContentDir()."/cache")) && (is_writable($this->getWpContentDir()."/cache")))){
907
  if (@mkdir($cachFilePath, 0755, true)){
908
 
 
 
909
  file_put_contents($cachFilePath."/".$file_name.$extension, $buffer);
910
 
911
  if(class_exists("WpFastestCacheStatics")){
@@ -938,7 +932,8 @@
938
  if(file_exists($cachFilePath."/".$file_name.$extension)){
939
 
940
  }else{
941
-
 
942
  file_put_contents($cachFilePath."/".$file_name.$extension, $buffer);
943
 
944
  if(class_exists("WpFastestCacheStatics")){
722
  }
723
  }
724
 
 
725
  $content = $this->cdn_rewrite($content);
726
 
 
 
 
 
 
 
 
727
  $content = $this->fix_pre_tag($content, $buffer);
728
 
729
  if($this->cacheFilePath){
730
+
731
  $this->createFolder($this->cacheFilePath, $content);
732
 
 
733
  do_action('wpfc_is_cacheable_action');
734
  }
735
 
898
  if(is_writable($this->getWpContentDir()) || ((is_dir($this->getWpContentDir()."/cache")) && (is_writable($this->getWpContentDir()."/cache")))){
899
  if (@mkdir($cachFilePath, 0755, true)){
900
 
901
+ $buffer = (string) apply_filters('wpfc_buffer_callback_filter', $buffer, $extension);
902
+
903
  file_put_contents($cachFilePath."/".$file_name.$extension, $buffer);
904
 
905
  if(class_exists("WpFastestCacheStatics")){
932
  if(file_exists($cachFilePath."/".$file_name.$extension)){
933
 
934
  }else{
935
+ $buffer = (string) apply_filters('wpfc_buffer_callback_filter', $buffer, $extension);
936
+
937
  file_put_contents($cachFilePath."/".$file_name.$extension, $buffer);
938
 
939
  if(class_exists("WpFastestCacheStatics")){
inc/cdn.php CHANGED
@@ -254,7 +254,7 @@
254
  $_GET["url"] = "http://".$_GET["url"];
255
  }
256
 
257
- $response = wp_remote_get($_GET["url"], array('timeout' => 20 ) );
258
 
259
  $header = wp_remote_retrieve_headers($response);
260
 
254
  $_GET["url"] = "http://".$_GET["url"];
255
  }
256
 
257
+ $response = wp_remote_get($_GET["url"], array('timeout' => 20, 'user-agent' => "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:64.0) Gecko/20100101 Firefox/64.0"));
258
 
259
  $header = wp_remote_retrieve_headers($response);
260
 
inc/preload.php CHANGED
@@ -214,14 +214,12 @@
214
 
215
  if(count($pages) > 0){
216
  foreach ($pages as $key => $page) {
217
- $page_url = get_option("home")."/".get_page_uri($page->ID);
218
-
219
  if($mobile_theme){
220
- array_push($urls, array("url" => $page_url, "user-agent" => "mobile"));
221
  $number--;
222
  }
223
 
224
- array_push($urls, array("url" => $page_url, "user-agent" => "desktop"));
225
  $number--;
226
 
227
  $pre_load->page = $pre_load->page + 1;
@@ -414,9 +412,11 @@
414
  }else if($value->prefix == "contain"){
415
  $preg_match_rule = preg_quote($value->content, "/");
416
  }
417
-
418
- if(preg_match("/".$preg_match_rule."/i", $request_url)){
419
- return true;
 
 
420
  }
421
  }
422
  }
214
 
215
  if(count($pages) > 0){
216
  foreach ($pages as $key => $page) {
 
 
217
  if($mobile_theme){
218
+ array_push($urls, array("url" => get_page_link($page->ID), "user-agent" => "mobile"));
219
  $number--;
220
  }
221
 
222
+ array_push($urls, array("url" => get_page_link($page->ID), "user-agent" => "desktop"));
223
  $number--;
224
 
225
  $pre_load->page = $pre_load->page + 1;
412
  }else if($value->prefix == "contain"){
413
  $preg_match_rule = preg_quote($value->content, "/");
414
  }
415
+
416
+ if(isset($preg_match_rule)){
417
+ if(preg_match("/".$preg_match_rule."/i", $request_url)){
418
+ return true;
419
+ }
420
  }
421
  }
422
  }
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.1
7
- Stable tag: 0.8.9.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -103,6 +103,16 @@ Wpfc supports Wordpress Multisite [<a target="_blank" href="https://www.wpfastes
103
 
104
  == Changelog ==
105
 
 
 
 
 
 
 
 
 
 
 
106
  = 0.8.9.3 =
107
  * to exclude urls on preload
108
  * to add exclude rule for admin cookie as default
@@ -884,7 +894,7 @@ Yes, it is compatible with WP-PostRatings.
884
  No, it is NOT compatible with AdRotate.
885
 
886
  = Is this plugin compatible with WP Hide & Security Enhancer? =
887
- No, it is NOT compatible with WP Hide & Security Enhancer.
888
 
889
  = Is this plugin compatible with WP-PostViews? =
890
  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.
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.2
7
+ Stable tag: 0.8.9.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
103
 
104
  == Changelog ==
105
 
106
+ = 0.8.9.4 =
107
+ * to clear cache of parent categories after clearing category cache [<a target="_blank" href="https://wordpress.org/support/topic/cache-of-mother-categories-not-auto-deleting/">Details</a>]
108
+ * to fix PHP Notice: Undefined variable: preg_match_rule in preload.php on line 418
109
+ * to show cloudflare integration warning if it has not been added
110
+ * to fix Preload visiting page urls without end slashes problem [<a target="_blank" href="https://wordpress.org/support/topic/preload-visiting-page-urls-without-end-slashes/">Details</a>]
111
+ * <strong>[FEATURE]</strong> to add Buffer Callback Filter [<a target="_blank" href="https://www.wpfastestcache.com/tutorial/buffer-callback-filter/">Details</a>]
112
+ * to add application/x-font-opentype and application/x-font-truetype for browser caching
113
+ * <strong>[FEATURE]</strong> Widget Cache is compatible with WPML Multilingual Plugin
114
+ * to fix 403 forbidden error when the cdn-url is checking
115
+
116
  = 0.8.9.3 =
117
  * to exclude urls on preload
118
  * to add exclude rule for admin cookie as default
894
  No, it is NOT compatible with AdRotate.
895
 
896
  = Is this plugin compatible with WP Hide & Security Enhancer? =
897
+ Yes, it is compatible with WP Hide & Security Enhancer.
898
 
899
  = Is this plugin compatible with WP-PostViews? =
900
  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.
templates/cloudflare_warning.html ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div template-id="wpfc-modal-cloudflarewarning" style="top: 10.5px; left: 226px; position: absolute; padding: 6px; height: auto; width: 360px; z-index: 10001;display:none;">
2
+ <div style="height: 100%; width: 100%; background: none repeat scroll 0% 0% rgb(0, 0, 0); position: absolute; top: 0px; left: 0px; z-index: -1; opacity: 0.5; border-radius: 8px;">
3
+ </div>
4
+ <div style="z-index: 600; border-radius: 3px;">
5
+ <div style="font-family:Verdana,Geneva,Arial,Helvetica,sans-serif;font-size:12px;background: none repeat scroll 0px 0px rgb(255, 161, 0); z-index: 1000; position: relative; padding: 2px; border-bottom: 1px solid rgb(194, 122, 0); height: 35px; border-radius: 3px 3px 0px 0px;">
6
+ <table width="100%" height="100%">
7
+ <tbody>
8
+ <tr>
9
+ <td valign="middle" style="vertical-align: middle; font-weight: bold; color: rgb(255, 255, 255); text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.5); padding-left: 10px; font-size: 13px; cursor: move;">Enable Cloudflare Integration</td>
10
+ <td width="20" align="center" style="vertical-align: middle;"></td>
11
+ <td width="20" align="center" style="vertical-align: middle; font-family: Arial,Helvetica,sans-serif; color: rgb(170, 170, 170); cursor: default;">
12
+ <div title="Close Window" class="close-wiz"></div>
13
+ </td>
14
+ </tr>
15
+ </tbody>
16
+ </table>
17
+ </div>
18
+ <div class="window-content-wrapper" style="padding: 8px;">
19
+ <div style="z-index: 1000; height: auto; position: relative; display: inline-block; width: 100%;" class="window-content">
20
+ <div class="wpfc-cdn-pages-container">
21
+ <div class="wiz-cont" style="">
22
+ <h1>Cloudflare Integration</h1>
23
+ <p>You are using Cloudflare so you need to enable Cloudflare Integration via <b>CDN tab.</b> Please take a look at the following tutorial.</p>
24
+ <div class="wiz-input-cont" style="margin-top:10px !important;">
25
+ <label class="mc-input-label" style="margin-right: 5px;">
26
+ <a href="https://www.wpfastestcache.com/tutorial/wp-fastest-cache-cloudflare/" target="_blank">https://www.wpfastestcache.com/tutorial/wp-fastest-cache-cloudflare/</a>
27
+ </label>
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </div>
32
+ </div>
33
+ <div class="window-buttons-wrapper" style="padding: 0px; display: inline-block; width: 100%; border-top: 1px solid rgb(255, 255, 255); background: none repeat scroll 0px 0px rgb(222, 222, 222); z-index: 999; position: relative; text-align: right; border-radius: 0px 0px 3px 3px;">
34
+ <div style="padding: 12px; height: 23px;text-align: center;">
35
+ <button class="wpfc-dialog-buttons buttons" type="button" action="close">
36
+ <span>OK</span>
37
+ </button>
38
+ </div>
39
+ </div>
40
+ </div>
41
+ </div>
42
+ <script type="text/javascript">
43
+ window.addEventListener('load', function(){
44
+ Wpfc_New_Dialog.dialog("wpfc-modal-cloudflarewarning", {close: function(){
45
+ Wpfc_New_Dialog.clone.remove();
46
+ }});
47
+
48
+ Wpfc_New_Dialog.show_button("close");
49
+ });
50
+
51
+
52
+
53
+
54
+
55
+
56
+ </script>
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.8.9.3
7
  Author: Emre Vona
8
  Author URI: http://tr.linkedin.com/in/emrevona
9
  Text Domain: wp-fastest-cache
@@ -758,9 +758,18 @@ GNU General Public License for more details.
758
  /cache/testWpFc/
759
 
760
  /cache/all/testWpFc/
 
 
 
 
761
  */
762
 
763
  if($path){
 
 
 
 
 
764
  if(is_multisite()){
765
  $path = preg_replace("/\/cache\/(all|wpfc-minified|wpfc-widget-cache|wpfc-mobile-cache)/", "/cache/".$_SERVER['HTTP_HOST']."/$1", $path);
766
  }
@@ -1000,6 +1009,11 @@ GNU General Public License for more details.
1000
  $this->rm_folder_recursively($this->getWpContentDir("/cache/wpfc-mobile-cache/").$path."/page");
1001
  }
1002
 
 
 
 
 
 
1003
 
1004
 
1005
  }
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.8.9.4
7
  Author: Emre Vona
8
  Author URI: http://tr.linkedin.com/in/emrevona
9
  Text Domain: wp-fastest-cache
758
  /cache/testWpFc/
759
 
760
  /cache/all/testWpFc/
761
+
762
+ /cache/wpfc-widget-cache/
763
+ /cache/wpfc-widget-cache
764
+ /cache/wpfc-widget-cache/".$args["widget_id"].".html
765
  */
766
 
767
  if($path){
768
+ if($current_language = apply_filters('wpml_current_language', false)){
769
+ //https://wpml.org/forums/topic/wpml-language-switch-wp-fastest-cache-issue/
770
+ $path = preg_replace("/(\/cache\/wpfc-widget-cache\/)(.+\.html)$/", "$1/$current_language-$2", $path);
771
+ }
772
+
773
  if(is_multisite()){
774
  $path = preg_replace("/\/cache\/(all|wpfc-minified|wpfc-widget-cache|wpfc-mobile-cache)/", "/cache/".$_SERVER['HTTP_HOST']."/$1", $path);
775
  }
1009
  $this->rm_folder_recursively($this->getWpContentDir("/cache/wpfc-mobile-cache/").$path."/page");
1010
  }
1011
 
1012
+ if($term->parent > 0){
1013
+ $parent = get_term_by("id", $term->parent, $term->taxonomy);
1014
+ $this->delete_cache_of_term($parent->term_taxonomy_id);
1015
+ }
1016
+
1017
 
1018
 
1019
  }