WP Fastest Cache - Version 0.8.6.9

Version Description

  • [FEATURE] to clear cache of the post tags and the post categories after new post
  • [FEATURE] WebP [Details]
  • to fix BlogPosting error on Structured Data Testing Tool when cdn is used
  • to fix more than one cdn work concurrently
  • [FEATURE] Preload for category
  • [FEATURE] Preload for woocommerce products
Download this release

Release Info

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

Code changes from version 0.8.6.8 to 0.8.6.9

inc/admin.php CHANGED
@@ -387,24 +387,13 @@
387
  }
388
 
389
  public function insertWebp($htaccess){
390
- $tester_arr = array(
391
- "tr-TR",
392
- "berkatan.com",
393
- "pembeportakal.com",
394
- "wpfastestcache.com",
395
- "zamknijkonto.pl",
396
- "devv.zamknijkonto.pl",
397
- "goldsgym.nl",
398
- "luxury-chauffeurs.com",
399
- "rashays.com",
400
- "bitcoincafe.ch",
401
- "romeing.it",
402
- "huzurlabeslen.com",
403
- "premiumlv.com",
404
- "ribbons.se"
405
- );
406
-
407
- if(in_array(get_bloginfo('language'), $tester_arr) || in_array(str_replace("www.", "", $_SERVER["HTTP_HOST"]), $tester_arr)){
408
  $data = "# BEGIN WEBPWpFastestCache"."\n".
409
  "<IfModule mod_rewrite.c>"."\n".
410
  "RewriteEngine On"."\n".
@@ -429,6 +418,7 @@
429
 
430
  return $htaccess;
431
  }else{
 
432
  return $htaccess;
433
  }
434
  }
@@ -1185,7 +1175,8 @@
1185
  "gingerdomain.com",
1186
  "topclassprinting.com",
1187
  "camilazivit.com.br",
1188
- "spycoupon.in"
 
1189
  );
1190
 
1191
  if(in_array(get_bloginfo('language'), $tester_arr) || in_array(str_replace("www.", "", $_SERVER["HTTP_HOST"]), $tester_arr)){ ?>
@@ -1584,7 +1575,7 @@
1584
  <span>Purchased</span>
1585
  </button>
1586
  <?php }else{ ?>
1587
- <form action="http://api.wpfastestcache.net/paypal/buypremium/" method="post">
1588
  <input type="hidden" name="ip" value="<?php echo $_SERVER["REMOTE_ADDR"]; ?>">
1589
  <input type="hidden" name="wpfclang" value="<?php echo $this->options->wpFastestCacheLanguage; ?>">
1590
  <input type="hidden" name="bloglang" value="<?php echo get_bloginfo('language'); ?>">
387
  }
388
 
389
  public function insertWebp($htaccess){
390
+ if(class_exists("WpFastestCachePowerfulHtml")){
391
+ $webp = true;
392
+ }else{
393
+ $webp = false;
394
+ }
395
+
396
+ if($webp){
 
 
 
 
 
 
 
 
 
 
 
397
  $data = "# BEGIN WEBPWpFastestCache"."\n".
398
  "<IfModule mod_rewrite.c>"."\n".
399
  "RewriteEngine On"."\n".
418
 
419
  return $htaccess;
420
  }else{
421
+ $htaccess = preg_replace("/#\s?BEGIN\s?WEBPWpFastestCache.*?#\s?END\s?WEBPWpFastestCache/s", "", $htaccess);
422
  return $htaccess;
423
  }
424
  }
1175
  "gingerdomain.com",
1176
  "topclassprinting.com",
1177
  "camilazivit.com.br",
1178
+ "spycoupon.in",
1179
+ "groovypost.com"
1180
  );
1181
 
1182
  if(in_array(get_bloginfo('language'), $tester_arr) || in_array(str_replace("www.", "", $_SERVER["HTTP_HOST"]), $tester_arr)){ ?>
1575
  <span>Purchased</span>
1576
  </button>
1577
  <?php }else{ ?>
1578
+ <form action="https://api.wpfastestcache.net/paypal/buypremium/" method="post">
1579
  <input type="hidden" name="ip" value="<?php echo $_SERVER["REMOTE_ADDR"]; ?>">
1580
  <input type="hidden" name="wpfclang" value="<?php echo $this->options->wpFastestCacheLanguage; ?>">
1581
  <input type="hidden" name="bloglang" value="<?php echo get_bloginfo('language'); ?>">
inc/cache.php CHANGED
@@ -58,7 +58,7 @@
58
  if($this->isPluginActive('gtranslate/gtranslate.php')){
59
  if(isset($_SERVER["HTTP_X_GT_LANG"])){
60
  $this->cacheFilePath = $this->getWpContentDir()."/cache/all/".$_SERVER["HTTP_X_GT_LANG"];
61
- }else if(isset($_SERVER["REDIRECT_URL"])){
62
  $this->cacheFilePath = $this->getWpContentDir()."/cache/all/".$_SERVER["REDIRECT_URL"];
63
  }else if(isset($_SERVER["REQUEST_URI"])){
64
  $this->cacheFilePath = $this->getWpContentDir()."/cache/all/".$_SERVER["REQUEST_URI"];
@@ -87,14 +87,6 @@
87
  }
88
  }
89
  }
90
-
91
- if(isset($_COOKIE) && isset($_COOKIE['safirmobilswitcher'])){
92
- if($_COOKIE['safirmobilswitcher'] == "mobil"){
93
- $this->cacheFilePath = str_replace("/cache/all/", "/cache/wpfc-mobile-cache/", $this->cacheFilePath);
94
- }else if($_COOKIE['safirmobilswitcher'] == "masaustu"){
95
- $this->cacheFilePath = str_replace("/cache/wpfc-mobile-cache/", "/cache/all/", $this->cacheFilePath);
96
- }
97
- }
98
  }
99
 
100
  public function set_cdn(){
@@ -169,6 +161,12 @@
169
  }
170
  }
171
 
 
 
 
 
 
 
172
  if(preg_match("/\?/", $_SERVER["REQUEST_URI"]) && !preg_match("/\/\?fdx\_switcher\=true/", $_SERVER["REQUEST_URI"])){ // for WP Mobile Edition
173
  if(preg_match("/\?amp(\=1)?/i", $_SERVER["REQUEST_URI"])){
174
  //
@@ -200,7 +198,9 @@
200
  //must be normal connection
201
  if(!$this->isPluginActive('really-simple-ssl/rlrsssl-really-simple-ssl.php')){
202
  if(!$this->isPluginActive('really-simple-ssl-pro/really-simple-ssl-pro.php')){
203
- return 0;
 
 
204
  }
205
  }
206
  }
@@ -362,8 +362,10 @@
362
  return true;
363
  }
364
  }else if($value->type == "cookie"){
365
- if(preg_match("/".preg_quote($value->content, "/")."/i", $_SERVER['HTTP_COOKIE'])){
366
- return true;
 
 
367
  }
368
  }
369
  }
@@ -570,13 +572,13 @@
570
 
571
  public function cdn_rewrite($content){
572
  if($this->cdn){
573
- $content = preg_replace_callback("/(srcset|src|href|data-lazyload|data-srcsmall|data-srclarge|data-srcfull|data-slide-img)\s{0,2}\=[\'\"]([^\'\"]+)[\'\"]/i", array($this, 'cdn_replace_urls'), $content);
574
  //url()
575
  $content = preg_replace_callback("/(url)\(([^\)]+)\)/i", array($this, 'cdn_replace_urls'), $content);
576
  //{"concatemoji":"http:\/\/your_url.com\/wp-includes\/js\/wp-emoji-release.min.js?ver=4.7"}
577
  $content = preg_replace_callback("/\{\"concatemoji\"\:\"[^\"]+\"\}/i", array($this, 'cdn_replace_urls'), $content);
578
  //<script>var loaderRandomImages=["https:\/\/www.site.com\/wp-content\/uploads\/2016\/12\/image.jpg"];</script>
579
- $content = preg_replace_callback("/[\"\']https?\:\\\\\/\\\\\/[^\"\']+[\"\']/i", array($this, 'cdn_replace_urls'), $content);
580
  }
581
 
582
  return $content;
58
  if($this->isPluginActive('gtranslate/gtranslate.php')){
59
  if(isset($_SERVER["HTTP_X_GT_LANG"])){
60
  $this->cacheFilePath = $this->getWpContentDir()."/cache/all/".$_SERVER["HTTP_X_GT_LANG"];
61
+ }else if(isset($_SERVER["REDIRECT_URL"]) && $_SERVER["REDIRECT_URL"] != "/index.php"){
62
  $this->cacheFilePath = $this->getWpContentDir()."/cache/all/".$_SERVER["REDIRECT_URL"];
63
  }else if(isset($_SERVER["REQUEST_URI"])){
64
  $this->cacheFilePath = $this->getWpContentDir()."/cache/all/".$_SERVER["REQUEST_URI"];
87
  }
88
  }
89
  }
 
 
 
 
 
 
 
 
90
  }
91
 
92
  public function set_cdn(){
161
  }
162
  }
163
 
164
+ if(isset($_COOKIE) && isset($_COOKIE['safirmobilswitcher'])){
165
+ ob_start(array($this, "cdn_rewrite"));
166
+
167
+ return 0;
168
+ }
169
+
170
  if(preg_match("/\?/", $_SERVER["REQUEST_URI"]) && !preg_match("/\/\?fdx\_switcher\=true/", $_SERVER["REQUEST_URI"])){ // for WP Mobile Edition
171
  if(preg_match("/\?amp(\=1)?/i", $_SERVER["REQUEST_URI"])){
172
  //
198
  //must be normal connection
199
  if(!$this->isPluginActive('really-simple-ssl/rlrsssl-really-simple-ssl.php')){
200
  if(!$this->isPluginActive('really-simple-ssl-pro/really-simple-ssl-pro.php')){
201
+ if(!$this->isPluginActive('ssl-insecure-content-fixer/ssl-insecure-content-fixer.php')){
202
+ return 0;
203
+ }
204
  }
205
  }
206
  }
362
  return true;
363
  }
364
  }else if($value->type == "cookie"){
365
+ if(isset($_SERVER['HTTP_COOKIE'])){
366
+ if(preg_match("/".preg_quote($value->content, "/")."/i", $_SERVER['HTTP_COOKIE'])){
367
+ return true;
368
+ }
369
  }
370
  }
371
  }
572
 
573
  public function cdn_rewrite($content){
574
  if($this->cdn){
575
+ $content = preg_replace_callback("/(srcset|src|href|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);
576
  //url()
577
  $content = preg_replace_callback("/(url)\(([^\)]+)\)/i", array($this, 'cdn_replace_urls'), $content);
578
  //{"concatemoji":"http:\/\/your_url.com\/wp-includes\/js\/wp-emoji-release.min.js?ver=4.7"}
579
  $content = preg_replace_callback("/\{\"concatemoji\"\:\"[^\"]+\"\}/i", array($this, 'cdn_replace_urls'), $content);
580
  //<script>var loaderRandomImages=["https:\/\/www.site.com\/wp-content\/uploads\/2016\/12\/image.jpg"];</script>
581
+ $content = preg_replace_callback("/[\"\']([^\'\"]+)[\"\']\s*\:\s*[\"\']https?\:\\\\\/\\\\\/[^\"\']+[\"\']/i", array($this, 'cdn_replace_urls'), $content);
582
  }
583
 
584
  return $content;
inc/js-utilities.php CHANGED
@@ -139,6 +139,11 @@
139
  if(preg_match("/wp-spamshield\/js\/jscripts\.php/i", $script_tag)){
140
  $this->jsLinksExcept = $this->jsLinksExcept.$script_tag;
141
  }
 
 
 
 
 
142
  }
143
  }
144
 
139
  if(preg_match("/wp-spamshield\/js\/jscripts\.php/i", $script_tag)){
140
  $this->jsLinksExcept = $this->jsLinksExcept.$script_tag;
141
  }
142
+
143
+ //amazonjs/components/js/jquery-tmpl/jquery.tmpl.min.js?ver=1.0.0pre
144
+ if(preg_match("/jquery-tmpl\/jquery\.tmpl\.min\.js/i", $script_tag)){
145
+ $this->jsLinksExcept = $this->jsLinksExcept.$script_tag;
146
+ }
147
  }
148
  }
149
 
js/db.js CHANGED
@@ -87,20 +87,25 @@ var WpfcDB = {
87
  }
88
  };
89
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
 
91
- if(window.attachEvent) {
92
- window.attachEvent('onload', WpfcDB_init);
93
- } else {
94
- if(window.onload) {
95
- var curronload = window.onload;
96
- var newonload = function(evt) {
97
- curronload(evt);
98
- WpfcDB_init(evt);
99
- };
100
- window.onload = newonload;
101
- } else {
102
- window.onload = WpfcDB_init;
103
- }
104
  }
105
 
106
  function WpfcDB_init(){WpfcDB.init();}
87
  }
88
  };
89
 
90
+ // if(window.attachEvent) {
91
+ // window.attachEvent('onload', WpfcDB_init);
92
+ // } else {
93
+ // if(window.onload) {
94
+ // var curronload = window.onload;
95
+ // var newonload = function(evt) {
96
+ // curronload(evt);
97
+ // WpfcDB_init(evt);
98
+ // };
99
+ // window.onload = newonload;
100
+ // } else {
101
+ // window.onload = WpfcDB_init;
102
+ // }
103
+ // }
104
 
105
+ if(window.attachEvent){
106
+ window.attachEvent('onload', WpfcDB_init);
107
+ }else if(window.addEventListener){
108
+ window.addEventListener('load', WpfcDB_init, false);
 
 
 
 
 
 
 
 
 
109
  }
110
 
111
  function WpfcDB_init(){WpfcDB.init();}
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: emrevona
3
  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.7.3
7
- Stable tag: 0.8.6.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -101,6 +101,14 @@ Wpfc does not support Wordpress Multisite yet.
101
 
102
  == Changelog ==
103
 
 
 
 
 
 
 
 
 
104
  = 0.8.6.8 =
105
  * <strong>[FEATURE]</strong> Widget Cache [<a target="_blank" href="http://www.wpfastestcache.com/premium/widget-cache-reduce-the-number-of-sql-queries/">Details</a>]
106
  * to add browser cache for woff2
3
  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.7.5
7
+ Stable tag: 0.8.6.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
101
 
102
  == Changelog ==
103
 
104
+ = 0.8.6.9 =
105
+ * <strong>[FEATURE]</strong> to clear cache of the post tags and the post categories after new post
106
+ * <strong>[FEATURE]</strong> WebP [<a target="_blank" href="http://www.wpfastestcache.com/premium/image-optimization/">Details</a>]
107
+ * to fix BlogPosting error on Structured Data Testing Tool when cdn is used
108
+ * to fix more than one cdn work concurrently
109
+ * <strong>[FEATURE]</strong> Preload for category
110
+ * <strong>[FEATURE]</strong> Preload for woocommerce products
111
+
112
  = 0.8.6.8 =
113
  * <strong>[FEATURE]</strong> Widget Cache [<a target="_blank" href="http://www.wpfastestcache.com/premium/widget-cache-reduce-the-number-of-sql-queries/">Details</a>]
114
  * to add browser cache for woff2
templates/cdn/photon.php CHANGED
@@ -35,10 +35,10 @@
35
  <p>Please enter your <strong>CDN Url</strong> below to deliver your contents via CDN.</p>
36
  <div class="wiz-input-cont">
37
  <label class="mc-input-label" for="cdn-url" style="padding-right: 12px;">CDN Url:</label><select id="cdn-url">
38
- <option value="http://i0.wp.com/<?php echo str_replace("www.", "", $_SERVER["HTTP_HOST"]); ?>">http://i0.wp.com</option>
39
- <option value="http://i1.wp.com/<?php echo str_replace("www.", "", $_SERVER["HTTP_HOST"]); ?>">http://i1.wp.com</option>
40
- <option value="http://i2.wp.com/<?php echo str_replace("www.", "", $_SERVER["HTTP_HOST"]); ?>">http://i2.wp.com</option>
41
- <option value="http://i3.wp.com/<?php echo str_replace("www.", "", $_SERVER["HTTP_HOST"]); ?>">http://i3.wp.com</option>
42
  <option value="random">Random</option>
43
  </select>
44
  <div id="cdn-url-loading"></div>
35
  <p>Please enter your <strong>CDN Url</strong> below to deliver your contents via CDN.</p>
36
  <div class="wiz-input-cont">
37
  <label class="mc-input-label" for="cdn-url" style="padding-right: 12px;">CDN Url:</label><select id="cdn-url">
38
+ <option value="http://i0.wp.com/<?php echo str_replace("www.", "", $_SERVER["HTTP_HOST"]); ?>">i0.wp.com</option>
39
+ <option value="http://i1.wp.com/<?php echo str_replace("www.", "", $_SERVER["HTTP_HOST"]); ?>">i1.wp.com</option>
40
+ <option value="http://i2.wp.com/<?php echo str_replace("www.", "", $_SERVER["HTTP_HOST"]); ?>">i2.wp.com</option>
41
+ <option value="http://i3.wp.com/<?php echo str_replace("www.", "", $_SERVER["HTTP_HOST"]); ?>">i3.wp.com</option>
42
  <option value="random">Random</option>
43
  </select>
44
  <div id="cdn-url-loading"></div>
templates/newpost.php CHANGED
@@ -52,7 +52,9 @@
52
  </div>
53
  <div class="wiz-input-cont">
54
  <label class="mc-input-label" style="margin-right: 5px;"><input type="radio" <?php echo $wpFastestCacheNewPost_type_homepage; ?> action-id="wpFastestCacheNewPost_type_homepage" id="wpFastestCacheNewPost_type_homepage" name="wpFastestCacheNewPost_type" value="homepage"></label>
55
- <label for="wpFastestCacheNewPost_type_homepage">Clear Only Homepage Cache</label>
 
 
56
  </div>
57
 
58
 
52
  </div>
53
  <div class="wiz-input-cont">
54
  <label class="mc-input-label" style="margin-right: 5px;"><input type="radio" <?php echo $wpFastestCacheNewPost_type_homepage; ?> action-id="wpFastestCacheNewPost_type_homepage" id="wpFastestCacheNewPost_type_homepage" name="wpFastestCacheNewPost_type" value="homepage"></label>
55
+ <label for="wpFastestCacheNewPost_type_homepage">Clear Cache of Homepage</label><br>
56
+ <label style="margin-left:24px;" for="wpFastestCacheNewPost_type_homepage">Clear Cache of Post Categories</label><br>
57
+ <label style="margin-left:24px;" for="wpFastestCacheNewPost_type_homepage">Clear Cache of Post Tags</label><br>
58
  </div>
59
 
60
 
templates/updatepost.php CHANGED
@@ -44,6 +44,10 @@
44
  ?>
45
 
46
 
 
 
 
 
47
  <div class="wiz-input-cont">
48
  <label class="mc-input-label" style="margin-right: 5px;"><input type="radio" <?php echo $wpFastestCacheUpdatePost_type_post; ?> action-id="wpFastestCacheUpdatePost_type_post" id="wpFastestCacheUpdatePost_type_post" name="wpFastestCacheUpdatePost_type" value="post"></label>
49
  <label for="wpFastestCacheUpdatePost_type_post">Clear Cache of Post / Page</label><br>
@@ -51,13 +55,6 @@
51
  <label style="margin-left:24px;" for="wpFastestCacheUpdatePost_type_post">Clear Cache of Post Tags</label><br>
52
  <label style="margin-left:24px;" for="wpFastestCacheUpdatePost_type_post">Clear Cache of Homepage</label>
53
  </div>
54
- <div class="wiz-input-cont">
55
- <label class="mc-input-label" style="margin-right: 5px;"><input type="radio" <?php echo $wpFastestCacheUpdatePost_type_all; ?> action-id="wpFastestCacheUpdatePost_type_all" id="wpFastestCacheUpdatePost_type_all" name="wpFastestCacheUpdatePost_type" value="all"></label>
56
- <label for="wpFastestCacheUpdatePost_type_all">Clear All Cache</label>
57
- </div>
58
-
59
-
60
-
61
 
62
  </div>
63
  </div>
44
  ?>
45
 
46
 
47
+ <div class="wiz-input-cont">
48
+ <label class="mc-input-label" style="margin-right: 5px;"><input type="radio" <?php echo $wpFastestCacheUpdatePost_type_all; ?> action-id="wpFastestCacheUpdatePost_type_all" id="wpFastestCacheUpdatePost_type_all" name="wpFastestCacheUpdatePost_type" value="all"></label>
49
+ <label for="wpFastestCacheUpdatePost_type_all">Clear All Cache</label>
50
+ </div>
51
  <div class="wiz-input-cont">
52
  <label class="mc-input-label" style="margin-right: 5px;"><input type="radio" <?php echo $wpFastestCacheUpdatePost_type_post; ?> action-id="wpFastestCacheUpdatePost_type_post" id="wpFastestCacheUpdatePost_type_post" name="wpFastestCacheUpdatePost_type" value="post"></label>
53
  <label for="wpFastestCacheUpdatePost_type_post">Clear Cache of Post / Page</label><br>
55
  <label style="margin-left:24px;" for="wpFastestCacheUpdatePost_type_post">Clear Cache of Post Tags</label><br>
56
  <label style="margin-left:24px;" for="wpFastestCacheUpdatePost_type_post">Clear Cache of Homepage</label>
57
  </div>
 
 
 
 
 
 
 
58
 
59
  </div>
60
  </div>
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.6.8
7
  Author: Emre Vona
8
  Author URI: http://tr.linkedin.com/in/emrevona
9
  Text Domain: wp-fastest-cache
@@ -105,10 +105,8 @@ GNU General Public License for more details.
105
  if(isset($_GET) && isset($_GET["type"]) && $_GET["type"] == "preload"){
106
  // /?action=wpfastestcache&type=preload
107
 
108
- $this->create_preload_cache();
109
  }
110
-
111
- exit;
112
  }else{
113
  $this->setCustomInterval();
114
 
@@ -793,6 +791,8 @@ GNU General Public License for more details.
793
  $this->deleteCache();
794
  }else if($this->options->wpFastestCacheNewPost_type == "homepage"){
795
  $this->deleteHomePageCache();
 
 
796
  }
797
  }else{
798
  $this->deleteCache();
@@ -872,8 +872,7 @@ GNU General Public License for more details.
872
  }
873
 
874
  // to clear cache of homepage
875
- @unlink($this->getWpContentDir()."/cache/all/index.html");
876
- @unlink($this->getWpContentDir()."/cache/wpfc-mobile-cache/index.html");
877
 
878
  // to clear cache of cats which contains the post (only first page)
879
  foreach (wp_get_post_categories($post_id) as $cat_key => $cat_id) {
@@ -1144,7 +1143,7 @@ GNU General Public License for more details.
1144
  // 'suppress_filters' => true
1145
  // ), ARRAY_A);
1146
  global $wpdb;
1147
- $recent_posts = $GLOBALS['wpdb']->get_results("SELECT SQL_CALC_FOUND_ROWS ".$wpdb->prefix."posts.ID FROM ".$wpdb->prefix."posts WHERE 1=1 AND ".$wpdb->prefix."posts.post_type = 'post' AND ((".$wpdb->prefix."posts.post_status = 'publish')) ORDER BY ".$wpdb->prefix."posts.ID DESC LIMIT ".$pre_load->post.", ".$number, ARRAY_A);
1148
 
1149
 
1150
  if(count($recent_posts) > 0){
@@ -1198,7 +1197,7 @@ GNU General Public License for more details.
1198
  }
1199
 
1200
  // CATEGORY
1201
- if(false && $number > 0 && $pre_load->category > -1){
1202
  $categories = get_terms("category", array(
1203
  'orderby' => 'id',
1204
  'order' => 'DESC',
@@ -1222,10 +1221,6 @@ GNU General Public License for more details.
1222
  $pre_load->category = $pre_load->category + 1;
1223
 
1224
  }
1225
-
1226
- if(count($categories) == 1){
1227
- $pre_load->category = -1;
1228
- }
1229
  }else{
1230
  $pre_load->category = -1;
1231
  }
@@ -1292,6 +1287,8 @@ GNU General Public License for more details.
1292
  $response = wp_remote_get($url, array('timeout' => 10, 'headers' => array("cache-control" => array("no-store, no-cache, must-revalidate", "post-check=0, pre-check=0"),'user-agent' => $user_agent)));
1293
 
1294
  if (!$response || is_wp_error($response)){
 
 
1295
  return false;
1296
  }else{
1297
  if(wp_remote_retrieve_response_code($response) != 200){
@@ -1437,10 +1434,7 @@ GNU General Public License for more details.
1437
  }
1438
 
1439
  protected function getMobileUserAgents(){
1440
-
1441
  return implode("|", $this->get_mobile_browsers())."|".implode("|", $this->get_operating_systems());
1442
-
1443
- //return "iphone|midp|sony|symbos|nokia|samsung|mobile|epoc|ericsson|panasonic|philips|sanyo|sharp|sie-|portalmmm|blazer|avantgo|danger|palm|series60|palmsource|pocketpc|android|blackberry|playbook|ipad|ipod|iemobile|palmos|webos|googlebot-mobile|bb10|xoom|p160u|nexus|SCH-I800|opera\smini|SM-G900R4|LG-|HTC|GT-I9505|WAP-Browser|Nokia309|Casper_VIA";
1444
  }
1445
 
1446
  public function get_premium_path($name){
@@ -1638,14 +1632,14 @@ GNU General Public License for more details.
1638
  $cdn->file_types = str_replace(",", "|", $cdn->file_types);
1639
 
1640
  if(!preg_match("/\.(".$cdn->file_types.")/i", $matches[0])){
1641
- return $matches[0];
1642
  }
1643
 
1644
  if($cdn->keywords){
1645
  $cdn->keywords = str_replace(",", "|", $cdn->keywords);
1646
 
1647
  if(!preg_match("/".$cdn->keywords."/i", $matches[0])){
1648
- return $matches[0];
1649
  }
1650
  }
1651
 
@@ -1657,12 +1651,18 @@ GNU General Public License for more details.
1657
  }else if(preg_match("/^(\/?)(wp-includes|wp-content)/", $matches[2])){
1658
  $matches[0] = preg_replace("/(\/?)(wp-includes|wp-content)/i", $cdnurl."/"."$2", $matches[0]);
1659
  }else if(preg_match("/[\"\']https?\:\\\\\/\\\\\/[^\"\']+[\"\']/i", $matches[0])){
1660
- //<script>var loaderRandomImages=["https:\/\/www.site.com\/wp-content\/uploads\/2016\/12\/image.jpg"];</script>
1661
- $matches[0] = preg_replace("/\\\\\//", "/", $matches[0]);
1662
-
1663
- if(preg_match("/".preg_quote($cdn->originurl, "/")."/", $matches[0])){
1664
- $matches[0] = preg_replace("/(http(s?)\:)?\/\/(www\.)?".preg_quote($cdn->originurl, "/")."/i", $cdnurl, $matches[0]);
1665
- $matches[0] = preg_replace("/\//", "\/", $matches[0]);
 
 
 
 
 
 
1666
  }
1667
  }
1668
  }
@@ -1703,6 +1703,7 @@ GNU General Public License for more details.
1703
  'Windows\sCE.*(PPC|Smartphone|Mobile|[0-9]{3}x[0-9]{3})|Window\sMobile|Windows\sPhone\s[0-9.]+|WCE;',
1704
  'Windows\sPhone\s10.0|Windows\sPhone\s8.1|Windows\sPhone\s8.0|Windows\sPhone\sOS|XBLWP7|ZuneWP7|Windows\sNT\s6\.[23]\;\sARM\;',
1705
  '\biPhone.*Mobile|\biPod|\biPad',
 
1706
  'MeeGo',
1707
  'Maemo',
1708
  'J2ME\/|\bMIDP\b|\bCLDC\b', // '|Java/' produces bug #135
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.6.9
7
  Author: Emre Vona
8
  Author URI: http://tr.linkedin.com/in/emrevona
9
  Text Domain: wp-fastest-cache
105
  if(isset($_GET) && isset($_GET["type"]) && $_GET["type"] == "preload"){
106
  // /?action=wpfastestcache&type=preload
107
 
108
+ add_action('init', array($this, "create_preload_cache"));
109
  }
 
 
110
  }else{
111
  $this->setCustomInterval();
112
 
791
  $this->deleteCache();
792
  }else if($this->options->wpFastestCacheNewPost_type == "homepage"){
793
  $this->deleteHomePageCache();
794
+ //to clear category cache and tag cache
795
+ $this->singleDeleteCache(false, $post->ID);
796
  }
797
  }else{
798
  $this->deleteCache();
872
  }
873
 
874
  // to clear cache of homepage
875
+ $this->deleteHomePageCache();
 
876
 
877
  // to clear cache of cats which contains the post (only first page)
878
  foreach (wp_get_post_categories($post_id) as $cat_key => $cat_id) {
1143
  // 'suppress_filters' => true
1144
  // ), ARRAY_A);
1145
  global $wpdb;
1146
+ $recent_posts = $GLOBALS['wpdb']->get_results("SELECT SQL_CALC_FOUND_ROWS ".$wpdb->prefix."posts.ID FROM ".$wpdb->prefix."posts WHERE 1=1 AND (".$wpdb->prefix."posts.post_type = 'post' OR ".$wpdb->prefix."posts.post_type = 'product') AND ((".$wpdb->prefix."posts.post_status = 'publish')) ORDER BY ".$wpdb->prefix."posts.ID DESC LIMIT ".$pre_load->post.", ".$number, ARRAY_A);
1147
 
1148
 
1149
  if(count($recent_posts) > 0){
1197
  }
1198
 
1199
  // CATEGORY
1200
+ if($number > 0 && $pre_load->category > -1){
1201
  $categories = get_terms("category", array(
1202
  'orderby' => 'id',
1203
  'order' => 'DESC',
1221
  $pre_load->category = $pre_load->category + 1;
1222
 
1223
  }
 
 
 
 
1224
  }else{
1225
  $pre_load->category = -1;
1226
  }
1287
  $response = wp_remote_get($url, array('timeout' => 10, 'headers' => array("cache-control" => array("no-store, no-cache, must-revalidate", "post-check=0, pre-check=0"),'user-agent' => $user_agent)));
1288
 
1289
  if (!$response || is_wp_error($response)){
1290
+ echo $response->get_error_message()." - ";
1291
+
1292
  return false;
1293
  }else{
1294
  if(wp_remote_retrieve_response_code($response) != 200){
1434
  }
1435
 
1436
  protected function getMobileUserAgents(){
 
1437
  return implode("|", $this->get_mobile_browsers())."|".implode("|", $this->get_operating_systems());
 
 
1438
  }
1439
 
1440
  public function get_premium_path($name){
1632
  $cdn->file_types = str_replace(",", "|", $cdn->file_types);
1633
 
1634
  if(!preg_match("/\.(".$cdn->file_types.")/i", $matches[0])){
1635
+ continue;
1636
  }
1637
 
1638
  if($cdn->keywords){
1639
  $cdn->keywords = str_replace(",", "|", $cdn->keywords);
1640
 
1641
  if(!preg_match("/".$cdn->keywords."/i", $matches[0])){
1642
+ continue;
1643
  }
1644
  }
1645
 
1651
  }else if(preg_match("/^(\/?)(wp-includes|wp-content)/", $matches[2])){
1652
  $matches[0] = preg_replace("/(\/?)(wp-includes|wp-content)/i", $cdnurl."/"."$2", $matches[0]);
1653
  }else if(preg_match("/[\"\']https?\:\\\\\/\\\\\/[^\"\']+[\"\']/i", $matches[0])){
1654
+ if(preg_match("/^(logo|url)$/i", $matches[1])){
1655
+ //If the url is called with "//", it causes an error on https://search.google.com/structured-data/testing-tool/u/0/
1656
+ //<script type="application/ld+json">"logo":{"@type":"ImageObject","url":"\/\/cdn.site.com\/image.png"}</script>
1657
+ //<script type="application/ld+json">{"logo":"\/\/cdn.site.com\/image.png"}</script>
1658
+ }else{
1659
+ //<script>var loaderRandomImages=["https:\/\/www.site.com\/wp-content\/uploads\/2016\/12\/image.jpg"];</script>
1660
+ $matches[0] = preg_replace("/\\\\\//", "/", $matches[0]);
1661
+
1662
+ if(preg_match("/".preg_quote($cdn->originurl, "/")."/", $matches[0])){
1663
+ $matches[0] = preg_replace("/(http(s?)\:)?\/\/(www\.)?".preg_quote($cdn->originurl, "/")."/i", $cdnurl, $matches[0]);
1664
+ $matches[0] = preg_replace("/\//", "\/", $matches[0]);
1665
+ }
1666
  }
1667
  }
1668
  }
1703
  'Windows\sCE.*(PPC|Smartphone|Mobile|[0-9]{3}x[0-9]{3})|Window\sMobile|Windows\sPhone\s[0-9.]+|WCE;',
1704
  'Windows\sPhone\s10.0|Windows\sPhone\s8.1|Windows\sPhone\s8.0|Windows\sPhone\sOS|XBLWP7|ZuneWP7|Windows\sNT\s6\.[23]\;\sARM\;',
1705
  '\biPhone.*Mobile|\biPod|\biPad',
1706
+ 'Apple-iPhone7C2',
1707
  'MeeGo',
1708
  'Maemo',
1709
  'J2ME\/|\bMIDP\b|\bCLDC\b', // '|Java/' produces bug #135