Version Description
- to fix error which is Undefined index: SERVER_PORT
- to prevent running preload when cache is disabled
- to change saving options and notice system
- to replace image urls of woocommerce variable with cdn-url
- to fix url() problem for data:font/opentype
- to add add_action('wp') for detection current page type
- to support non-latin characters for clearing category cache
- to show cache if the url contains fbclid (Facebook Click Identifier)
- to show cache if the url contains gclid (Google Click Identifier)
Download this release
Release Info
Developer | emrevona |
Plugin | WP Fastest Cache |
Version | 0.8.8.7 |
Comparing to | |
See all releases |
Code changes from version 0.8.8.6 to 0.8.8.7
- inc/admin.php +29 -16
- inc/cache.php +29 -3
- inc/css-utilities.php +3 -1
- readme.txt +13 -2
- uninstall.php +3 -0
- wpFastestCache.php +39 -6
inc/admin.php
CHANGED
@@ -10,9 +10,6 @@
|
|
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 |
-
|
16 |
$this->setCronJobSettings();
|
17 |
$this->addButtonOnEditor();
|
18 |
add_action('admin_enqueue_scripts', array($this, 'addJavaScript'));
|
@@ -116,7 +113,7 @@
|
|
116 |
include_once ABSPATH."wp-includes/pluggable.php";
|
117 |
|
118 |
if(is_multisite()){
|
119 |
-
$this->
|
120 |
return 0;
|
121 |
}
|
122 |
|
@@ -214,6 +211,11 @@
|
|
214 |
|
215 |
public function saveOption(){
|
216 |
unset($_POST["wpFastestCachePage"]);
|
|
|
|
|
|
|
|
|
|
|
217 |
$data = json_encode($_POST);
|
218 |
//for optionsPage() $_POST is array and json_decode() converts to stdObj
|
219 |
$this->options = json_decode($data);
|
@@ -243,6 +245,8 @@
|
|
243 |
}
|
244 |
}
|
245 |
}
|
|
|
|
|
246 |
}
|
247 |
|
248 |
public function checkCachePathWriteable(){
|
@@ -298,7 +302,7 @@
|
|
298 |
// }
|
299 |
|
300 |
if(!file_exists($path.".htaccess")){
|
301 |
-
if(isset($_SERVER["SERVER_SOFTWARE"]) && $_SERVER["SERVER_SOFTWARE"] && preg_match("/nginx/i", $_SERVER["SERVER_SOFTWARE"])){
|
302 |
//
|
303 |
}else{
|
304 |
return array("<label>.htaccess was not found</label> <a target='_blank' href='http://www.wpfastestcache.com/warnings/htaccess-was-not-found/'>Read More</a>", "error");
|
@@ -374,10 +378,10 @@
|
|
374 |
|
375 |
file_put_contents($path.".htaccess", $htaccess);
|
376 |
}else{
|
377 |
-
return array("Options have been saved", "
|
378 |
//return array(".htaccess is not writable", "error");
|
379 |
}
|
380 |
-
return array("Options have been saved", "
|
381 |
|
382 |
}
|
383 |
|
@@ -808,8 +812,6 @@
|
|
808 |
}
|
809 |
|
810 |
public function optionsPage(){
|
811 |
-
$this->systemMessage = count($this->systemMessage) > 0 ? $this->systemMessage : $this->getSystemMessage();
|
812 |
-
|
813 |
$wpFastestCacheCombineCss = isset($this->options->wpFastestCacheCombineCss) ? 'checked="checked"' : "";
|
814 |
$wpFastestCacheGoogleFonts = isset($this->options->wpFastestCacheGoogleFonts) ? 'checked="checked"' : "";
|
815 |
$wpFastestCacheGzip = isset($this->options->wpFastestCacheGzip) ? 'checked="checked"' : "";
|
@@ -873,9 +875,9 @@
|
|
873 |
<div class="wrap">
|
874 |
|
875 |
<h2>WP Fastest Cache Options</h2>
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
<div class="tabGroup">
|
880 |
<?php
|
881 |
$tabs = array(array("id"=>"wpfc-options","title"=>"Settings"),
|
@@ -907,7 +909,9 @@
|
|
907 |
?>
|
908 |
<br>
|
909 |
<div class="tab1" style="padding-left:10px;">
|
910 |
-
<form method="post" name="wp_manager">
|
|
|
|
|
911 |
<input type="hidden" value="options" name="wpFastestCachePage">
|
912 |
<div class="questionCon">
|
913 |
<div class="question">Cache System</div>
|
@@ -1254,7 +1258,14 @@
|
|
1254 |
"tr" => "Türkçe"
|
1255 |
);
|
1256 |
foreach($lang_array as $lang_array_key => $lang_array_value){
|
1257 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1258 |
echo '<option '.$option_selected.' value="'.$lang_array_key.'">'.$lang_array_value.'</option>';
|
1259 |
}
|
1260 |
?>
|
@@ -1325,7 +1336,8 @@
|
|
1325 |
}
|
1326 |
?>
|
1327 |
<h2 id="delete-cache-h2" style="padding-left:20px;padding-bottom:10px;">Delete Cache</h2>
|
1328 |
-
<form method="post" name="wp_manager" class="delete-line">
|
|
|
1329 |
<input type="hidden" value="deleteCache" name="wpFastestCachePage">
|
1330 |
<div class="questionCon qsubmit left">
|
1331 |
<div class="submit"><input type="submit" value="Delete Cache" class="button-primary"></div>
|
@@ -1337,7 +1349,8 @@
|
|
1337 |
</div>
|
1338 |
</div>
|
1339 |
</form>
|
1340 |
-
<form method="post" name="wp_manager" class="delete-line" style="height: 120px;">
|
|
|
1341 |
<input type="hidden" value="deleteCssAndJsCache" name="wpFastestCachePage">
|
1342 |
<div class="questionCon qsubmit left">
|
1343 |
<div class="submit"><input type="submit" value="Delete Cache and Minified CSS/JS" class="button-primary"></div>
|
10 |
public function __construct(){
|
11 |
$this->options = $this->getOptions();
|
12 |
|
|
|
|
|
|
|
13 |
$this->setCronJobSettings();
|
14 |
$this->addButtonOnEditor();
|
15 |
add_action('admin_enqueue_scripts', array($this, 'addJavaScript'));
|
113 |
include_once ABSPATH."wp-includes/pluggable.php";
|
114 |
|
115 |
if(is_multisite()){
|
116 |
+
$this->notify(array("The plugin does not work with Multisite", "error"));
|
117 |
return 0;
|
118 |
}
|
119 |
|
211 |
|
212 |
public function saveOption(){
|
213 |
unset($_POST["wpFastestCachePage"]);
|
214 |
+
unset($_POST["option_page"]);
|
215 |
+
unset($_POST["action"]);
|
216 |
+
unset($_POST["_wpnonce"]);
|
217 |
+
unset($_POST["_wp_http_referer"]);
|
218 |
+
|
219 |
$data = json_encode($_POST);
|
220 |
//for optionsPage() $_POST is array and json_decode() converts to stdObj
|
221 |
$this->options = json_decode($data);
|
245 |
}
|
246 |
}
|
247 |
}
|
248 |
+
|
249 |
+
$this->notify($this->systemMessage);
|
250 |
}
|
251 |
|
252 |
public function checkCachePathWriteable(){
|
302 |
// }
|
303 |
|
304 |
if(!file_exists($path.".htaccess")){
|
305 |
+
if(isset($_SERVER["SERVER_SOFTWARE"]) && $_SERVER["SERVER_SOFTWARE"] && (preg_match("/iis/i", $_SERVER["SERVER_SOFTWARE"]) || preg_match("/nginx/i", $_SERVER["SERVER_SOFTWARE"]))){
|
306 |
//
|
307 |
}else{
|
308 |
return array("<label>.htaccess was not found</label> <a target='_blank' href='http://www.wpfastestcache.com/warnings/htaccess-was-not-found/'>Read More</a>", "error");
|
378 |
|
379 |
file_put_contents($path.".htaccess", $htaccess);
|
380 |
}else{
|
381 |
+
return array("Options have been saved", "updated");
|
382 |
//return array(".htaccess is not writable", "error");
|
383 |
}
|
384 |
+
return array("Options have been saved", "updated");
|
385 |
|
386 |
}
|
387 |
|
812 |
}
|
813 |
|
814 |
public function optionsPage(){
|
|
|
|
|
815 |
$wpFastestCacheCombineCss = isset($this->options->wpFastestCacheCombineCss) ? 'checked="checked"' : "";
|
816 |
$wpFastestCacheGoogleFonts = isset($this->options->wpFastestCacheGoogleFonts) ? 'checked="checked"' : "";
|
817 |
$wpFastestCacheGzip = isset($this->options->wpFastestCacheGzip) ? 'checked="checked"' : "";
|
875 |
<div class="wrap">
|
876 |
|
877 |
<h2>WP Fastest Cache Options</h2>
|
878 |
+
|
879 |
+
<?php settings_errors("wpfc-notice"); ?>
|
880 |
+
|
881 |
<div class="tabGroup">
|
882 |
<?php
|
883 |
$tabs = array(array("id"=>"wpfc-options","title"=>"Settings"),
|
909 |
?>
|
910 |
<br>
|
911 |
<div class="tab1" style="padding-left:10px;">
|
912 |
+
<form method="post" name="wp_manager" action="options.php">
|
913 |
+
<?php settings_fields( 'wpfc-group' ); ?>
|
914 |
+
|
915 |
<input type="hidden" value="options" name="wpFastestCachePage">
|
916 |
<div class="questionCon">
|
917 |
<div class="question">Cache System</div>
|
1258 |
"tr" => "Türkçe"
|
1259 |
);
|
1260 |
foreach($lang_array as $lang_array_key => $lang_array_value){
|
1261 |
+
if(isset($this->options->wpFastestCacheLanguage) && $this->options->wpFastestCacheLanguage == $lang_array_key){
|
1262 |
+
$option_selected = 'selected="selected"';
|
1263 |
+
}else if($lang_array_key == "eng"){
|
1264 |
+
$option_selected = 'selected="selected"';
|
1265 |
+
}else{
|
1266 |
+
$option_selected = "";
|
1267 |
+
}
|
1268 |
+
|
1269 |
echo '<option '.$option_selected.' value="'.$lang_array_key.'">'.$lang_array_value.'</option>';
|
1270 |
}
|
1271 |
?>
|
1336 |
}
|
1337 |
?>
|
1338 |
<h2 id="delete-cache-h2" style="padding-left:20px;padding-bottom:10px;">Delete Cache</h2>
|
1339 |
+
<form method="post" name="wp_manager" class="delete-line" action="options.php">
|
1340 |
+
<?php settings_fields( 'wpfc-group' ); ?>
|
1341 |
<input type="hidden" value="deleteCache" name="wpFastestCachePage">
|
1342 |
<div class="questionCon qsubmit left">
|
1343 |
<div class="submit"><input type="submit" value="Delete Cache" class="button-primary"></div>
|
1349 |
</div>
|
1350 |
</div>
|
1351 |
</form>
|
1352 |
+
<form method="post" name="wp_manager" class="delete-line" style="height: 120px;" action="options.php">
|
1353 |
+
<?php settings_fields( 'wpfc-group' ); ?>
|
1354 |
<input type="hidden" value="deleteCssAndJsCache" name="wpFastestCachePage">
|
1355 |
<div class="questionCon qsubmit left">
|
1356 |
<div class="submit"><input type="submit" value="Delete Cache and Minified CSS/JS" class="button-primary"></div>
|
inc/cache.php
CHANGED
@@ -118,6 +118,10 @@
|
|
118 |
if(!preg_match("/\/$/", $_SERVER["REQUEST_URI"])){
|
119 |
if(defined('WPFC_CACHE_QUERYSTRING') && WPFC_CACHE_QUERYSTRING){
|
120 |
|
|
|
|
|
|
|
|
|
121 |
}else if(preg_match("/utm_(source|medium|campaign|content|term)/i", $this->cacheFilePath)){
|
122 |
|
123 |
}else{
|
@@ -130,7 +134,7 @@
|
|
130 |
}
|
131 |
}
|
132 |
|
133 |
-
$this->
|
134 |
|
135 |
// to decode path if it is not utf-8
|
136 |
if($this->cacheFilePath){
|
@@ -138,9 +142,25 @@
|
|
138 |
}
|
139 |
}
|
140 |
|
141 |
-
public function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
//to remove query strings for cache if google analytics parameters are set
|
143 |
if(preg_match("/utm_(source|medium|campaign|content|term)/i", $this->cacheFilePath)){
|
|
|
|
|
|
|
|
|
144 |
if(strlen($_SERVER["REQUEST_URI"]) > 1){ // for the sub-pages
|
145 |
|
146 |
$this->cacheFilePath = preg_replace("/\/*\?.+/", "", $this->cacheFilePath);
|
@@ -374,6 +394,8 @@
|
|
374 |
if($create_cache){
|
375 |
$this->startTime = microtime(true);
|
376 |
|
|
|
|
|
377 |
add_action('get_footer', array($this, "detect_current_page_type"));
|
378 |
add_action('get_footer', array($this, "wp_print_scripts_action"));
|
379 |
|
@@ -761,6 +783,10 @@
|
|
761 |
// jsFileLocation:"//domain.com/wp-content/plugins/revslider/public/assets/js/"
|
762 |
// </script>
|
763 |
$content = preg_replace_callback("/(jsFileLocation)\s*\:[\"\']([^\"\']+)[\"\']/i", array($this, 'cdn_replace_urls'), $content);
|
|
|
|
|
|
|
|
|
764 |
}
|
765 |
|
766 |
return $content;
|
@@ -831,7 +857,7 @@
|
|
831 |
$name = "";
|
832 |
|
833 |
foreach ($arr as $tag_key => $tag_value){
|
834 |
-
$tmp = preg_replace("
|
835 |
$name = $name.$tmp;
|
836 |
}
|
837 |
|
118 |
if(!preg_match("/\/$/", $_SERVER["REQUEST_URI"])){
|
119 |
if(defined('WPFC_CACHE_QUERYSTRING') && WPFC_CACHE_QUERYSTRING){
|
120 |
|
121 |
+
}else if(preg_match("/gclid\=/i", $this->cacheFilePath)){
|
122 |
+
|
123 |
+
}else if(preg_match("/fbclid\=/i", $this->cacheFilePath)){
|
124 |
+
|
125 |
}else if(preg_match("/utm_(source|medium|campaign|content|term)/i", $this->cacheFilePath)){
|
126 |
|
127 |
}else{
|
134 |
}
|
135 |
}
|
136 |
|
137 |
+
$this->remove_url_paramters();
|
138 |
|
139 |
// to decode path if it is not utf-8
|
140 |
if($this->cacheFilePath){
|
142 |
}
|
143 |
}
|
144 |
|
145 |
+
public function remove_url_paramters(){
|
146 |
+
$action = false;
|
147 |
+
|
148 |
+
//to remove query strings for cache if Google Click Identifier are set
|
149 |
+
if(preg_match("/gclid\=/i", $this->cacheFilePath)){
|
150 |
+
$action = true;
|
151 |
+
}
|
152 |
+
|
153 |
+
//to remove query strings for cache if facebook parameters are set
|
154 |
+
if(preg_match("/fbclid\=/i", $this->cacheFilePath)){
|
155 |
+
$action = true;
|
156 |
+
}
|
157 |
+
|
158 |
//to remove query strings for cache if google analytics parameters are set
|
159 |
if(preg_match("/utm_(source|medium|campaign|content|term)/i", $this->cacheFilePath)){
|
160 |
+
$action = true;
|
161 |
+
}
|
162 |
+
|
163 |
+
if($action){
|
164 |
if(strlen($_SERVER["REQUEST_URI"]) > 1){ // for the sub-pages
|
165 |
|
166 |
$this->cacheFilePath = preg_replace("/\/*\?.+/", "", $this->cacheFilePath);
|
394 |
if($create_cache){
|
395 |
$this->startTime = microtime(true);
|
396 |
|
397 |
+
|
398 |
+
add_action('wp', array($this, "detect_current_page_type"));
|
399 |
add_action('get_footer', array($this, "detect_current_page_type"));
|
400 |
add_action('get_footer', array($this, "wp_print_scripts_action"));
|
401 |
|
783 |
// jsFileLocation:"//domain.com/wp-content/plugins/revslider/public/assets/js/"
|
784 |
// </script>
|
785 |
$content = preg_replace_callback("/(jsFileLocation)\s*\:[\"\']([^\"\']+)[\"\']/i", array($this, 'cdn_replace_urls'), $content);
|
786 |
+
|
787 |
+
|
788 |
+
// <form data-product_variations="[{"src":"//domain.com\/img.jpg"}]">
|
789 |
+
$content = preg_replace_callback("/data-product_variations\=[\"\'][^\"\']+[\"\']/i", array($this, 'cdn_replace_urls'), $content);
|
790 |
}
|
791 |
|
792 |
return $content;
|
857 |
$name = "";
|
858 |
|
859 |
foreach ($arr as $tag_key => $tag_value){
|
860 |
+
$tmp = preg_replace("/(\.css|\.js)\?.*/", "$1", $tag_value["href"]); //to remove version number
|
861 |
$name = $name.$tmp;
|
862 |
}
|
863 |
|
inc/css-utilities.php
CHANGED
@@ -401,7 +401,9 @@
|
|
401 |
public function newImgPath($matches){
|
402 |
$matches[1] = trim($matches[1]);
|
403 |
|
404 |
-
if(preg_match("/data\:
|
|
|
|
|
405 |
$matches[1] = $matches[1];
|
406 |
}else{
|
407 |
$matches[1] = str_replace(array("\"","'"), "", $matches[1]);
|
401 |
public function newImgPath($matches){
|
402 |
$matches[1] = trim($matches[1]);
|
403 |
|
404 |
+
if(preg_match("/data\:font\/opentype/i", $matches[1])){
|
405 |
+
$matches[1] = $matches[1];
|
406 |
+
}else if(preg_match("/data\:image\/svg\+xml/i", $matches[1])){
|
407 |
$matches[1] = $matches[1];
|
408 |
}else{
|
409 |
$matches[1] = str_replace(array("\"","'"), "", $matches[1]);
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== WP Fastest Cache ===
|
2 |
Contributors: emrevona
|
3 |
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,17 @@ Wpfc does not support Wordpress Multisite yet.
|
|
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
|
1 |
=== WP Fastest Cache ===
|
2 |
Contributors: emrevona
|
3 |
Donate link: http://profiles.wordpress.org/emrevona/
|
4 |
+
Tags: cache, performance, wp-cache, total cache, super cache, cdn
|
5 |
Requires at least: 3.3
|
6 |
Tested up to: 4.9
|
7 |
+
Stable tag: 0.8.8.7
|
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.7 =
|
107 |
+
* to fix error which is Undefined index: SERVER_PORT
|
108 |
+
* to prevent running preload when cache is disabled
|
109 |
+
* to change saving options and notice system
|
110 |
+
* to replace image urls of woocommerce variable with cdn-url
|
111 |
+
* to fix url() problem for data:font/opentype
|
112 |
+
* to add add_action('wp') for detection current page type
|
113 |
+
* to support non-latin characters for clearing category cache
|
114 |
+
* to show cache if the url contains “fbclid” (Facebook Click Identifier)
|
115 |
+
* to show cache if the url contains “gclid” (Google Click Identifier)
|
116 |
+
|
117 |
= 0.8.8.6 =
|
118 |
* to show single clear cache button for the pages
|
119 |
* to show warning if wp cron is disabled when a cache timeout rule is added
|
uninstall.php
CHANGED
@@ -27,6 +27,9 @@
|
|
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 ) {
|
27 |
delete_option("WpFastestCacheJS");
|
28 |
delete_option("WpFastestCacheJSSIZE");
|
29 |
delete_option("wpfc_server_location");
|
30 |
+
delete_option("wpfc-group");
|
31 |
+
delete_option("WpFc_credit");
|
32 |
+
delete_option("WpFc_api_key");
|
33 |
|
34 |
foreach ((array)_get_cron_array() as $cron_key => $cron_value) {
|
35 |
foreach ( (array) $cron_value as $hook => $events ) {
|
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
|
@@ -281,6 +281,14 @@ GNU General Public License for more details.
|
|
281 |
}
|
282 |
}
|
283 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
284 |
public function set_content_url(){
|
285 |
$content_url = content_url();
|
286 |
|
@@ -629,9 +637,25 @@ GNU General Public License for more details.
|
|
629 |
}
|
630 |
}
|
631 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
632 |
public function register_my_custom_menu_page(){
|
633 |
if(function_exists('add_menu_page')){
|
634 |
add_menu_page("WP Fastest Cache Settings", "WP Fastest Cache", 'manage_options', "wpfastestcacheoptions", array($this, 'optionsPage'), plugins_url("wp-fastest-cache/images/icon-32x32.png"));
|
|
|
|
|
635 |
wp_enqueue_style("wp-fastest-cache", plugins_url("wp-fastest-cache/css/style.css"), array(), time(), "all");
|
636 |
}
|
637 |
|
@@ -902,6 +926,7 @@ GNU General Public License for more details.
|
|
902 |
if(preg_match("/^http/", $url)){
|
903 |
$path = preg_replace("/https?\:\/\/[^\/]+/i", "", $url);
|
904 |
$path = trim($path, "/");
|
|
|
905 |
|
906 |
// to remove the cache of tag/cat
|
907 |
@unlink($this->getWpContentDir()."/cache/all/".$path."/index.html");
|
@@ -1037,7 +1062,7 @@ GNU General Public License for more details.
|
|
1037 |
if($created_tmpWpfc && $cache_deleted && $minifed_deleted){
|
1038 |
do_action('wpfc_delete_cache');
|
1039 |
|
1040 |
-
$this->
|
1041 |
|
1042 |
if($this->isPluginActive("wp-fastest-cache-premium/wpFastestCachePremium.php")){
|
1043 |
include_once $this->get_premium_path("logs.php");
|
@@ -1046,7 +1071,7 @@ GNU General Public License for more details.
|
|
1046 |
$log->action();
|
1047 |
}
|
1048 |
}else{
|
1049 |
-
$this->
|
1050 |
}
|
1051 |
|
1052 |
// for ajax request
|
@@ -1136,11 +1161,16 @@ GNU General Public License for more details.
|
|
1136 |
|
1137 |
public function create_preload_cache(){
|
1138 |
if($data = get_option("WpFastestCachePreLoad")){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1139 |
$count_posts = wp_count_posts("post");
|
1140 |
$count_pages = wp_count_posts('page');
|
1141 |
|
1142 |
-
$this->options = $this->getOptions();
|
1143 |
-
|
1144 |
$pre_load = json_decode($data);
|
1145 |
|
1146 |
if(defined("WPFC_PRELOAD_NUMBER") && WPFC_PRELOAD_NUMBER){
|
@@ -1845,7 +1875,10 @@ GNU General Public License for more details.
|
|
1845 |
}
|
1846 |
}
|
1847 |
|
1848 |
-
if(preg_match("
|
|
|
|
|
|
|
1849 |
$matches[0] = preg_replace("/(http(s?)\:)?".preg_quote("\/\/", "/")."(www\.)?/i", "", $matches[0]);
|
1850 |
$matches[0] = preg_replace("/".preg_quote($cdn->originurl, "/")."/i", $cdnurl, $matches[0]);
|
1851 |
}else if(isset($matches[2]) && preg_match("/".preg_quote($cdn->originurl, "/")."/", $matches[2])){
|
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
|
7 |
Author: Emre Vona
|
8 |
Author URI: http://tr.linkedin.com/in/emrevona
|
9 |
Text Domain: wp-fastest-cache
|
281 |
}
|
282 |
}
|
283 |
|
284 |
+
public function notify($message = array()){
|
285 |
+
if(isset($message[0]) && $message[0]){
|
286 |
+
if(function_exists("add_settings_error")){
|
287 |
+
add_settings_error('wpfc-notice', esc_attr( 'settings_updated' ), $message[0], $message[1]);
|
288 |
+
}
|
289 |
+
}
|
290 |
+
}
|
291 |
+
|
292 |
public function set_content_url(){
|
293 |
$content_url = content_url();
|
294 |
|
637 |
}
|
638 |
}
|
639 |
|
640 |
+
public function tmp_saveOption(){
|
641 |
+
if(!empty($_POST)){
|
642 |
+
if(isset($_POST["wpFastestCachePage"])){
|
643 |
+
include_once('inc/admin.php');
|
644 |
+
$wpfc = new WpFastestCacheAdmin();
|
645 |
+
$wpfc->optionsPageRequest();
|
646 |
+
}
|
647 |
+
}
|
648 |
+
}
|
649 |
+
|
650 |
+
public function register_mysettings(){
|
651 |
+
register_setting('wpfc-group', 'wpfc-group', array($this, 'tmp_saveOption'));
|
652 |
+
}
|
653 |
+
|
654 |
public function register_my_custom_menu_page(){
|
655 |
if(function_exists('add_menu_page')){
|
656 |
add_menu_page("WP Fastest Cache Settings", "WP Fastest Cache", 'manage_options', "wpfastestcacheoptions", array($this, 'optionsPage'), plugins_url("wp-fastest-cache/images/icon-32x32.png"));
|
657 |
+
add_action('admin_init', array($this, 'register_mysettings'));
|
658 |
+
|
659 |
wp_enqueue_style("wp-fastest-cache", plugins_url("wp-fastest-cache/css/style.css"), array(), time(), "all");
|
660 |
}
|
661 |
|
926 |
if(preg_match("/^http/", $url)){
|
927 |
$path = preg_replace("/https?\:\/\/[^\/]+/i", "", $url);
|
928 |
$path = trim($path, "/");
|
929 |
+
$path = urldecode($path);
|
930 |
|
931 |
// to remove the cache of tag/cat
|
932 |
@unlink($this->getWpContentDir()."/cache/all/".$path."/index.html");
|
1062 |
if($created_tmpWpfc && $cache_deleted && $minifed_deleted){
|
1063 |
do_action('wpfc_delete_cache');
|
1064 |
|
1065 |
+
$this->notify(array("All cache files have been deleted", "updated"));
|
1066 |
|
1067 |
if($this->isPluginActive("wp-fastest-cache-premium/wpFastestCachePremium.php")){
|
1068 |
include_once $this->get_premium_path("logs.php");
|
1071 |
$log->action();
|
1072 |
}
|
1073 |
}else{
|
1074 |
+
$this->notify(array("Permissions Problem: <a href='http://www.wpfastestcache.com/warnings/delete-cache-problem-related-to-permission/' target='_blank'>Read More</a>", "error"));
|
1075 |
}
|
1076 |
|
1077 |
// for ajax request
|
1161 |
|
1162 |
public function create_preload_cache(){
|
1163 |
if($data = get_option("WpFastestCachePreLoad")){
|
1164 |
+
$this->options = $this->getOptions();
|
1165 |
+
|
1166 |
+
if(!isset($this->options->wpFastestCacheStatus)){
|
1167 |
+
die("Cache System must be enabled");
|
1168 |
+
}
|
1169 |
+
|
1170 |
+
|
1171 |
$count_posts = wp_count_posts("post");
|
1172 |
$count_pages = wp_count_posts('page');
|
1173 |
|
|
|
|
|
1174 |
$pre_load = json_decode($data);
|
1175 |
|
1176 |
if(defined("WPFC_PRELOAD_NUMBER") && WPFC_PRELOAD_NUMBER){
|
1875 |
}
|
1876 |
}
|
1877 |
|
1878 |
+
if(preg_match("/data-product_variations\=[\"\'][^\"\']+[\"\']/i", $matches[0])){
|
1879 |
+
$matches[0] = preg_replace("/(http(s?)\:)?".preg_quote("\/\/", "/")."(www\.)?/i", "", $matches[0]);
|
1880 |
+
$matches[0] = preg_replace("/".preg_quote($cdn->originurl, "/")."/i", $cdnurl, $matches[0]);
|
1881 |
+
}else if(preg_match("/\{\"concatemoji\"\:\"[^\"]+\"\}/i", $matches[0])){
|
1882 |
$matches[0] = preg_replace("/(http(s?)\:)?".preg_quote("\/\/", "/")."(www\.)?/i", "", $matches[0]);
|
1883 |
$matches[0] = preg_replace("/".preg_quote($cdn->originurl, "/")."/i", $cdnurl, $matches[0]);
|
1884 |
}else if(isset($matches[2]) && preg_match("/".preg_quote($cdn->originurl, "/")."/", $matches[2])){
|