WP Fastest Cache - Version 0.8.9.5

Version Description

  • to check the page is 404 or not with http_response_code() if is_404() does not work
  • [FEATURE] to add Custom Taxonomies on the preload feature
  • [FEATURE] to show statistics of Preload
  • to replace urls which have data-img-url attribute with cdn-url
  • [FEATURE] to add WP-CLI command for clearing cache [Details]
  • refactoring of is_amp()
Download this release

Release Info

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

Code changes from version 0.8.9.4 to 0.8.9.5

inc/admin.php CHANGED
@@ -935,6 +935,7 @@
935
  $wpFastestCachePreload_post = isset($this->options->wpFastestCachePreload_post) ? 'checked="checked"' : "";
936
  $wpFastestCachePreload_category = isset($this->options->wpFastestCachePreload_category) ? 'checked="checked"' : "";
937
  $wpFastestCachePreload_customposttypes = isset($this->options->wpFastestCachePreload_customposttypes) ? 'checked="checked"' : "";
 
938
  $wpFastestCachePreload_page = isset($this->options->wpFastestCachePreload_page) ? 'checked="checked"' : "";
939
  $wpFastestCachePreload_tag = isset($this->options->wpFastestCachePreload_tag) ? 'checked="checked"' : "";
940
  $wpFastestCachePreload_attachment = isset($this->options->wpFastestCachePreload_attachment) ? 'checked="checked"' : "";
@@ -2204,11 +2205,11 @@
2204
  </script>
2205
  <script type="text/javascript">
2206
  jQuery("#wpFastestCachePreload").click(function(){
2207
- if(typeof jQuery(this).attr("checked") != "undefined"){
2208
  if(jQuery("div[id^='wpfc-modal-preload-']").length === 0){
2209
  Wpfc_New_Dialog.dialog("wpfc-modal-preload", {close: function(){
2210
  Wpfc_New_Dialog.clone.find("div.window-content input").each(function(){
2211
- if(typeof jQuery(this).attr("checked") != "undefined"){
2212
  jQuery("div.tab1 div[template-id='wpfc-modal-preload'] div.window-content input[name='" + jQuery(this).attr("name") + "']").attr("checked", true);
2213
  }else{
2214
  jQuery("div.tab1 div[template-id='wpfc-modal-preload'] div.window-content input[name='" + jQuery(this).attr("name") + "']").attr("checked", false);
935
  $wpFastestCachePreload_post = isset($this->options->wpFastestCachePreload_post) ? 'checked="checked"' : "";
936
  $wpFastestCachePreload_category = isset($this->options->wpFastestCachePreload_category) ? 'checked="checked"' : "";
937
  $wpFastestCachePreload_customposttypes = isset($this->options->wpFastestCachePreload_customposttypes) ? 'checked="checked"' : "";
938
+ $wpFastestCachePreload_customTaxonomies = isset($this->options->wpFastestCachePreload_customTaxonomies) ? 'checked="checked"' : "";
939
  $wpFastestCachePreload_page = isset($this->options->wpFastestCachePreload_page) ? 'checked="checked"' : "";
940
  $wpFastestCachePreload_tag = isset($this->options->wpFastestCachePreload_tag) ? 'checked="checked"' : "";
941
  $wpFastestCachePreload_attachment = isset($this->options->wpFastestCachePreload_attachment) ? 'checked="checked"' : "";
2205
  </script>
2206
  <script type="text/javascript">
2207
  jQuery("#wpFastestCachePreload").click(function(){
2208
+ if(jQuery(this).is(':checked')){
2209
  if(jQuery("div[id^='wpfc-modal-preload-']").length === 0){
2210
  Wpfc_New_Dialog.dialog("wpfc-modal-preload", {close: function(){
2211
  Wpfc_New_Dialog.clone.find("div.window-content input").each(function(){
2212
+ if(jQuery(this).is(':checked')){
2213
  jQuery("div.tab1 div[template-id='wpfc-modal-preload'] div.window-content input[name='" + jQuery(this).attr("name") + "']").attr("checked", true);
2214
  }else{
2215
  jQuery("div.tab1 div[template-id='wpfc-modal-preload'] div.window-content input[name='" + jQuery(this).attr("name") + "']").attr("checked", false);
inc/cache.php CHANGED
@@ -587,7 +587,7 @@
587
  return $buffer."<!-- wp-login.php -->";
588
  }else if($this->hasContactForm7WithCaptcha($buffer)){
589
  return $buffer."<!-- This page was not cached because ContactForm7's captcha -->";
590
- }else if(is_404() || preg_match("/<title>404\sNot\sFound<\/title>/", $buffer)){
591
  return $buffer;
592
  }else if($this->ignored($buffer)){
593
  return $buffer;
@@ -764,7 +764,7 @@
764
 
765
  public function cdn_rewrite($content){
766
  if($this->cdn){
767
- $content = preg_replace_callback("/(srcset|src|href|data-cvpsrc|data-cvpset|data-thumb|data-bg-url|data-large_image|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);
768
 
769
  //url()
770
  $content = preg_replace_callback("/(url)\(([^\)\>]+)\)/i", array($this, 'cdn_replace_urls'), $content);
@@ -961,6 +961,10 @@
961
  if(preg_match("/<html[^\>]+amp[^\>]*>/i", $content)){
962
  return true;
963
  }
 
 
 
 
964
  }
965
 
966
  return false;
587
  return $buffer."<!-- wp-login.php -->";
588
  }else if($this->hasContactForm7WithCaptcha($buffer)){
589
  return $buffer."<!-- This page was not cached because ContactForm7's captcha -->";
590
+ }else if((function_exists("http_response_code") && (http_response_code() === 404)) || is_404() || preg_match("/<title>404\sNot\sFound<\/title>/", $buffer)){
591
  return $buffer;
592
  }else if($this->ignored($buffer)){
593
  return $buffer;
764
 
765
  public function cdn_rewrite($content){
766
  if($this->cdn){
767
+ $content = preg_replace_callback("/(srcset|src|href|data-img-url|data-cvpsrc|data-cvpset|data-thumb|data-bg-url|data-large_image|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);
768
 
769
  //url()
770
  $content = preg_replace_callback("/(url)\(([^\)\>]+)\)/i", array($this, 'cdn_replace_urls'), $content);
961
  if(preg_match("/<html[^\>]+amp[^\>]*>/i", $content)){
962
  return true;
963
  }
964
+
965
+ if(preg_match("/<html[^\>]+\⚡[^\>]*>/i", $content)){
966
+ return true;
967
+ }
968
  }
969
 
970
  return false;
inc/cli.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WP-CLI commands for WP Fastest Cache.
4
+ */
5
+
6
+ if(!defined('ABSPATH')){
7
+ exit;
8
+ }
9
+
10
+ // This is a WP-CLI command, so bail if it's not available.
11
+ if(!defined('WP_CLI')){
12
+ return;
13
+ }
14
+
15
+
16
+ class wpfcCLI extends \WP_CLI_Command
17
+ {
18
+ /**
19
+ * Clears the cache.
20
+ *
21
+ * ## EXAMPLES
22
+ * wp fastest-cache clear all
23
+ *
24
+ *
25
+ * @subcommand clear
26
+ *
27
+ * @param array $args Args.
28
+ * @param array $args_assoc Associative args.
29
+ *
30
+ * @return void
31
+ */
32
+ public function clear($args, $args_assoc){
33
+ if(isset($args[0]) && $args[0] == "all"){
34
+ if(isset($GLOBALS['wp_fastest_cache'])){
35
+ if(method_exists($GLOBALS['wp_fastest_cache'], 'deleteCache')){
36
+
37
+ WP_CLI::line("Clearing the ALL cache...");
38
+ $GLOBALS['wp_fastest_cache']->deleteCache();
39
+ WP_CLI::success("The cache has been cleared!");
40
+
41
+ }else{
42
+ WP_CLI::error("deleteCache() does not exist!");
43
+ }
44
+ }else{
45
+ WP_CLI::error("GLOBALS['wp_fastest_cache'] has not been defined!");
46
+ }
47
+ }else{
48
+ WP_CLI::error("The cache has been cleared!");
49
+ }
50
+ }
51
+ }
52
+
53
+ WP_CLI::add_command( 'fastest-cache', 'wpfcCLI' );
54
+
55
+ ?>
inc/preload.php CHANGED
@@ -63,16 +63,84 @@
63
  }
64
  }
65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  public static function create_preload_cache($options){
67
  if($data = get_option("WpFastestCachePreLoad")){
68
  if(!isset($options->wpFastestCacheStatus)){
69
  die("Cache System must be enabled");
70
  }
71
 
72
-
73
- $count_posts = wp_count_posts("post");
74
- $count_pages = wp_count_posts('page');
75
-
76
  $pre_load = json_decode($data);
77
 
78
  if(defined("WPFC_PRELOAD_NUMBER") && WPFC_PRELOAD_NUMBER){
@@ -231,28 +299,25 @@
231
 
232
  // CATEGORY
233
  if($number > 0 && isset($pre_load->category) && $pre_load->category > -1){
234
- // $categories = get_terms(array(
235
- // 'taxonomy' => array('category', 'product_cat'),
236
- // 'orderby' => 'id',
237
- // 'order' => 'DESC',
238
- // 'hide_empty' => false,
239
- // 'number' => $number,
240
- // 'fields' => 'all',
241
- // 'pad_counts' => false,
242
- // 'offset' => $pre_load->category
243
- // ));
244
-
245
- global $wpdb;
246
- $categories = $wpdb->get_results("SELECT t.*, tt.* FROM ".$wpdb->prefix."terms AS t INNER JOIN ".$wpdb->prefix."term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('category', 'product_cat', 'hersteller', 'anschlussart', 'typ') ORDER BY t.term_id ASC LIMIT ".$pre_load->category.", ".$number, ARRAY_A);
247
 
248
  if(count($categories) > 0){
249
  foreach ($categories as $key => $category) {
250
  if($mobile_theme){
251
- array_push($urls, array("url" => get_term_link($category["slug"], $category["taxonomy"]), "user-agent" => "mobile"));
252
  $number--;
253
  }
254
 
255
- array_push($urls, array("url" => get_term_link($category["slug"], $category["taxonomy"]), "user-agent" => "desktop"));
256
  $number--;
257
 
258
  $pre_load->category = $pre_load->category + 1;
@@ -265,29 +330,25 @@
265
 
266
  // TAG
267
  if($number > 0 && isset($pre_load->tag) && $pre_load->tag > -1){
268
- // $tags = get_terms(array(
269
- // 'taxonomy' => array('post_tag', 'product_tag'),
270
- // 'orderby' => 'id',
271
- // 'order' => 'DESC',
272
- // 'hide_empty' => false,
273
- // 'number' => $number,
274
- // 'fields' => 'all',
275
- // 'pad_counts' => false,
276
- // 'offset' => $pre_load->tag
277
- // ));
278
-
279
- global $wpdb;
280
- $tags = $wpdb->get_results("SELECT t.*, tt.* FROM ".$wpdb->prefix."terms AS t INNER JOIN ".$wpdb->prefix."term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('post_tag', 'product_tag') ORDER BY t.term_id ASC LIMIT ".$pre_load->tag.", ".$number, ARRAY_A);
281
-
282
 
283
  if(count($tags) > 0){
284
  foreach ($tags as $key => $tag) {
285
  if($mobile_theme){
286
- array_push($urls, array("url" => get_term_link($tag["slug"], $tag["taxonomy"]), "user-agent" => "mobile"));
287
  $number--;
288
  }
289
 
290
- array_push($urls, array("url" => get_term_link($tag["slug"], $tag["taxonomy"]), "user-agent" => "desktop"));
291
  $number--;
292
 
293
  $pre_load->tag = $pre_load->tag + 1;
@@ -298,8 +359,42 @@
298
  }
299
  }
300
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
301
 
 
302
 
 
 
 
 
 
 
 
 
303
 
304
 
305
 
@@ -336,27 +431,8 @@
336
 
337
  echo "<br><br>";
338
 
339
- // if(isset($pre_load->homepage)){
340
- // if($pre_load->homepage == -1){
341
- // echo "Homepage: 1/1"."<br>";
342
- // }
343
- // }
344
-
345
- // if(isset($pre_load->post)){
346
- // if($pre_load->post > -1){
347
- // echo "Posts: ".$pre_load->post."/".$count_posts->publish."<br>";
348
- // }else{
349
- // echo "Posts: ".$count_posts->publish."/".$count_posts->publish."<br>";
350
- // }
351
- // }
352
-
353
- // if(isset($pre_load->page)){
354
- // if($pre_load->page > -1){
355
- // echo "Pages: ".$pre_load->page."/".$count_pages->publish."<br>";
356
- // }else{
357
- // echo "Pages: ".$count_pages->publish."/".$count_pages->publish."<br>";
358
- // }
359
- // }
360
  }else{
361
  if(isset($options->wpFastestCachePreload_restart)){
362
  foreach ($pre_load as $pre_load_key => &$pre_load_value) {
63
  }
64
  }
65
 
66
+ public static function statistic($pre_load = false){
67
+ $total = new stdClass();
68
+
69
+
70
+ if(isset($pre_load->homepage)){
71
+ $total->homepage = 1;
72
+ }
73
+
74
+ if(isset($pre_load->customposttypes)){
75
+ global $wpdb;
76
+ $post_types = get_post_types(array('public' => true), "names", "and");
77
+ $where_query = "";
78
+
79
+ foreach ($post_types as $post_type_key => $post_type_value) {
80
+ if(!in_array($post_type_key, array("post", "page", "attachment"))){
81
+ $where_query = $where_query.$wpdb->prefix."posts.post_type = '".$post_type_value."' OR ";
82
+ }
83
+
84
+ }
85
+
86
+ if($where_query){
87
+ $where_query = preg_replace("/(\s*OR\s*)$/", "", $where_query);
88
+
89
+ $recent_custom_posts = $wpdb->get_results("SELECT SQL_CALC_FOUND_ROWS COUNT(".$wpdb->prefix."posts.ID) as total FROM ".$wpdb->prefix."posts WHERE 1=1 AND (".$where_query.") AND ((".$wpdb->prefix."posts.post_status = 'publish')) ORDER BY ".$wpdb->prefix."posts.ID", ARRAY_A);
90
+ $total->customposttypes = $recent_custom_posts[0]["total"];
91
+ }
92
+ }
93
+
94
+ if(isset($pre_load->post)){
95
+ $count_posts = wp_count_posts("post", array('post_status' => 'publish', 'suppress_filters' => true));
96
+
97
+ $total->post = $count_posts->publish;
98
+ }
99
+
100
+ if(isset($pre_load->attachment)){
101
+ $total_attachments = wp_count_attachments();
102
+
103
+ $total->attachment = array_sum((array)$total_attachments) - $total_attachments->trash;
104
+ }
105
+
106
+
107
+
108
+
109
+ if(isset($pre_load->page)){
110
+ $count_pages = wp_count_posts("page", array('post_status' => 'publish', 'suppress_filters' => true));
111
+
112
+ $total->page = $count_posts->publish;
113
+ }
114
+
115
+ if(isset($pre_load->category)){
116
+ $total->category = wp_count_terms("category", array('hide_empty' => false));
117
+ }
118
+
119
+ if(isset($pre_load->tag)){
120
+ $total->tag = wp_count_terms("post_tag", array('hide_empty' => false));
121
+ }
122
+
123
+ if(isset($pre_load->customTaxonomies)){
124
+ $taxo = get_taxonomies(array('public' => true, '_builtin' => false), "names", "and");
125
+
126
+ if(count($taxo) > 0){
127
+ $total->customTaxonomies = wp_count_terms($taxo, array('hide_empty' => false));
128
+ }
129
+ }
130
+
131
+
132
+ foreach ($total as $key => $value) {
133
+ $pre_load->$key = $pre_load->$key == -1 ? $value : $pre_load->$key;
134
+ echo $key.": ".$pre_load->$key."/".$value."<br>";
135
+ }
136
+ }
137
+
138
  public static function create_preload_cache($options){
139
  if($data = get_option("WpFastestCachePreLoad")){
140
  if(!isset($options->wpFastestCacheStatus)){
141
  die("Cache System must be enabled");
142
  }
143
 
 
 
 
 
144
  $pre_load = json_decode($data);
145
 
146
  if(defined("WPFC_PRELOAD_NUMBER") && WPFC_PRELOAD_NUMBER){
299
 
300
  // CATEGORY
301
  if($number > 0 && isset($pre_load->category) && $pre_load->category > -1){
302
+ $categories = get_terms(array(
303
+ 'taxonomy' => array('category'),
304
+ 'orderby' => 'id',
305
+ 'order' => 'ASC',
306
+ 'hide_empty' => false,
307
+ 'number' => $number,
308
+ 'fields' => 'all',
309
+ 'pad_counts' => false,
310
+ 'offset' => $pre_load->category
311
+ ));
 
 
 
312
 
313
  if(count($categories) > 0){
314
  foreach ($categories as $key => $category) {
315
  if($mobile_theme){
316
+ array_push($urls, array("url" => get_term_link($category->slug, $category->taxonomy), "user-agent" => "mobile"));
317
  $number--;
318
  }
319
 
320
+ array_push($urls, array("url" => get_term_link($category->slug, $category->taxonomy), "user-agent" => "desktop"));
321
  $number--;
322
 
323
  $pre_load->category = $pre_load->category + 1;
330
 
331
  // TAG
332
  if($number > 0 && isset($pre_load->tag) && $pre_load->tag > -1){
333
+ $tags = get_terms(array(
334
+ 'taxonomy' => array('post_tag'),
335
+ 'orderby' => 'id',
336
+ 'order' => 'ASC',
337
+ 'hide_empty' => false,
338
+ 'number' => $number,
339
+ 'fields' => 'all',
340
+ 'pad_counts' => false,
341
+ 'offset' => $pre_load->tag
342
+ ));
 
 
 
 
343
 
344
  if(count($tags) > 0){
345
  foreach ($tags as $key => $tag) {
346
  if($mobile_theme){
347
+ array_push($urls, array("url" => get_term_link($tag->slug, $tag->taxonomy), "user-agent" => "mobile"));
348
  $number--;
349
  }
350
 
351
+ array_push($urls, array("url" => get_term_link($tag->slug, $tag->taxonomy), "user-agent" => "desktop"));
352
  $number--;
353
 
354
  $pre_load->tag = $pre_load->tag + 1;
359
  }
360
  }
361
 
362
+ // Custom Taxonomies
363
+ if($number > 0 && isset($pre_load->customTaxonomies) && $pre_load->customTaxonomies > -1){
364
+ $taxo = get_taxonomies(array('public' => true, '_builtin' => false), "names", "and");
365
+
366
+ if(count($taxo) > 0){
367
+ $custom_taxos = get_terms(array(
368
+ 'taxonomy' => array_values($taxo),
369
+ 'orderby' => 'id',
370
+ 'order' => 'ASC',
371
+ 'hide_empty' => false,
372
+ 'number' => $number,
373
+ 'fields' => 'all',
374
+ 'pad_counts' => false,
375
+ 'offset' => $pre_load->customTaxonomies
376
+ ));
377
+
378
+ if(count($custom_taxos) > 0){
379
+ foreach ($custom_taxos as $key => $custom_tax) {
380
+ if($mobile_theme){
381
+ array_push($urls, array("url" => get_term_link($custom_tax->slug, $custom_tax->taxonomy), "user-agent" => "mobile"));
382
+ $number--;
383
+ }
384
+
385
+ array_push($urls, array("url" => get_term_link($custom_tax->slug, $custom_tax->taxonomy), "user-agent" => "desktop"));
386
+ $number--;
387
 
388
+ $pre_load->customTaxonomies = $pre_load->customTaxonomies + 1;
389
 
390
+ }
391
+ }else{
392
+ $pre_load->customTaxonomies = -1;
393
+ }
394
+ }else{
395
+ $pre_load->customTaxonomies = -1;
396
+ }
397
+ }
398
 
399
 
400
 
431
 
432
  echo "<br><br>";
433
 
434
+ self::statistic($pre_load);
435
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
436
  }else{
437
  if(isset($options->wpFastestCachePreload_restart)){
438
  foreach ($pre_load as $pre_load_key => &$pre_load_value) {
js/dialog_new.js CHANGED
@@ -135,7 +135,7 @@ var Wpfc_New_Dialog = {
135
  jQuery("div.tab1 div[template-id='" + self.template_id + "'] div.window-content select[name='" + jQuery(this).attr("name") + "']").val(jQuery(this).val());
136
  }else if(jQuery(this).prop("tagName") == "INPUT"){
137
  if(jQuery(this).attr("type") == "checkbox"){
138
- if(typeof jQuery(this).attr("checked") != "undefined"){
139
  jQuery("div.tab1 div[template-id='" + self.template_id + "'] div.window-content input[name='" + jQuery(this).attr("name") + "']").attr("checked", true);
140
  }else{
141
  jQuery("div.tab1 div[template-id='" + self.template_id + "'] div.window-content input[name='" + jQuery(this).attr("name") + "']").attr("checked", false);
135
  jQuery("div.tab1 div[template-id='" + self.template_id + "'] div.window-content select[name='" + jQuery(this).attr("name") + "']").val(jQuery(this).val());
136
  }else if(jQuery(this).prop("tagName") == "INPUT"){
137
  if(jQuery(this).attr("type") == "checkbox"){
138
+ if(jQuery(this).is(':checked')){
139
  jQuery("div.tab1 div[template-id='" + self.template_id + "'] div.window-content input[name='" + jQuery(this).attr("name") + "']").attr("checked", true);
140
  }else{
141
  jQuery("div.tab1 div[template-id='" + self.template_id + "'] div.window-content input[name='" + jQuery(this).attr("name") + "']").attr("checked", false);
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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
 
@@ -18,9 +18,9 @@ You can find more information on our web site (<a href="http://www.wpfastestcach
18
 
19
  This plugin creates static html files from your dynamic WordPress blog.
20
  When a page is rendered, php and mysql are used. Therefore, system needs RAM and CPU.
21
- If many visitors come to a site, system uses lots of RAM and CPU so page is rendered so slowly.
22
- In this case, you need a cache system not to render page again and again.
23
- Cache system generates a static html file and saves. Other users reach to static html page.
24
  <br><br>
25
  Setup of this plugin is so easy. You don't need to modify the .htacces file. It will be modified automatically.
26
 
@@ -103,6 +103,14 @@ Wpfc supports Wordpress Multisite [<a target="_blank" href="https://www.wpfastes
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
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.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
18
 
19
  This plugin creates static html files from your dynamic WordPress blog.
20
  When a page is rendered, php and mysql are used. Therefore, system needs RAM and CPU.
21
+ If many visitors come to a site, system uses lots of RAM and CPU so page is rendered so slowly. In this case, you need a cache system not to render page again and again. Cache system generates a static html file and saves. Other users reach to static html page.
22
+ <br><br>
23
+ In addition, the site speed is used in Google’s search ranking algorithm so cache plugins that can improve your page load time will also improve your SEO ranking.
24
  <br><br>
25
  Setup of this plugin is so easy. You don't need to modify the .htacces file. It will be modified automatically.
26
 
103
 
104
  == Changelog ==
105
 
106
+ = 0.8.9.5 =
107
+ * to check the page is 404 or not with http_response_code() if is_404() does not work
108
+ * <strong>[FEATURE]</strong> to add Custom Taxonomies on the preload feature
109
+ * <strong>[FEATURE]</strong> to show statistics of Preload
110
+ * to replace urls which have data-img-url attribute with cdn-url
111
+ * <strong>[FEATURE]</strong> to add WP-CLI command for clearing cache [<a target="_blank" href="https://www.wpfastestcache.com/features/wp-cli-commands/">Details</a>]
112
+ * refactoring of is_amp()
113
+
114
  = 0.8.9.4 =
115
  * 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>]
116
  * to fix PHP Notice: Undefined variable: preg_match_rule in preload.php on line 418
templates/lazy_load.php CHANGED
@@ -64,7 +64,7 @@
64
  </div>
65
  <script type="text/javascript">
66
  jQuery("#wpFastestCacheLazyLoad").click(function(){
67
- if(typeof jQuery(this).attr("checked") != "undefined"){
68
  if(jQuery("div[id^='wpfc-modal-lazyload-']").length === 0){
69
  Wpfc_New_Dialog.dialog("wpfc-modal-lazyload", {close: function(){
70
  Wpfc_New_Dialog.clone.find("div.window-content input").each(function(){
64
  </div>
65
  <script type="text/javascript">
66
  jQuery("#wpFastestCacheLazyLoad").click(function(){
67
+ if(jQuery(this).is(':checked')){
68
  if(jQuery("div[id^='wpfc-modal-lazyload-']").length === 0){
69
  Wpfc_New_Dialog.dialog("wpfc-modal-lazyload", {close: function(){
70
  Wpfc_New_Dialog.clone.find("div.window-content input").each(function(){
templates/newpost.php CHANGED
@@ -73,7 +73,7 @@
73
  </div>
74
  <script type="text/javascript">
75
  jQuery("#wpFastestCacheNewPost").click(function(){
76
- if(typeof jQuery(this).attr("checked") != "undefined"){
77
  if(jQuery("div[id^='wpfc-modal-newpost-']").length === 0){
78
  Wpfc_New_Dialog.dialog("wpfc-modal-newpost", {close: function(){
79
  Wpfc_New_Dialog.clone.find("div.window-content input").each(function(){
73
  </div>
74
  <script type="text/javascript">
75
  jQuery("#wpFastestCacheNewPost").click(function(){
76
+ if(jQuery(this).is(':checked')){
77
  if(jQuery("div[id^='wpfc-modal-newpost-']").length === 0){
78
  Wpfc_New_Dialog.dialog("wpfc-modal-newpost", {close: function(){
79
  Wpfc_New_Dialog.clone.find("div.window-content input").each(function(){
templates/preload.php CHANGED
@@ -9,7 +9,7 @@
9
  margin-right: 0 !important;
10
  }
11
  </style>
12
- <div template-id="wpfc-modal-preload" style="display:none;top: 10.5px; left: 226px; position: absolute; padding: 6px; height: auto; width: 300px; z-index: 10001;">
13
  <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;">
14
  </div>
15
  <div style="z-index: 600; border-radius: 3px;">
@@ -32,15 +32,15 @@
32
  <label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_homepage; ?> id="wpFastestCachePreload_homepage" name="wpFastestCachePreload_homepage"></label>
33
  <label for="wpFastestCachePreload_homepage">Homepage</label>
34
  </div>
35
- <div class="wiz-input-cont">
36
  <label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_post; ?> id="wpFastestCachePreload_post" name="wpFastestCachePreload_post"></label>
37
  <label for="wpFastestCachePreload_post">Posts</label>
38
  </div>
39
- <div class="wiz-input-cont" style="padding-right: 8px;margin-right: 10px;">
40
  <label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_category; ?> id="wpFastestCachePreload_category" name="wpFastestCachePreload_category"></label>
41
  <label for="wpFastestCachePreload_category">Categories</label>
42
  </div>
43
- <div class="wiz-input-cont">
44
  <label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_page; ?> id="wpFastestCachePreload_page" name="wpFastestCachePreload_page"></label>
45
  <label for="wpFastestCachePreload_page">Pages</label>
46
  </div>
@@ -53,12 +53,17 @@
53
  <label for="wpFastestCachePreload_attachment">Attachments</label>
54
  </div>
55
 
56
- <div class="wiz-input-cont" style="width: 91% !important;margin-bottom: 10px !important;">
57
  <label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_customposttypes; ?> id="wpFastestCachePreload_customposttypes" name="wpFastestCachePreload_customposttypes"></label>
58
  <label for="wpFastestCachePreload_customposttypes">Custom Post Types</label>
59
  </div>
60
 
61
- <div class="wiz-input-cont" style="width: 91% !important;margin-bottom: 10px !important;">
 
 
 
 
 
62
  <label class="mc-input-label" style="float:left;">
63
  <table id="wpfc-form-spinner-preload" class="wpfc-form-spinner" cellpadding="0" cellspacing="0" border="0" height="20" width="70" style="border: 1px solid rgb(204, 204, 204); border-collapse: collapse; background: rgb(255, 255, 255);">
64
  <tbody>
@@ -82,7 +87,7 @@
82
  <label style="float:left;margin-left:8px;padding-top:4px;">pages per minute</label>
83
  </div>
84
 
85
- <div class="wiz-input-cont" style="width: 91% !important;margin-bottom: 0px !important;">
86
  <label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_restart; ?> id="wpFastestCachePreload_restart" name="wpFastestCachePreload_restart"></label>
87
  <label for="wpFastestCachePreload_restart">Restart After Completed</label>
88
  <a style="margin-left:5px;" target="_blank" href="http://www.wpfastestcache.com/features/restart-preload-after-completed/"><img src="<?php echo plugins_url("wp-fastest-cache/images/info.png"); ?>"></a>
9
  margin-right: 0 !important;
10
  }
11
  </style>
12
+ <div template-id="wpfc-modal-preload" style="display:none;top: 10.5px; left: 226px; position: absolute; padding: 6px; height: auto; width: 440px; z-index: 10001;">
13
  <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;">
14
  </div>
15
  <div style="z-index: 600; border-radius: 3px;">
32
  <label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_homepage; ?> id="wpFastestCachePreload_homepage" name="wpFastestCachePreload_homepage"></label>
33
  <label for="wpFastestCachePreload_homepage">Homepage</label>
34
  </div>
35
+ <div class="wiz-input-cont" style="padding-right: 8px;margin-right: 10px;">
36
  <label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_post; ?> id="wpFastestCachePreload_post" name="wpFastestCachePreload_post"></label>
37
  <label for="wpFastestCachePreload_post">Posts</label>
38
  </div>
39
+ <div class="wiz-input-cont">
40
  <label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_category; ?> id="wpFastestCachePreload_category" name="wpFastestCachePreload_category"></label>
41
  <label for="wpFastestCachePreload_category">Categories</label>
42
  </div>
43
+ <div class="wiz-input-cont" style="padding-right: 8px;margin-right: 10px;">
44
  <label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_page; ?> id="wpFastestCachePreload_page" name="wpFastestCachePreload_page"></label>
45
  <label for="wpFastestCachePreload_page">Pages</label>
46
  </div>
53
  <label for="wpFastestCachePreload_attachment">Attachments</label>
54
  </div>
55
 
56
+ <div class="wiz-input-cont" style="width: 175px !important; margin-right: 10px; margin-bottom: 10px !important;">
57
  <label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_customposttypes; ?> id="wpFastestCachePreload_customposttypes" name="wpFastestCachePreload_customposttypes"></label>
58
  <label for="wpFastestCachePreload_customposttypes">Custom Post Types</label>
59
  </div>
60
 
61
+ <div class="wiz-input-cont" style="width: 175px !important;margin-bottom: 10px !important;">
62
+ <label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_customTaxonomies; ?> id="wpFastestCachePreload_customTaxonomies" name="wpFastestCachePreload_customTaxonomies"></label>
63
+ <label for="wpFastestCachePreload_customposttypes">Custom Taxonomies</label>
64
+ </div>
65
+
66
+ <div class="wiz-input-cont" style="width: 94% !important;margin-bottom: 10px !important;">
67
  <label class="mc-input-label" style="float:left;">
68
  <table id="wpfc-form-spinner-preload" class="wpfc-form-spinner" cellpadding="0" cellspacing="0" border="0" height="20" width="70" style="border: 1px solid rgb(204, 204, 204); border-collapse: collapse; background: rgb(255, 255, 255);">
69
  <tbody>
87
  <label style="float:left;margin-left:8px;padding-top:4px;">pages per minute</label>
88
  </div>
89
 
90
+ <div class="wiz-input-cont" style="width: 94% !important;margin-bottom: 0px !important;">
91
  <label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_restart; ?> id="wpFastestCachePreload_restart" name="wpFastestCachePreload_restart"></label>
92
  <label for="wpFastestCachePreload_restart">Restart After Completed</label>
93
  <a style="margin-left:5px;" target="_blank" href="http://www.wpfastestcache.com/features/restart-preload-after-completed/"><img src="<?php echo plugins_url("wp-fastest-cache/images/info.png"); ?>"></a>
templates/updatepost.php CHANGED
@@ -69,7 +69,7 @@
69
  </div>
70
  <script type="text/javascript">
71
  jQuery("#wpFastestCacheUpdatePost").click(function(){
72
- if(typeof jQuery(this).attr("checked") != "undefined"){
73
  if(jQuery("div[id^='wpfc-modal-updatepost-']").length === 0){
74
  Wpfc_New_Dialog.dialog("wpfc-modal-updatepost", {close: function(){
75
  Wpfc_New_Dialog.clone.find("div.window-content input").each(function(){
69
  </div>
70
  <script type="text/javascript">
71
  jQuery("#wpFastestCacheUpdatePost").click(function(){
72
+ if(jQuery(this).is(':checked')){
73
  if(jQuery("div[id^='wpfc-modal-updatepost-']").length === 0){
74
  Wpfc_New_Dialog.dialog("wpfc-modal-updatepost", {close: function(){
75
  Wpfc_New_Dialog.clone.find("div.window-content input").each(function(){
uninstall.php CHANGED
@@ -30,6 +30,7 @@
30
  delete_option("wpfc-group");
31
  delete_option("WpFc_credit");
32
  delete_option("WpFc_api_key");
 
33
 
34
  foreach ((array)_get_cron_array() as $cron_key => $cron_value) {
35
  foreach ( (array) $cron_value as $hook => $events ) {
30
  delete_option("wpfc-group");
31
  delete_option("WpFc_credit");
32
  delete_option("WpFc_api_key");
33
+ delete_transient("wpfc_premium_update_info");
34
 
35
  foreach ((array)_get_cron_array() as $cron_key => $cron_value) {
36
  foreach ( (array) $cron_value as $hook => $events ) {
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.4
7
  Author: Emre Vona
8
  Author URI: http://tr.linkedin.com/in/emrevona
9
  Text Domain: wp-fastest-cache
@@ -1769,5 +1769,10 @@ GNU General Public License for more details.
1769
 
1770
  }
1771
 
 
 
 
 
 
1772
  $GLOBALS["wp_fastest_cache"] = new WpFastestCache();
1773
  ?>
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.5
7
  Author: Emre Vona
8
  Author URI: http://tr.linkedin.com/in/emrevona
9
  Text Domain: wp-fastest-cache
1769
 
1770
  }
1771
 
1772
+ // Load WP CLI command(s) on demand.
1773
+ if ( defined( 'WP_CLI' ) && WP_CLI ) {
1774
+ require_once "inc/cli.php";
1775
+ }
1776
+
1777
  $GLOBALS["wp_fastest_cache"] = new WpFastestCache();
1778
  ?>