WP Fastest Cache - Version 0.9.0.0

Version Description

  • to exclude the css source of elementor which is /elementor/css/post-[number].css to avoid increasing the size of minified sources
  • to replace urls which have data-vc-parallax-image attribute with cdn-url
  • to avoid clearing cache of feed after voting (All In One Schema.org Rich Snippets)
  • to fix clearing cache after switching url on WPML
Download this release

Release Info

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

Code changes from version 0.8.9.9 to 0.9.0.0

inc/cache.php CHANGED
@@ -827,7 +827,7 @@
827
 
828
  public function cdn_rewrite($content){
829
  if($this->cdn){
830
- $content = preg_replace_callback("/(srcset|src|href|data-bg|data-fullurl|data-mobileurl|data-img-url|data-cvpsrc|data-cvpset|data-thumb|data-bg-url|data-large_image|data-lazyload|data-lazy|data-source-url|data-srcsmall|data-srclarge|data-srcfull|data-slide-img|data-lazy-original)\s{0,2}\=[\'\"]([^\'\"]+)[\'\"]/i", array($this, 'cdn_replace_urls'), $content);
831
 
832
  //url()
833
  $content = preg_replace_callback("/(url)\(([^\)\>]+)\)/i", array($this, 'cdn_replace_urls'), $content);
827
 
828
  public function cdn_rewrite($content){
829
  if($this->cdn){
830
+ $content = preg_replace_callback("/(srcset|src|href|data-vc-parallax-image|data-bg|data-fullurl|data-mobileurl|data-img-url|data-cvpsrc|data-cvpset|data-thumb|data-bg-url|data-large_image|data-lazyload|data-lazy|data-source-url|data-srcsmall|data-srclarge|data-srcfull|data-slide-img|data-lazy-original)\s{0,2}\=[\'\"]([^\'\"]+)[\'\"]/i", array($this, 'cdn_replace_urls'), $content);
831
 
832
  //url()
833
  $content = preg_replace_callback("/(url)\(([^\)\>]+)\)/i", array($this, 'cdn_replace_urls'), $content);
inc/css-utilities.php CHANGED
@@ -16,6 +16,11 @@
16
 
17
  public function check_exclude($css_url = false){
18
  if($css_url){
 
 
 
 
 
19
  foreach((array)$this->wpfc->exclude_rules as $key => $value){
20
 
21
  if(isset($value->prefix) && $value->prefix && $value->type == "css"){
16
 
17
  public function check_exclude($css_url = false){
18
  if($css_url){
19
+ // to exclude the css source of elementor which is /elementor/css/post-[number].css to avoid increasing the size of minified sources
20
+ if(preg_match("/\/elementor\/css\/post-\d+\.css/i", $css_url)){
21
+ return true;
22
+ }
23
+
24
  foreach((array)$this->wpfc->exclude_rules as $key => $value){
25
 
26
  if(isset($value->prefix) && $value->prefix && $value->type == "css"){
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.2
7
- Stable tag: 0.8.9.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -103,6 +103,12 @@ Wpfc supports Wordpress Multisite [<a target="_blank" href="https://www.wpfastes
103
 
104
  == Changelog ==
105
 
 
 
 
 
 
 
106
  = 0.8.9.9 =
107
  * to fix Undefined variable: count_posts in preload.php on line 112
108
  * to update of Spanish translation
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.3
7
+ Stable tag: 0.9.0.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
103
 
104
  == Changelog ==
105
 
106
+ = 0.9.0.0 =
107
+ * to exclude the css source of elementor which is /elementor/css/post-[number].css to avoid increasing the size of minified sources
108
+ * to replace urls which have data-vc-parallax-image attribute with cdn-url
109
+ * to avoid clearing cache of feed after voting (All In One Schema.org Rich Snippets)
110
+ * to fix clearing cache after switching url on WPML
111
+
112
  = 0.8.9.9 =
113
  * to fix Undefined variable: count_posts in preload.php on line 112
114
  * to update of Spanish translation
templates/timeout.php CHANGED
@@ -126,7 +126,11 @@
126
  <select name="wpfc-timeout-rule-schedule">
127
  <?php
128
  $schedules = wp_get_schedules();
129
- $schedules = wp_list_sort($schedules, "interval", "ASC", true);
 
 
 
 
130
  $first = true;
131
  foreach ($schedules as $key => $value) {
132
  if(!isset($value["wpfc"])){
126
  <select name="wpfc-timeout-rule-schedule">
127
  <?php
128
  $schedules = wp_get_schedules();
129
+
130
+ if(function_exists("wp_list_sort")){
131
+ $schedules = wp_list_sort($schedules, "interval", "ASC", true);
132
+ }
133
+
134
  $first = true;
135
  foreach ($schedules as $key => $value) {
136
  if(!isset($value["wpfc"])){
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.9
7
  Author: Emre Vona
8
  Author URI: http://tr.linkedin.com/in/emrevona
9
  Text Domain: wp-fastest-cache
@@ -785,7 +785,11 @@ GNU General Public License for more details.
785
  //https://wpml.org/forums/topic/wpml-language-switch-wp-fastest-cache-issue/
786
  $language_negotiation_type = apply_filters('wpml_setting', false, 'language_negotiation_type');
787
  if(($language_negotiation_type == 2) && $this->isPluginActive('sitepress-multilingual-cms/sitepress.php')){
788
- $path = preg_replace("/\/cache\/(all|wpfc-minified|wpfc-widget-cache|wpfc-mobile-cache)/", "/cache/".$_SERVER['HTTP_HOST']."/$1", $path);
 
 
 
 
789
  }
790
 
791
  if(is_multisite()){
@@ -910,6 +914,7 @@ GNU General Public License for more details.
910
  CdnWPFC::cloudflare_clear_cache();
911
 
912
  $to_clear_parents = true;
 
913
 
914
  // not to clear cache of homepage/cats/tags after ajax request by other plugins
915
  if(isset($_POST) && isset($_POST["action"])){
@@ -928,6 +933,11 @@ GNU General Public License for more details.
928
  $to_clear_parents = false;
929
  $post_id = $_POST["post_id"];
930
  }
 
 
 
 
 
931
  }
932
 
933
  if($comment_id){
@@ -986,14 +996,16 @@ GNU General Public License for more details.
986
  }
987
  }
988
 
989
- // to clear cache of /feed
990
- if(preg_match("/https?:\/\/[^\/]+\/(.+)/", get_feed_link(), $feed_out)){
991
- array_push($files, $this->getWpContentDir("/cache/all/").$feed_out[1]);
992
- }
 
993
 
994
- // to clear cache of /comments/feed/
995
- if(preg_match("/https?:\/\/[^\/]+\/(.+)/", get_feed_link("comments_"), $comment_feed_out)){
996
- array_push($files, $this->getWpContentDir("/cache/all/").$comment_feed_out[1]);
 
997
  }
998
 
999
  foreach((array)$files as $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.0.0
7
  Author: Emre Vona
8
  Author URI: http://tr.linkedin.com/in/emrevona
9
  Text Domain: wp-fastest-cache
785
  //https://wpml.org/forums/topic/wpml-language-switch-wp-fastest-cache-issue/
786
  $language_negotiation_type = apply_filters('wpml_setting', false, 'language_negotiation_type');
787
  if(($language_negotiation_type == 2) && $this->isPluginActive('sitepress-multilingual-cms/sitepress.php')){
788
+ $my_home_url = apply_filters('wpml_home_url', get_option('home'));
789
+ $my_home_url = preg_replace("/https?\:\/\//i", "", $my_home_url);
790
+ $my_home_url = trim($my_home_url, "/");
791
+
792
+ $path = preg_replace("/\/cache\/(all|wpfc-minified|wpfc-widget-cache|wpfc-mobile-cache)/", "/cache/".$my_home_url."/$1", $path);
793
  }
794
 
795
  if(is_multisite()){
914
  CdnWPFC::cloudflare_clear_cache();
915
 
916
  $to_clear_parents = true;
917
+ $to_clear_feed = true;
918
 
919
  // not to clear cache of homepage/cats/tags after ajax request by other plugins
920
  if(isset($_POST) && isset($_POST["action"])){
933
  $to_clear_parents = false;
934
  $post_id = $_POST["post_id"];
935
  }
936
+
937
+ // All In One Schema.org Rich Snippets
938
+ if(preg_match("/bsf_(update|submit)_rating/i", $_POST["action"])){
939
+ $to_clear_feed = false;
940
+ }
941
  }
942
 
943
  if($comment_id){
996
  }
997
  }
998
 
999
+ if($to_clear_feed){
1000
+ // to clear cache of /feed
1001
+ if(preg_match("/https?:\/\/[^\/]+\/(.+)/", get_feed_link(), $feed_out)){
1002
+ array_push($files, $this->getWpContentDir("/cache/all/").$feed_out[1]);
1003
+ }
1004
 
1005
+ // to clear cache of /comments/feed/
1006
+ if(preg_match("/https?:\/\/[^\/]+\/(.+)/", get_feed_link("comments_"), $comment_feed_out)){
1007
+ array_push($files, $this->getWpContentDir("/cache/all/").$comment_feed_out[1]);
1008
+ }
1009
  }
1010
 
1011
  foreach((array)$files as $file){