Version Description
- to remove "via php" text if WPFC_REMOVE_VIA_FOOTER_COMMENT is defined as true
- [FEATURE] Restart Preload [Details]
- to fix the problem of selecting chinese language automatically
- to fix php notice trying to get property of non-object in delete_cache_of_term()
- to speed up getting db optimization statistics()
- to show the cache of main content without query string if google analytics parameters are set [Details]
Download this release
Release Info
Developer | emrevona |
Plugin | WP Fastest Cache |
Version | 0.8.7.7 |
Comparing to | |
See all releases |
Code changes from version 0.8.7.6 to 0.8.7.7
- inc/admin.php +28 -4
- inc/cache.php +56 -5
- js/dialog_new.js +34 -1
- js/language.js +0 -5
- readme.txt +10 -2
- templates/exclude.php +1 -1
- templates/preload.php +9 -1
- wpFastestCache.php +42 -26
inc/admin.php
CHANGED
@@ -616,6 +616,7 @@
|
|
616 |
$this->excludeAdminCookie()."\n".
|
617 |
$this->http_condition_rule()."\n".
|
618 |
"RewriteCond %{HTTP_USER_AGENT} !(".$this->get_excluded_useragent().")"."\n".
|
|
|
619 |
"RewriteCond %{REQUEST_METHOD} !POST"."\n".
|
620 |
$ifIsNotSecure."\n".
|
621 |
"RewriteCond %{REQUEST_URI} !(\/){2}$"."\n".
|
@@ -804,7 +805,7 @@
|
|
804 |
|
805 |
|
806 |
$wpFastestCacheLazyLoad = isset($this->options->wpFastestCacheLazyLoad) ? 'checked="checked"' : "";
|
807 |
-
|
808 |
|
809 |
|
810 |
|
@@ -837,6 +838,9 @@
|
|
837 |
$wpFastestCachePreload_tag = isset($this->options->wpFastestCachePreload_tag) ? 'checked="checked"' : "";
|
838 |
$wpFastestCachePreload_attachment = isset($this->options->wpFastestCachePreload_attachment) ? 'checked="checked"' : "";
|
839 |
$wpFastestCachePreload_number = isset($this->options->wpFastestCachePreload_number) ? $this->options->wpFastestCachePreload_number : 4;
|
|
|
|
|
|
|
840 |
|
841 |
|
842 |
$wpFastestCacheStatus = isset($this->options->wpFastestCacheStatus) ? 'checked="checked"' : "";
|
@@ -1206,6 +1210,8 @@
|
|
1206 |
// "pt-PT",
|
1207 |
// "pt-BR",
|
1208 |
"tr-TR",
|
|
|
|
|
1209 |
"rynofitness.com.au",
|
1210 |
"margotickets.com",
|
1211 |
"berkatan.com",
|
@@ -1222,7 +1228,13 @@
|
|
1222 |
"spycoupon.in",
|
1223 |
"groovypost.com",
|
1224 |
"parkviewhomes.info",
|
1225 |
-
"myparkviewhomes.com"
|
|
|
|
|
|
|
|
|
|
|
|
|
1226 |
);
|
1227 |
|
1228 |
if(in_array(get_bloginfo('language'), $tester_arr) || in_array(str_replace("www.", "", $_SERVER["HTTP_HOST"]), $tester_arr)){ ?>
|
@@ -1231,9 +1243,19 @@
|
|
1231 |
<?php if(method_exists("WpFastestCachePowerfulHtml", "lazy_load")){ ?>
|
1232 |
<div class="questionCon">
|
1233 |
<div class="question">Lazy Load</div>
|
1234 |
-
<div class="inputCon"
|
|
|
|
|
|
|
1235 |
<div class="get-info"><a target="_blank" href="http://www.wpfastestcache.com/premium/lazy-load-reduce-http-request-and-page-load-time/"><img src="<?php echo plugins_url("wp-fastest-cache/images/info.png"); ?>" /></a></div>
|
1236 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1237 |
<?php }else{ ?>
|
1238 |
<div class="questionCon update-needed">
|
1239 |
<div class="question">Lazy Load</div>
|
@@ -1623,7 +1645,7 @@
|
|
1623 |
<?php }else{ ?>
|
1624 |
<form action="https://api.wpfastestcache.net/paypal/buypremium/" method="post">
|
1625 |
<input type="hidden" name="ip" value="<?php echo $_SERVER["REMOTE_ADDR"]; ?>">
|
1626 |
-
<input type="hidden" name="wpfclang" value="<?php echo $this->options->wpFastestCacheLanguage; ?>">
|
1627 |
<input type="hidden" name="bloglang" value="<?php echo get_bloginfo('language'); ?>">
|
1628 |
<input type="hidden" name="hostname" value="<?php echo str_replace(array("http://", "www."), "", $_SERVER["HTTP_HOST"]); ?>">
|
1629 |
<button id="wpfc-buy-premium-button" type="submit" class="wpfc-btn primaryCta" style="width:200px;">
|
@@ -2230,6 +2252,8 @@
|
|
2230 |
jQuery(document).ready(function() {
|
2231 |
Wpfclang.init("<?php echo $wpFastestCacheLanguage; ?>");
|
2232 |
});
|
|
|
|
|
2233 |
</script>
|
2234 |
<?php
|
2235 |
if(isset($_SERVER["SERVER_SOFTWARE"]) && $_SERVER["SERVER_SOFTWARE"] && !preg_match("/iis/i", $_SERVER["SERVER_SOFTWARE"]) && !preg_match("/nginx/i", $_SERVER["SERVER_SOFTWARE"])){
|
616 |
$this->excludeAdminCookie()."\n".
|
617 |
$this->http_condition_rule()."\n".
|
618 |
"RewriteCond %{HTTP_USER_AGENT} !(".$this->get_excluded_useragent().")"."\n".
|
619 |
+
"RewriteCond %{HTTP_USER_AGENT} !(WP\sFastest\sCache\sPreload(\siPhone\sMobile)?\s*Bot)"."\n".
|
620 |
"RewriteCond %{REQUEST_METHOD} !POST"."\n".
|
621 |
$ifIsNotSecure."\n".
|
622 |
"RewriteCond %{REQUEST_URI} !(\/){2}$"."\n".
|
805 |
|
806 |
|
807 |
$wpFastestCacheLazyLoad = isset($this->options->wpFastestCacheLazyLoad) ? 'checked="checked"' : "";
|
808 |
+
$wpFastestCacheLazyLoad_keywords = isset($this->options->wpFastestCacheLazyLoad_keywords) ? $this->options->wpFastestCacheLazyLoad_keywords : "";
|
809 |
|
810 |
|
811 |
|
838 |
$wpFastestCachePreload_tag = isset($this->options->wpFastestCachePreload_tag) ? 'checked="checked"' : "";
|
839 |
$wpFastestCachePreload_attachment = isset($this->options->wpFastestCachePreload_attachment) ? 'checked="checked"' : "";
|
840 |
$wpFastestCachePreload_number = isset($this->options->wpFastestCachePreload_number) ? $this->options->wpFastestCachePreload_number : 4;
|
841 |
+
$wpFastestCachePreload_restart = isset($this->options->wpFastestCachePreload_restart) ? 'checked="checked"' : "";
|
842 |
+
|
843 |
+
|
844 |
|
845 |
|
846 |
$wpFastestCacheStatus = isset($this->options->wpFastestCacheStatus) ? 'checked="checked"' : "";
|
1210 |
// "pt-PT",
|
1211 |
// "pt-BR",
|
1212 |
"tr-TR",
|
1213 |
+
"addkenmerken.net",
|
1214 |
+
"animefantastica.com",
|
1215 |
"rynofitness.com.au",
|
1216 |
"margotickets.com",
|
1217 |
"berkatan.com",
|
1228 |
"spycoupon.in",
|
1229 |
"groovypost.com",
|
1230 |
"parkviewhomes.info",
|
1231 |
+
"myparkviewhomes.com",
|
1232 |
+
"kompressorcheck.de",
|
1233 |
+
"sackkarre-tests.de",
|
1234 |
+
"schraubstock-test.de",
|
1235 |
+
"knarrenkasten-tests.de",
|
1236 |
+
"zahlungserinnerung-vorlage.de",
|
1237 |
+
"eigenbeleg-vorlage.de"
|
1238 |
);
|
1239 |
|
1240 |
if(in_array(get_bloginfo('language'), $tester_arr) || in_array(str_replace("www.", "", $_SERVER["HTTP_HOST"]), $tester_arr)){ ?>
|
1243 |
<?php if(method_exists("WpFastestCachePowerfulHtml", "lazy_load")){ ?>
|
1244 |
<div class="questionCon">
|
1245 |
<div class="question">Lazy Load</div>
|
1246 |
+
<div class="inputCon">
|
1247 |
+
<input type="hidden" value="<?php echo $wpFastestCacheLazyLoad_keywords; ?>" id="wpFastestCacheLazyLoad_keywords" name="wpFastestCacheLazyLoad_keywords">
|
1248 |
+
<input type="checkbox" <?php echo $wpFastestCacheLazyLoad; ?> id="wpFastestCacheLazyLoad" name="wpFastestCacheLazyLoad"><label for="wpFastestCacheLazyLoad">Load images and iframes when they enter the browsers viewport</label>
|
1249 |
+
</div>
|
1250 |
<div class="get-info"><a target="_blank" href="http://www.wpfastestcache.com/premium/lazy-load-reduce-http-request-and-page-load-time/"><img src="<?php echo plugins_url("wp-fastest-cache/images/info.png"); ?>" /></a></div>
|
1251 |
</div>
|
1252 |
+
|
1253 |
+
<?php
|
1254 |
+
if(file_exists(WPFC_WP_PLUGIN_DIR."/wp-fastest-cache-premium/pro/templates/lazy-load.php")){
|
1255 |
+
include_once WPFC_WP_PLUGIN_DIR."/wp-fastest-cache-premium/pro/templates/lazy-load.php";
|
1256 |
+
}
|
1257 |
+
?>
|
1258 |
+
|
1259 |
<?php }else{ ?>
|
1260 |
<div class="questionCon update-needed">
|
1261 |
<div class="question">Lazy Load</div>
|
1645 |
<?php }else{ ?>
|
1646 |
<form action="https://api.wpfastestcache.net/paypal/buypremium/" method="post">
|
1647 |
<input type="hidden" name="ip" value="<?php echo $_SERVER["REMOTE_ADDR"]; ?>">
|
1648 |
+
<input type="hidden" name="wpfclang" value="<?php echo isset($this->options->wpFastestCacheLanguage) ? $this->options->wpFastestCacheLanguage : ""; ?>">
|
1649 |
<input type="hidden" name="bloglang" value="<?php echo get_bloginfo('language'); ?>">
|
1650 |
<input type="hidden" name="hostname" value="<?php echo str_replace(array("http://", "www."), "", $_SERVER["HTTP_HOST"]); ?>">
|
1651 |
<button id="wpfc-buy-premium-button" type="submit" class="wpfc-btn primaryCta" style="width:200px;">
|
2252 |
jQuery(document).ready(function() {
|
2253 |
Wpfclang.init("<?php echo $wpFastestCacheLanguage; ?>");
|
2254 |
});
|
2255 |
+
|
2256 |
+
document.getElementById("wpFastestCacheLanguage").value = "<?php echo $wpFastestCacheLanguage; ?>";
|
2257 |
</script>
|
2258 |
<?php
|
2259 |
if(isset($_SERVER["SERVER_SOFTWARE"]) && $_SERVER["SERVER_SOFTWARE"] && !preg_match("/iis/i", $_SERVER["SERVER_SOFTWARE"]) && !preg_match("/nginx/i", $_SERVER["SERVER_SOFTWARE"])){
|
inc/cache.php
CHANGED
@@ -7,11 +7,19 @@
|
|
7 |
private $err = "";
|
8 |
public $cacheFilePath = "";
|
9 |
public $exclude_rules = false;
|
|
|
10 |
|
11 |
public function __construct(){
|
12 |
//to fix: PHP Notice: Undefined index: HTTP_USER_AGENT
|
13 |
$_SERVER['HTTP_USER_AGENT'] = isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT'] ? strip_tags($_SERVER['HTTP_USER_AGENT']) : "Empty User Agent";
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
$this->options = $this->getOptions();
|
16 |
|
17 |
$this->set_cdn();
|
@@ -123,7 +131,9 @@
|
|
123 |
if($this->is_trailing_slash()){
|
124 |
if(!preg_match("/\/$/", $_SERVER["REQUEST_URI"])){
|
125 |
if(defined('WPFC_CACHE_QUERYSTRING') && WPFC_CACHE_QUERYSTRING){
|
126 |
-
|
|
|
|
|
127 |
}else{
|
128 |
$this->cacheFilePath = false;
|
129 |
}
|
@@ -133,6 +143,8 @@
|
|
133 |
}
|
134 |
}
|
135 |
}
|
|
|
|
|
136 |
|
137 |
// to decode path if it is not utf-8
|
138 |
if($this->cacheFilePath){
|
@@ -140,6 +152,19 @@
|
|
140 |
}
|
141 |
}
|
142 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
public function set_cdn(){
|
144 |
$cdn_values = get_option("WpFastestCacheCDN");
|
145 |
if($cdn_values){
|
@@ -303,10 +328,11 @@
|
|
303 |
return 0;
|
304 |
}
|
305 |
|
|
|
306 |
//to show cache version via php if htaccess rewrite rule does not work
|
307 |
-
if($this->cacheFilePath && @file_exists($this->cacheFilePath."index.html")){
|
308 |
if($content = @file_get_contents($this->cacheFilePath."index.html")){
|
309 |
-
if(defined('
|
310 |
die($content);
|
311 |
}else{
|
312 |
$content = $content."<!-- via php -->";
|
@@ -673,11 +699,28 @@
|
|
673 |
$this->createFolder($this->cacheFilePath, $content);
|
674 |
}
|
675 |
|
|
|
|
|
676 |
return $content."<!-- need to refresh to see cached version -->";
|
677 |
}
|
678 |
}
|
679 |
}
|
680 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
681 |
public function cdn_rewrite($content){
|
682 |
if($this->cdn){
|
683 |
$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);
|
@@ -754,6 +797,7 @@
|
|
754 |
|
755 |
public function createFolder($cachFilePath, $buffer, $extension = "html", $prefix = "", $gzip = false){
|
756 |
$create = false;
|
|
|
757 |
|
758 |
if($buffer && strlen($buffer) > 100 && $extension == "html"){
|
759 |
if(!preg_match("/^\<\!\-\-\sMobile\:\sWP\sFastest\sCache/i", $buffer)){
|
@@ -761,6 +805,13 @@
|
|
761 |
$create = true;
|
762 |
}
|
763 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
764 |
}
|
765 |
|
766 |
if(($extension == "css" || $extension == "js") && $buffer && strlen($buffer) > 5){
|
@@ -782,7 +833,7 @@
|
|
782 |
file_put_contents($cachFilePath."/".$prefix."index.".$extension, $buffer);
|
783 |
|
784 |
if(class_exists("WpFastestCacheStatics")){
|
785 |
-
if(!preg_match("/After\sCache\sTimeout/i", $_SERVER['HTTP_USER_AGENT'])){
|
786 |
if(preg_match("/wpfc\-mobile\-cache/", $cachFilePath)){
|
787 |
$extension = "mobile";
|
788 |
}
|
@@ -815,7 +866,7 @@
|
|
815 |
file_put_contents($cachFilePath."/".$prefix."index.".$extension, $buffer);
|
816 |
|
817 |
if(class_exists("WpFastestCacheStatics")){
|
818 |
-
if(!preg_match("/After\sCache\sTimeout/i", $_SERVER['HTTP_USER_AGENT'])){
|
819 |
if(preg_match("/wpfc\-mobile\-cache/", $cachFilePath)){
|
820 |
$extension = "mobile";
|
821 |
}
|
7 |
private $err = "";
|
8 |
public $cacheFilePath = "";
|
9 |
public $exclude_rules = false;
|
10 |
+
public $preload_user_agent = false;
|
11 |
|
12 |
public function __construct(){
|
13 |
//to fix: PHP Notice: Undefined index: HTTP_USER_AGENT
|
14 |
$_SERVER['HTTP_USER_AGENT'] = isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT'] ? strip_tags($_SERVER['HTTP_USER_AGENT']) : "Empty User Agent";
|
15 |
|
16 |
+
if(preg_match("/(WP\sFastest\sCache\sPreload(\siPhone\sMobile)?\s*Bot)/", $_SERVER['HTTP_USER_AGENT'])){
|
17 |
+
$this->preload_user_agent = true;
|
18 |
+
}else{
|
19 |
+
$this->preload_user_agent = false;
|
20 |
+
}
|
21 |
+
|
22 |
+
|
23 |
$this->options = $this->getOptions();
|
24 |
|
25 |
$this->set_cdn();
|
131 |
if($this->is_trailing_slash()){
|
132 |
if(!preg_match("/\/$/", $_SERVER["REQUEST_URI"])){
|
133 |
if(defined('WPFC_CACHE_QUERYSTRING') && WPFC_CACHE_QUERYSTRING){
|
134 |
+
|
135 |
+
}else if(preg_match("/utm_(source|medium|campaign|content|term)/i", $this->cacheFilePath)){
|
136 |
+
|
137 |
}else{
|
138 |
$this->cacheFilePath = false;
|
139 |
}
|
143 |
}
|
144 |
}
|
145 |
}
|
146 |
+
|
147 |
+
$this->remove_google_analytics_paramters();
|
148 |
|
149 |
// to decode path if it is not utf-8
|
150 |
if($this->cacheFilePath){
|
152 |
}
|
153 |
}
|
154 |
|
155 |
+
public function remove_google_analytics_paramters(){
|
156 |
+
//to remove query strings for cache if google analytics parameters are set
|
157 |
+
if(preg_match("/utm_(source|medium|campaign|content|term)/i", $this->cacheFilePath)){
|
158 |
+
if(strlen($_SERVER["REQUEST_URI"]) > 1){ // for the sub-pages
|
159 |
+
|
160 |
+
$this->cacheFilePath = preg_replace("/\/*\?.+/", "", $this->cacheFilePath);
|
161 |
+
$this->cacheFilePath = $this->cacheFilePath."/";
|
162 |
+
|
163 |
+
define('WPFC_CACHE_QUERYSTRING', true);
|
164 |
+
}
|
165 |
+
}
|
166 |
+
}
|
167 |
+
|
168 |
public function set_cdn(){
|
169 |
$cdn_values = get_option("WpFastestCacheCDN");
|
170 |
if($cdn_values){
|
328 |
return 0;
|
329 |
}
|
330 |
|
331 |
+
|
332 |
//to show cache version via php if htaccess rewrite rule does not work
|
333 |
+
if(!$this->preload_user_agent && $this->cacheFilePath && @file_exists($this->cacheFilePath."index.html")){
|
334 |
if($content = @file_get_contents($this->cacheFilePath."index.html")){
|
335 |
+
if(defined('WPFC_REMOVE_VIA_FOOTER_COMMENT') && WPFC_REMOVE_VIA_FOOTER_COMMENT){
|
336 |
die($content);
|
337 |
}else{
|
338 |
$content = $content."<!-- via php -->";
|
699 |
$this->createFolder($this->cacheFilePath, $content);
|
700 |
}
|
701 |
|
702 |
+
$content = $this->fix_pre_tag($content, $buffer);
|
703 |
+
|
704 |
return $content."<!-- need to refresh to see cached version -->";
|
705 |
}
|
706 |
}
|
707 |
}
|
708 |
|
709 |
+
public function fix_pre_tag($content, $buffer){
|
710 |
+
if(preg_match("/<pre[^\>]*>/i", $buffer)){
|
711 |
+
preg_match_all("/<pre[^\>]*>((?!<\/pre>).)+<\/pre>/is", $buffer, $pre_buffer);
|
712 |
+
preg_match_all("/<pre[^\>]*>((?!<\/pre>).)+<\/pre>/is", $content, $pre_content);
|
713 |
+
|
714 |
+
if(isset($pre_content[0]) && isset($pre_content[0][0])){
|
715 |
+
foreach ($pre_content[0] as $key => $value){
|
716 |
+
$content = preg_replace("/".preg_quote($value, "/")."/", $pre_buffer[0][$key], $content);
|
717 |
+
}
|
718 |
+
}
|
719 |
+
}
|
720 |
+
|
721 |
+
return $content;
|
722 |
+
}
|
723 |
+
|
724 |
public function cdn_rewrite($content){
|
725 |
if($this->cdn){
|
726 |
$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);
|
797 |
|
798 |
public function createFolder($cachFilePath, $buffer, $extension = "html", $prefix = "", $gzip = false){
|
799 |
$create = false;
|
800 |
+
$update_db_statistic = true;
|
801 |
|
802 |
if($buffer && strlen($buffer) > 100 && $extension == "html"){
|
803 |
if(!preg_match("/^\<\!\-\-\sMobile\:\sWP\sFastest\sCache/i", $buffer)){
|
805 |
$create = true;
|
806 |
}
|
807 |
}
|
808 |
+
|
809 |
+
if($this->preload_user_agent){
|
810 |
+
if(file_exists($cachFilePath."/".$prefix."index.".$extension)){
|
811 |
+
$update_db_statistic = false;
|
812 |
+
@unlink($cachFilePath."/".$prefix."index.".$extension);
|
813 |
+
}
|
814 |
+
}
|
815 |
}
|
816 |
|
817 |
if(($extension == "css" || $extension == "js") && $buffer && strlen($buffer) > 5){
|
833 |
file_put_contents($cachFilePath."/".$prefix."index.".$extension, $buffer);
|
834 |
|
835 |
if(class_exists("WpFastestCacheStatics")){
|
836 |
+
if($update_db_statistic && !preg_match("/After\sCache\sTimeout/i", $_SERVER['HTTP_USER_AGENT'])){
|
837 |
if(preg_match("/wpfc\-mobile\-cache/", $cachFilePath)){
|
838 |
$extension = "mobile";
|
839 |
}
|
866 |
file_put_contents($cachFilePath."/".$prefix."index.".$extension, $buffer);
|
867 |
|
868 |
if(class_exists("WpFastestCacheStatics")){
|
869 |
+
if($update_db_statistic && !preg_match("/After\sCache\sTimeout/i", $_SERVER['HTTP_USER_AGENT'])){
|
870 |
if(preg_match("/wpfc\-mobile\-cache/", $cachFilePath)){
|
871 |
$extension = "mobile";
|
872 |
}
|
js/dialog_new.js
CHANGED
@@ -37,6 +37,9 @@ var Wpfc_New_Dialog = {
|
|
37 |
callback(self);
|
38 |
}
|
39 |
}
|
|
|
|
|
|
|
40 |
},
|
41 |
remove: function(button){
|
42 |
jQuery(button).closest("div[id^='wpfc-modal-']").remove();
|
@@ -138,5 +141,35 @@ var Wpfc_New_Dialog = {
|
|
138 |
}
|
139 |
}
|
140 |
});
|
141 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
};
|
37 |
callback(self);
|
38 |
}
|
39 |
}
|
40 |
+
|
41 |
+
self.click_event_add_new_keyword_button();
|
42 |
+
self.add_new_keyword_keypress();
|
43 |
},
|
44 |
remove: function(button){
|
45 |
jQuery(button).closest("div[id^='wpfc-modal-']").remove();
|
141 |
}
|
142 |
}
|
143 |
});
|
144 |
+
},
|
145 |
+
add_new_keyword_keypress: function(){
|
146 |
+
Wpfc_New_Dialog.clone.find(".wpfc-textbox-con .fixed-search input").keypress(function(e){
|
147 |
+
if(e.keyCode == 13){
|
148 |
+
var keyword = jQuery(e.target).val().replace(/(\s|\,)/g, "");
|
149 |
+
|
150 |
+
Wpfc_New_Dialog.clone.find(".wpfc-textbox-con").hide();
|
151 |
+
jQuery(e.target).val("");
|
152 |
+
jQuery('<li class="keyword-item"><a class="keyword-label">' + keyword + '</a></li>').insertBefore(Wpfc_New_Dialog.clone.find(".wpfc-add-new-keyword").closest(".keyword-item")).click(function(){
|
153 |
+
jQuery(this).remove();
|
154 |
+
});
|
155 |
+
}
|
156 |
+
});
|
157 |
+
},
|
158 |
+
click_event_add_new_keyword_button: function(){
|
159 |
+
Wpfc_New_Dialog.clone.find(".wpfc-add-new-keyword").click(function(){
|
160 |
+
Wpfc_New_Dialog.clone.find(".wpfc-textbox-con").show();
|
161 |
+
Wpfc_New_Dialog.clone.find(".wpfc-textbox-con .fixed-search input").focus();
|
162 |
+
});
|
163 |
+
},
|
164 |
+
insert_keywords: function(id, keywords){
|
165 |
+
if(keywords){
|
166 |
+
jQuery.each(keywords.split(","), function( index, value ) {
|
167 |
+
jQuery('<li class="keyword-item"><a class="keyword-label">' + value + '</a></li>').insertBefore(jQuery("div[id^='" + id + "']").find(".wpfc-add-new-keyword").closest(".keyword-item")).click(function(){
|
168 |
+
jQuery(this).remove();
|
169 |
+
});
|
170 |
+
});
|
171 |
+
}
|
172 |
+
|
173 |
+
|
174 |
+
},
|
175 |
};
|
js/language.js
CHANGED
@@ -23,11 +23,6 @@ var Wpfclang = {
|
|
23 |
init: function(language){
|
24 |
this.language = language;
|
25 |
this.translate();
|
26 |
-
this.setLanguageInputField();
|
27 |
-
},
|
28 |
-
setLanguageInputField: function(){
|
29 |
-
var self = this;
|
30 |
-
jQuery("#wpFastestCacheLanguage").val(self.language);
|
31 |
},
|
32 |
translate: function(){
|
33 |
if(typeof window.wpfc != "undefined" && typeof window.wpfc.dictionary != "undefined"){
|
23 |
init: function(language){
|
24 |
this.language = language;
|
25 |
this.translate();
|
|
|
|
|
|
|
|
|
|
|
26 |
},
|
27 |
translate: function(){
|
28 |
if(typeof window.wpfc != "undefined" && typeof window.wpfc.dictionary != "undefined"){
|
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.7.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -102,8 +102,16 @@ Wpfc does not support Wordpress Multisite yet.
|
|
102 |
|
103 |
== Changelog ==
|
104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
= 0.8.7.6 =
|
106 |
-
* to remove "via php" text if WPFC_REMOVE_FOOTER_COMMENT is defined as true
|
107 |
* to fix the problem which show the same cache for every language on Polylang
|
108 |
* <strong>[FEATURE]</strong> to remove wordpress emojis [<a target="_blank" href="http://www.wpfastestcache.com/optimization/disableremove-wordpress-emojis/">Details</a>]
|
109 |
|
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.7.7
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
102 |
|
103 |
== Changelog ==
|
104 |
|
105 |
+
= 0.8.7.7 =
|
106 |
+
* to remove "via php" text if WPFC_REMOVE_VIA_FOOTER_COMMENT is defined as true
|
107 |
+
* <strong>[FEATURE]</strong> Restart Preload [<a target="_blank" href="http://www.wpfastestcache.com/features/restart-preload-after-completed/">Details</a>]
|
108 |
+
* to fix the problem of selecting chinese language automatically
|
109 |
+
* to fix php notice trying to get property of non-object in delete_cache_of_term()
|
110 |
+
* to speed up getting db optimization statistics()
|
111 |
+
* to show the cache of main content without query string if google analytics parameters are set [<a target="_blank" href="http://www.wpfastestcache.com/features/cache-url-with-google-analytics-parameters-querystring/">Details</a>]
|
112 |
+
|
113 |
+
|
114 |
= 0.8.7.6 =
|
|
|
115 |
* to fix the problem which show the same cache for every language on Polylang
|
116 |
* <strong>[FEATURE]</strong> to remove wordpress emojis [<a target="_blank" href="http://www.wpfastestcache.com/optimization/disableremove-wordpress-emojis/">Details</a>]
|
117 |
|
templates/exclude.php
CHANGED
@@ -309,7 +309,7 @@
|
|
309 |
return "All" + " " + b_start + this.create_title(prefix).toLowerCase() + b_end + " " + "have been excluded";
|
310 |
}
|
311 |
}else{
|
312 |
-
return "<?php echo
|
313 |
}
|
314 |
}else if(type == "useragent"){
|
315 |
return "User-Agent: " + request_uri;
|
309 |
return "All" + " " + b_start + this.create_title(prefix).toLowerCase() + b_end + " " + "have been excluded";
|
310 |
}
|
311 |
}else{
|
312 |
+
return "<?php echo preg_replace("/(https?\:\/\/[^\/]+).*/", "$1", site_url());?>" + "/" + request_uri;
|
313 |
}
|
314 |
}else if(type == "useragent"){
|
315 |
return "User-Agent: " + request_uri;
|
templates/preload.php
CHANGED
@@ -53,7 +53,7 @@
|
|
53 |
<label for="wpFastestCachePreload_attachment">Attachments</label>
|
54 |
</div>
|
55 |
|
56 |
-
<div class="wiz-input-cont" style="width: 91% !important;margin-bottom:
|
57 |
<label class="mc-input-label" style="float:left;">
|
58 |
<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);">
|
59 |
<tbody>
|
@@ -76,6 +76,14 @@
|
|
76 |
</label>
|
77 |
<label style="float:left;margin-left:8px;padding-top:4px;">pages per minute</label>
|
78 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
</div>
|
80 |
</div>
|
81 |
<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;">
|
53 |
<label for="wpFastestCachePreload_attachment">Attachments</label>
|
54 |
</div>
|
55 |
|
56 |
+
<div class="wiz-input-cont" style="width: 91% !important;margin-bottom: 5px !important;">
|
57 |
<label class="mc-input-label" style="float:left;">
|
58 |
<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);">
|
59 |
<tbody>
|
76 |
</label>
|
77 |
<label style="float:left;margin-left:8px;padding-top:4px;">pages per minute</label>
|
78 |
</div>
|
79 |
+
|
80 |
+
<div class="wiz-input-cont" style="width: 91% !important;margin-bottom: 0px !important;">
|
81 |
+
<label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_restart; ?> id="wpFastestCachePreload_restart" name="wpFastestCachePreload_restart"></label>
|
82 |
+
<label for="wpFastestCachePreload_restart">Restart After Completed</label>
|
83 |
+
<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>
|
84 |
+
</div>
|
85 |
+
|
86 |
+
|
87 |
</div>
|
88 |
</div>
|
89 |
<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;">
|
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.7.
|
7 |
Author: Emre Vona
|
8 |
Author URI: http://tr.linkedin.com/in/emrevona
|
9 |
Text Domain: wp-fastest-cache
|
@@ -272,13 +272,15 @@ GNU General Public License for more details.
|
|
272 |
}
|
273 |
|
274 |
public function clear_cache_after_woocommerce_checkout_order_processed($order_id = false){
|
275 |
-
if(
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
$
|
|
|
|
|
282 |
}
|
283 |
}
|
284 |
}
|
@@ -312,24 +314,20 @@ GNU General Public License for more details.
|
|
312 |
);
|
313 |
|
314 |
|
315 |
-
$
|
316 |
-
$statics["
|
317 |
-
$statics["all_warnings"] = $statics["all_warnings"] + $wpdb->query( $element );
|
318 |
|
319 |
-
$
|
320 |
-
$statics["
|
321 |
-
$statics["all_warnings"] = $statics["all_warnings"] + $wpdb->query( $element );
|
322 |
|
323 |
-
$
|
324 |
-
$statics["
|
325 |
-
$statics["all_warnings"] = $statics["all_warnings"] + $wpdb->query( $element );
|
326 |
|
327 |
-
$
|
328 |
-
$statics["
|
329 |
-
$statics["all_warnings"] = $statics["all_warnings"] + $wpdb->query( $element );
|
330 |
|
331 |
-
$element = "SELECT * FROM `$wpdb->options` WHERE option_name LIKE '%\_transient\_%' ;";
|
332 |
-
$statics["transient_options"] = $wpdb->
|
333 |
$statics["all_warnings"] = $statics["all_warnings"] + $statics["transient_options"];
|
334 |
|
335 |
die(json_encode($statics));
|
@@ -1018,6 +1016,10 @@ GNU General Public License for more details.
|
|
1018 |
public function delete_cache_of_term($term_id){
|
1019 |
$term = get_term($term_id);
|
1020 |
|
|
|
|
|
|
|
|
|
1021 |
if(preg_match("/cat|tag/", $term->taxonomy)){
|
1022 |
$url = get_term_link($term->term_id, $term->taxonomy);
|
1023 |
|
@@ -1178,7 +1180,9 @@ GNU General Public License for more details.
|
|
1178 |
preg_match("/wpFastestCachePreload_(.+)/", $key, $type);
|
1179 |
|
1180 |
if(!empty($type)){
|
1181 |
-
if($type[1] == "
|
|
|
|
|
1182 |
$preload_arr[$type[1]] = $value;
|
1183 |
}else{
|
1184 |
$preload_arr[$type[1]] = 0;
|
@@ -1467,9 +1471,21 @@ GNU General Public License for more details.
|
|
1467 |
// }
|
1468 |
// }
|
1469 |
}else{
|
1470 |
-
|
1471 |
-
|
1472 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1473 |
}
|
1474 |
}
|
1475 |
|
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.7.7
|
7 |
Author: Emre Vona
|
8 |
Author URI: http://tr.linkedin.com/in/emrevona
|
9 |
Text Domain: wp-fastest-cache
|
272 |
}
|
273 |
|
274 |
public function clear_cache_after_woocommerce_checkout_order_processed($order_id = false){
|
275 |
+
if(function_exists("wc_get_order")){
|
276 |
+
if($order_id){
|
277 |
+
$order = wc_get_order($order_id);
|
278 |
+
|
279 |
+
if($order){
|
280 |
+
foreach($order->get_items() as $item_key => $item_values ){
|
281 |
+
if(method_exists($item_values, 'get_product_id')){
|
282 |
+
$this->singleDeleteCache(false, $item_values->get_product_id());
|
283 |
+
}
|
284 |
}
|
285 |
}
|
286 |
}
|
314 |
);
|
315 |
|
316 |
|
317 |
+
$statics["post_revisions"] = $wpdb->get_var("SELECT COUNT(*) FROM `$wpdb->posts` WHERE post_type = 'revision';");
|
318 |
+
$statics["all_warnings"] = $statics["all_warnings"] + $statics["post_revisions"];
|
|
|
319 |
|
320 |
+
$statics["trashed_contents"] = $wpdb->get_var("SELECT COUNT(*) FROM `$wpdb->posts` WHERE post_status = 'trash';");
|
321 |
+
$statics["all_warnings"] = $statics["all_warnings"] + $statics["trashed_contents"];
|
|
|
322 |
|
323 |
+
$statics["trashed_spam_comments"] = $wpdb->get_var("SELECT COUNT(*) FROM `$wpdb->comments` WHERE comment_approved = 'spam' OR comment_approved = 'trash' ;");
|
324 |
+
$statics["all_warnings"] = $statics["all_warnings"] + $statics["trashed_spam_comments"];
|
|
|
325 |
|
326 |
+
$statics["trackback_pingback"] = $wpdb->get_var("SELECT COUNT(*) FROM `$wpdb->comments` WHERE comment_type = 'trackback' OR comment_type = 'pingback' ;");
|
327 |
+
$statics["all_warnings"] = $statics["all_warnings"] + $statics["trackback_pingback"];
|
|
|
328 |
|
329 |
+
$element = "SELECT COUNT(*) FROM `$wpdb->options` WHERE option_name LIKE '%\_transient\_%' ;";
|
330 |
+
$statics["transient_options"] = $wpdb->get_var( $element ) > 20 ? $wpdb->get_var( $element ) : 0;
|
331 |
$statics["all_warnings"] = $statics["all_warnings"] + $statics["transient_options"];
|
332 |
|
333 |
die(json_encode($statics));
|
1016 |
public function delete_cache_of_term($term_id){
|
1017 |
$term = get_term($term_id);
|
1018 |
|
1019 |
+
if(!$term || is_wp_error($term)){
|
1020 |
+
return false;
|
1021 |
+
}
|
1022 |
+
|
1023 |
if(preg_match("/cat|tag/", $term->taxonomy)){
|
1024 |
$url = get_term_link($term->term_id, $term->taxonomy);
|
1025 |
|
1180 |
preg_match("/wpFastestCachePreload_(.+)/", $key, $type);
|
1181 |
|
1182 |
if(!empty($type)){
|
1183 |
+
if($type[1] == "restart"){
|
1184 |
+
//to need to remove "restart" value
|
1185 |
+
}else if($type[1] == "number"){
|
1186 |
$preload_arr[$type[1]] = $value;
|
1187 |
}else{
|
1188 |
$preload_arr[$type[1]] = 0;
|
1471 |
// }
|
1472 |
// }
|
1473 |
}else{
|
1474 |
+
if(isset($this->options->wpFastestCachePreload_restart)){
|
1475 |
+
foreach ($pre_load as $pre_load_key => &$pre_load_value) {
|
1476 |
+
if($pre_load_key != "number"){
|
1477 |
+
$pre_load_value = 0;
|
1478 |
+
}
|
1479 |
+
}
|
1480 |
+
|
1481 |
+
update_option("WpFastestCachePreLoad", json_encode($pre_load));
|
1482 |
+
|
1483 |
+
echo "Preload Restarted";
|
1484 |
+
}else{
|
1485 |
+
echo "Completed";
|
1486 |
+
|
1487 |
+
wp_clear_scheduled_hook("wp_fastest_cache_Preload");
|
1488 |
+
}
|
1489 |
}
|
1490 |
}
|
1491 |
|