Version Description
- [FEATURE] to add Re-Order feture for Preload [Details]
- to add WPFC_DISABLE_CLEARING_CACHE_AFTER_WOOCOMMERCE_CHECKOUT_ORDER_PROCESSED
Download this release
Release Info
Developer | emrevona |
Plugin | WP Fastest Cache |
Version | 0.9.1.5 |
Comparing to | |
See all releases |
Code changes from version 0.9.1.4 to 0.9.1.5
- inc/admin.php +19 -57
- inc/preload.php +218 -159
- readme.txt +6 -2
- templates/preload.php +142 -9
- wpFastestCache.php +6 -3
inc/admin.php
CHANGED
@@ -506,6 +506,21 @@
|
|
506 |
if(preg_match("/".preg_quote($homeurl_base_name[1], "/")."$/", trim(ABSPATH, "/"))){
|
507 |
$basename = $homeurl_base_name[1]."/".$basename;
|
508 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
509 |
}
|
510 |
}else{
|
511 |
/*
|
@@ -521,7 +536,9 @@
|
|
521 |
$RewriteCond = "RewriteCond %{DOCUMENT_ROOT}/".$basename." -f"."\n";
|
522 |
}else{
|
523 |
// to escape spaces
|
524 |
-
$tmp_ABSPATH
|
|
|
|
|
525 |
|
526 |
$RewriteCond = "RewriteCond %{DOCUMENT_ROOT}/".$basename." -f [or]"."\n";
|
527 |
$RewriteCond = $RewriteCond."RewriteCond ".$tmp_ABSPATH."$1.webp -f"."\n";
|
@@ -970,6 +987,7 @@
|
|
970 |
$wpFastestCachePreload_attachment = isset($this->options->wpFastestCachePreload_attachment) ? 'checked="checked"' : "";
|
971 |
$wpFastestCachePreload_number = isset($this->options->wpFastestCachePreload_number) ? esc_attr($this->options->wpFastestCachePreload_number) : 4;
|
972 |
$wpFastestCachePreload_restart = isset($this->options->wpFastestCachePreload_restart) ? 'checked="checked"' : "";
|
|
|
973 |
|
974 |
|
975 |
|
@@ -2182,62 +2200,6 @@
|
|
2182 |
</div>
|
2183 |
</div>
|
2184 |
</div>
|
2185 |
-
<script type="text/javascript">
|
2186 |
-
var WPFC_SPINNER = {
|
2187 |
-
id: false,
|
2188 |
-
number: false,
|
2189 |
-
init: function(id, number){
|
2190 |
-
this.id = id;
|
2191 |
-
//this.number = number;
|
2192 |
-
this.set_number();
|
2193 |
-
this.click_event();
|
2194 |
-
},
|
2195 |
-
set_number: function(){
|
2196 |
-
this.number = jQuery("#" + this.id + " input.wpfc-form-spinner-input").val();
|
2197 |
-
this.number = parseInt(this.number);
|
2198 |
-
},
|
2199 |
-
click_event: function(){
|
2200 |
-
var id = this.id;
|
2201 |
-
var number = this.number;
|
2202 |
-
|
2203 |
-
jQuery("#" + this.id + " .wpfc-form-spinner-up, #" + this.id + " .wpfc-form-spinner-down").click(function(e){
|
2204 |
-
if(jQuery(this).attr('class').match(/up$/)){
|
2205 |
-
number = number + 2;
|
2206 |
-
}else if(jQuery(this).attr('class').match(/down$/)){
|
2207 |
-
number = number - 2;
|
2208 |
-
}
|
2209 |
-
|
2210 |
-
number = number < 2 ? 2 : number;
|
2211 |
-
number = number > 12 ? 12 : number;
|
2212 |
-
|
2213 |
-
jQuery("#" + id + " .wpfc-form-spinner-number").text(number);
|
2214 |
-
jQuery("#" + id + " input.wpfc-form-spinner-input").val(number);
|
2215 |
-
});
|
2216 |
-
}
|
2217 |
-
};
|
2218 |
-
</script>
|
2219 |
-
<script type="text/javascript">
|
2220 |
-
jQuery("#wpFastestCachePreload").click(function(){
|
2221 |
-
if(jQuery(this).is(':checked')){
|
2222 |
-
if(jQuery("div[id^='wpfc-modal-preload-']").length === 0){
|
2223 |
-
Wpfc_New_Dialog.dialog("wpfc-modal-preload", {close: function(){
|
2224 |
-
Wpfc_New_Dialog.clone.find("div.window-content input").each(function(){
|
2225 |
-
if(jQuery(this).is(':checked')){
|
2226 |
-
jQuery("div.tab1 div[template-id='wpfc-modal-preload'] div.window-content input[name='" + jQuery(this).attr("name") + "']").attr("checked", true);
|
2227 |
-
}else{
|
2228 |
-
jQuery("div.tab1 div[template-id='wpfc-modal-preload'] div.window-content input[name='" + jQuery(this).attr("name") + "']").attr("checked", false);
|
2229 |
-
}
|
2230 |
-
|
2231 |
-
Wpfc_New_Dialog.clone.remove();
|
2232 |
-
});
|
2233 |
-
}});
|
2234 |
-
|
2235 |
-
Wpfc_New_Dialog.show_button("close");
|
2236 |
-
WPFC_SPINNER.init("wpfc-form-spinner-preload", 6);
|
2237 |
-
}
|
2238 |
-
}
|
2239 |
-
});
|
2240 |
-
</script>
|
2241 |
|
2242 |
<?php if(!class_exists("WpFastestCacheImageOptimisation")){ ?>
|
2243 |
<div id="wpfc-premium-tooltip" style="display:none;width: 160px; height: 60px; position: absolute; margin-left: 354px; margin-top: 112px; color: white;">
|
506 |
if(preg_match("/".preg_quote($homeurl_base_name[1], "/")."$/", trim(ABSPATH, "/"))){
|
507 |
$basename = $homeurl_base_name[1]."/".$basename;
|
508 |
}
|
509 |
+
}else{
|
510 |
+
if(!preg_match("/\//", $homeurl_base_name[1]) && !preg_match("/\//", $siteurl_base_name[1])){
|
511 |
+
/*
|
512 |
+
site_url() return http://example.com/wordpress
|
513 |
+
home_url() returns http://example.com/blog
|
514 |
+
*/
|
515 |
+
|
516 |
+
$basename = $homeurl_base_name[1]."/".$basename;
|
517 |
+
$tmp_ABSPATH = str_replace(" ", "\ ", ABSPATH);
|
518 |
+
|
519 |
+
if(preg_match("/\/$/", $tmp_ABSPATH)){
|
520 |
+
$tmp_ABSPATH = rtrim($tmp_ABSPATH, "/");
|
521 |
+
$tmp_ABSPATH = dirname($tmp_ABSPATH)."/".$homeurl_base_name[1]."/";
|
522 |
+
}
|
523 |
+
}
|
524 |
}
|
525 |
}else{
|
526 |
/*
|
536 |
$RewriteCond = "RewriteCond %{DOCUMENT_ROOT}/".$basename." -f"."\n";
|
537 |
}else{
|
538 |
// to escape spaces
|
539 |
+
if(!isset($tmp_ABSPATH)){
|
540 |
+
$tmp_ABSPATH = str_replace(" ", "\ ", ABSPATH);
|
541 |
+
}
|
542 |
|
543 |
$RewriteCond = "RewriteCond %{DOCUMENT_ROOT}/".$basename." -f [or]"."\n";
|
544 |
$RewriteCond = $RewriteCond."RewriteCond ".$tmp_ABSPATH."$1.webp -f"."\n";
|
987 |
$wpFastestCachePreload_attachment = isset($this->options->wpFastestCachePreload_attachment) ? 'checked="checked"' : "";
|
988 |
$wpFastestCachePreload_number = isset($this->options->wpFastestCachePreload_number) ? esc_attr($this->options->wpFastestCachePreload_number) : 4;
|
989 |
$wpFastestCachePreload_restart = isset($this->options->wpFastestCachePreload_restart) ? 'checked="checked"' : "";
|
990 |
+
$wpFastestCachePreload_order = isset($this->options->wpFastestCachePreload_order) ? esc_attr($this->options->wpFastestCachePreload_order) : "";
|
991 |
|
992 |
|
993 |
|
2200 |
</div>
|
2201 |
</div>
|
2202 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2203 |
|
2204 |
<?php if(!class_exists("WpFastestCacheImageOptimisation")){ ?>
|
2205 |
<div id="wpfc-premium-tooltip" style="display:none;width: 160px; height: 60px; position: absolute; margin-left: 354px; margin-top: 112px; color: white;">
|
inc/preload.php
CHANGED
@@ -149,7 +149,34 @@
|
|
149 |
$number = $pre_load->number;
|
150 |
}
|
151 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
|
|
|
|
|
|
|
|
|
|
|
153 |
$urls_limit = isset($options->wpFastestCachePreload_number) ? $options->wpFastestCachePreload_number : 4; // must be even
|
154 |
$urls = array();
|
155 |
|
@@ -159,42 +186,83 @@
|
|
159 |
}else{
|
160 |
$mobile_theme = false;
|
161 |
}
|
162 |
-
|
|
|
163 |
|
164 |
// HOME
|
165 |
-
if(isset($
|
166 |
-
if($
|
167 |
-
|
|
|
|
|
|
|
|
|
|
|
168 |
$number--;
|
|
|
|
|
169 |
}
|
170 |
-
|
171 |
-
array_push($urls, array("url" => get_option("home"), "user-agent" => "desktop"));
|
172 |
-
$number--;
|
173 |
|
174 |
-
$pre_load->homepage = -1;
|
175 |
}
|
176 |
|
177 |
|
178 |
// CUSTOM POSTS
|
179 |
-
if($
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
$
|
|
|
|
|
|
|
187 |
}
|
188 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
}
|
|
|
190 |
|
191 |
-
if($where_query){
|
192 |
-
$where_query = preg_replace("/(\s*OR\s*)$/", "", $where_query);
|
193 |
-
|
194 |
-
$recent_custom_posts = $wpdb->get_results("SELECT SQL_CALC_FOUND_ROWS ".$wpdb->prefix."posts.ID FROM ".$wpdb->prefix."posts WHERE 1=1 AND (".$where_query.") AND ((".$wpdb->prefix."posts.post_status = 'publish')) ORDER BY ".$wpdb->prefix."posts.ID DESC LIMIT ".$pre_load->customposttypes.", ".$number, ARRAY_A);
|
195 |
|
196 |
-
|
197 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
if($mobile_theme){
|
199 |
array_push($urls, array("url" => get_permalink($post["ID"]), "user-agent" => "mobile"));
|
200 |
$number--;
|
@@ -203,194 +271,185 @@
|
|
203 |
array_push($urls, array("url" => get_permalink($post["ID"]), "user-agent" => "desktop"));
|
204 |
$number--;
|
205 |
|
206 |
-
$pre_load->
|
207 |
}
|
208 |
}else{
|
209 |
-
$pre_load->
|
210 |
}
|
211 |
}
|
212 |
}
|
213 |
|
214 |
|
215 |
-
// POST
|
216 |
-
if($number > 0 && isset($pre_load->post) && $pre_load->post > -1){
|
217 |
-
// $recent_posts = wp_get_recent_posts(array(
|
218 |
-
// 'numberposts' => $number,
|
219 |
-
// 'offset' => $pre_load->post,
|
220 |
-
// 'orderby' => 'ID',
|
221 |
-
// 'order' => 'DESC',
|
222 |
-
// 'post_type' => 'post',
|
223 |
-
// 'post_status' => 'publish',
|
224 |
-
// 'suppress_filters' => true
|
225 |
-
// ), ARRAY_A);
|
226 |
-
global $wpdb;
|
227 |
-
$recent_posts = $wpdb->get_results("SELECT SQL_CALC_FOUND_ROWS ".$wpdb->prefix."posts.ID FROM ".$wpdb->prefix."posts WHERE 1=1 AND (".$wpdb->prefix."posts.post_type = 'post') AND ((".$wpdb->prefix."posts.post_status = 'publish')) ORDER BY ".$wpdb->prefix."posts.ID DESC LIMIT ".$pre_load->post.", ".$number, ARRAY_A);
|
228 |
-
|
229 |
-
|
230 |
-
if(count($recent_posts) > 0){
|
231 |
-
foreach ($recent_posts as $key => $post) {
|
232 |
-
if($mobile_theme){
|
233 |
-
array_push($urls, array("url" => get_permalink($post["ID"]), "user-agent" => "mobile"));
|
234 |
-
$number--;
|
235 |
-
}
|
236 |
-
|
237 |
-
array_push($urls, array("url" => get_permalink($post["ID"]), "user-agent" => "desktop"));
|
238 |
-
$number--;
|
239 |
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
}
|
246 |
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
|
248 |
-
|
249 |
-
if($number > 0 && isset($pre_load->attachment) && $pre_load->attachment > -1){
|
250 |
-
global $wpdb;
|
251 |
-
$recent_attachments = $wpdb->get_results("SELECT SQL_CALC_FOUND_ROWS ".$wpdb->prefix."posts.ID FROM ".$wpdb->prefix."posts WHERE 1=1 AND (".$wpdb->prefix."posts.post_type = 'attachment') ORDER BY ".$wpdb->prefix."posts.ID DESC LIMIT ".$pre_load->attachment.", ".$number, ARRAY_A);
|
252 |
-
|
253 |
-
if(count($recent_attachments) > 0){
|
254 |
-
foreach ($recent_attachments as $key => $attachment) {
|
255 |
-
if($mobile_theme){
|
256 |
-
array_push($urls, array("url" => get_permalink($attachment["ID"]), "user-agent" => "mobile"));
|
257 |
$number--;
|
258 |
-
}
|
259 |
-
|
260 |
-
array_push($urls, array("url" => get_permalink($attachment["ID"]), "user-agent" => "desktop"));
|
261 |
-
$number--;
|
262 |
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
|
|
268 |
}
|
269 |
|
270 |
// PAGE
|
271 |
-
if($
|
|
|
272 |
|
273 |
-
|
274 |
-
|
275 |
|
276 |
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
|
284 |
-
|
285 |
-
|
286 |
|
287 |
-
|
|
|
|
|
|
|
288 |
}
|
289 |
-
}else{
|
290 |
-
$pre_load->page = -1;
|
291 |
}
|
292 |
}
|
293 |
|
294 |
// CATEGORY
|
295 |
-
if($
|
296 |
-
$
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
|
|
313 |
|
314 |
-
|
315 |
-
|
316 |
|
317 |
-
|
318 |
|
|
|
|
|
|
|
319 |
}
|
320 |
-
}else{
|
321 |
-
$pre_load->category = -1;
|
322 |
}
|
323 |
}
|
324 |
|
325 |
// TAG
|
326 |
-
if($
|
327 |
-
$
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
|
|
344 |
|
345 |
-
|
346 |
-
|
347 |
|
348 |
-
|
349 |
|
|
|
|
|
|
|
350 |
}
|
351 |
-
}else{
|
352 |
-
$pre_load->tag = -1;
|
353 |
}
|
354 |
}
|
355 |
|
356 |
// Custom Taxonomies
|
357 |
-
if($
|
358 |
-
$
|
359 |
-
|
360 |
-
|
361 |
-
$
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
|
|
|
|
|
|
|
|
|
|
376 |
$number--;
|
377 |
-
}
|
378 |
-
|
379 |
-
array_push($urls, array("url" => get_term_link($custom_tax->slug, $custom_tax->taxonomy), "user-agent" => "desktop"));
|
380 |
-
$number--;
|
381 |
|
382 |
-
|
383 |
|
|
|
|
|
|
|
384 |
}
|
385 |
}else{
|
386 |
$pre_load->customTaxonomies = -1;
|
387 |
}
|
388 |
-
}else{
|
389 |
-
$pre_load->customTaxonomies = -1;
|
390 |
}
|
391 |
}
|
392 |
|
393 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
394 |
|
395 |
if(count($urls) > 0){
|
396 |
foreach ($urls as $key => $arr) {
|
@@ -430,7 +489,7 @@
|
|
430 |
}else{
|
431 |
if(isset($options->wpFastestCachePreload_restart)){
|
432 |
foreach ($pre_load as $pre_load_key => &$pre_load_value) {
|
433 |
-
if($pre_load_key != "number"){
|
434 |
$pre_load_value = 0;
|
435 |
}
|
436 |
}
|
149 |
$number = $pre_load->number;
|
150 |
}
|
151 |
|
152 |
+
//START:ORDER
|
153 |
+
if(isset($pre_load->order) && $pre_load->order){
|
154 |
+
$order_arr = explode(",", $pre_load->order);
|
155 |
+
}else{
|
156 |
+
if(isset($options->wpFastestCachePreload_order) && $options->wpFastestCachePreload_order){
|
157 |
+
$order_arr = explode(",", $options->wpFastestCachePreload_order);
|
158 |
+
}
|
159 |
+
}
|
160 |
+
|
161 |
+
if(is_array($order_arr)){
|
162 |
+
foreach ($order_arr as $o_key => $o_value){
|
163 |
+
if($o_value == "order" || $o_value == "number"){
|
164 |
+
unset($order_arr[$o_key]);
|
165 |
+
}
|
166 |
+
|
167 |
+
if(!isset($pre_load->$o_value)){
|
168 |
+
unset($order_arr[$o_key]);
|
169 |
+
}
|
170 |
+
|
171 |
+
}
|
172 |
+
$order_arr = array_values($order_arr);
|
173 |
+
}
|
174 |
|
175 |
+
$current_order = isset($order_arr[0]) ? $order_arr[0] : "go";
|
176 |
+
//START:END
|
177 |
+
|
178 |
+
|
179 |
+
|
180 |
$urls_limit = isset($options->wpFastestCachePreload_number) ? $options->wpFastestCachePreload_number : 4; // must be even
|
181 |
$urls = array();
|
182 |
|
186 |
}else{
|
187 |
$mobile_theme = false;
|
188 |
}
|
189 |
+
|
190 |
+
|
191 |
|
192 |
// HOME
|
193 |
+
if(isset($current_order) && ($current_order == "homepage" || $current_order == "go")){
|
194 |
+
if(isset($pre_load->homepage) && $pre_load->homepage > -1){
|
195 |
+
if($mobile_theme){
|
196 |
+
array_push($urls, array("url" => get_option("home"), "user-agent" => "mobile"));
|
197 |
+
$number--;
|
198 |
+
}
|
199 |
+
|
200 |
+
array_push($urls, array("url" => get_option("home"), "user-agent" => "desktop"));
|
201 |
$number--;
|
202 |
+
|
203 |
+
$pre_load->homepage = -1;
|
204 |
}
|
|
|
|
|
|
|
205 |
|
|
|
206 |
}
|
207 |
|
208 |
|
209 |
// CUSTOM POSTS
|
210 |
+
if(isset($current_order) && ($current_order == "customposttypes" || $current_order == "go")){
|
211 |
+
if($number > 0 && isset($pre_load->customposttypes) && $pre_load->customposttypes > -1){
|
212 |
+
global $wpdb;
|
213 |
+
$post_types = get_post_types(array('public' => true), "names", "and");
|
214 |
+
$where_query = "";
|
215 |
+
|
216 |
+
foreach ($post_types as $post_type_key => $post_type_value) {
|
217 |
+
if(!in_array($post_type_key, array("post", "page", "attachment"))){
|
218 |
+
$where_query = $where_query.$wpdb->prefix."posts.post_type = '".$post_type_value."' OR ";
|
219 |
+
}
|
220 |
+
|
221 |
}
|
222 |
|
223 |
+
if($where_query){
|
224 |
+
$where_query = preg_replace("/(\s*OR\s*)$/", "", $where_query);
|
225 |
+
|
226 |
+
$recent_custom_posts = $wpdb->get_results("SELECT SQL_CALC_FOUND_ROWS ".$wpdb->prefix."posts.ID FROM ".$wpdb->prefix."posts WHERE 1=1 AND (".$where_query.") AND ((".$wpdb->prefix."posts.post_status = 'publish')) ORDER BY ".$wpdb->prefix."posts.ID DESC LIMIT ".$pre_load->customposttypes.", ".$number, ARRAY_A);
|
227 |
+
|
228 |
+
if(count($recent_custom_posts) > 0){
|
229 |
+
foreach ($recent_custom_posts as $key => $post) {
|
230 |
+
if($mobile_theme){
|
231 |
+
array_push($urls, array("url" => get_permalink($post["ID"]), "user-agent" => "mobile"));
|
232 |
+
$number--;
|
233 |
+
}
|
234 |
+
|
235 |
+
array_push($urls, array("url" => get_permalink($post["ID"]), "user-agent" => "desktop"));
|
236 |
+
$number--;
|
237 |
+
|
238 |
+
$pre_load->customposttypes = $pre_load->customposttypes + 1;
|
239 |
+
}
|
240 |
+
}else{
|
241 |
+
$pre_load->customposttypes = -1;
|
242 |
+
}
|
243 |
+
}
|
244 |
}
|
245 |
+
}
|
246 |
|
|
|
|
|
|
|
|
|
247 |
|
248 |
+
// POST
|
249 |
+
if(isset($current_order) && ($current_order == "post" || $current_order == "go")){
|
250 |
+
if($number > 0 && isset($pre_load->post) && $pre_load->post > -1){
|
251 |
+
// $recent_posts = wp_get_recent_posts(array(
|
252 |
+
// 'numberposts' => $number,
|
253 |
+
// 'offset' => $pre_load->post,
|
254 |
+
// 'orderby' => 'ID',
|
255 |
+
// 'order' => 'DESC',
|
256 |
+
// 'post_type' => 'post',
|
257 |
+
// 'post_status' => 'publish',
|
258 |
+
// 'suppress_filters' => true
|
259 |
+
// ), ARRAY_A);
|
260 |
+
global $wpdb;
|
261 |
+
$recent_posts = $wpdb->get_results("SELECT SQL_CALC_FOUND_ROWS ".$wpdb->prefix."posts.ID FROM ".$wpdb->prefix."posts WHERE 1=1 AND (".$wpdb->prefix."posts.post_type = 'post') AND ((".$wpdb->prefix."posts.post_status = 'publish')) ORDER BY ".$wpdb->prefix."posts.ID DESC LIMIT ".$pre_load->post.", ".$number, ARRAY_A);
|
262 |
+
|
263 |
+
|
264 |
+
if(count($recent_posts) > 0){
|
265 |
+
foreach ($recent_posts as $key => $post) {
|
266 |
if($mobile_theme){
|
267 |
array_push($urls, array("url" => get_permalink($post["ID"]), "user-agent" => "mobile"));
|
268 |
$number--;
|
271 |
array_push($urls, array("url" => get_permalink($post["ID"]), "user-agent" => "desktop"));
|
272 |
$number--;
|
273 |
|
274 |
+
$pre_load->post = $pre_load->post + 1;
|
275 |
}
|
276 |
}else{
|
277 |
+
$pre_load->post = -1;
|
278 |
}
|
279 |
}
|
280 |
}
|
281 |
|
282 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
283 |
|
284 |
+
// ATTACHMENT
|
285 |
+
if(isset($current_order) && ($current_order == "attachment" || $current_order == "go")){
|
286 |
+
if($number > 0 && isset($pre_load->attachment) && $pre_load->attachment > -1){
|
287 |
+
global $wpdb;
|
288 |
+
$recent_attachments = $wpdb->get_results("SELECT SQL_CALC_FOUND_ROWS ".$wpdb->prefix."posts.ID FROM ".$wpdb->prefix."posts WHERE 1=1 AND (".$wpdb->prefix."posts.post_type = 'attachment') ORDER BY ".$wpdb->prefix."posts.ID DESC LIMIT ".$pre_load->attachment.", ".$number, ARRAY_A);
|
|
|
289 |
|
290 |
+
if(count($recent_attachments) > 0){
|
291 |
+
foreach ($recent_attachments as $key => $attachment) {
|
292 |
+
if($mobile_theme){
|
293 |
+
array_push($urls, array("url" => get_permalink($attachment["ID"]), "user-agent" => "mobile"));
|
294 |
+
$number--;
|
295 |
+
}
|
296 |
|
297 |
+
array_push($urls, array("url" => get_permalink($attachment["ID"]), "user-agent" => "desktop"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
$number--;
|
|
|
|
|
|
|
|
|
299 |
|
300 |
+
$pre_load->attachment = $pre_load->attachment + 1;
|
301 |
+
}
|
302 |
+
}else{
|
303 |
+
$pre_load->attachment = -1;
|
304 |
+
}
|
305 |
+
}
|
306 |
}
|
307 |
|
308 |
// PAGE
|
309 |
+
if(isset($current_order) && ($current_order == "page" || $current_order == "go")){
|
310 |
+
if($number > 0 && isset($pre_load->page) && $pre_load->page > -1){
|
311 |
|
312 |
+
global $wpdb;
|
313 |
+
$pages = $wpdb->get_results("SELECT SQL_CALC_FOUND_ROWS ".$wpdb->prefix."posts.ID FROM ".$wpdb->prefix."posts WHERE 1=1 AND (".$wpdb->prefix."posts.post_type = 'page') AND ((".$wpdb->prefix."posts.post_status = 'publish')) ORDER BY ".$wpdb->prefix."posts.ID DESC LIMIT ".$pre_load->page.", ".$number, ARRAY_A);
|
314 |
|
315 |
|
316 |
+
if(count($pages) > 0){
|
317 |
+
foreach ($pages as $key => $page) {
|
318 |
+
if($mobile_theme){
|
319 |
+
array_push($urls, array("url" => get_page_link($page["ID"]), "user-agent" => "mobile"));
|
320 |
+
$number--;
|
321 |
+
}
|
322 |
|
323 |
+
array_push($urls, array("url" => get_page_link($page["ID"]), "user-agent" => "desktop"));
|
324 |
+
$number--;
|
325 |
|
326 |
+
$pre_load->page = $pre_load->page + 1;
|
327 |
+
}
|
328 |
+
}else{
|
329 |
+
$pre_load->page = -1;
|
330 |
}
|
|
|
|
|
331 |
}
|
332 |
}
|
333 |
|
334 |
// CATEGORY
|
335 |
+
if(isset($current_order) && ($current_order == "category" || $current_order == "go")){
|
336 |
+
if($number > 0 && isset($pre_load->category) && $pre_load->category > -1){
|
337 |
+
$categories = get_terms(array(
|
338 |
+
'taxonomy' => array('category'),
|
339 |
+
'orderby' => 'id',
|
340 |
+
'order' => 'ASC',
|
341 |
+
'hide_empty' => false,
|
342 |
+
'number' => $number,
|
343 |
+
'fields' => 'all',
|
344 |
+
'pad_counts' => false,
|
345 |
+
'offset' => $pre_load->category
|
346 |
+
));
|
347 |
+
|
348 |
+
if(count($categories) > 0){
|
349 |
+
foreach ($categories as $key => $category) {
|
350 |
+
if($mobile_theme){
|
351 |
+
array_push($urls, array("url" => get_term_link($category->slug, $category->taxonomy), "user-agent" => "mobile"));
|
352 |
+
$number--;
|
353 |
+
}
|
354 |
|
355 |
+
array_push($urls, array("url" => get_term_link($category->slug, $category->taxonomy), "user-agent" => "desktop"));
|
356 |
+
$number--;
|
357 |
|
358 |
+
$pre_load->category = $pre_load->category + 1;
|
359 |
|
360 |
+
}
|
361 |
+
}else{
|
362 |
+
$pre_load->category = -1;
|
363 |
}
|
|
|
|
|
364 |
}
|
365 |
}
|
366 |
|
367 |
// TAG
|
368 |
+
if(isset($current_order) && ($current_order == "tag" || $current_order == "go")){
|
369 |
+
if($number > 0 && isset($pre_load->tag) && $pre_load->tag > -1){
|
370 |
+
$tags = get_terms(array(
|
371 |
+
'taxonomy' => array('post_tag'),
|
372 |
+
'orderby' => 'id',
|
373 |
+
'order' => 'ASC',
|
374 |
+
'hide_empty' => false,
|
375 |
+
'number' => $number,
|
376 |
+
'fields' => 'all',
|
377 |
+
'pad_counts' => false,
|
378 |
+
'offset' => $pre_load->tag
|
379 |
+
));
|
380 |
+
|
381 |
+
if(count($tags) > 0){
|
382 |
+
foreach ($tags as $key => $tag) {
|
383 |
+
if($mobile_theme){
|
384 |
+
array_push($urls, array("url" => get_term_link($tag->slug, $tag->taxonomy), "user-agent" => "mobile"));
|
385 |
+
$number--;
|
386 |
+
}
|
387 |
|
388 |
+
array_push($urls, array("url" => get_term_link($tag->slug, $tag->taxonomy), "user-agent" => "desktop"));
|
389 |
+
$number--;
|
390 |
|
391 |
+
$pre_load->tag = $pre_load->tag + 1;
|
392 |
|
393 |
+
}
|
394 |
+
}else{
|
395 |
+
$pre_load->tag = -1;
|
396 |
}
|
|
|
|
|
397 |
}
|
398 |
}
|
399 |
|
400 |
// Custom Taxonomies
|
401 |
+
if(isset($current_order) && ($current_order == "customTaxonomies" || $current_order == "go")){
|
402 |
+
if($number > 0 && isset($pre_load->customTaxonomies) && $pre_load->customTaxonomies > -1){
|
403 |
+
$taxo = get_taxonomies(array('public' => true, '_builtin' => false), "names", "and");
|
404 |
+
|
405 |
+
if(count($taxo) > 0){
|
406 |
+
$custom_taxos = get_terms(array(
|
407 |
+
'taxonomy' => array_values($taxo),
|
408 |
+
'orderby' => 'id',
|
409 |
+
'order' => 'ASC',
|
410 |
+
'hide_empty' => false,
|
411 |
+
'number' => $number,
|
412 |
+
'fields' => 'all',
|
413 |
+
'pad_counts' => false,
|
414 |
+
'offset' => $pre_load->customTaxonomies
|
415 |
+
));
|
416 |
+
|
417 |
+
if(count($custom_taxos) > 0){
|
418 |
+
foreach ($custom_taxos as $key => $custom_tax) {
|
419 |
+
if($mobile_theme){
|
420 |
+
array_push($urls, array("url" => get_term_link($custom_tax->slug, $custom_tax->taxonomy), "user-agent" => "mobile"));
|
421 |
+
$number--;
|
422 |
+
}
|
423 |
+
|
424 |
+
array_push($urls, array("url" => get_term_link($custom_tax->slug, $custom_tax->taxonomy), "user-agent" => "desktop"));
|
425 |
$number--;
|
|
|
|
|
|
|
|
|
426 |
|
427 |
+
$pre_load->customTaxonomies = $pre_load->customTaxonomies + 1;
|
428 |
|
429 |
+
}
|
430 |
+
}else{
|
431 |
+
$pre_load->customTaxonomies = -1;
|
432 |
}
|
433 |
}else{
|
434 |
$pre_load->customTaxonomies = -1;
|
435 |
}
|
|
|
|
|
436 |
}
|
437 |
}
|
438 |
|
439 |
|
440 |
+
if($pre_load->$current_order == -1){
|
441 |
+
array_shift($order_arr);
|
442 |
+
|
443 |
+
if(isset($order_arr[0])){
|
444 |
+
$pre_load->order = implode(",", $order_arr);
|
445 |
+
|
446 |
+
update_option("WpFastestCachePreLoad", json_encode($pre_load));
|
447 |
+
|
448 |
+
self::create_preload_cache($options);
|
449 |
+
}else{
|
450 |
+
unset($pre_load->order);
|
451 |
+
}
|
452 |
+
}
|
453 |
|
454 |
if(count($urls) > 0){
|
455 |
foreach ($urls as $key => $arr) {
|
489 |
}else{
|
490 |
if(isset($options->wpFastestCachePreload_restart)){
|
491 |
foreach ($pre_load as $pre_load_key => &$pre_load_value) {
|
492 |
+
if($pre_load_key != "number" && $pre_load_key != "order"){
|
493 |
$pre_load_value = 0;
|
494 |
}
|
495 |
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://profiles.wordpress.org/emrevona/
|
|
4 |
Tags: cache, caching, performance, wp-cache, total cache, super cache, cdn
|
5 |
Requires at least: 3.3
|
6 |
Tested up to: 5.6
|
7 |
-
Stable tag: 0.9.1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -125,10 +125,14 @@ The free version is enough to speed up your site but in the premium version ther
|
|
125 |
|
126 |
== Changelog ==
|
127 |
|
|
|
|
|
|
|
|
|
128 |
= 0.9.1.4 =
|
129 |
* to fix saving "Update Post" settings issue
|
130 |
* to fix saving "New Post" settings issue
|
131 |
-
* <strong>[FEATURE]</strong> Compatible with AMP Takeover feature of <a target="_blank" href="https://wordpress.org/plugins/accelerated-mobile-pages/">AMP for WP – Accelerated Mobile Pages</a>
|
132 |
|
133 |
= 0.9.1.3 =
|
134 |
* to fix PHP Notice: Undefined offset: -1 js-utilities.php on line 84
|
4 |
Tags: cache, caching, performance, wp-cache, total cache, super cache, cdn
|
5 |
Requires at least: 3.3
|
6 |
Tested up to: 5.6
|
7 |
+
Stable tag: 0.9.1.5
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
125 |
|
126 |
== Changelog ==
|
127 |
|
128 |
+
= 0.9.1.5 =
|
129 |
+
* <strong>[FEATURE]</strong> to add Re-Order feture for Preload [<a target="_blank" href="https://www.wpfastestcache.com/features/re-order-preload/">Details</a>]
|
130 |
+
* to add WPFC_DISABLE_CLEARING_CACHE_AFTER_WOOCOMMERCE_CHECKOUT_ORDER_PROCESSED
|
131 |
+
|
132 |
= 0.9.1.4 =
|
133 |
* to fix saving "Update Post" settings issue
|
134 |
* to fix saving "New Post" settings issue
|
135 |
+
* <strong>[FEATURE]</strong> Compatible with the AMP Takeover feature of <a target="_blank" href="https://wordpress.org/plugins/accelerated-mobile-pages/">AMP for WP – Accelerated Mobile Pages</a>
|
136 |
|
137 |
= 0.9.1.3 =
|
138 |
* to fix PHP Notice: Undefined offset: -1 js-utilities.php on line 84
|
templates/preload.php
CHANGED
@@ -5,9 +5,16 @@
|
|
5 |
float: left !important;
|
6 |
width: 108px !important;
|
7 |
}
|
|
|
|
|
|
|
8 |
.wiz-input-cont label{
|
9 |
margin-right: 0 !important;
|
10 |
}
|
|
|
|
|
|
|
|
|
11 |
</style>
|
12 |
<div template-id="wpfc-modal-preload" style="display:none;top: 10.5px; left: 226px; position: absolute; padding: 6px; height: auto; width: 440px; z-index: 10001;">
|
13 |
<div style="height: 100%; width: 100%; background: none repeat scroll 0% 0% rgb(0, 0, 0); position: absolute; top: 0px; left: 0px; z-index: -1; opacity: 0.5; border-radius: 8px;">
|
@@ -28,40 +35,42 @@
|
|
28 |
</div>
|
29 |
<div class="window-content-wrapper" style="padding: 15px;">
|
30 |
<div class="window-content" style="z-index: 1000; height: auto; position: relative; display: inline-block; width: 100%;">
|
31 |
-
<div class="wiz-input-cont" style="padding-right: 8px;margin-right: 10px;">
|
32 |
<label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_homepage; ?> id="wpFastestCachePreload_homepage" name="wpFastestCachePreload_homepage"></label>
|
33 |
<label for="wpFastestCachePreload_homepage"><?php _e('Homepage'); ?></label>
|
34 |
</div>
|
35 |
-
<div class="wiz-input-cont" style="padding-right: 8px;margin-right: 10px;">
|
36 |
<label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_post; ?> id="wpFastestCachePreload_post" name="wpFastestCachePreload_post"></label>
|
37 |
<label for="wpFastestCachePreload_post"><?php _e('Posts'); ?></label>
|
38 |
</div>
|
39 |
-
<div class="wiz-input-cont">
|
40 |
<label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_category; ?> id="wpFastestCachePreload_category" name="wpFastestCachePreload_category"></label>
|
41 |
<label for="wpFastestCachePreload_category"><?php _e('Categories'); ?></label>
|
42 |
</div>
|
43 |
-
<div class="wiz-input-cont" style="padding-right: 8px;margin-right: 10px;">
|
44 |
<label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_page; ?> id="wpFastestCachePreload_page" name="wpFastestCachePreload_page"></label>
|
45 |
<label for="wpFastestCachePreload_page"><?php _e('Pages'); ?></label>
|
46 |
</div>
|
47 |
-
<div class="wiz-input-cont" style="padding-right: 8px;margin-right: 10px;">
|
48 |
<label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_tag; ?> id="wpFastestCachePreload_tag" name="wpFastestCachePreload_tag"></label>
|
49 |
<label for="wpFastestCachePreload_tag"><?php _e('Tags'); ?></label>
|
50 |
</div>
|
51 |
-
<div class="wiz-input-cont">
|
52 |
<label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_attachment; ?> id="wpFastestCachePreload_attachment" name="wpFastestCachePreload_attachment"></label>
|
53 |
<label for="wpFastestCachePreload_attachment"><?php _e('Attachments', 'wp-fastest-cache'); ?></label>
|
54 |
</div>
|
55 |
|
56 |
-
<div class="wiz-input-cont" style="
|
57 |
<label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_customposttypes; ?> id="wpFastestCachePreload_customposttypes" name="wpFastestCachePreload_customposttypes"></label>
|
58 |
<label for="wpFastestCachePreload_customposttypes"><?php _e('Custom Post Types', 'wp-fastest-cache'); ?></label>
|
59 |
</div>
|
60 |
|
61 |
-
<div class="wiz-input-cont
|
62 |
<label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_customTaxonomies; ?> id="wpFastestCachePreload_customTaxonomies" name="wpFastestCachePreload_customTaxonomies"></label>
|
63 |
<label for="wpFastestCachePreload_customposttypes"><?php _e('Custom Taxonomies', 'wp-fastest-cache'); ?></label>
|
64 |
</div>
|
|
|
|
|
65 |
|
66 |
<div class="wiz-input-cont" style="width: 94% !important;margin-bottom: 10px !important;">
|
67 |
<label class="mc-input-label" style="float:left;">
|
@@ -93,6 +102,7 @@
|
|
93 |
<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>
|
94 |
</div>
|
95 |
|
|
|
96 |
|
97 |
</div>
|
98 |
</div>
|
@@ -104,4 +114,127 @@
|
|
104 |
</div>
|
105 |
</div>
|
106 |
</div>
|
107 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
float: left !important;
|
6 |
width: 108px !important;
|
7 |
}
|
8 |
+
div[id^="wpfc-modal-preload"] .wiz-input-cont.ui-sortable-handle{
|
9 |
+
cursor: grab;
|
10 |
+
}
|
11 |
.wiz-input-cont label{
|
12 |
margin-right: 0 !important;
|
13 |
}
|
14 |
+
div[id^="wpfc-modal-preload"] .wiz-input-cont.custom-half{
|
15 |
+
width: 175px !important;
|
16 |
+
|
17 |
+
}
|
18 |
</style>
|
19 |
<div template-id="wpfc-modal-preload" style="display:none;top: 10.5px; left: 226px; position: absolute; padding: 6px; height: auto; width: 440px; z-index: 10001;">
|
20 |
<div style="height: 100%; width: 100%; background: none repeat scroll 0% 0% rgb(0, 0, 0); position: absolute; top: 0px; left: 0px; z-index: -1; opacity: 0.5; border-radius: 8px;">
|
35 |
</div>
|
36 |
<div class="window-content-wrapper" style="padding: 15px;">
|
37 |
<div class="window-content" style="z-index: 1000; height: auto; position: relative; display: inline-block; width: 100%;">
|
38 |
+
<div class="wiz-input-cont" style="padding-right: 8px;margin-right: 10px;" data-type="homepage">
|
39 |
<label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_homepage; ?> id="wpFastestCachePreload_homepage" name="wpFastestCachePreload_homepage"></label>
|
40 |
<label for="wpFastestCachePreload_homepage"><?php _e('Homepage'); ?></label>
|
41 |
</div>
|
42 |
+
<div class="wiz-input-cont" style="padding-right: 8px;margin-right: 10px;" data-type="post">
|
43 |
<label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_post; ?> id="wpFastestCachePreload_post" name="wpFastestCachePreload_post"></label>
|
44 |
<label for="wpFastestCachePreload_post"><?php _e('Posts'); ?></label>
|
45 |
</div>
|
46 |
+
<div class="wiz-input-cont" data-type="category">
|
47 |
<label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_category; ?> id="wpFastestCachePreload_category" name="wpFastestCachePreload_category"></label>
|
48 |
<label for="wpFastestCachePreload_category"><?php _e('Categories'); ?></label>
|
49 |
</div>
|
50 |
+
<div class="wiz-input-cont" style="padding-right: 8px;margin-right: 10px;" data-type="page">
|
51 |
<label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_page; ?> id="wpFastestCachePreload_page" name="wpFastestCachePreload_page"></label>
|
52 |
<label for="wpFastestCachePreload_page"><?php _e('Pages'); ?></label>
|
53 |
</div>
|
54 |
+
<div class="wiz-input-cont" style="padding-right: 8px;margin-right: 10px;" data-type="tag">
|
55 |
<label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_tag; ?> id="wpFastestCachePreload_tag" name="wpFastestCachePreload_tag"></label>
|
56 |
<label for="wpFastestCachePreload_tag"><?php _e('Tags'); ?></label>
|
57 |
</div>
|
58 |
+
<div class="wiz-input-cont" data-type="attachment">
|
59 |
<label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_attachment; ?> id="wpFastestCachePreload_attachment" name="wpFastestCachePreload_attachment"></label>
|
60 |
<label for="wpFastestCachePreload_attachment"><?php _e('Attachments', 'wp-fastest-cache'); ?></label>
|
61 |
</div>
|
62 |
|
63 |
+
<div class="wiz-input-cont custom-half" style="margin-right: 10px;" data-type="customposttypes">
|
64 |
<label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_customposttypes; ?> id="wpFastestCachePreload_customposttypes" name="wpFastestCachePreload_customposttypes"></label>
|
65 |
<label for="wpFastestCachePreload_customposttypes"><?php _e('Custom Post Types', 'wp-fastest-cache'); ?></label>
|
66 |
</div>
|
67 |
|
68 |
+
<div class="wiz-input-cont custom-half" data-type="customTaxonomies">
|
69 |
<label class="mc-input-label" style="margin-right: 5px;"><input type="checkbox" <?php echo $wpFastestCachePreload_customTaxonomies; ?> id="wpFastestCachePreload_customTaxonomies" name="wpFastestCachePreload_customTaxonomies"></label>
|
70 |
<label for="wpFastestCachePreload_customposttypes"><?php _e('Custom Taxonomies', 'wp-fastest-cache'); ?></label>
|
71 |
</div>
|
72 |
+
</div>
|
73 |
+
<div class="window-content" style="z-index: 1000; height: auto; position: relative; display: inline-block; width: 100%;">
|
74 |
|
75 |
<div class="wiz-input-cont" style="width: 94% !important;margin-bottom: 10px !important;">
|
76 |
<label class="mc-input-label" style="float:left;">
|
102 |
<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>
|
103 |
</div>
|
104 |
|
105 |
+
<input type="hidden" value="<?php echo $wpFastestCachePreload_order; ?>" id="wpFastestCachePreload_order" name="wpFastestCachePreload_order">
|
106 |
|
107 |
</div>
|
108 |
</div>
|
114 |
</div>
|
115 |
</div>
|
116 |
</div>
|
117 |
+
</div>
|
118 |
+
<script type="text/javascript">
|
119 |
+
var WPFC_SPINNER = {
|
120 |
+
id: false,
|
121 |
+
number: false,
|
122 |
+
init: function(id, number){
|
123 |
+
this.id = id;
|
124 |
+
//this.number = number;
|
125 |
+
this.set_number();
|
126 |
+
this.click_event();
|
127 |
+
},
|
128 |
+
set_number: function(){
|
129 |
+
this.number = jQuery("#" + this.id + " input.wpfc-form-spinner-input").val();
|
130 |
+
this.number = parseInt(this.number);
|
131 |
+
},
|
132 |
+
click_event: function(){
|
133 |
+
var id = this.id;
|
134 |
+
var number = this.number;
|
135 |
+
|
136 |
+
jQuery("#" + this.id + " .wpfc-form-spinner-up, #" + this.id + " .wpfc-form-spinner-down").click(function(e){
|
137 |
+
if(jQuery(this).attr('class').match(/up$/)){
|
138 |
+
number = number + 2;
|
139 |
+
}else if(jQuery(this).attr('class').match(/down$/)){
|
140 |
+
number = number - 2;
|
141 |
+
}
|
142 |
+
|
143 |
+
number = number < 2 ? 2 : number;
|
144 |
+
number = number > 12 ? 12 : number;
|
145 |
+
|
146 |
+
jQuery("#" + id + " .wpfc-form-spinner-number").text(number);
|
147 |
+
jQuery("#" + id + " input.wpfc-form-spinner-input").val(number);
|
148 |
+
});
|
149 |
+
}
|
150 |
+
};
|
151 |
+
</script>
|
152 |
+
<script type="text/javascript">
|
153 |
+
jQuery("#wpFastestCachePreload").click(function(){
|
154 |
+
if(jQuery(this).is(':checked')){
|
155 |
+
if(jQuery("div[id^='wpfc-modal-preload-']").length === 0){
|
156 |
+
Wpfc_New_Dialog.dialog("wpfc-modal-preload", {close: function(){
|
157 |
+
var order_arr = [];
|
158 |
+
|
159 |
+
Wpfc_New_Dialog.clone.find("div.window-content input").each(function(){
|
160 |
+
if(jQuery(this).is(':checked')){
|
161 |
+
jQuery("div.tab1 div[template-id='wpfc-modal-preload'] div.window-content input[name='" + jQuery(this).attr("name") + "']").attr("checked", true);
|
162 |
+
}else{
|
163 |
+
jQuery("div.tab1 div[template-id='wpfc-modal-preload'] div.window-content input[name='" + jQuery(this).attr("name") + "']").attr("checked", false);
|
164 |
+
}
|
165 |
+
|
166 |
+
order_arr.push(jQuery(this).attr("name").replace(/wpFastestCachePreload_/, ""));
|
167 |
+
});
|
168 |
+
|
169 |
+
jQuery("div.tab1 div[template-id='wpfc-modal-preload'] div.window-content input[name='wpFastestCachePreload_order']").val(order_arr.join(","));
|
170 |
+
|
171 |
+
Wpfc_New_Dialog.clone.remove();
|
172 |
+
}});
|
173 |
+
|
174 |
+
var update_style = function(){
|
175 |
+
var top = 0
|
176 |
+
var item_number = 1;
|
177 |
+
|
178 |
+
jQuery("div[id^='wpfc-modal-preload-'] div.window-content").first().find("div").each(function(i, div){
|
179 |
+
jQuery(div).removeAttr("style");
|
180 |
+
|
181 |
+
top = (i === 0) ? jQuery(div).offset().top : top;
|
182 |
+
|
183 |
+
if(top == jQuery(div).offset().top){
|
184 |
+
if(item_number == 1 || item_number == 2){
|
185 |
+
jQuery(div).css({"padding-right": "8px", "margin-right" : "10px"});
|
186 |
+
}
|
187 |
+
}else{
|
188 |
+
top = jQuery(div).offset().top;
|
189 |
+
jQuery(div).css({"padding-right": "8px", "margin-right" : "10px"});
|
190 |
+
item_number = 1;
|
191 |
+
}
|
192 |
+
|
193 |
+
item_number++;
|
194 |
+
});
|
195 |
+
};
|
196 |
+
|
197 |
+
var sort = function(){
|
198 |
+
var order_string = jQuery("#wpFastestCachePreload_order").val();
|
199 |
+
var order_arr = [];
|
200 |
+
var clone_div;
|
201 |
+
|
202 |
+
if(order_string.length > 0){
|
203 |
+
order_arr = order_string.split(",");
|
204 |
+
|
205 |
+
jQuery.each(order_arr, function(i, value){
|
206 |
+
|
207 |
+
jQuery("div[id^='wpfc-modal-preload-'] div.window-content").first().find("div").each(function(i, div){
|
208 |
+
if(jQuery(div).attr("data-type") == value){
|
209 |
+
clone_div = jQuery(div).clone();
|
210 |
+
|
211 |
+
div.remove();
|
212 |
+
|
213 |
+
jQuery("div[id^='wpfc-modal-preload-'] div.window-content").first().append(clone_div);
|
214 |
+
}
|
215 |
+
});
|
216 |
+
});
|
217 |
+
}
|
218 |
+
|
219 |
+
update_style();
|
220 |
+
};
|
221 |
+
|
222 |
+
sort();
|
223 |
+
|
224 |
+
Wpfc_New_Dialog.show_button("close");
|
225 |
+
WPFC_SPINNER.init("wpfc-form-spinner-preload", 6);
|
226 |
+
jQuery("div[id^='wpfc-modal-preload-'] div.window-content").first().sortable({
|
227 |
+
out: function(event,ui){
|
228 |
+
update_style();
|
229 |
+
},
|
230 |
+
change: function(event, ui) {
|
231 |
+
jQuery('.ui-sortable-placeholder').css({
|
232 |
+
visibility: 'visible',
|
233 |
+
background: 'lightYellow'
|
234 |
+
});
|
235 |
+
}
|
236 |
+
});
|
237 |
+
}
|
238 |
+
}
|
239 |
+
});
|
240 |
+
</script>
|
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.9.1.
|
7 |
Author: Emre Vona
|
8 |
Author URI: http://tr.linkedin.com/in/emrevona
|
9 |
Text Domain: wp-fastest-cache
|
@@ -129,8 +129,11 @@ GNU General Public License for more details.
|
|
129 |
add_action('upgrader_process_complete', array($this, 'clear_cache_after_update_theme'), 10, 2);
|
130 |
}
|
131 |
|
132 |
-
|
133 |
-
|
|
|
|
|
|
|
134 |
|
135 |
// kk Star Ratings: to clear the cache of the post after voting
|
136 |
add_action('kksr_rate', array($this, 'clear_cache_on_kksr_rate'));
|
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.9.1.5
|
7 |
Author: Emre Vona
|
8 |
Author URI: http://tr.linkedin.com/in/emrevona
|
9 |
Text Domain: wp-fastest-cache
|
129 |
add_action('upgrader_process_complete', array($this, 'clear_cache_after_update_theme'), 10, 2);
|
130 |
}
|
131 |
|
132 |
+
if(defined("WPFC_DISABLE_CLEARING_CACHE_AFTER_WOOCOMMERCE_CHECKOUT_ORDER_PROCESSED") && WPFC_DISABLE_CLEARING_CACHE_AFTER_WOOCOMMERCE_CHECKOUT_ORDER_PROCESSED){
|
133 |
+
}else{
|
134 |
+
// to clear cache after new Woocommerce orders
|
135 |
+
add_action('woocommerce_checkout_order_processed', array($this, 'clear_cache_after_woocommerce_checkout_order_processed'), 1, 1);
|
136 |
+
}
|
137 |
|
138 |
// kk Star Ratings: to clear the cache of the post after voting
|
139 |
add_action('kksr_rate', array($this, 'clear_cache_on_kksr_rate'));
|