WP Fastest Cache - Version 0.8.8.3

Version Description

  • to fix Revolution Slider Error
  • to make Cloudflare CDN integration work with sub-domains
  • to fix error on js combine feature
  • to fix error replace cdn-url
  • to replace urls on data-thumb attribute with cdn-url
  • to move the rules of Gtranslate at the top of WP Fastest Cache on .htaccess
  • to define preload number manually [Details]
Download this release

Release Info

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

Code changes from version 0.8.8.2 to 0.8.8.3

inc/admin.php CHANGED
@@ -369,7 +369,8 @@
369
  $htaccess = $this->insertLBCRule($htaccess, $post);
370
  $htaccess = $this->insertGzipRule($htaccess, $post);
371
  $htaccess = $this->insertRewriteRule($htaccess, $post);
372
- //$htaccess = preg_replace("/\n+/","\n", $htaccess);
 
373
 
374
  file_put_contents($path.".htaccess", $htaccess);
375
  }else{
@@ -380,6 +381,17 @@
380
 
381
  }
382
 
 
 
 
 
 
 
 
 
 
 
 
383
  public function warningIncompatible($incompatible, $alternative = false){
384
  if($alternative){
385
  return array($incompatible." <label>needs to be deactive</label><br><label>We advise</label> <a id='alternative-plugin' target='_blank' href='".$alternative["url"]."'>".$alternative["name"]."</a>", "error");
@@ -1248,6 +1260,7 @@
1248
  "parkviewhomes.info",
1249
  "myparkviewhomes.com",
1250
  "kompressorcheck.de",
 
1251
  "cutflower.com",
1252
  "sackkarre-tests.de",
1253
  "schraubstock-test.de",
369
  $htaccess = $this->insertLBCRule($htaccess, $post);
370
  $htaccess = $this->insertGzipRule($htaccess, $post);
371
  $htaccess = $this->insertRewriteRule($htaccess, $post);
372
+
373
+ $htaccess = $this->to_move_gtranslate_rules($htaccess);
374
 
375
  file_put_contents($path.".htaccess", $htaccess);
376
  }else{
381
 
382
  }
383
 
384
+ public function to_move_gtranslate_rules($htaccess){
385
+ preg_match("/\#\#\#\s+BEGIN\sGTranslate\sconfig\s\#\#\#[^\#]+\#\#\#\s+END\sGTranslate\sconfig\s\#\#\#/i", $htaccess, $gtranslate);
386
+
387
+ if(isset($gtranslate[0])){
388
+ $htaccess = preg_replace("/\#\#\#\s+BEGIN\sGTranslate\sconfig\s\#\#\#[^\#]+\#\#\#\s+END\sGTranslate\sconfig\s\#\#\#/i", "", $htaccess);
389
+ $htaccess = $gtranslate[0]."\n".$htaccess;
390
+ }
391
+
392
+ return $htaccess;
393
+ }
394
+
395
  public function warningIncompatible($incompatible, $alternative = false){
396
  if($alternative){
397
  return array($incompatible." <label>needs to be deactive</label><br><label>We advise</label> <a id='alternative-plugin' target='_blank' href='".$alternative["url"]."'>".$alternative["name"]."</a>", "error");
1260
  "parkviewhomes.info",
1261
  "myparkviewhomes.com",
1262
  "kompressorcheck.de",
1263
+ "bsty.vn",
1264
  "cutflower.com",
1265
  "sackkarre-tests.de",
1266
  "schraubstock-test.de",
inc/cache.php CHANGED
@@ -767,7 +767,7 @@
767
 
768
  public function cdn_rewrite($content){
769
  if($this->cdn){
770
- $content = preg_replace_callback("/(srcset|src|href|data-bg-url|data-lazyload|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);
771
 
772
  //url()
773
  $content = preg_replace_callback("/(url)\(([^\)\>]+)\)/i", array($this, 'cdn_replace_urls'), $content);
767
 
768
  public function cdn_rewrite($content){
769
  if($this->cdn){
770
+ $content = preg_replace_callback("/(srcset|src|href|data-thumb|data-bg-url|data-lazyload|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);
771
 
772
  //url()
773
  $content = preg_replace_callback("/(url)\(([^\)\>]+)\)/i", array($this, 'cdn_replace_urls'), $content);
inc/cdn.php CHANGED
@@ -144,7 +144,7 @@
144
  ),
145
  );
146
 
147
- $response = wp_remote_request('https://api.cloudflare.com/client/v4/zones?name='.$hostname, $header);
148
 
149
  if(!$response || is_wp_error($response)){
150
  $res = array("success" => false, "error_message" => $response->get_error_message());
@@ -155,7 +155,11 @@
155
  $res = array("success" => false, "error_message" => $zone->errors[0]->message);
156
  }else{
157
  if(isset($zone->result) && isset($zone->result[0])){
158
- $res = array("success" => true, "zoneid" => $zone->result[0]->id);
 
 
 
 
159
  }else{
160
  $res = array("success" => false, "error_message" => "No zone name ".$hostname);
161
  }
144
  ),
145
  );
146
 
147
+ $response = wp_remote_request('https://api.cloudflare.com/client/v4/zones', $header);
148
 
149
  if(!$response || is_wp_error($response)){
150
  $res = array("success" => false, "error_message" => $response->get_error_message());
155
  $res = array("success" => false, "error_message" => $zone->errors[0]->message);
156
  }else{
157
  if(isset($zone->result) && isset($zone->result[0])){
158
+ foreach ($zone->result as $zone_key => $zone_value) {
159
+ if(preg_match("/".$zone_value->name."/", $hostname)){
160
+ $res = array("success" => true, "zoneid" => $zone_value->id);
161
+ }
162
+ }
163
  }else{
164
  $res = array("success" => false, "error_message" => "No zone name ".$hostname);
165
  }
inc/js-utilities.php CHANGED
@@ -96,8 +96,10 @@
96
  }
97
  }
98
  }else{
99
- $this->mergeJs($prev_content, $this->jsLinks[$key - 1]);
100
- $prev_content = "";
 
 
101
  }
102
  }
103
  }
96
  }
97
  }
98
  }else{
99
+ if($key > 0 && $prev_content){
100
+ $this->mergeJs($prev_content, $this->jsLinks[$key - 1]);
101
+ $prev_content = "";
102
+ }
103
  }
104
  }
105
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://profiles.wordpress.org/emrevona/
4
  Tags: cache, performance, wp-cache, total cache, super cache
5
  Requires at least: 3.3
6
  Tested up to: 4.9
7
- Stable tag: 0.8.8.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -103,6 +103,15 @@ Wpfc does not support Wordpress Multisite yet.
103
 
104
  == Changelog ==
105
 
 
 
 
 
 
 
 
 
 
106
  = 0.8.8.2 =
107
  * to fix removing the escaped slashes of Cloudflare Integration [<a target="_blank" href="https://wordpress.org/support/topic/wpfc-cf-is-stripping-important-code/">Details</a>]
108
  * <strong>[FEATURE]</strong> Compatible with Fast Velocity Minify
4
  Tags: cache, performance, wp-cache, total cache, super cache
5
  Requires at least: 3.3
6
  Tested up to: 4.9
7
+ Stable tag: 0.8.8.3
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.8.3 =
107
+ * to fix Revolution Slider Error
108
+ * to make Cloudflare CDN integration work with sub-domains
109
+ * to fix error on js combine feature
110
+ * to fix error replace cdn-url
111
+ * to replace urls on data-thumb attribute with cdn-url
112
+ * to move the rules of Gtranslate at the top of WP Fastest Cache on .htaccess
113
+ * to define preload number manually [<a target="_blank" href="https://www.wpfastestcache.com/features/preload-settings/#preload-number">Details</a>]
114
+
115
  = 0.8.8.2 =
116
  * to fix removing the escaped slashes of Cloudflare Integration [<a target="_blank" href="https://wordpress.org/support/topic/wpfc-cf-is-stripping-important-code/">Details</a>]
117
  * <strong>[FEATURE]</strong> Compatible with Fast Velocity Minify
templates/cdn/cloudflare.php CHANGED
@@ -40,7 +40,7 @@
40
  </div>
41
  <div class="wiz-input-cont">
42
  <label style="padding-right: 5px;" class="mc-input-label" for="origin-url">API Key:</label><input type="text" name="" value="" class="api-key" id="origin-url">
43
- <a style="margin-left:5px;" target="_blank" href="http://www.wpfastestcache.com/tutorial/wp-fastest-cache-cloudflare/#cloudflare-api-key"><img src="http://berkatan.com/wp-content/plugins/wp-fastest-cache/images/info.png"></a>
44
  </div>
45
  </div>
46
  <div wpfc-cdn-page="3" class="wiz-cont" style="display:none">
40
  </div>
41
  <div class="wiz-input-cont">
42
  <label style="padding-right: 5px;" class="mc-input-label" for="origin-url">API Key:</label><input type="text" name="" value="" class="api-key" id="origin-url">
43
+ <a style="margin-left:5px;" target="_blank" href="http://www.wpfastestcache.com/tutorial/wp-fastest-cache-cloudflare/#cloudflare-api-key"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACgElEQVR42qVSX0hTYRT/3Xu3uzvUy7Q/29BMRbMyR+ZDIAQiEQVKT9HCJx9iQVKU4INCD6OJD46K9SL04IvkUyDrKQiKJHoJcktSYiKlbkYqG7Xd/7fvu/e2GdZTBw7fx++c8/t+53yHwX8asw+5EA/C1zws8NyA3+dtA8Ngq6B8ljQkUVhPIBnJ/Zvg6rNwsK5quv9MQOxoEKHqhpXh5lxY2vyB54vbhWxeiWDm/Nx+gmvz4RNHfLOXuwMsx7Ko9jC4c7GZCsCjF1+Ql01QvvnFHeNTtjSIJ+fmKgSXHgYOtoRWBrr8IkuKqZ1trsb13gbrPrOQxcJqEZSNcCCZzhe+r2eO4+mVrE0w9DLW0+obq63mrSTKy3PAcG8ALMvg8etvkAzWfo/Ed4sG3q4VJ5A4PW4RuCNvUqHGmk6AtRJMgmmabp20yO3hwVjK7Dj11KacVuMnQ7aCG+9KVYJLEL0u0P41TUN2sqs8nuD4R7h4j1WomwwKiomfCiRMtXltgpvvS+QJgSZwHEsOokKVoSW6rTA/skRkemCQYt1pg+RLmGxyCG6nUwTsJGBZInQN5oMOu4mRFUIgVGJ2XhqxeqeFu8sxAoxVCMipqzCnjtkEo6tEhrC3mKITiB62h4jwbBBHe5ZJQLQSqMlFmPF2hyADeGtQjjFMAdlUO6b7cpVFGs2EicxZOm7eVCDfb/xjST33NqBwAr0aMPRBRP17Fum3jX8NwyVMk88QD/AqagU7vCuZ2FbcKOnkZUOLIBr4yypTO9TOoLWvHvXdtxA41c/UNbVQ2NxZW8XWUhKbHxLIvNpALm3uJaCNkU8G1ed1XHAwt5On0qkQl4iXHKd3+RfbC84TL5MhdwAAAABJRU5ErkJggg=="></a>
44
  </div>
45
  </div>
46
  <div wpfc-cdn-page="3" class="wiz-cont" style="display:none">
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.8.2
7
  Author: Emre Vona
8
  Author URI: http://tr.linkedin.com/in/emrevona
9
  Text Domain: wp-fastest-cache
@@ -1109,7 +1109,13 @@ GNU General Public License for more details.
1109
  $this->options = $this->getOptions();
1110
 
1111
  $pre_load = json_decode($data);
1112
- $number = $pre_load->number;
 
 
 
 
 
 
1113
 
1114
  $urls_limit = isset($this->options->wpFastestCachePreload_number) ? $this->options->wpFastestCachePreload_number : 4; // must be even
1115
  $urls = array();
@@ -1758,7 +1764,7 @@ GNU General Public License for more details.
1758
  if(count($this->cdn) > 0){
1759
  foreach ($this->cdn as $key => $cdn) {
1760
  if($cdn->id == "cloudflare"){
1761
- //nothing to do
1762
  }
1763
 
1764
  if(preg_match("/manifest\.json\.php/i", $matches[0])){
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.8.3
7
  Author: Emre Vona
8
  Author URI: http://tr.linkedin.com/in/emrevona
9
  Text Domain: wp-fastest-cache
1109
  $this->options = $this->getOptions();
1110
 
1111
  $pre_load = json_decode($data);
1112
+
1113
+ if(defined("WPFC_PRELOAD_NUMBER") && WPFC_PRELOAD_NUMBER){
1114
+ $number = WPFC_PRELOAD_NUMBER;
1115
+ }else{
1116
+ $number = $pre_load->number;
1117
+ }
1118
+
1119
 
1120
  $urls_limit = isset($this->options->wpFastestCachePreload_number) ? $this->options->wpFastestCachePreload_number : 4; // must be even
1121
  $urls = array();
1764
  if(count($this->cdn) > 0){
1765
  foreach ($this->cdn as $key => $cdn) {
1766
  if($cdn->id == "cloudflare"){
1767
+ continue;
1768
  }
1769
 
1770
  if(preg_match("/manifest\.json\.php/i", $matches[0])){