Version Description
- to serve sources via cdn for excluded pages if cdn is enabled
- to fix PHP Notice: Undefined offset: -1 in js-utilities.php on line 48
Download this release
Release Info
Developer | emrevona |
Plugin | WP Fastest Cache |
Version | 1.0.6 |
Comparing to | |
See all releases |
Code changes from version 1.0.5 to 1.0.6
- inc/admin.php +13 -1
- inc/cache.php +6 -1
- inc/js-utilities.php +1 -1
- js/db.js +30 -0
- readme.txt +5 -1
- uninstall.php +2 -0
- wpFastestCache.php +2 -2
inc/admin.php
CHANGED
@@ -2038,7 +2038,14 @@
|
|
2038 |
</div>
|
2039 |
|
2040 |
<div class="tab8" style="padding-left:20px;">
|
2041 |
-
<h2 style="padding-bottom:10px;"><?php _e("Database Cleanup", "wp-fastest-cache"); ?></h2>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2042 |
<div>
|
2043 |
|
2044 |
<?php if(!$this->isPluginActive("wp-fastest-cache-premium/wpFastestCachePremium.php")){ ?>
|
@@ -2048,6 +2055,11 @@
|
|
2048 |
}
|
2049 |
div.tab8 .integration-page{
|
2050 |
opacity: 0.3 !important;
|
|
|
|
|
|
|
|
|
|
|
2051 |
}
|
2052 |
</style>
|
2053 |
|
2038 |
</div>
|
2039 |
|
2040 |
<div class="tab8" style="padding-left:20px;">
|
2041 |
+
<h2 style="padding-bottom:10px;display: inline-block;float: left;width: 48%;"><?php _e("Database Cleanup", "wp-fastest-cache"); ?></h2>
|
2042 |
+
|
2043 |
+
<?php
|
2044 |
+
if(file_exists(WPFC_WP_PLUGIN_DIR."/wp-fastest-cache-premium/pro/templates/db-auto-cleanup.php")){
|
2045 |
+
include_once WPFC_WP_PLUGIN_DIR."/wp-fastest-cache-premium/pro/templates/db-auto-cleanup.php";
|
2046 |
+
}
|
2047 |
+
?>
|
2048 |
+
|
2049 |
<div>
|
2050 |
|
2051 |
<?php if(!$this->isPluginActive("wp-fastest-cache-premium/wpFastestCachePremium.php")){ ?>
|
2055 |
}
|
2056 |
div.tab8 .integration-page{
|
2057 |
opacity: 0.3 !important;
|
2058 |
+
pointer-events: none !important;
|
2059 |
+
}
|
2060 |
+
select#wpfc-auto-cleanup-option{
|
2061 |
+
opacity: 0.3 !important;
|
2062 |
+
pointer-events: none !important;
|
2063 |
}
|
2064 |
</style>
|
2065 |
|
inc/cache.php
CHANGED
@@ -355,6 +355,8 @@
|
|
355 |
}
|
356 |
|
357 |
if($this->exclude_page()){
|
|
|
|
|
358 |
//echo "<!-- Wp Fastest Cache: Exclude Page -->"."\n";
|
359 |
return 0;
|
360 |
}
|
@@ -694,7 +696,10 @@
|
|
694 |
|
695 |
|
696 |
if($this->exclude_page($buffer)){
|
697 |
-
$buffer = preg_replace('/<\!--WPFC_PAGE_TYPE_[a-z]+-->/i', '', $buffer);
|
|
|
|
|
|
|
698 |
return $buffer;
|
699 |
}
|
700 |
|
355 |
}
|
356 |
|
357 |
if($this->exclude_page()){
|
358 |
+
ob_start(array($this, "cdn_rewrite"));
|
359 |
+
|
360 |
//echo "<!-- Wp Fastest Cache: Exclude Page -->"."\n";
|
361 |
return 0;
|
362 |
}
|
696 |
|
697 |
|
698 |
if($this->exclude_page($buffer)){
|
699 |
+
$buffer = preg_replace('/<\!--WPFC_PAGE_TYPE_[a-z]+-->/i', '', $buffer);
|
700 |
+
|
701 |
+
$buffer = $this->cdn_rewrite($buffer);
|
702 |
+
|
703 |
return $buffer;
|
704 |
}
|
705 |
|
inc/js-utilities.php
CHANGED
@@ -44,7 +44,7 @@
|
|
44 |
if(!preg_match("/<script[^>]+json[^>]+>.+/", $script_tag) && !preg_match("/<script[^>]+text\/template[^>]+>.+/", $script_tag)){
|
45 |
if($href = $this->checkInternal($script_tag)){
|
46 |
if(strpos($this->jsLinksExcept, $href) === false){
|
47 |
-
if(
|
48 |
$this->mergeJs($prev_content, $this->jsLinks[$key - 1]);
|
49 |
$prev_content = "";
|
50 |
continue;
|
44 |
if(!preg_match("/<script[^>]+json[^>]+>.+/", $script_tag) && !preg_match("/<script[^>]+text\/template[^>]+>.+/", $script_tag)){
|
45 |
if($href = $this->checkInternal($script_tag)){
|
46 |
if(strpos($this->jsLinksExcept, $href) === false){
|
47 |
+
if($key > 0 && $this->check_exclude($href)){
|
48 |
$this->mergeJs($prev_content, $this->jsLinks[$key - 1]);
|
49 |
$prev_content = "";
|
50 |
continue;
|
js/db.js
CHANGED
@@ -17,6 +17,36 @@ var WpfcDB = {
|
|
17 |
});
|
18 |
|
19 |
self.click_event_for_warnings();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
},
|
21 |
click_event_for_warnings: function(){
|
22 |
var self = this;
|
17 |
});
|
18 |
|
19 |
self.click_event_for_warnings();
|
20 |
+
self.click_event_for_auto_cleanup();
|
21 |
+
},
|
22 |
+
click_event_for_auto_cleanup: function(){
|
23 |
+
jQuery("#wpfc-auto-cleanup-option").change(function(){
|
24 |
+
let status = jQuery(this).val();
|
25 |
+
let nonce = jQuery("#wpfc-auto-cleanup-nonce").val();
|
26 |
+
|
27 |
+
jQuery("#revert-loader-toolbar").show();
|
28 |
+
|
29 |
+
jQuery.ajax({
|
30 |
+
type: 'POST',
|
31 |
+
url: ajaxurl,
|
32 |
+
dataType : "json",
|
33 |
+
data : {"action": "wpfc_db_set_auto_cleanup", "status" : status, "nonce" : nonce},
|
34 |
+
cache: false,
|
35 |
+
success: function(data){
|
36 |
+
if(typeof data.status != "undefined"){
|
37 |
+
jQuery("#wpfc-auto-cleanup-option").val(data.status);
|
38 |
+
}else{
|
39 |
+
jQuery("#wpfc-auto-cleanup-option").val("off");
|
40 |
+
}
|
41 |
+
|
42 |
+
jQuery("#revert-loader-toolbar").hide();
|
43 |
+
|
44 |
+
console.log(data);
|
45 |
+
}
|
46 |
+
});
|
47 |
+
|
48 |
+
|
49 |
+
});
|
50 |
},
|
51 |
click_event_for_warnings: function(){
|
52 |
var self = this;
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://profiles.wordpress.org/emrevona/
|
|
4 |
Tags: cache, Optimize, performance, wp-cache, core web vitals
|
5 |
Requires at least: 3.3
|
6 |
Tested up to: 6.0
|
7 |
-
Stable tag: 1.0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -131,6 +131,10 @@ WP Fastest Cache is compatible with most popular plugins such as Contact Form 7,
|
|
131 |
|
132 |
== Changelog ==
|
133 |
|
|
|
|
|
|
|
|
|
134 |
= 1.0.5 =
|
135 |
* to fix E_NOTICE: Undefined variable: path in wpFastestCache.php on line 2142
|
136 |
* to add excluding feature for Buffer Callback Filter [<a target="_blank" href="https://www.wpfastestcache.com/tutorial/buffer-callback-filter/#exclude">Details</a>]
|
4 |
Tags: cache, Optimize, performance, wp-cache, core web vitals
|
5 |
Requires at least: 3.3
|
6 |
Tested up to: 6.0
|
7 |
+
Stable tag: 1.0.6
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
131 |
|
132 |
== Changelog ==
|
133 |
|
134 |
+
= 1.0.6 =
|
135 |
+
* to serve sources via cdn for excluded pages if cdn is enabled
|
136 |
+
* to fix PHP Notice: Undefined offset: -1 in js-utilities.php on line 48
|
137 |
+
|
138 |
= 1.0.5 =
|
139 |
* to fix E_NOTICE: Undefined variable: path in wpFastestCache.php on line 2142
|
140 |
* to add excluding feature for Buffer Callback Filter [<a target="_blank" href="https://www.wpfastestcache.com/tutorial/buffer-callback-filter/#exclude">Details</a>]
|
uninstall.php
CHANGED
@@ -41,6 +41,8 @@
|
|
41 |
delete_option("WpFc_api_key");
|
42 |
delete_transient("wpfc_premium_update_info");
|
43 |
|
|
|
|
|
44 |
foreach ((array)_get_cron_array() as $cron_key => $cron_value) {
|
45 |
foreach ( (array) $cron_value as $hook => $events ) {
|
46 |
if(preg_match("/^wp\_fastest\_cache/", $hook)){
|
41 |
delete_option("WpFc_api_key");
|
42 |
delete_transient("wpfc_premium_update_info");
|
43 |
|
44 |
+
wp_clear_scheduled_hook("wpfc_db_auto_cleanup");
|
45 |
+
|
46 |
foreach ((array)_get_cron_array() as $cron_key => $cron_value) {
|
47 |
foreach ( (array) $cron_value as $hook => $events ) {
|
48 |
if(preg_match("/^wp\_fastest\_cache/", $hook)){
|
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: 1.0.
|
7 |
Author: Emre Vona
|
8 |
Author URI: http://tr.linkedin.com/in/emrevona
|
9 |
Text Domain: wp-fastest-cache
|
@@ -514,7 +514,7 @@ GNU General Public License for more details.
|
|
514 |
$statics["all_warnings"] = $statics["all_warnings"] + $statics["trackback_pingback"];
|
515 |
|
516 |
$element = "SELECT COUNT(*) FROM `$wpdb->options` WHERE option_name LIKE '%\_transient\_%' ;";
|
517 |
-
$statics["transient_options"] = $wpdb->get_var( $element ) >
|
518 |
$statics["all_warnings"] = $statics["all_warnings"] + $statics["transient_options"];
|
519 |
|
520 |
die(json_encode($statics));
|
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: 1.0.6
|
7 |
Author: Emre Vona
|
8 |
Author URI: http://tr.linkedin.com/in/emrevona
|
9 |
Text Domain: wp-fastest-cache
|
514 |
$statics["all_warnings"] = $statics["all_warnings"] + $statics["trackback_pingback"];
|
515 |
|
516 |
$element = "SELECT COUNT(*) FROM `$wpdb->options` WHERE option_name LIKE '%\_transient\_%' ;";
|
517 |
+
$statics["transient_options"] = $wpdb->get_var( $element ) > 50 ? $wpdb->get_var( $element ) : 0;
|
518 |
$statics["all_warnings"] = $statics["all_warnings"] + $statics["transient_options"];
|
519 |
|
520 |
die(json_encode($statics));
|