Version Description
- to check
for 404 if the header return 200 - to clear all the cache if the visibility is converted to private
- refactoring of ignored()
- to stop loading the admin functions if DOING_AJAX is set
- to fix excluding attachment pages problem
- [FEATURE] Compatible with Yet Another Stars Rating
- to disable including powerfulhtml class for ajax request
- to convert the uninstall method to uninstall.php
- [FEATURE] exclude Google Analytics Parameters [Details]
- to add WPFC_DISABLE_WEBP [Details]
- to fix 403 cdn template error
- to fix height problem of lightbox
Download this release
Release Info
Developer | emrevona |
Plugin | WP Fastest Cache |
Version | 0.8.7.8 |
Comparing to | |
See all releases |
Code changes from version 0.8.7.7 to 0.8.7.8
- css/fonts/db/.DS_Store +0 -0
- inc/admin.php +33 -24
- inc/cache.php +32 -33
- js/cdn/cdn.js +4 -4
- js/dialog.js +5 -1
- js/dialog_new.js +5 -1
- readme.txt +16 -2
- templates/exclude.php +8 -5
- uninstall.php +46 -0
- wpFastestCache.php +82 -86
css/fonts/db/.DS_Store
DELETED
Binary file
|
inc/admin.php
CHANGED
@@ -10,6 +10,8 @@
|
|
10 |
public function __construct(){
|
11 |
$this->options = $this->getOptions();
|
12 |
|
|
|
|
|
13 |
//to call like that because on WP Multisite current_user_can() cannot get the user
|
14 |
add_action('admin_init', array($this, "optionsPageRequest"));
|
15 |
|
@@ -392,29 +394,34 @@
|
|
392 |
|
393 |
public function insertWebp($htaccess){
|
394 |
if(class_exists("WpFastestCachePowerfulHtml")){
|
395 |
-
|
|
|
|
|
|
|
|
|
396 |
}else{
|
397 |
$webp = false;
|
398 |
}
|
399 |
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
|
|
|
|
|
|
412 |
}
|
413 |
}
|
414 |
}
|
415 |
-
|
416 |
-
|
417 |
-
if($webp){
|
418 |
if(ABSPATH == "//"){
|
419 |
$RewriteCond = "RewriteCond %{DOCUMENT_ROOT}/".$basename." -f"."\n";
|
420 |
}else{
|
@@ -806,7 +813,7 @@
|
|
806 |
|
807 |
$wpFastestCacheLazyLoad = isset($this->options->wpFastestCacheLazyLoad) ? 'checked="checked"' : "";
|
808 |
$wpFastestCacheLazyLoad_keywords = isset($this->options->wpFastestCacheLazyLoad_keywords) ? $this->options->wpFastestCacheLazyLoad_keywords : "";
|
809 |
-
|
810 |
|
811 |
|
812 |
$wpFastestCacheLBC = isset($this->options->wpFastestCacheLBC) ? 'checked="checked"' : "";
|
@@ -1206,10 +1213,11 @@
|
|
1206 |
// "fr-FR",
|
1207 |
// "it-IT",
|
1208 |
// "ja",
|
1209 |
-
|
1210 |
-
|
1211 |
-
|
1212 |
"tr-TR",
|
|
|
1213 |
"addkenmerken.net",
|
1214 |
"animefantastica.com",
|
1215 |
"rynofitness.com.au",
|
@@ -1230,6 +1238,7 @@
|
|
1230 |
"parkviewhomes.info",
|
1231 |
"myparkviewhomes.com",
|
1232 |
"kompressorcheck.de",
|
|
|
1233 |
"sackkarre-tests.de",
|
1234 |
"schraubstock-test.de",
|
1235 |
"knarrenkasten-tests.de",
|
@@ -1244,6 +1253,7 @@
|
|
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>
|
@@ -1730,6 +1740,7 @@
|
|
1730 |
<option value="startwith">Start With</option>
|
1731 |
<option value="contain">Contain</option>
|
1732 |
<option value="exact">Exact</option>
|
|
|
1733 |
</select>
|
1734 |
</div>
|
1735 |
<div class="wpfc-exclude-rule-line-middle">
|
@@ -1922,7 +1933,7 @@
|
|
1922 |
type: 'GET',
|
1923 |
url: ajaxurl,
|
1924 |
cache: false,
|
1925 |
-
data : {"action": "
|
1926 |
dataType : "json",
|
1927 |
success: function(data){
|
1928 |
if(data.id){
|
@@ -2073,9 +2084,7 @@
|
|
2073 |
<?php if(class_exists("WpFastestCachePowerfulHtml")){ ?>
|
2074 |
<?php }else{ ?>
|
2075 |
<div class="omni_admin_sidebar_section" style="padding:0 !important;border:none !important;background:none !important;">
|
2076 |
-
|
2077 |
-
<img style="width: 273px; margin-left: -27px;" src="<?php echo plugins_url("wp-fastest-cache/images/inmotion-ads.png"); ?>">
|
2078 |
-
</a>
|
2079 |
</div>
|
2080 |
<?php } ?>
|
2081 |
<div class="omni_admin_sidebar_section" id="vote-us">
|
10 |
public function __construct(){
|
11 |
$this->options = $this->getOptions();
|
12 |
|
13 |
+
$this->set_content_url();
|
14 |
+
|
15 |
//to call like that because on WP Multisite current_user_can() cannot get the user
|
16 |
add_action('admin_init', array($this, "optionsPageRequest"));
|
17 |
|
394 |
|
395 |
public function insertWebp($htaccess){
|
396 |
if(class_exists("WpFastestCachePowerfulHtml")){
|
397 |
+
if(defined("WPFC_DISABLE_WEBP") && WPFC_DISABLE_WEBP){
|
398 |
+
$webp = false;
|
399 |
+
}else{
|
400 |
+
$webp = true;
|
401 |
+
}
|
402 |
}else{
|
403 |
$webp = false;
|
404 |
}
|
405 |
|
406 |
+
|
407 |
+
if($webp){
|
408 |
+
$basename = "$1.webp";
|
409 |
+
|
410 |
+
// this part for sub-directory installation
|
411 |
+
// site_url() and home_url() must be the same
|
412 |
+
if(preg_match("/https?\:\/\/[^\/]+\/(.+)/", site_url(), $siteurl_base_name)){
|
413 |
+
if(preg_match("/https?\:\/\/[^\/]+\/(.+)/", home_url(), $homeurl_base_name)){
|
414 |
+
$homeurl_base_name[1] = trim($homeurl_base_name[1], "/");
|
415 |
+
$siteurl_base_name[1] = trim($siteurl_base_name[1], "/");
|
416 |
+
|
417 |
+
if($homeurl_base_name[1] == $siteurl_base_name[1]){
|
418 |
+
if(preg_match("/".preg_quote($homeurl_base_name[1], "/")."$/", trim(ABSPATH, "/"))){
|
419 |
+
$basename = $homeurl_base_name[1]."/".$basename;
|
420 |
+
}
|
421 |
}
|
422 |
}
|
423 |
}
|
424 |
+
|
|
|
|
|
425 |
if(ABSPATH == "//"){
|
426 |
$RewriteCond = "RewriteCond %{DOCUMENT_ROOT}/".$basename." -f"."\n";
|
427 |
}else{
|
813 |
|
814 |
$wpFastestCacheLazyLoad = isset($this->options->wpFastestCacheLazyLoad) ? 'checked="checked"' : "";
|
815 |
$wpFastestCacheLazyLoad_keywords = isset($this->options->wpFastestCacheLazyLoad_keywords) ? $this->options->wpFastestCacheLazyLoad_keywords : "";
|
816 |
+
$wpFastestCacheLazyLoad_placeholder = isset($this->options->wpFastestCacheLazyLoad_placeholder) ? $this->options->wpFastestCacheLazyLoad_placeholder : "default";
|
817 |
|
818 |
|
819 |
$wpFastestCacheLBC = isset($this->options->wpFastestCacheLBC) ? 'checked="checked"' : "";
|
1213 |
// "fr-FR",
|
1214 |
// "it-IT",
|
1215 |
// "ja",
|
1216 |
+
"nl-NL",
|
1217 |
+
"pt-PT",
|
1218 |
+
"pt-BR",
|
1219 |
"tr-TR",
|
1220 |
+
"nicheadvice.co.uk",
|
1221 |
"addkenmerken.net",
|
1222 |
"animefantastica.com",
|
1223 |
"rynofitness.com.au",
|
1238 |
"parkviewhomes.info",
|
1239 |
"myparkviewhomes.com",
|
1240 |
"kompressorcheck.de",
|
1241 |
+
"cutflower.com",
|
1242 |
"sackkarre-tests.de",
|
1243 |
"schraubstock-test.de",
|
1244 |
"knarrenkasten-tests.de",
|
1253 |
<div class="questionCon">
|
1254 |
<div class="question">Lazy Load</div>
|
1255 |
<div class="inputCon">
|
1256 |
+
<input type="hidden" value="<?php echo $wpFastestCacheLazyLoad_placeholder; ?>" id="wpFastestCacheLazyLoad_placeholder" name="wpFastestCacheLazyLoad_placeholder">
|
1257 |
<input type="hidden" value="<?php echo $wpFastestCacheLazyLoad_keywords; ?>" id="wpFastestCacheLazyLoad_keywords" name="wpFastestCacheLazyLoad_keywords">
|
1258 |
<input type="checkbox" <?php echo $wpFastestCacheLazyLoad; ?> id="wpFastestCacheLazyLoad" name="wpFastestCacheLazyLoad"><label for="wpFastestCacheLazyLoad">Load images and iframes when they enter the browsers viewport</label>
|
1259 |
</div>
|
1740 |
<option value="startwith">Start With</option>
|
1741 |
<option value="contain">Contain</option>
|
1742 |
<option value="exact">Exact</option>
|
1743 |
+
<option value="googleanalytics">has Google Analytics Parameters</option>
|
1744 |
</select>
|
1745 |
</div>
|
1746 |
<div class="wpfc-exclude-rule-line-middle">
|
1933 |
type: 'GET',
|
1934 |
url: ajaxurl,
|
1935 |
cache: false,
|
1936 |
+
data : {"action": "wpfc_cdn_options"},
|
1937 |
dataType : "json",
|
1938 |
success: function(data){
|
1939 |
if(data.id){
|
2084 |
<?php if(class_exists("WpFastestCachePowerfulHtml")){ ?>
|
2085 |
<?php }else{ ?>
|
2086 |
<div class="omni_admin_sidebar_section" style="padding:0 !important;border:none !important;background:none !important;">
|
2087 |
+
<!-- ads area -->
|
|
|
|
|
2088 |
</div>
|
2089 |
<?php } ?>
|
2090 |
<div class="omni_admin_sidebar_section" id="vote-us">
|
inc/cache.php
CHANGED
@@ -8,6 +8,7 @@
|
|
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
|
@@ -69,24 +70,6 @@
|
|
69 |
}
|
70 |
}
|
71 |
|
72 |
-
public function set_content_url(){
|
73 |
-
$content_url = content_url();
|
74 |
-
|
75 |
-
// Hide My WP
|
76 |
-
if($this->isPluginActive('hide_my_wp/hide-my-wp.php')){
|
77 |
-
$hide_my_wp = get_option("hide_my_wp");
|
78 |
-
|
79 |
-
if(isset($hide_my_wp["new_content_path"]) && $hide_my_wp["new_content_path"]){
|
80 |
-
$hide_my_wp["new_content_path"] = trim($hide_my_wp["new_content_path"], "/");
|
81 |
-
$content_url = str_replace(basename(WPFC_WP_CONTENT_DIR), $hide_my_wp["new_content_path"], $content_url);
|
82 |
-
}
|
83 |
-
}
|
84 |
-
|
85 |
-
if (!defined('WPFC_WP_CONTENT_URL')) {
|
86 |
-
define("WPFC_WP_CONTENT_URL", $content_url);
|
87 |
-
}
|
88 |
-
}
|
89 |
-
|
90 |
public function set_exclude_rules(){
|
91 |
if($json_data = get_option("WpFastestCacheExclude")){
|
92 |
$this->exclude_rules = json_decode($json_data);
|
@@ -405,25 +388,29 @@
|
|
405 |
"\/clientarea\.php"
|
406 |
);
|
407 |
if($this->isPluginActive('woocommerce/woocommerce.php')){
|
408 |
-
if(
|
409 |
-
|
410 |
-
$woocommerce_ids = array();
|
411 |
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
array_push($woocommerce_ids, wc_get_page_id('cart'), wc_get_page_id('checkout'), wc_get_page_id('receipt'), wc_get_page_id('confirmation'), wc_get_page_id('myaccount'));
|
416 |
|
417 |
-
|
418 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
419 |
}
|
420 |
}
|
421 |
-
}
|
422 |
|
423 |
-
|
424 |
-
|
425 |
|
426 |
-
|
|
|
427 |
}
|
428 |
|
429 |
if($this->isPluginActive('wp-easycart/wpeasycart.php')){
|
@@ -454,7 +441,7 @@
|
|
454 |
$value->content = trim($value->content);
|
455 |
$value->content = trim($value->content, "/");
|
456 |
|
457 |
-
if(preg_match("/^(homepage|category|tag|post|page)$/", $value->prefix)){
|
458 |
if(preg_match('/<\!--WPFC_PAGE_TYPE_'.$value->prefix.'-->/i', $buffer)){
|
459 |
return true;
|
460 |
}
|
@@ -473,6 +460,10 @@
|
|
473 |
return true;
|
474 |
}
|
475 |
}
|
|
|
|
|
|
|
|
|
476 |
}else if($value->type == "useragent"){
|
477 |
if(preg_match("/".preg_quote($value->content, "/")."/i", $_SERVER['HTTP_USER_AGENT'])){
|
478 |
return true;
|
@@ -517,7 +508,15 @@
|
|
517 |
return false;
|
518 |
}
|
519 |
|
|
|
|
|
|
|
|
|
|
|
|
|
520 |
public function callback($buffer){
|
|
|
|
|
521 |
$buffer = $this->checkShortCode($buffer);
|
522 |
|
523 |
// for Wordfence: not to cache 503 pages
|
@@ -550,7 +549,7 @@
|
|
550 |
return $buffer."<!-- wp-login.php -->";
|
551 |
}else if($this->hasContactForm7WithCaptcha($buffer)){
|
552 |
return $buffer."<!-- This page was not cached because ContactForm7's captcha -->";
|
553 |
-
}else if(is_404()){
|
554 |
return $buffer;
|
555 |
}else if($this->ignored($buffer)){
|
556 |
return $buffer;
|
8 |
public $cacheFilePath = "";
|
9 |
public $exclude_rules = false;
|
10 |
public $preload_user_agent = false;
|
11 |
+
public $current_page_type = false;
|
12 |
|
13 |
public function __construct(){
|
14 |
//to fix: PHP Notice: Undefined index: HTTP_USER_AGENT
|
70 |
}
|
71 |
}
|
72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
public function set_exclude_rules(){
|
74 |
if($json_data = get_option("WpFastestCacheExclude")){
|
75 |
$this->exclude_rules = json_decode($json_data);
|
388 |
"\/clientarea\.php"
|
389 |
);
|
390 |
if($this->isPluginActive('woocommerce/woocommerce.php')){
|
391 |
+
if($this->current_page_type != "homepage"){
|
392 |
+
global $post;
|
|
|
393 |
|
394 |
+
if(isset($post->ID) && $post->ID){
|
395 |
+
if(function_exists("wc_get_page_id")){
|
396 |
+
$woocommerce_ids = array();
|
|
|
397 |
|
398 |
+
//wc_get_page_id('product')
|
399 |
+
//wc_get_page_id('product-category')
|
400 |
+
|
401 |
+
array_push($woocommerce_ids, wc_get_page_id('cart'), wc_get_page_id('checkout'), wc_get_page_id('receipt'), wc_get_page_id('confirmation'), wc_get_page_id('myaccount'));
|
402 |
+
|
403 |
+
if (in_array($post->ID, $woocommerce_ids)) {
|
404 |
+
return true;
|
405 |
+
}
|
406 |
}
|
407 |
}
|
|
|
408 |
|
409 |
+
//"\/product"
|
410 |
+
//"\/product-category"
|
411 |
|
412 |
+
array_push($list, "\/cart", "\/checkout", "\/receipt", "\/confirmation", "\/wc-api\/");
|
413 |
+
}
|
414 |
}
|
415 |
|
416 |
if($this->isPluginActive('wp-easycart/wpeasycart.php')){
|
441 |
$value->content = trim($value->content);
|
442 |
$value->content = trim($value->content, "/");
|
443 |
|
444 |
+
if(preg_match("/^(homepage|category|tag|post|page|attachment)$/", $value->prefix)){
|
445 |
if(preg_match('/<\!--WPFC_PAGE_TYPE_'.$value->prefix.'-->/i', $buffer)){
|
446 |
return true;
|
447 |
}
|
460 |
return true;
|
461 |
}
|
462 |
}
|
463 |
+
}else if($value->prefix == "googleanalytics"){
|
464 |
+
if(preg_match("/utm_(source|medium|campaign|content|term)/i", $request_url)){
|
465 |
+
return true;
|
466 |
+
}
|
467 |
}else if($value->type == "useragent"){
|
468 |
if(preg_match("/".preg_quote($value->content, "/")."/i", $_SERVER['HTTP_USER_AGENT'])){
|
469 |
return true;
|
508 |
return false;
|
509 |
}
|
510 |
|
511 |
+
public function set_current_page_type($buffer){
|
512 |
+
preg_match('/<\!--WPFC_PAGE_TYPE_([a-z]+)-->/i', $buffer, $out);
|
513 |
+
|
514 |
+
$this->current_page_type = isset($out[1]) ? $out[1] : false;
|
515 |
+
}
|
516 |
+
|
517 |
public function callback($buffer){
|
518 |
+
$this->set_current_page_type($buffer);
|
519 |
+
|
520 |
$buffer = $this->checkShortCode($buffer);
|
521 |
|
522 |
// for Wordfence: not to cache 503 pages
|
549 |
return $buffer."<!-- wp-login.php -->";
|
550 |
}else if($this->hasContactForm7WithCaptcha($buffer)){
|
551 |
return $buffer."<!-- This page was not cached because ContactForm7's captcha -->";
|
552 |
+
}else if(is_404() || preg_match("/<title>404\sNot\sFound<\/title>/", $buffer)){
|
553 |
return $buffer;
|
554 |
}else if($this->ignored($buffer)){
|
555 |
return $buffer;
|
js/cdn/cdn.js
CHANGED
@@ -141,7 +141,7 @@ var WpfcCDN = {
|
|
141 |
type: 'POST',
|
142 |
dataType: "json",
|
143 |
url: ajaxurl,
|
144 |
-
data : {"action": "
|
145 |
success: function(res){
|
146 |
self.values = jQuery.grep(self.values, function (e, i) {
|
147 |
if(e.id == self.id){
|
@@ -189,7 +189,7 @@ var WpfcCDN = {
|
|
189 |
type: 'POST',
|
190 |
dataType: "json",
|
191 |
url: ajaxurl,
|
192 |
-
data : {"action": "
|
193 |
success: function(res){
|
194 |
jQuery("div[wpfc-cdn-name='" + self.id + "']").find("div.meta").addClass("isConnected");
|
195 |
jQuery(".wpfc-dialog-buttons[action='finish']").attr("disabled", false);
|
@@ -236,7 +236,7 @@ var WpfcCDN = {
|
|
236 |
type: 'GET',
|
237 |
dataType: "json",
|
238 |
url: ajaxurl,
|
239 |
-
data : {"action": "
|
240 |
success: function(res){
|
241 |
modal.find("#cdn-url-loading").hide();
|
242 |
if(res.success){
|
@@ -307,7 +307,7 @@ var WpfcCDN = {
|
|
307 |
type: 'POST',
|
308 |
dataType: "json",
|
309 |
url: ajaxurl,
|
310 |
-
data : {"action": "
|
311 |
success: function(res){
|
312 |
jQuery("body").append(res.content);
|
313 |
Wpfc_Dialog.dialog("wpfc-modal-" + self.id);
|
141 |
type: 'POST',
|
142 |
dataType: "json",
|
143 |
url: ajaxurl,
|
144 |
+
data : {"action": "wpfc_remove_cdn_integration", "id" : self.id},
|
145 |
success: function(res){
|
146 |
self.values = jQuery.grep(self.values, function (e, i) {
|
147 |
if(e.id == self.id){
|
189 |
type: 'POST',
|
190 |
dataType: "json",
|
191 |
url: ajaxurl,
|
192 |
+
data : {"action": "wpfc_save_cdn_integration", "values" : self.values, "file_types" : self.values.file_types, "keywords" : self.values.keywords},
|
193 |
success: function(res){
|
194 |
jQuery("div[wpfc-cdn-name='" + self.id + "']").find("div.meta").addClass("isConnected");
|
195 |
jQuery(".wpfc-dialog-buttons[action='finish']").attr("disabled", false);
|
236 |
type: 'GET',
|
237 |
dataType: "json",
|
238 |
url: ajaxurl,
|
239 |
+
data : {"action": "wpfc_check_url", "url" : cdn_url},
|
240 |
success: function(res){
|
241 |
modal.find("#cdn-url-loading").hide();
|
242 |
if(res.success){
|
307 |
type: 'POST',
|
308 |
dataType: "json",
|
309 |
url: ajaxurl,
|
310 |
+
data : {"action": "wpfc_cdn_template", "id": self.id},
|
311 |
success: function(res){
|
312 |
jQuery("body").append(res.content);
|
313 |
Wpfc_Dialog.dialog("wpfc-modal-" + self.id);
|
js/dialog.js
CHANGED
@@ -8,7 +8,11 @@ var Wpfc_Dialog = {
|
|
8 |
|
9 |
jQuery("#" + id).show();
|
10 |
|
11 |
-
jQuery("#" + id).draggable(
|
|
|
|
|
|
|
|
|
12 |
|
13 |
jQuery("#" + id).position({my: "center", at: "center", of: window});
|
14 |
|
8 |
|
9 |
jQuery("#" + id).show();
|
10 |
|
11 |
+
jQuery("#" + id).draggable({
|
12 |
+
stop: function(){
|
13 |
+
jQuery(this).height("auto");
|
14 |
+
}
|
15 |
+
});
|
16 |
|
17 |
jQuery("#" + id).position({my: "center", at: "center", of: window});
|
18 |
|
js/dialog_new.js
CHANGED
@@ -22,7 +22,11 @@ var Wpfc_New_Dialog = {
|
|
22 |
|
23 |
self.clone.show();
|
24 |
|
25 |
-
self.clone.draggable(
|
|
|
|
|
|
|
|
|
26 |
self.clone.position({my: "center", at: "center", of: window});
|
27 |
self.clone.find(".close-wiz").click(function(){
|
28 |
self.remove(this);
|
22 |
|
23 |
self.clone.show();
|
24 |
|
25 |
+
self.clone.draggable({
|
26 |
+
stop: function(){
|
27 |
+
jQuery(this).height("auto");
|
28 |
+
}
|
29 |
+
});
|
30 |
self.clone.position({my: "center", at: "center", of: window});
|
31 |
self.clone.find(".close-wiz").click(function(){
|
32 |
self.remove(this);
|
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,6 +102,20 @@ Wpfc does not support Wordpress Multisite yet.
|
|
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>]
|
@@ -709,7 +723,7 @@ Wpfc does not create .htaccess automatically so you need to create empty one.
|
|
709 |
When the cached files are deleted, they are moved to "tmpWpfc" instead of being deleted and a cron-job is set. Delete all files are so difficult for server so cron-job is set not to use a lot of CPU resources. Cron-job is set and it deletes 100 files every 5 minutes. When all files in "tmpWpfc" are deleted, cron-job is unset.
|
710 |
|
711 |
= How can stop caching for some pages? =
|
712 |
-
If you add <!--[wpfcNOT]--> into source coude, creating cache stops. You can find it on visual and text editor after opening Add New Post panel.
|
713 |
|
714 |
= Does Wpfc work with WPMU (Wordpress Multisite) properly? =
|
715 |
No. Wpfc does not support Wordpress Multisite yet.
|
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
|
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.8 =
|
106 |
+
* to check <title> for 404 if the header return 200
|
107 |
+
* to clear all the cache if the visibility is converted to private
|
108 |
+
* refactoring of ignored()
|
109 |
+
* to stop loading the admin functions if DOING_AJAX is set
|
110 |
+
* to fix excluding attachment pages problem
|
111 |
+
* <strong>[FEATURE]</strong> Compatible with Yet Another Stars Rating
|
112 |
+
* to disable including powerfulhtml class for ajax request
|
113 |
+
* to convert the uninstall method to uninstall.php
|
114 |
+
* <strong>[FEATURE]</strong> exclude Google Analytics Parameters [<a target="_blank" href="http://www.wpfastestcache.com/features/cache-url-with-google-analytics-parameters-querystring/#disable-cache-google-analytics-parameters">Details</a>]
|
115 |
+
* to add WPFC_DISABLE_WEBP [<a target="_blank" href="http://www.wpfastestcache.com/premium/image-optimization/#disable-webp">Details</a>]
|
116 |
+
* to fix 403 cdn template error
|
117 |
+
* to fix height problem of lightbox
|
118 |
+
|
119 |
= 0.8.7.7 =
|
120 |
* to remove "via php" text if WPFC_REMOVE_VIA_FOOTER_COMMENT is defined as true
|
121 |
* <strong>[FEATURE]</strong> Restart Preload [<a target="_blank" href="http://www.wpfastestcache.com/features/restart-preload-after-completed/">Details</a>]
|
723 |
When the cached files are deleted, they are moved to "tmpWpfc" instead of being deleted and a cron-job is set. Delete all files are so difficult for server so cron-job is set not to use a lot of CPU resources. Cron-job is set and it deletes 100 files every 5 minutes. When all files in "tmpWpfc" are deleted, cron-job is unset.
|
724 |
|
725 |
= How can stop caching for some pages? =
|
726 |
+
If you add <!-- [wpfcNOT] --> into source coude, creating cache stops. You can find it on visual and text editor after opening Add New Post panel.
|
727 |
|
728 |
= Does Wpfc work with WPMU (Wordpress Multisite) properly? =
|
729 |
No. Wpfc does not support Wordpress Multisite yet.
|
templates/exclude.php
CHANGED
@@ -88,7 +88,7 @@
|
|
88 |
<tr>
|
89 |
<td width="100" height="35" class="wpfc-condition-text" style="padding-left:10px;font-family: Verdana,Geneva,Arial,Helvetica,sans-serif;font-size: 12px;">If REQUEST_URI</td>
|
90 |
<td class="" width="95">
|
91 |
-
<select name="wpfc-exclude-rule-prefix">
|
92 |
<option selected="" value=""></option>
|
93 |
<option value="homepage">Home Page</option>
|
94 |
<option value="category">Categories</option>
|
@@ -99,6 +99,7 @@
|
|
99 |
<option value="startwith">Starts With</option>
|
100 |
<option value="contain">Contains</option>
|
101 |
<option value="exact">Is Equal To</option>
|
|
|
102 |
</select>
|
103 |
</td>
|
104 |
<td width="300">
|
@@ -179,7 +180,7 @@
|
|
179 |
var clone_modal_id = "wpfc-modal-exclude-" + new Date().getTime();
|
180 |
|
181 |
clone_modal.find("select").change(function(e){
|
182 |
-
if(jQuery(this).val().match(/^(homepage|category|tag|post|page|attachment)$/)){
|
183 |
clone_modal.find("input[name='wpfc-exclude-rule-content']").hide();
|
184 |
clone_modal.find("input[name='wpfc-exclude-rule-content']").val(jQuery(this).val());
|
185 |
}else{
|
@@ -188,7 +189,7 @@
|
|
188 |
}
|
189 |
});
|
190 |
|
191 |
-
if(e.prefix.match(/^(homepage|category|tag|post|page|attachment)$/)){
|
192 |
clone_modal.find("input[name='wpfc-exclude-rule-content']").hide();
|
193 |
}
|
194 |
|
@@ -282,6 +283,8 @@
|
|
282 |
title = "Pages";
|
283 |
}else if(prefix == "attachment"){
|
284 |
title = "Attachments";
|
|
|
|
|
285 |
}
|
286 |
|
287 |
return title;
|
@@ -302,7 +305,7 @@
|
|
302 |
}
|
303 |
|
304 |
if(type == "page" || type == "css" || type == "js"){
|
305 |
-
if(prefix.match(/^(homepage|category|tag|post|page|attachment)$/)){
|
306 |
if(prefix == "homepage"){
|
307 |
return "The " + b_start + "homepage" + b_end + " has been excluded";
|
308 |
}else{
|
@@ -366,7 +369,7 @@
|
|
366 |
|
367 |
|
368 |
clone_modal.find("select").change(function(){
|
369 |
-
if(jQuery(this).val().match(/^(homepage|category|tag|post|page|attachment)$/)){
|
370 |
clone_modal.find("input[name='wpfc-exclude-rule-content']").hide();
|
371 |
clone_modal.find("input[name='wpfc-exclude-rule-content']").val(jQuery(this).val());
|
372 |
}else{
|
88 |
<tr>
|
89 |
<td width="100" height="35" class="wpfc-condition-text" style="padding-left:10px;font-family: Verdana,Geneva,Arial,Helvetica,sans-serif;font-size: 12px;">If REQUEST_URI</td>
|
90 |
<td class="" width="95">
|
91 |
+
<select name="wpfc-exclude-rule-prefix" style="width: 98px !important;">
|
92 |
<option selected="" value=""></option>
|
93 |
<option value="homepage">Home Page</option>
|
94 |
<option value="category">Categories</option>
|
99 |
<option value="startwith">Starts With</option>
|
100 |
<option value="contain">Contains</option>
|
101 |
<option value="exact">Is Equal To</option>
|
102 |
+
<option value="googleanalytics">has Google Analytics Parameters</option>
|
103 |
</select>
|
104 |
</td>
|
105 |
<td width="300">
|
180 |
var clone_modal_id = "wpfc-modal-exclude-" + new Date().getTime();
|
181 |
|
182 |
clone_modal.find("select").change(function(e){
|
183 |
+
if(jQuery(this).val().match(/^(homepage|category|tag|post|page|attachment|googleanalytics)$/)){
|
184 |
clone_modal.find("input[name='wpfc-exclude-rule-content']").hide();
|
185 |
clone_modal.find("input[name='wpfc-exclude-rule-content']").val(jQuery(this).val());
|
186 |
}else{
|
189 |
}
|
190 |
});
|
191 |
|
192 |
+
if(e.prefix.match(/^(homepage|category|tag|post|page|attachment|googleanalytics)$/)){
|
193 |
clone_modal.find("input[name='wpfc-exclude-rule-content']").hide();
|
194 |
}
|
195 |
|
283 |
title = "Pages";
|
284 |
}else if(prefix == "attachment"){
|
285 |
title = "Attachments";
|
286 |
+
}else if(prefix == "googleanalytics"){
|
287 |
+
title = "Google Analytics Parameters";
|
288 |
}
|
289 |
|
290 |
return title;
|
305 |
}
|
306 |
|
307 |
if(type == "page" || type == "css" || type == "js"){
|
308 |
+
if(prefix.match(/^(homepage|category|tag|post|page|attachment|googleanalytics)$/)){
|
309 |
if(prefix == "homepage"){
|
310 |
return "The " + b_start + "homepage" + b_end + " has been excluded";
|
311 |
}else{
|
369 |
|
370 |
|
371 |
clone_modal.find("select").change(function(){
|
372 |
+
if(jQuery(this).val().match(/^(homepage|category|tag|post|page|attachment|googleanalytics)$/)){
|
373 |
clone_modal.find("input[name='wpfc-exclude-rule-content']").hide();
|
374 |
clone_modal.find("input[name='wpfc-exclude-rule-content']").val(jQuery(this).val());
|
375 |
}else{
|
uninstall.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Runs on Uninstall of WP Fastest Cache
|
4 |
+
*
|
5 |
+
* @package WP Fastest Cache
|
6 |
+
* @author Emre Vona
|
7 |
+
* @license GPL-2.0+
|
8 |
+
* @link http://wordpress.org/plugins/wp-fastest-cache/
|
9 |
+
*/
|
10 |
+
|
11 |
+
// if uninstall.php is not called by WordPress, die
|
12 |
+
if(!defined('WP_UNINSTALL_PLUGIN')){
|
13 |
+
die;
|
14 |
+
}
|
15 |
+
|
16 |
+
include_once("wpFastestCache.php");
|
17 |
+
|
18 |
+
wpfastestcache_deactivate();
|
19 |
+
|
20 |
+
delete_option("WpFastestCache");
|
21 |
+
delete_option("WpFcDeleteCacheLogs");
|
22 |
+
delete_option("WpFastestCacheCDN");
|
23 |
+
delete_option("WpFastestCacheExclude");
|
24 |
+
delete_option("WpFastestCachePreLoad");
|
25 |
+
delete_option("WpFastestCacheCSS");
|
26 |
+
delete_option("WpFastestCacheCSSSIZE");
|
27 |
+
delete_option("WpFastestCacheJS");
|
28 |
+
delete_option("WpFastestCacheJSSIZE");
|
29 |
+
delete_option("wpfc_server_location");
|
30 |
+
|
31 |
+
foreach ((array)_get_cron_array() as $cron_key => $cron_value) {
|
32 |
+
foreach ( (array) $cron_value as $hook => $events ) {
|
33 |
+
if(preg_match("/^wp\_fastest\_cache/", $hook)){
|
34 |
+
$args = array();
|
35 |
+
|
36 |
+
foreach ( (array) $events as $event_key => $event ) {
|
37 |
+
if(isset($event["args"]) && isset($event["args"][0])){
|
38 |
+
$args = array(json_encode(json_decode($event["args"][0])));
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
wp_clear_scheduled_hook($hook, $args);
|
43 |
+
}
|
44 |
+
}
|
45 |
+
}
|
46 |
+
?>
|
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
|
@@ -93,14 +93,16 @@ GNU General Public License for more details.
|
|
93 |
"wpfc_update_image_list_ajax_request"
|
94 |
);
|
95 |
|
96 |
-
|
|
|
|
|
97 |
add_action( 'wp_ajax_wpfc_save_timeout_pages', array($this, 'wpfc_save_timeout_pages_callback'));
|
98 |
add_action( 'wp_ajax_wpfc_save_exclude_pages', array($this, 'wpfc_save_exclude_pages_callback'));
|
99 |
-
add_action( '
|
100 |
-
add_action( '
|
101 |
-
add_action( '
|
102 |
-
add_action( '
|
103 |
-
add_action( '
|
104 |
add_action( 'wp_ajax_wpfc_cache_statics_get', array($this, 'wpfc_cache_statics_get_callback'));
|
105 |
add_action( 'wp_ajax_wpfc_db_statics', array($this, 'wpfc_db_statics_callback'));
|
106 |
add_action( 'wp_ajax_wpfc_db_fix', array($this, 'wpfc_db_fix_callback'));
|
@@ -126,6 +128,14 @@ GNU General Public License for more details.
|
|
126 |
$this->singleDeleteCache(false, $_POST["post_id"]);
|
127 |
}
|
128 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
}
|
130 |
|
131 |
// to clear /tmpWpfc folder
|
@@ -150,7 +160,7 @@ GNU General Public License for more details.
|
|
150 |
if(isset($_GET) && isset($_GET["type"]) && $_GET["type"] == "preload"){
|
151 |
// /?action=wpfastestcache&type=preload
|
152 |
|
153 |
-
add_action('init', array($this, "create_preload_cache"));
|
154 |
}
|
155 |
}else{
|
156 |
$this->setCustomInterval();
|
@@ -163,41 +173,41 @@ GNU General Public License for more details.
|
|
163 |
|
164 |
$this->checkCronTime();
|
165 |
|
166 |
-
register_uninstall_hook( __FILE__, array('WpFastestCache', 'uninstall'));
|
167 |
-
|
168 |
if($this->isPluginActive("wp-fastest-cache-premium/wpFastestCachePremium.php")){
|
169 |
include_once $this->get_premium_path("mobile-cache.php");
|
170 |
-
}
|
171 |
|
172 |
-
if($this->isPluginActive("wp-fastest-cache-premium/wpFastestCachePremium.php")){
|
173 |
-
include_once $this->get_premium_path("powerful-html.php");
|
174 |
-
}
|
175 |
-
|
176 |
-
if($this->isPluginActive("wp-fastest-cache-premium/wpFastestCachePremium.php")){
|
177 |
if(file_exists(WPFC_WP_PLUGIN_DIR."/wp-fastest-cache-premium/pro/library/statics.php")){
|
178 |
include_once $this->get_premium_path("statics.php");
|
179 |
}
|
|
|
|
|
|
|
|
|
180 |
}
|
181 |
|
182 |
if(is_admin()){
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
|
|
|
|
|
|
|
|
|
|
190 |
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
|
195 |
-
|
196 |
-
|
197 |
-
add_action('wp_loaded', array($this, "load_admin_toolbar"));
|
198 |
-
add_action('wp_loaded', array($this, "load_column"));
|
199 |
|
200 |
-
|
|
|
201 |
}
|
202 |
}else{
|
203 |
if(preg_match("/wpfc-minified\/([^\/]+)\/([^\/]+)/", $this->current_url(), $path)){
|
@@ -237,6 +247,24 @@ GNU General Public License for more details.
|
|
237 |
}
|
238 |
}
|
239 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
public function clear_cache_on_kksr_rate($id){
|
241 |
$this->singleDeleteCache(false, $id);
|
242 |
}
|
@@ -723,10 +751,6 @@ GNU General Public License for more details.
|
|
723 |
if($show){
|
724 |
include_once plugin_dir_path(__FILE__)."inc/admin-toolbar.php";
|
725 |
|
726 |
-
add_action('wp_ajax_wpfc_delete_cache', array($this, "deleteCacheToolbar"));
|
727 |
-
add_action('wp_ajax_wpfc_delete_cache_and_minified', array($this, "deleteCssAndJsCacheToolbar"));
|
728 |
-
add_action('wp_ajax_wpfc_delete_current_page_cache', array($this, "delete_current_page_cache"));
|
729 |
-
|
730 |
$toolbar = new WpFastestCacheAdminToolbar();
|
731 |
$toolbar->add();
|
732 |
}
|
@@ -800,40 +824,6 @@ GNU General Public License for more details.
|
|
800 |
$wpfc->createCache();
|
801 |
}
|
802 |
|
803 |
-
public function uninstall(){
|
804 |
-
wpfastestcache_deactivate();
|
805 |
-
|
806 |
-
// wp_clear_scheduled_hook("wp_fastest_cache");
|
807 |
-
// wp_clear_scheduled_hook("wp_fastest_cache_regular");
|
808 |
-
|
809 |
-
delete_option("WpFastestCache");
|
810 |
-
delete_option("WpFcDeleteCacheLogs");
|
811 |
-
delete_option("WpFastestCacheCDN");
|
812 |
-
delete_option("WpFastestCacheExclude");
|
813 |
-
delete_option("WpFastestCachePreLoad");
|
814 |
-
delete_option("WpFastestCacheCSS");
|
815 |
-
delete_option("WpFastestCacheCSSSIZE");
|
816 |
-
delete_option("WpFastestCacheJS");
|
817 |
-
delete_option("WpFastestCacheJSSIZE");
|
818 |
-
delete_option("wpfc_server_location");
|
819 |
-
|
820 |
-
foreach ((array)_get_cron_array() as $cron_key => $cron_value) {
|
821 |
-
foreach ( (array) $cron_value as $hook => $events ) {
|
822 |
-
if(preg_match("/^wp\_fastest\_cache/", $hook)){
|
823 |
-
$args = array();
|
824 |
-
|
825 |
-
foreach ( (array) $events as $event_key => $event ) {
|
826 |
-
if(isset($event["args"]) && isset($event["args"][0])){
|
827 |
-
$args = array(json_encode(json_decode($event["args"][0])));
|
828 |
-
}
|
829 |
-
}
|
830 |
-
|
831 |
-
wp_clear_scheduled_hook($hook, $args);
|
832 |
-
}
|
833 |
-
}
|
834 |
-
}
|
835 |
-
}
|
836 |
-
|
837 |
protected function slug(){
|
838 |
return "wp_fastest_cache";
|
839 |
}
|
@@ -912,7 +902,7 @@ GNU General Public License for more details.
|
|
912 |
|
913 |
if($new_status == "trash" && $old_status == "publish"){
|
914 |
$this->singleDeleteCache(false, $post->ID);
|
915 |
-
}else if(($new_status == "draft" || $new_status == "pending") && $old_status == "publish"){
|
916 |
$this->deleteCache();
|
917 |
}
|
918 |
}
|
@@ -935,6 +925,25 @@ GNU General Public License for more details.
|
|
935 |
public function singleDeleteCache($comment_id = false, $post_id = false){
|
936 |
$to_clear_parents = true;
|
937 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
938 |
if($comment_id){
|
939 |
$comment_id = intval($comment_id);
|
940 |
|
@@ -984,19 +993,6 @@ GNU General Public License for more details.
|
|
984 |
$this->rm_folder_recursively($mobile_path);
|
985 |
}
|
986 |
}
|
987 |
-
|
988 |
-
// not to clear cache of homepage/cats/tags after ajax request by other plugins
|
989 |
-
if(isset($_POST) && isset($_POST["action"])){
|
990 |
-
// kk Star Rating
|
991 |
-
if($_POST["action"] == "kksr_ajax"){
|
992 |
-
$to_clear_parents = false;
|
993 |
-
}
|
994 |
-
|
995 |
-
// All In One Schema.org Rich Snippets
|
996 |
-
if(preg_match("/bsf_(update|submit)_rating/i", $_POST["action"])){
|
997 |
-
$to_clear_parents = false;
|
998 |
-
}
|
999 |
-
}
|
1000 |
|
1001 |
if($to_clear_parents){
|
1002 |
// to clear cache of homepage
|
@@ -1166,7 +1162,7 @@ GNU General Public License for more details.
|
|
1166 |
}
|
1167 |
}
|
1168 |
|
1169 |
-
add_action($this->slug()."_Preload", array($this, 'create_preload_cache'));
|
1170 |
}
|
1171 |
|
1172 |
public function set_preload(){
|
@@ -1252,7 +1248,7 @@ GNU General Public License for more details.
|
|
1252 |
|
1253 |
|
1254 |
// HOME
|
1255 |
-
if($pre_load->homepage > -1){
|
1256 |
if($mobile_theme){
|
1257 |
array_push($urls, array("url" => get_option("home"), "user-agent" => "mobile"));
|
1258 |
$number--;
|
@@ -1364,7 +1360,7 @@ GNU General Public License for more details.
|
|
1364 |
// ));
|
1365 |
|
1366 |
global $wpdb;
|
1367 |
-
$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') ORDER BY t.term_id ASC LIMIT ".$pre_load->category.", ".$number, ARRAY_A);
|
1368 |
|
1369 |
if(count($categories) > 0){
|
1370 |
foreach ($categories as $key => $category) {
|
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.8
|
7 |
Author: Emre Vona
|
8 |
Author URI: http://tr.linkedin.com/in/emrevona
|
9 |
Text Domain: wp-fastest-cache
|
93 |
"wpfc_update_image_list_ajax_request"
|
94 |
);
|
95 |
|
96 |
+
add_action('wp_ajax_wpfc_delete_cache', array($this, "deleteCacheToolbar"));
|
97 |
+
add_action('wp_ajax_wpfc_delete_cache_and_minified', array($this, "deleteCssAndJsCacheToolbar"));
|
98 |
+
add_action('wp_ajax_wpfc_delete_current_page_cache', array($this, "delete_current_page_cache"));
|
99 |
add_action( 'wp_ajax_wpfc_save_timeout_pages', array($this, 'wpfc_save_timeout_pages_callback'));
|
100 |
add_action( 'wp_ajax_wpfc_save_exclude_pages', array($this, 'wpfc_save_exclude_pages_callback'));
|
101 |
+
add_action( 'wp_ajax_wpfc_cdn_options', array($this, 'wpfc_cdn_options_ajax_request_callback'));
|
102 |
+
add_action( 'wp_ajax_wpfc_remove_cdn_integration', array($this, 'wpfc_remove_cdn_integration_ajax_request_callback'));
|
103 |
+
add_action( 'wp_ajax_wpfc_save_cdn_integration', array($this, 'wpfc_save_cdn_integration_ajax_request_callback'));
|
104 |
+
add_action( 'wp_ajax_wpfc_cdn_template', array($this, 'wpfc_cdn_template_ajax_request_callback'));
|
105 |
+
add_action( 'wp_ajax_wpfc_check_url', array($this, 'wpfc_check_url_ajax_request_callback'));
|
106 |
add_action( 'wp_ajax_wpfc_cache_statics_get', array($this, 'wpfc_cache_statics_get_callback'));
|
107 |
add_action( 'wp_ajax_wpfc_db_statics', array($this, 'wpfc_db_statics_callback'));
|
108 |
add_action( 'wp_ajax_wpfc_db_fix', array($this, 'wpfc_db_fix_callback'));
|
128 |
$this->singleDeleteCache(false, $_POST["post_id"]);
|
129 |
}
|
130 |
}
|
131 |
+
|
132 |
+
// Yet Another Stars Rating
|
133 |
+
if($_POST["action"] == "yasr_send_visitor_rating"){
|
134 |
+
if(isset($_POST["post_id"])){
|
135 |
+
// to need call like that because get_permalink() does not work if we call singleDeleteCache() directly
|
136 |
+
add_action('init', array($this, "singleDeleteCache"));
|
137 |
+
}
|
138 |
+
}
|
139 |
}
|
140 |
|
141 |
// to clear /tmpWpfc folder
|
160 |
if(isset($_GET) && isset($_GET["type"]) && $_GET["type"] == "preload"){
|
161 |
// /?action=wpfastestcache&type=preload
|
162 |
|
163 |
+
add_action('init', array($this, "create_preload_cache"), 11);
|
164 |
}
|
165 |
}else{
|
166 |
$this->setCustomInterval();
|
173 |
|
174 |
$this->checkCronTime();
|
175 |
|
|
|
|
|
176 |
if($this->isPluginActive("wp-fastest-cache-premium/wpFastestCachePremium.php")){
|
177 |
include_once $this->get_premium_path("mobile-cache.php");
|
|
|
178 |
|
|
|
|
|
|
|
|
|
|
|
179 |
if(file_exists(WPFC_WP_PLUGIN_DIR."/wp-fastest-cache-premium/pro/library/statics.php")){
|
180 |
include_once $this->get_premium_path("statics.php");
|
181 |
}
|
182 |
+
|
183 |
+
if(!defined('DOING_AJAX')){
|
184 |
+
include_once $this->get_premium_path("powerful-html.php");
|
185 |
+
}
|
186 |
}
|
187 |
|
188 |
if(is_admin()){
|
189 |
+
add_action('wp_loaded', array($this, "load_column"));
|
190 |
+
|
191 |
+
if(defined('DOING_AJAX') && DOING_AJAX){
|
192 |
+
//do nothing
|
193 |
+
}else{
|
194 |
+
// to avoid loading menu and optionPage() twice
|
195 |
+
if(!class_exists("WpFastestCacheAdmin")){
|
196 |
+
//for wp-panel
|
197 |
+
|
198 |
+
if($this->isPluginActive("wp-fastest-cache-premium/wpFastestCachePremium.php")){
|
199 |
+
include_once $this->get_premium_path("image.php");
|
200 |
+
}
|
201 |
|
202 |
+
if($this->isPluginActive("wp-fastest-cache-premium/wpFastestCachePremium.php")){
|
203 |
+
include_once $this->get_premium_path("logs.php");
|
204 |
+
}
|
205 |
|
206 |
+
add_action('plugins_loaded', array($this, 'wpfc_load_plugin_textdomain'));
|
207 |
+
add_action('wp_loaded', array($this, "load_admin_toolbar"));
|
|
|
|
|
208 |
|
209 |
+
$this->admin();
|
210 |
+
}
|
211 |
}
|
212 |
}else{
|
213 |
if(preg_match("/wpfc-minified\/([^\/]+)\/([^\/]+)/", $this->current_url(), $path)){
|
247 |
}
|
248 |
}
|
249 |
|
250 |
+
public function set_content_url(){
|
251 |
+
$content_url = content_url();
|
252 |
+
|
253 |
+
// Hide My WP
|
254 |
+
if($this->isPluginActive('hide_my_wp/hide-my-wp.php')){
|
255 |
+
$hide_my_wp = get_option("hide_my_wp");
|
256 |
+
|
257 |
+
if(isset($hide_my_wp["new_content_path"]) && $hide_my_wp["new_content_path"]){
|
258 |
+
$hide_my_wp["new_content_path"] = trim($hide_my_wp["new_content_path"], "/");
|
259 |
+
$content_url = str_replace(basename(WPFC_WP_CONTENT_DIR), $hide_my_wp["new_content_path"], $content_url);
|
260 |
+
}
|
261 |
+
}
|
262 |
+
|
263 |
+
if (!defined('WPFC_WP_CONTENT_URL')) {
|
264 |
+
define("WPFC_WP_CONTENT_URL", $content_url);
|
265 |
+
}
|
266 |
+
}
|
267 |
+
|
268 |
public function clear_cache_on_kksr_rate($id){
|
269 |
$this->singleDeleteCache(false, $id);
|
270 |
}
|
751 |
if($show){
|
752 |
include_once plugin_dir_path(__FILE__)."inc/admin-toolbar.php";
|
753 |
|
|
|
|
|
|
|
|
|
754 |
$toolbar = new WpFastestCacheAdminToolbar();
|
755 |
$toolbar->add();
|
756 |
}
|
824 |
$wpfc->createCache();
|
825 |
}
|
826 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
827 |
protected function slug(){
|
828 |
return "wp_fastest_cache";
|
829 |
}
|
902 |
|
903 |
if($new_status == "trash" && $old_status == "publish"){
|
904 |
$this->singleDeleteCache(false, $post->ID);
|
905 |
+
}else if(($new_status == "draft" || $new_status == "pending" || $new_status == "private") && $old_status == "publish"){
|
906 |
$this->deleteCache();
|
907 |
}
|
908 |
}
|
925 |
public function singleDeleteCache($comment_id = false, $post_id = false){
|
926 |
$to_clear_parents = true;
|
927 |
|
928 |
+
// not to clear cache of homepage/cats/tags after ajax request by other plugins
|
929 |
+
if(isset($_POST) && isset($_POST["action"])){
|
930 |
+
// kk Star Rating
|
931 |
+
if($_POST["action"] == "kksr_ajax"){
|
932 |
+
$to_clear_parents = false;
|
933 |
+
}
|
934 |
+
|
935 |
+
// All In One Schema.org Rich Snippets
|
936 |
+
if(preg_match("/bsf_(update|submit)_rating/i", $_POST["action"])){
|
937 |
+
$to_clear_parents = false;
|
938 |
+
}
|
939 |
+
|
940 |
+
// Yet Another Stars Rating
|
941 |
+
if($_POST["action"] == "yasr_send_visitor_rating"){
|
942 |
+
$to_clear_parents = false;
|
943 |
+
$post_id = $_POST["post_id"];
|
944 |
+
}
|
945 |
+
}
|
946 |
+
|
947 |
if($comment_id){
|
948 |
$comment_id = intval($comment_id);
|
949 |
|
993 |
$this->rm_folder_recursively($mobile_path);
|
994 |
}
|
995 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
996 |
|
997 |
if($to_clear_parents){
|
998 |
// to clear cache of homepage
|
1162 |
}
|
1163 |
}
|
1164 |
|
1165 |
+
add_action($this->slug()."_Preload", array($this, 'create_preload_cache'), 11);
|
1166 |
}
|
1167 |
|
1168 |
public function set_preload(){
|
1248 |
|
1249 |
|
1250 |
// HOME
|
1251 |
+
if(isset($pre_load->homepage) && $pre_load->homepage > -1){
|
1252 |
if($mobile_theme){
|
1253 |
array_push($urls, array("url" => get_option("home"), "user-agent" => "mobile"));
|
1254 |
$number--;
|
1360 |
// ));
|
1361 |
|
1362 |
global $wpdb;
|
1363 |
+
$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);
|
1364 |
|
1365 |
if(count($categories) > 0){
|
1366 |
foreach ($categories as $key => $category) {
|