Version Description
- to show single clear cache button for the pages
- to show warning if wp cron is disabled when a cache timeout rule is added
- to disabe lazy load for the amp pages
- to replace urls on data-cvpsrc and data-cvpset attribute with cdn-url
- to clear the cache of a post which includes /%postname%/%post_id% permalink after the post is deleted
- to fix vulnerability
- to add "event" and "artist" custom post types for preload
Download this release
Release Info
Developer | emrevona |
Plugin | WP Fastest Cache |
Version | 0.8.8.6 |
Comparing to | |
See all releases |
Code changes from version 0.8.8.5 to 0.8.8.6
- inc/admin.php +17 -6
- inc/cache.php +2 -2
- inc/cdn.php +6 -0
- inc/column.php +2 -0
- readme.txt +10 -1
- templates/disable_wp_cron.php +48 -0
- templates/timeout.php +37 -30
- wpFastestCache.php +4 -2
inc/admin.php
CHANGED
@@ -857,7 +857,7 @@
|
|
857 |
$wpFastestCachePreload_page = isset($this->options->wpFastestCachePreload_page) ? 'checked="checked"' : "";
|
858 |
$wpFastestCachePreload_tag = isset($this->options->wpFastestCachePreload_tag) ? 'checked="checked"' : "";
|
859 |
$wpFastestCachePreload_attachment = isset($this->options->wpFastestCachePreload_attachment) ? 'checked="checked"' : "";
|
860 |
-
$wpFastestCachePreload_number = isset($this->options->wpFastestCachePreload_number) ? $this->options->wpFastestCachePreload_number : 4;
|
861 |
$wpFastestCachePreload_restart = isset($this->options->wpFastestCachePreload_restart) ? 'checked="checked"' : "";
|
862 |
|
863 |
|
@@ -1391,9 +1391,20 @@
|
|
1391 |
<!-- samples end -->
|
1392 |
|
1393 |
<div style="float:left;margin-top:-37px;padding-left:628px;">
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1397 |
</div>
|
1398 |
|
1399 |
<div class="wpfc-timeout-list" style="display: block;width:98%;float:left;">
|
@@ -1427,7 +1438,7 @@
|
|
1427 |
|
1428 |
$tmp_array = array("schedule" => $event["schedule"],
|
1429 |
"prefix" => $tmp_std->prefix,
|
1430 |
-
"content" => $tmp_std->content);
|
1431 |
|
1432 |
if(isset($tmp_std->hour) && isset($tmp_std->minute)){
|
1433 |
$tmp_array["hour"] = $tmp_std->hour;
|
@@ -1614,7 +1625,7 @@
|
|
1614 |
<?php }else{ ?>
|
1615 |
<form action="https://api.wpfastestcache.net/paypal/buypremium/" method="post">
|
1616 |
<input type="hidden" name="ip" value="<?php echo $_SERVER["REMOTE_ADDR"]; ?>">
|
1617 |
-
<input type="hidden" name="wpfclang" value="<?php echo isset($this->options->wpFastestCacheLanguage) ? $this->options->wpFastestCacheLanguage : ""; ?>">
|
1618 |
<input type="hidden" name="bloglang" value="<?php echo get_bloginfo('language'); ?>">
|
1619 |
<input type="hidden" name="hostname" value="<?php echo str_replace(array("http://", "www."), "", $_SERVER["HTTP_HOST"]); ?>">
|
1620 |
<button id="wpfc-buy-premium-button" type="submit" class="wpfc-btn primaryCta" style="width:200px;">
|
857 |
$wpFastestCachePreload_page = isset($this->options->wpFastestCachePreload_page) ? 'checked="checked"' : "";
|
858 |
$wpFastestCachePreload_tag = isset($this->options->wpFastestCachePreload_tag) ? 'checked="checked"' : "";
|
859 |
$wpFastestCachePreload_attachment = isset($this->options->wpFastestCachePreload_attachment) ? 'checked="checked"' : "";
|
860 |
+
$wpFastestCachePreload_number = isset($this->options->wpFastestCachePreload_number) ? esc_attr($this->options->wpFastestCachePreload_number) : 4;
|
861 |
$wpFastestCachePreload_restart = isset($this->options->wpFastestCachePreload_restart) ? 'checked="checked"' : "";
|
862 |
|
863 |
|
1391 |
<!-- samples end -->
|
1392 |
|
1393 |
<div style="float:left;margin-top:-37px;padding-left:628px;">
|
1394 |
+
<?php
|
1395 |
+
$disable_wp_cron = '';
|
1396 |
+
if(defined("DISABLE_WP_CRON")){
|
1397 |
+
if((is_bool(DISABLE_WP_CRON) && DISABLE_WP_CRON == true) ||
|
1398 |
+
(is_string(DISABLE_WP_CRON) && preg_match("/^true$/i", DISABLE_WP_CRON))){
|
1399 |
+
$disable_wp_cron = 'disable-wp-cron="true" ';
|
1400 |
+
|
1401 |
+
include(WPFC_MAIN_PATH."templates/disable_wp_cron.php");
|
1402 |
+
}
|
1403 |
+
}
|
1404 |
+
?>
|
1405 |
+
<button type="button" <?php echo $disable_wp_cron;?> class="wpfc-add-new-timeout-button wpfc-dialog-buttons" style="display: inline-block;padding: 4px 10px;">
|
1406 |
+
<span>Add New Rule</span>
|
1407 |
+
</button>
|
1408 |
</div>
|
1409 |
|
1410 |
<div class="wpfc-timeout-list" style="display: block;width:98%;float:left;">
|
1438 |
|
1439 |
$tmp_array = array("schedule" => $event["schedule"],
|
1440 |
"prefix" => $tmp_std->prefix,
|
1441 |
+
"content" => esc_attr($tmp_std->content));
|
1442 |
|
1443 |
if(isset($tmp_std->hour) && isset($tmp_std->minute)){
|
1444 |
$tmp_array["hour"] = $tmp_std->hour;
|
1625 |
<?php }else{ ?>
|
1626 |
<form action="https://api.wpfastestcache.net/paypal/buypremium/" method="post">
|
1627 |
<input type="hidden" name="ip" value="<?php echo $_SERVER["REMOTE_ADDR"]; ?>">
|
1628 |
+
<input type="hidden" name="wpfclang" value="<?php echo isset($this->options->wpFastestCacheLanguage) ? esc_attr($this->options->wpFastestCacheLanguage) : ""; ?>">
|
1629 |
<input type="hidden" name="bloglang" value="<?php echo get_bloginfo('language'); ?>">
|
1630 |
<input type="hidden" name="hostname" value="<?php echo str_replace(array("http://", "www."), "", $_SERVER["HTTP_HOST"]); ?>">
|
1631 |
<button id="wpfc-buy-premium-button" type="submit" class="wpfc-btn primaryCta" style="width:200px;">
|
inc/cache.php
CHANGED
@@ -677,7 +677,7 @@
|
|
677 |
$execute_lazy_load = true;
|
678 |
|
679 |
// to disable Lazy Load if the page is amp
|
680 |
-
if(
|
681 |
$execute_lazy_load = false;
|
682 |
}
|
683 |
|
@@ -746,7 +746,7 @@
|
|
746 |
|
747 |
public function cdn_rewrite($content){
|
748 |
if($this->cdn){
|
749 |
-
$content = preg_replace_callback("/(srcset|src|href|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);
|
750 |
|
751 |
//url()
|
752 |
$content = preg_replace_callback("/(url)\(([^\)\>]+)\)/i", array($this, 'cdn_replace_urls'), $content);
|
677 |
$execute_lazy_load = true;
|
678 |
|
679 |
// to disable Lazy Load if the page is amp
|
680 |
+
if($this->is_amp($content)){
|
681 |
$execute_lazy_load = false;
|
682 |
}
|
683 |
|
746 |
|
747 |
public function cdn_rewrite($content){
|
748 |
if($this->cdn){
|
749 |
+
$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);
|
750 |
|
751 |
//url()
|
752 |
$content = preg_replace_callback("/(url)\(([^\)\>]+)\)/i", array($this, 'cdn_replace_urls'), $content);
|
inc/cdn.php
CHANGED
@@ -372,6 +372,12 @@
|
|
372 |
|
373 |
public static function save_cdn_integration(){
|
374 |
if(current_user_can('manage_options')){
|
|
|
|
|
|
|
|
|
|
|
|
|
375 |
if($data = get_option("WpFastestCacheCDN")){
|
376 |
$cdn_exist = false;
|
377 |
$arr = json_decode($data);
|
372 |
|
373 |
public static function save_cdn_integration(){
|
374 |
if(current_user_can('manage_options')){
|
375 |
+
if(isset($_POST) && isset($_POST["values"])){
|
376 |
+
foreach ($_POST["values"] as $val_key => &$val_value) {
|
377 |
+
$val_value = sanitize_text_field($val_value);
|
378 |
+
}
|
379 |
+
}
|
380 |
+
|
381 |
if($data = get_option("WpFastestCacheCDN")){
|
382 |
$cdn_exist = false;
|
383 |
$arr = json_decode($data);
|
inc/column.php
CHANGED
@@ -5,6 +5,8 @@
|
|
5 |
public function add(){
|
6 |
add_filter('manage_posts_columns', array($this, 'wpfc_clear_column_head'));
|
7 |
add_action('manage_posts_custom_column', array($this, 'wpfc_clear_column_content'), 10, 2);
|
|
|
|
|
8 |
add_action('admin_enqueue_scripts', array($this, 'load_js'));
|
9 |
add_action('wp_ajax_wpfc_clear_cache_column', array($this, "clear_cache_column"));
|
10 |
}
|
5 |
public function add(){
|
6 |
add_filter('manage_posts_columns', array($this, 'wpfc_clear_column_head'));
|
7 |
add_action('manage_posts_custom_column', array($this, 'wpfc_clear_column_content'), 10, 2);
|
8 |
+
add_filter('manage_pages_columns', array($this, 'wpfc_clear_column_head'));
|
9 |
+
add_action('manage_pages_custom_column', array($this, 'wpfc_clear_column_content'), 10, 2);
|
10 |
add_action('admin_enqueue_scripts', array($this, 'load_js'));
|
11 |
add_action('wp_ajax_wpfc_clear_cache_column', array($this, "clear_cache_column"));
|
12 |
}
|
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.
|
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.5 =
|
107 |
* to fix pre tag problem after minify html
|
108 |
* to add woff2 extensions for cdn
|
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.6
|
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.6 =
|
107 |
+
* to show single clear cache button for the pages
|
108 |
+
* to show warning if wp cron is disabled when a cache timeout rule is added
|
109 |
+
* to disabe lazy load for the amp pages
|
110 |
+
* to replace urls on data-cvpsrc and data-cvpset attribute with cdn-url
|
111 |
+
* to clear the cache of a post which includes /%postname%/%post_id% permalink after the post is deleted
|
112 |
+
* to fix vulnerability
|
113 |
+
* to add "event" and "artist" custom post types for preload
|
114 |
+
|
115 |
= 0.8.8.5 =
|
116 |
* to fix pre tag problem after minify html
|
117 |
* to add woff2 extensions for cdn
|
templates/disable_wp_cron.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<style type="text/css">
|
2 |
+
div[id^="wpfc-modal-disablewpcron"] .wiz-input-cont{
|
3 |
+
margin-top: 0 !important;
|
4 |
+
margin-bottom: 5px !important;
|
5 |
+
float: left !important;
|
6 |
+
width: 40% !important;
|
7 |
+
}
|
8 |
+
.wiz-input-cont label{
|
9 |
+
margin-right: 0 !important;
|
10 |
+
}
|
11 |
+
</style>
|
12 |
+
<div template-id="wpfc-modal-disablewpcron" 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;">
|
16 |
+
<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;">
|
17 |
+
<table width="100%" height="100%">
|
18 |
+
<tbody>
|
19 |
+
<tr>
|
20 |
+
<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;">Warning</td>
|
21 |
+
<td width="20" align="center" style="vertical-align: middle;"></td>
|
22 |
+
<td width="20" align="center" style="vertical-align: middle; font-family: Arial,Helvetica,sans-serif; color: rgb(170, 170, 170); cursor: default;">
|
23 |
+
<div title="Close Window" class="close-wiz"></div>
|
24 |
+
</td>
|
25 |
+
</tr>
|
26 |
+
</tbody>
|
27 |
+
</table>
|
28 |
+
</div>
|
29 |
+
<div class="window-content-wrapper" style="padding: 15px;">
|
30 |
+
<div class="window-content" style="z-index: 1000; height: auto; position: relative; display: inline-block; width: 100%;">
|
31 |
+
|
32 |
+
<div class="wpfc-cdn-pages-container">
|
33 |
+
<div class="wiz-cont" style="padding: 10px !important">
|
34 |
+
<h1>Disabled Cron</h1>
|
35 |
+
<p>The Cron has been disabled entirely by setting <b><a href="https://codex.wordpress.org/Editing_wp-config.php#Disable_Cron_and_Cron_Timeout" target="_blank">DISABLE_WP_CRON</a></b> to true.</p>
|
36 |
+
</div>
|
37 |
+
</div>
|
38 |
+
</div>
|
39 |
+
</div>
|
40 |
+
<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;">
|
41 |
+
<div style="padding: 12px; height: 23px;text-align: center;">
|
42 |
+
<button class="wpfc-dialog-buttons buttons" type="button" action="close">
|
43 |
+
<span>OK</span>
|
44 |
+
</button>
|
45 |
+
</div>
|
46 |
+
</div>
|
47 |
+
</div>
|
48 |
+
</div>
|
templates/timeout.php
CHANGED
@@ -433,43 +433,50 @@
|
|
433 |
var self = this;
|
434 |
|
435 |
jQuery(".wpfc-add-new-timeout-button").click(function(e){
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
440 |
|
441 |
-
|
442 |
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
|
456 |
-
|
457 |
-
|
458 |
|
459 |
-
|
460 |
-
|
461 |
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
|
|
|
|
|
|
|
|
467 |
}
|
468 |
-
}
|
469 |
-
|
470 |
-
function(){
|
471 |
-
}
|
472 |
-
});
|
473 |
});
|
474 |
},
|
475 |
save: function(callback){
|
433 |
var self = this;
|
434 |
|
435 |
jQuery(".wpfc-add-new-timeout-button").click(function(e){
|
436 |
+
if(jQuery(e.target).attr("disable-wp-cron")){
|
437 |
+
if(jQuery("div[id^='wpfc-modal-disablewpcron-']").length === 0){
|
438 |
+
Wpfc_New_Dialog.dialog("wpfc-modal-disablewpcron", {close: "default"});
|
439 |
+
Wpfc_New_Dialog.show_button("close");
|
440 |
+
}
|
441 |
+
}else{
|
442 |
+
var clone_modal = jQuery("#wpfc-modal-timeout").clone();
|
443 |
+
//var number = jQuery("div.wpfc-timeout-rule-line[wpfc-timeout-rule-number]").length;
|
444 |
+
var number = new Date().getTime();
|
445 |
+
var clone_modal_id = "wpfc-modal-timeout-" + new Date().getTime();
|
446 |
|
447 |
+
clone_modal.attr("id", clone_modal_id);
|
448 |
|
449 |
+
self.hide_input_content(clone_modal);
|
450 |
+
self.show_hour_and_minute(clone_modal);
|
451 |
+
|
452 |
+
jQuery("#wpfc-modal-timeout").after(clone_modal);
|
453 |
|
454 |
+
Wpfc_Dialog.dialog(clone_modal_id, {"finish" :
|
455 |
+
function(){
|
456 |
+
var prefix = clone_modal.find("select[name='wpfc-timeout-rule-prefix']").val();
|
457 |
+
var content = clone_modal.find("input[name='wpfc-timeout-rule-content']").val();
|
458 |
+
var schedule = clone_modal.find("select[name='wpfc-timeout-rule-schedule']").val();
|
459 |
+
var hour = clone_modal.find("select[name='wpfc-timeout-rule-hour']").val();
|
460 |
+
var minute = clone_modal.find("select[name='wpfc-timeout-rule-minute']").val();
|
461 |
|
462 |
+
content = self.remove_host_name(content);
|
463 |
+
content = content.replace(/^\/|\/$/g, '');
|
464 |
|
465 |
+
if(self.is_empty_values(prefix, content, schedule)){
|
466 |
+
self.add_line(number + 1, {"prefix" : prefix, "content" : content, "schedule" : schedule, "hour" : hour, "minute" : minute});
|
467 |
|
468 |
+
Wpfc_Dialog.remove(clone_modal_id);
|
469 |
+
|
470 |
+
self.save(function(){
|
471 |
+
self.add_item(number + 1, {"prefix" : prefix, "content" : content, "schedule" : schedule, "hour" : hour, "minute" : minute});
|
472 |
+
});
|
473 |
+
}
|
474 |
+
},
|
475 |
+
"close" :
|
476 |
+
function(){
|
477 |
}
|
478 |
+
});
|
479 |
+
}
|
|
|
|
|
|
|
480 |
});
|
481 |
},
|
482 |
save: function(callback){
|
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.
|
7 |
Author: Emre Vona
|
8 |
Author URI: http://tr.linkedin.com/in/emrevona
|
9 |
Text Domain: wp-fastest-cache
|
@@ -841,6 +841,8 @@ GNU General Public License for more details.
|
|
841 |
//for trash contents
|
842 |
$permalink = rtrim($permalink, "/");
|
843 |
$permalink = preg_replace("/__trashed$/", "", $permalink);
|
|
|
|
|
844 |
|
845 |
if(preg_match("/https?:\/\/[^\/]+\/(.+)/", $permalink, $out)){
|
846 |
|
@@ -1184,7 +1186,7 @@ GNU General Public License for more details.
|
|
1184 |
// 'suppress_filters' => true
|
1185 |
// ), ARRAY_A);
|
1186 |
global $wpdb;
|
1187 |
-
$recent_posts = $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);
|
1188 |
|
1189 |
|
1190 |
if(count($recent_posts) > 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.6
|
7 |
Author: Emre Vona
|
8 |
Author URI: http://tr.linkedin.com/in/emrevona
|
9 |
Text Domain: wp-fastest-cache
|
841 |
//for trash contents
|
842 |
$permalink = rtrim($permalink, "/");
|
843 |
$permalink = preg_replace("/__trashed$/", "", $permalink);
|
844 |
+
//for /%postname%/%post_id% : sample-url__trashed/57595
|
845 |
+
$permalink = preg_replace("/__trashed\/(\d+)$/", "/$1", $permalink);
|
846 |
|
847 |
if(preg_match("/https?:\/\/[^\/]+\/(.+)/", $permalink, $out)){
|
848 |
|
1186 |
// 'suppress_filters' => true
|
1187 |
// ), ARRAY_A);
|
1188 |
global $wpdb;
|
1189 |
+
$recent_posts = $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' OR ".$wpdb->prefix."posts.post_type = 'ajde_events' OR ".$wpdb->prefix."posts.post_type = 'artists') AND ((".$wpdb->prefix."posts.post_status = 'publish')) ORDER BY ".$wpdb->prefix."posts.ID DESC LIMIT ".$pre_load->post.", ".$number, ARRAY_A);
|
1190 |
|
1191 |
|
1192 |
if(count($recent_posts) > 0){
|