Version Description
Update Breeze through WordPress Admin > Dashboard >Updates. The settings will remain intact after the update.
Download this release
Release Info
Developer | adeelkhan |
Plugin | Breeze – WordPress Cache Plugin |
Version | 2.0.8 |
Comparing to | |
See all releases |
Code changes from version 2.0.7 to 2.0.8
- assets/js/breeze-main.js +57 -12
- assets/js/breeze-main.min.js +2 -2
- assets/js/js-front-end/breeze-lazy-load.min.js +1 -1
- assets/js/js-front-end/breeze-prefetch-links.min.js +1 -1
- breeze.php +2 -2
- inc/breeze-admin.php +12 -0
- inc/breeze-configuration.php +16 -0
- inc/cache/execute-cache.php +11 -24
- inc/cache/purge-cache.php +16 -1
- inc/cache/purge-varnish.php +13 -1
- inc/helpers.php +37 -5
- inc/wp-cli/class-breeze-cli-helpers.php +14 -2
- readme.txt +12 -4
assets/js/breeze-main.js
CHANGED
@@ -40,6 +40,15 @@ jQuery( document ).ready(
|
|
40 |
breeze_purgeVarnish_callAjax();
|
41 |
}
|
42 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
|
44 |
$( document ).on(
|
45 |
'click',
|
@@ -67,6 +76,42 @@ jQuery( document ).ready(
|
|
67 |
}
|
68 |
);
|
69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
//clear cache by button
|
71 |
function breeze_purgeVarnish_callAjax() {
|
72 |
$.ajax(
|
@@ -533,17 +578,17 @@ jQuery( document ).ready(
|
|
533 |
);
|
534 |
|
535 |
// Cookie do
|
536 |
-
function
|
537 |
-
|
538 |
-
if ( !
|
539 |
-
|
540 |
}
|
541 |
|
542 |
-
if ('import_export' ===
|
543 |
-
|
544 |
}
|
545 |
|
546 |
-
if ( $( "#tab-" +
|
547 |
firstTab = $( '#breeze-tabs' ).find( 'a:first-child' );
|
548 |
if (firstTab.length) {
|
549 |
tabType = firstTab.attr( 'id' ).replace( 'tab-', '' );
|
@@ -551,12 +596,12 @@ jQuery( document ).ready(
|
|
551 |
$( "#tab-content-" + tabType ).addClass( 'active' );
|
552 |
}
|
553 |
} else {
|
554 |
-
$( "#tab-" +
|
555 |
-
$( "#tab-content-" +
|
556 |
}
|
557 |
|
558 |
// Toggle right-side content
|
559 |
-
if (
|
560 |
$( '#breeze-and-cloudways' ).hide();
|
561 |
if ( $( '#faq-content' ).length ) {
|
562 |
$( '#faq-content' ).accordion(
|
@@ -588,7 +633,7 @@ jQuery( document ).ready(
|
|
588 |
return "";
|
589 |
}
|
590 |
|
591 |
-
|
592 |
|
593 |
// Sub-site settings toggle.
|
594 |
var global_tabs = [
|
@@ -744,7 +789,7 @@ jQuery( document ).ready(
|
|
744 |
'#breeze_import_btn',
|
745 |
function () {
|
746 |
if ( true === $valid_json ) {
|
747 |
-
network = $( '#breeze-level' ).val();
|
748 |
var the_file = $( '#breeze_import_settings' ).get( 0 ).files[ 0 ];
|
749 |
|
750 |
var breeze_data = new FormData();
|
40 |
breeze_purgeVarnish_callAjax();
|
41 |
}
|
42 |
);
|
43 |
+
// Topbar action
|
44 |
+
$( document ).on(
|
45 |
+
'click',
|
46 |
+
'#wp-admin-bar-breeze-purge-object-cache-group',
|
47 |
+
function ( e ) {
|
48 |
+
e.preventDefault();
|
49 |
+
breeze_purge_opcache_ajax();
|
50 |
+
}
|
51 |
+
);
|
52 |
|
53 |
$( document ).on(
|
54 |
'click',
|
76 |
}
|
77 |
);
|
78 |
|
79 |
+
//clear cache by button
|
80 |
+
function breeze_purge_opcache_ajax() {
|
81 |
+
$.ajax(
|
82 |
+
{
|
83 |
+
url: ajaxurl,
|
84 |
+
dataType: 'json',
|
85 |
+
method: 'POST',
|
86 |
+
data: {
|
87 |
+
action: 'breeze_purge_opcache',
|
88 |
+
is_network: $( 'body' ).hasClass( 'network-admin' ),
|
89 |
+
security: breeze_token_name.breeze_purge_opcache
|
90 |
+
},
|
91 |
+
success: function ( res ) {
|
92 |
+
current = location.href;
|
93 |
+
if ( res.clear ) {
|
94 |
+
var div = '<div id="message" class="notice notice-success is-dismissible breeze-notice" style="margin-top:10px; margin-bottom:10px;padding: 10px;margin-left: 0;"><p><strong>Object Cache has been purged.</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>';
|
95 |
+
//backend
|
96 |
+
$( "#wpbody #wpbody-content" ).prepend( div );
|
97 |
+
setTimeout(
|
98 |
+
function () {
|
99 |
+
//location.reload();
|
100 |
+
purge_action = true;
|
101 |
+
},
|
102 |
+
2000
|
103 |
+
);
|
104 |
+
|
105 |
+
} else {
|
106 |
+
window.location.href = current + "breeze-msg=purge-fail";
|
107 |
+
purge_action = true;
|
108 |
+
location.reload();
|
109 |
+
}
|
110 |
+
}
|
111 |
+
}
|
112 |
+
);
|
113 |
+
}
|
114 |
+
|
115 |
//clear cache by button
|
116 |
function breeze_purgeVarnish_callAjax() {
|
117 |
$.ajax(
|
578 |
);
|
579 |
|
580 |
// Cookie do
|
581 |
+
function Breeze_setTabFromCookie() {
|
582 |
+
var breeze_active_tab = getCookie( 'breeze_active_tab' );
|
583 |
+
if ( ! breeze_active_tab ) {
|
584 |
+
breeze_active_tab = 'basic';
|
585 |
}
|
586 |
|
587 |
+
if ('import_export' === breeze_active_tab) {
|
588 |
+
breeze_active_tab = 'basic';
|
589 |
}
|
590 |
|
591 |
+
if ( $( "#tab-" + breeze_active_tab ).length === 0 ) { // Tab not found (multisite case)
|
592 |
firstTab = $( '#breeze-tabs' ).find( 'a:first-child' );
|
593 |
if (firstTab.length) {
|
594 |
tabType = firstTab.attr( 'id' ).replace( 'tab-', '' );
|
596 |
$( "#tab-content-" + tabType ).addClass( 'active' );
|
597 |
}
|
598 |
} else {
|
599 |
+
$( "#tab-" + breeze_active_tab ).addClass( 'active' );
|
600 |
+
$( "#tab-content-" + breeze_active_tab ).addClass( 'active' );
|
601 |
}
|
602 |
|
603 |
// Toggle right-side content
|
604 |
+
if ( breeze_active_tab === 'faq' ) {
|
605 |
$( '#breeze-and-cloudways' ).hide();
|
606 |
if ( $( '#faq-content' ).length ) {
|
607 |
$( '#faq-content' ).accordion(
|
633 |
return "";
|
634 |
}
|
635 |
|
636 |
+
Breeze_setTabFromCookie();
|
637 |
|
638 |
// Sub-site settings toggle.
|
639 |
var global_tabs = [
|
789 |
'#breeze_import_btn',
|
790 |
function () {
|
791 |
if ( true === $valid_json ) {
|
792 |
+
var network = $( '#breeze-level' ).val();
|
793 |
var the_file = $( '#breeze_import_settings' ).get( 0 ).files[ 0 ];
|
794 |
|
795 |
var breeze_data = new FormData();
|
assets/js/breeze-main.min.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
/*! Created by Cloudways
|
2 |
-
On 16-
|
3 |
|
4 |
-
jQuery(document).ready(function(n){var e=n(".breeze-box");n("#breeze-plugins-notice").length&&n(document).on("click tap",".notice-dismiss",function(){n.ajax({type:"POST",url:ajaxurl,data:{action:"compatibility_warning_close",breeze_close_warning:"1"},dataType:"json",success:function(e){},error:function(e,t,a){},complete:function(e,t){}})}),n(document).on("click","#wp-admin-bar-breeze-purge-varnish-group",function(e){e.preventDefault(),a()}),n(document).on("click","#wp-admin-bar-breeze-purge-file-group",function(e){e.preventDefault(),n.ajax({url:ajaxurl,dataType:"json",method:"POST",data:{action:"breeze_purge_file",security:breeze_token_name.breeze_purge_cache},success:function(e){current=location.href;var t=e=parseFloat(e);window.location.href=current+"#breeze-msg=success-cleancache&file="+e,div=0<t?'<div id="message" class="notice notice-success is-dismissible breeze-notice" style="margin-top:10px; margin-bottom:10px;padding: 10px;margin-left: 0;"><p><strong>Internal cache has been purged: '+t+'Kb cleaned</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>':'<div id="message" class="notice notice-success is-dismissible breeze-notice" style="margin-top:10px; margin-bottom:10px;padding: 10px;margin-left: 0;"><p><strong>Internal cache has been purged.</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>',n("#wpbody #wpbody-content").prepend(div)}})});var t=!0;function a(){n.ajax({url:ajaxurl,dataType:"json",method:"POST",data:{action:"breeze_purge_varnish",is_network:n("body").hasClass("network-admin"),security:breeze_token_name.breeze_purge_varnish},success:function(e){current=location.href,e.clear?(n("#wpbody #wpbody-content").prepend('<div id="message" class="notice notice-success is-dismissible breeze-notice" style="margin-top:10px; margin-bottom:10px;padding: 10px;margin-left: 0;"><p><strong>Varnish Cache has been purged.</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>'),setTimeout(function(){t=!0},2e3)):(window.location.href=current+"breeze-msg=purge-fail",t=!0,location.reload())}})}n(".breeze-box").on("click","#purge-varnish-button",function(e){e.preventDefault(),!0===t&&(t=!1,n(this).addClass("br-is-disabled"),a())});var i,s,r,o=location.href,c=parseFloat((i="file",s=(s=o)||window.location.href,i=i.replace(/[\[\]]/g,"\\$&"),(s=new RegExp("[?&]"+i+"(=([^&#]*)|&|#|$)").exec(s))?s[2]?decodeURIComponent(s[2].replace(/\+/g," ")):"":null));n(window).on("load",function(){var e,t;/wp-admin/i.test(o)&&(e="",0<o.indexOf("msg=success-cleancache")&&!isNaN(c)&&(e=0<c?'<div id="message" class="notice notice-success is-dismissible breeze-notice" style="margin-top:10px; margin-bottom:10px;padding: 10px;"><p><strong>Internal cache has been purged: '+c+'Kb cleaned</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>':'<div id="message" class="notice notice-success is-dismissible breeze-notice" style="margin-top:10px; margin-bottom:10px;padding: 10px;"><p><strong>Internal cache has been purged.</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>',n("#wpbody .wrap h1").after(e),t=o.split("breeze-msg"),setTimeout(function(){window.location=t[0]},2e3)))}),n("#breeze-hide-install-msg").unbind("click").click(function(){n(this).closest("div.notice").fadeOut()}),-1!==(r=location.search).indexOf("breeze_purge=1")&&-1!==r.indexOf("_wpnonce")&&((r=new URLSearchParams(location.search)).delete("breeze_purge"),r.delete("_wpnonce"),history.replaceState(null,"","?"+r+location.hash)),e.on("change","#bz-lazy-load",function(){var e=n("#native-lazy-option"),t=n("#native-lazy-option-iframe");!0===n(this).is(":checked")?(e.show(),t.show()):(e.hide(),t.hide(),n("#bz-lazy-load-nat").attr("checked",!1),n("#bz-lazy-load-iframe").attr("checked",!1))}),e.on("change","#minification-css",function(){var e=n("#font-display-swap"),t=n("#font-display"),a=n("#include-inline-css"),i=n("#group-css"),s=n("#exclude-css");n(this).is(":checked")?(e.show(),s.closest("div.br-option-item").removeClass("br-apply-disable"),i.closest("div.br-option-item").removeClass("br-apply-disable"),a.closest("div.br-option-item").removeClass("br-apply-disable")):(e.hide(),t.removeAttr("checked"),a.prop("checked",!1),i.prop("checked",!1),s.closest("div.br-option-item").addClass("br-apply-disable"),i.closest("div.br-option-item").addClass("br-apply-disable"),a.closest("div.br-option-item").addClass("br-apply-disable"))}),e.on("change","#minification-js",function(){var e=n("#include-inline-js"),t=n("#group-js"),a=n("#exclude-js");n(this).is(":checked")?(a.closest("div.br-option-item").removeClass("br-apply-disable"),t.closest("div.br-option-item").removeClass("br-apply-disable"),e.closest("div.br-option-item").removeClass("br-apply-disable")):(e.prop("checked",!1),t.prop("checked",!1),a.closest("div.br-option-item").addClass("br-apply-disable"),t.closest("div.br-option-item").addClass("br-apply-disable"),e.closest("div.br-option-item").addClass("br-apply-disable"))}),e.on("change","#breeze-delay-all-js",function(){var e=n("#breeze-delay-js-scripts-div-all"),t=n("#enable-js-delay");n(this).is(":checked")?(e.show(),n('input[name="enable-js-delay"]').prop("checked",!1),n("#breeze-delay-js-scripts-div").hide(),t.attr("disabled","disabled")):(e.hide(),t.removeAttr("disabled"))}),e.on("change","#enable-js-delay",function(){var e=n("#breeze-delay-js-scripts-div"),t=n("#breeze-delay-all-js");n(this).is(":checked")?(e.show(),n('input[name="breeze-delay-all-js"]').prop("checked",!1),n("#breeze-delay-js-scripts-div-all").hide(),t.attr("disabled","disabled")):(e.hide(),t.removeAttr("disabled"))})});var $valid_json=!1;jQuery(document).ready(function(r){var e=r(".breeze-box");function o(){e.on("click","span.item-remove",function(){var e=r(this).closest(".breeze-input-group");e.fadeOut(300,function(){e.remove(),d()})})}function c(){r(".breeze-list-url").length&&r(".breeze-list-url").sortable({handle:r("span.sort-handle"),stop:d})}function l(){r(".sort-handle span").unbind("click").click(function(e){var t=r(this).parents(".breeze-input-group");r(this).hasClass("moveUp")?t.insertBefore(t.prev()):t.insertAfter(t.next()),d()})}function d(){var e=r(".breeze-list-url");e.find(".breeze-input-group").find(".sort-handle").find("span").removeClass("blur"),e.find(".breeze-input-group:first-child").find(".moveUp").addClass("blur"),e.find(".breeze-input-group:last-child").find(".moveDown").addClass("blur")}r('input[name="all_control"]').click(function(){1==r(this).is(":checked")?r(".clean-data").prop("checked",!0):r(".clean-data").prop("checked",!1)}),r(".clean-data").click(function(){0==r(this).is(":checked")&&r('input[name="all_control"]').prop("checked",!1)}),o(),c(),l(),d(),e.on("keyup change blur",".breeze-input-url",function(){var e=r(this).val();""!==e&&(!0==!!/^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/.test(e)?r(this).removeClass("is-invalid-url"):r(this).addClass("is-invalid-url"))}),e.on("click","button.add-url",function(){var e=-1<r(this).attr("id").indexOf("defer"),t=-1<r(this).attr("id").indexOf("preload-fonts"),a=r(this).closest("div.br-option").find(".breeze-list-url"),i="",s=a.find(".breeze-input-group"),n=!1;if(s.each(function(){var e=r(this).find(".breeze-input-url");if(""===e.val().trim())return e.focus(),!(n=!0)}),n)return!1;i+='<div class="breeze-input-group">',i+=' <input type="text" size="98"',i+='class="breeze-input-url"',i+=t?'name="breeze-preload-font[]"':e?'name="defer-js[]"':'name="move-to-footer-js[]"',i+='placeholder="Enter URL..."',i+='value="" />',i+=' <span class="sort-handle">',i+=' <span class="dashicons dashicons-arrow-up moveUp"></span>',i+=' <span class="dashicons dashicons-arrow-down moveDown"></span>',i+=" </span>",i+=' <span class="dashicons dashicons-no item-remove" title="Remove"></span>',a.append(i+="</div>"),o(),c(),l(),d()}),r("#breeze-tabs .nav-tab").click(function(e){e.preventDefault(),r("#breeze-tabs .nav-tab").removeClass("active"),r(e.target).addClass("active"),id_tab=r(this).data("tab-id"),r("#tab-"+id_tab).addClass("active"),r("#breeze-tabs-content .tab-pane").removeClass("active"),r("#tab-content-"+id_tab).addClass("active"),document.cookie="breeze_active_tab="+id_tab,"faq"===id_tab?(r("#breeze-and-cloudways").hide(),r("#faq-content").length&&r("#faq-content").accordion({collapsible:!0,animate:200,header:".faq-question",heightStyle:"content"})):r("#breeze-and-cloudways").show()}),active_tab=function(e){for(var t=e+"=",a=document.cookie.split(";"),i=0;i<a.length;i++){for(var s=a[i];" "==s.charAt(0);)s=s.substring(1);if(0==s.indexOf(t))return s.substring(t.length,s.length)}return""}("breeze_active_tab"),active_tab=active_tab||"basic","import_export"===active_tab&&(active_tab="basic"),0===r("#tab-"+active_tab).length?(firstTab=r("#breeze-tabs").find("a:first-child"),firstTab.length&&(tabType=firstTab.attr("id").replace("tab-",""),firstTab.addClass("active"),r("#tab-content-"+tabType).addClass("active"))):(r("#tab-"+active_tab).addClass("active"),r("#tab-content-"+active_tab).addClass("active")),"faq"===active_tab?(r("#breeze-and-cloudways").hide(),r("#faq-content").length&&r("#faq-content").accordion({collapsible:!0,animate:200,header:".faq-question",heightStyle:"content"})):r("#breeze-and-cloudways").show();var t,a=["faq"],i=!0,s=!1,n=r("#breeze-inherit-settings-toggle");function b(e,t){var a=e.split("?");if(2<=a.length){for(var i=encodeURIComponent(t)+"=",s=a[1].split(/[&;]/g),n=s.length;0<n--;)-1!==s[n].lastIndexOf(i,0)&&s.splice(n,1);return a[0]+(0<s.length?"?"+s.join("&"):"")}return e}n.length&&(r("input",n).on("change",function(){var t="1"==r(this).val();r("#breeze-tabs").toggleClass("tabs-hidden",t),r("#breeze-tabs-content").toggleClass("tabs-hidden",t),r("#breeze-tabs .nav-tab").each(function(){var e=r(this).data("tab-id");-1===r.inArray(e,a)&&(r(this).toggleClass("inactive",t),r("#breeze-tabs-content #tab-content-"+e).toggleClass("inactive",t))}),s=!r(this).parents(".radio-field").hasClass("active")}),r("#breeze-tabs-content form").on("submit",function(e){var t=r(this);i&&s&&(e.preventDefault(),r.ajax({url:window.location,method:"post",data:n.serializeArray(),beforeSend:function(){n.addClass("loading")},complete:function(){n.removeClass("loading"),s=!1,t.submit()},success:function(){r("input:checked",n).parents(".radio-field").addClass("active").siblings().removeClass("active")}}))})),r("#breeze-database-optimize").on("click",function(e){i=!1}),r("#tab-content-database .submit input").on("click",function(e){r("#tab-content-database input[type=checkbox]").attr("checked",!1)}),window.history&&"function"==typeof window.history.pushState&&(t=b(window.location.href,"save-settings"),t=b(t,"database-cleanup"),window.history.pushState(null,null,t)),e.on("click tap","#breeze_export_settings",function(){$network=r("#breeze-level").val(),window.location=ajaxurl+"?action=breeze_export_json&network_level="+$network}),r("#breeze_import_btn").attr("disabled","disabled"),e.on("change","#breeze_import_settings",function(){var e=this.files[0],t=r("#file-selected"),a=r("#file-error"),i=r("#breeze_import_btn");t.html(e.name),"application/json"!==e.type?($valid_json=!1,t.removeClass("file_green file_red").addClass("file_red"),a.html("File must be JSON"),i.attr("disabled","disabled")):($valid_json=!0,t.removeClass("file_green file_red").addClass("file_green"),a.html(""),i.removeAttr("disabled")),r(".br-file-text").remove()}),e.on("click tap","#breeze_import_btn",function(){var e,t,a,i;!0===$valid_json&&(network=r("#breeze-level").val(),e=r("#breeze_import_settings").get(0).files[0],(t=new FormData).append("action","breeze_import_json"),t.append("network_level",network),t.append("breeze_import_file",e),a=r("#file-selected"),i=r("#file-error"),a.removeClass("file_green file_red").addClass("file_green"),a.html('<div class="br-loader-spinner import_settings"><div></div><div></div><div></div><div></div></div>'),r.ajax({type:"POST",url:ajaxurl,data:t,processData:!1,contentType:!1,enctype:"multipart/form-data",mimeType:"multipart/form-data",cache:!1,dataType:"json",success:function(e){1==e.success?(a.removeClass("file_green file_red").addClass("file_green"),a.html(e.data),i.html(""),alert(e.data),window.location.reload(!0)):(a.removeClass("file_green file_red"),a.html(""),i.html(e.data[0].message))},error:function(e,t,a){},complete:function(e,t){}}))})}),function(n){var s=[];setTimeout(function(){var e=n("#message-clear-cache-top");e.length&&(e.prependTo("#wpbody-content"),e.show())},1e3),n(window).on("resize",function(){632<=n(this).height()&&n(".br-link").removeAttr("style")});function r(e){for(var t=e+"=",a=document.cookie.split(";"),i=0;i<a.length;i++){for(var s=a[i];" "==s.charAt(0);)s=s.substring(1);if(0==s.indexOf(t))return s.substring(t.length,s.length)}return""}n(".breeze-box .br-link").on("click tap","a",function(e){e.preventDefault();var a=this.dataset.tabId,t=n(".br-options");o=(o=r("breeze_active_tab"))||"basic",n(".br-link").removeClass("br-active"),n(".br-link").each(function(e,t){var a=t.dataset.breezeLink,i=n(this).find("img"),t=i.get(0).dataset.path;i.attr("src",t+a+".png")});var i=n(this).closest(".br-link");i.addClass("br-active");e=i.find("img"),i=e.get(0).dataset.path;e.attr("src",i+a+"-active.png"),t.html('<div class="br-loader-spinner loading_tab"><div></div><div></div><div></div><div></div></div>'),!0===n(".br-mobile-menu").is(":visible")&&n(".br-link").fadeOut(),n.ajax({type:"GET",url:ajaxurl,data:{action:"breeze_load_options_tab",request_tab:a,"is-network":n("body").hasClass("network-admin")},contentType:"text/html; charset=UTF-8",dataType:"html",success:function(e){t.html(e)},error:function(e,t,a){},complete:function(e,t){!function(){var t=n(".breeze-per");t.length&&(t.empty(),t.append("<p>Re-checking permissions, please wait...</p>"));n.ajax({type:"GET",url:ajaxurl,data:{action:"breeze_file_permission_check","is-network":n("body").hasClass("network-admin")},dataType:"html",success:function(e){""===e?t.remove():t.length?(n(e).insertBefore(t),t.remove()):n("#wpbody-content").prepend(e)},error:function(e,t,a){},complete:function(e,t){}})}(),document.cookie="breeze_active_tab="+a,"faq"===a&&n("#faq-content").length&&n("#faq-content").accordion({collapsible:!0,animate:200,header:".faq-question",heightStyle:"content"}),s=[]}})});var e,o=r("breeze_active_tab");n("#tab-basic").closest("div.br-link").hasClass("br-hide")?n("#tab-faq").trigger("click"):void 0!==o&&""!==o?(e=n("#tab-"+(o="import_export"===o?"basic":o))).length&&e.trigger("click"):(t=n("#tab-basic")).length&&t.trigger("click");var t=n(".breeze-box");t.on("click",".br-db-item",function(){var e=this.dataset.section;if(n(this).hasClass("br-db-selected")){if(n(this).removeClass("br-db-selected"),s.length){for(var t=[],a=0;a<s.length;a++)e!==s[a]&&t.push(s[a]);s=t}}else n(this).addClass("br-db-selected"),s.push(e);var i=n("#optimize-selected-services");s.length?i.show():i.hide()}),t.on("click","#optimize-selected-services",function(e){var t=!1;!1===(t=s.length?!0:t)?alert("Please select an options first"):confirm("Proceed to optimize the selected items?")&&n.ajax({type:"POST",url:ajaxurl,data:{action:"breeze_purge_database",action_type:"custom",services:JSON.stringify(Object.assign({},s)),security:breeze_token_name.breeze_purge_database,"is-network":n("body").hasClass("network-admin")},dataType:"JSON",success:function(e){n("div.br-db-item").each(function(e,t){var a=t.dataset.section;-1!==n.inArray(a,s)&&(n(t).find("h3").find("span").removeClass("br-has").html("0"),n(t).removeClass("br-db-selected"))}),alert("Optimization process finished"),n("#tab-database").trigger("click")},error:function(e,t,a){},complete:function(e,t){s=[]}})}),t.on("click",".do_clean_action",function(e){e.preventDefault();var e=this.dataset.section,t=n(this).closest("div.br-db-item"),a=t.get(0).dataset.sectionTitle;confirm("Confirm the action to clean "+a)&&(n(this).addClass("opac"),n.ajax({type:"POST",url:ajaxurl,data:{action:"breeze_purge_database",action_type:e,security:breeze_token_name.breeze_purge_database,"is-network":n("body").hasClass("network-admin")},dataType:"JSON",success:function(e){t.find("h3").find("span").removeClass("br-has").html("0"),alert("Data for "+a+" has been cleaned")},error:function(e,t,a){},complete:function(e,t){}}))}),t.on("change","#br-clean-all",function(e){var t=n(this).is(":checked"),a=n("#br-clean-all-cta");!0===t?a.removeAttr("disabled"):a.attr("disabled","disabled")}),t.on("click","#br-clean-all-cta",function(e){!1===n(this).is(":disabled")&&confirm("Proceed to clean all trashed posts and pages?")&&n.ajax({type:"POST",url:ajaxurl,data:{action:"breeze_purge_database",action_type:"all",security:breeze_token_name.breeze_purge_database,"is-network":n("body").hasClass("network-admin")},dataType:"JSON",success:function(e){n(".br-clean-label").find("span").removeClass("br-has").html("( 0 )"),n("div.br-db-item").each(function(e,t){n(t).find("h3").find("span").removeClass("br-has").html("0")});var t=n("#br-clean-all");t.is(":checked")&&t.trigger("click"),alert("Clean all process finished")},error:function(e,t,a){},complete:function(e,t){}})}),t.on("click",".br-mobile-menu",function(){n(".br-link").fadeToggle()}),t.on("click",".br-submit-save",function(e){e.preventDefault();var e=n(this).closest("form"),t=e.get(0).dataset.section,e={action:"save_settings_tab_"+t,security:breeze_token_name.breeze_save_options,"form-data":e.serialize(),"is-network":n("body").hasClass("network-admin")};n(".br-options").html('<div class="br-loader-spinner saving_settings"><div></div><div></div><div></div><div></div></div>'),n.ajax({type:"POST",url:ajaxurl,data:e,dataType:"JSON",success:function(e){n("#tab-"+t).trigger("click")},error:function(e,t,a){},complete:function(e,t){}})}),n(document).on("change",'input:radio[name="inherit-settings"]',function(){var a=n('input:radio[name="inherit-settings"]:checked').val(),i=".br-is-network",s=".br-is-custom",e=n(this).closest("div.change-settings-use").find("input#breeze_inherit_settings_nonce").val();n(".br-overlay-disable").addClass("br-hide");e={action:"save_settings_tab_inherit","is-selected":a,security:e,"is-network":n("body").hasClass("network-admin")};n("<div/>",{class:"br-inherit-wait",html:'<div class="br-loader-spinner switch-to-settings"><div></div><div></div><div></div><div></div></div>'}).appendTo(n("#wpcontent")),n.ajax({type:"POST",url:ajaxurl,data:e,dataType:"JSON",success:function(e){},error:function(e,t,a){},complete:function(e,t){n("#wpcontent").find("div.br-inherit-wait").remove(),"0"===a||!0===a?(n(i).removeClass("br-show").addClass("br-hide"),n(s).removeClass("br-hide").addClass("br-show"),n(".br-link").removeClass("br-hide"),n("#tab-basic").trigger("click")):(n(s).removeClass("br-show").addClass("br-hide"),n(i).removeClass("br-hide").addClass("br-show"),n(".br-link").each(function(e,t){"faq"!==t.dataset.breezeLink&&n(t).addClass("br-hide")}),n("#tab-faq").trigger("click"))}})}),n(document).on("click",".notice-dismiss",function(){var e=n(this).closest("div.notice");e.hasClass("breeze-notice")&&e.fadeOut("fast").remove()})}(jQuery);
|
1 |
/*! Created by Cloudways
|
2 |
+
On 16-08-2022 */
|
3 |
|
4 |
+
jQuery(document).ready(function(n){var e=n(".breeze-box");n("#breeze-plugins-notice").length&&n(document).on("click tap",".notice-dismiss",function(){n.ajax({type:"POST",url:ajaxurl,data:{action:"compatibility_warning_close",breeze_close_warning:"1"},dataType:"json",success:function(e){},error:function(e,t,a){},complete:function(e,t){}})}),n(document).on("click","#wp-admin-bar-breeze-purge-varnish-group",function(e){e.preventDefault(),a()}),n(document).on("click","#wp-admin-bar-breeze-purge-object-cache-group",function(e){e.preventDefault(),n.ajax({url:ajaxurl,dataType:"json",method:"POST",data:{action:"breeze_purge_opcache",is_network:n("body").hasClass("network-admin"),security:breeze_token_name.breeze_purge_opcache},success:function(e){current=location.href,e.clear?(n("#wpbody #wpbody-content").prepend('<div id="message" class="notice notice-success is-dismissible breeze-notice" style="margin-top:10px; margin-bottom:10px;padding: 10px;margin-left: 0;"><p><strong>Object Cache has been purged.</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>'),setTimeout(function(){t=!0},2e3)):(window.location.href=current+"breeze-msg=purge-fail",t=!0,location.reload())}})}),n(document).on("click","#wp-admin-bar-breeze-purge-file-group",function(e){e.preventDefault(),n.ajax({url:ajaxurl,dataType:"json",method:"POST",data:{action:"breeze_purge_file",security:breeze_token_name.breeze_purge_cache},success:function(e){current=location.href;var t=e=parseFloat(e);window.location.href=current+"#breeze-msg=success-cleancache&file="+e,div=0<t?'<div id="message" class="notice notice-success is-dismissible breeze-notice" style="margin-top:10px; margin-bottom:10px;padding: 10px;margin-left: 0;"><p><strong>Internal cache has been purged: '+t+'Kb cleaned</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>':'<div id="message" class="notice notice-success is-dismissible breeze-notice" style="margin-top:10px; margin-bottom:10px;padding: 10px;margin-left: 0;"><p><strong>Internal cache has been purged.</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>',n("#wpbody #wpbody-content").prepend(div)}})});var t=!0;function a(){n.ajax({url:ajaxurl,dataType:"json",method:"POST",data:{action:"breeze_purge_varnish",is_network:n("body").hasClass("network-admin"),security:breeze_token_name.breeze_purge_varnish},success:function(e){current=location.href,e.clear?(n("#wpbody #wpbody-content").prepend('<div id="message" class="notice notice-success is-dismissible breeze-notice" style="margin-top:10px; margin-bottom:10px;padding: 10px;margin-left: 0;"><p><strong>Varnish Cache has been purged.</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>'),setTimeout(function(){t=!0},2e3)):(window.location.href=current+"breeze-msg=purge-fail",t=!0,location.reload())}})}n(".breeze-box").on("click","#purge-varnish-button",function(e){e.preventDefault(),!0===t&&(t=!1,n(this).addClass("br-is-disabled"),a())});var i,s,r,o=location.href,c=parseFloat((i="file",s=(s=o)||window.location.href,i=i.replace(/[\[\]]/g,"\\$&"),(s=new RegExp("[?&]"+i+"(=([^&#]*)|&|#|$)").exec(s))?s[2]?decodeURIComponent(s[2].replace(/\+/g," ")):"":null));n(window).on("load",function(){var e,t;/wp-admin/i.test(o)&&(e="",0<o.indexOf("msg=success-cleancache")&&!isNaN(c)&&(e=0<c?'<div id="message" class="notice notice-success is-dismissible breeze-notice" style="margin-top:10px; margin-bottom:10px;padding: 10px;"><p><strong>Internal cache has been purged: '+c+'Kb cleaned</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>':'<div id="message" class="notice notice-success is-dismissible breeze-notice" style="margin-top:10px; margin-bottom:10px;padding: 10px;"><p><strong>Internal cache has been purged.</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>',n("#wpbody .wrap h1").after(e),t=o.split("breeze-msg"),setTimeout(function(){window.location=t[0]},2e3)))}),n("#breeze-hide-install-msg").unbind("click").click(function(){n(this).closest("div.notice").fadeOut()}),-1!==(r=location.search).indexOf("breeze_purge=1")&&-1!==r.indexOf("_wpnonce")&&((r=new URLSearchParams(location.search)).delete("breeze_purge"),r.delete("_wpnonce"),history.replaceState(null,"","?"+r+location.hash)),e.on("change","#bz-lazy-load",function(){var e=n("#native-lazy-option"),t=n("#native-lazy-option-iframe");!0===n(this).is(":checked")?(e.show(),t.show()):(e.hide(),t.hide(),n("#bz-lazy-load-nat").attr("checked",!1),n("#bz-lazy-load-iframe").attr("checked",!1))}),e.on("change","#minification-css",function(){var e=n("#font-display-swap"),t=n("#font-display"),a=n("#include-inline-css"),i=n("#group-css"),s=n("#exclude-css");n(this).is(":checked")?(e.show(),s.closest("div.br-option-item").removeClass("br-apply-disable"),i.closest("div.br-option-item").removeClass("br-apply-disable"),a.closest("div.br-option-item").removeClass("br-apply-disable")):(e.hide(),t.removeAttr("checked"),a.prop("checked",!1),i.prop("checked",!1),s.closest("div.br-option-item").addClass("br-apply-disable"),i.closest("div.br-option-item").addClass("br-apply-disable"),a.closest("div.br-option-item").addClass("br-apply-disable"))}),e.on("change","#minification-js",function(){var e=n("#include-inline-js"),t=n("#group-js"),a=n("#exclude-js");n(this).is(":checked")?(a.closest("div.br-option-item").removeClass("br-apply-disable"),t.closest("div.br-option-item").removeClass("br-apply-disable"),e.closest("div.br-option-item").removeClass("br-apply-disable")):(e.prop("checked",!1),t.prop("checked",!1),a.closest("div.br-option-item").addClass("br-apply-disable"),t.closest("div.br-option-item").addClass("br-apply-disable"),e.closest("div.br-option-item").addClass("br-apply-disable"))}),e.on("change","#breeze-delay-all-js",function(){var e=n("#breeze-delay-js-scripts-div-all"),t=n("#enable-js-delay");n(this).is(":checked")?(e.show(),n('input[name="enable-js-delay"]').prop("checked",!1),n("#breeze-delay-js-scripts-div").hide(),t.attr("disabled","disabled")):(e.hide(),t.removeAttr("disabled"))}),e.on("change","#enable-js-delay",function(){var e=n("#breeze-delay-js-scripts-div"),t=n("#breeze-delay-all-js");n(this).is(":checked")?(e.show(),n('input[name="breeze-delay-all-js"]').prop("checked",!1),n("#breeze-delay-js-scripts-div-all").hide(),t.attr("disabled","disabled")):(e.hide(),t.removeAttr("disabled"))})});var $valid_json=!1;jQuery(document).ready(function(r){var e,t=r(".breeze-box");function o(){t.on("click","span.item-remove",function(){var e=r(this).closest(".breeze-input-group");e.fadeOut(300,function(){e.remove(),d()})})}function c(){r(".breeze-list-url").length&&r(".breeze-list-url").sortable({handle:r("span.sort-handle"),stop:d})}function l(){r(".sort-handle span").unbind("click").click(function(e){var t=r(this).parents(".breeze-input-group");r(this).hasClass("moveUp")?t.insertBefore(t.prev()):t.insertAfter(t.next()),d()})}function d(){var e=r(".breeze-list-url");e.find(".breeze-input-group").find(".sort-handle").find("span").removeClass("blur"),e.find(".breeze-input-group:first-child").find(".moveUp").addClass("blur"),e.find(".breeze-input-group:last-child").find(".moveDown").addClass("blur")}r('input[name="all_control"]').click(function(){1==r(this).is(":checked")?r(".clean-data").prop("checked",!0):r(".clean-data").prop("checked",!1)}),r(".clean-data").click(function(){0==r(this).is(":checked")&&r('input[name="all_control"]').prop("checked",!1)}),o(),c(),l(),d(),t.on("keyup change blur",".breeze-input-url",function(){var e=r(this).val();""!==e&&(!0==!!/^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/.test(e)?r(this).removeClass("is-invalid-url"):r(this).addClass("is-invalid-url"))}),t.on("click","button.add-url",function(){var e=-1<r(this).attr("id").indexOf("defer"),t=-1<r(this).attr("id").indexOf("preload-fonts"),a=r(this).closest("div.br-option").find(".breeze-list-url"),i="",s=a.find(".breeze-input-group"),n=!1;if(s.each(function(){var e=r(this).find(".breeze-input-url");if(""===e.val().trim())return e.focus(),!(n=!0)}),n)return!1;i+='<div class="breeze-input-group">',i+=' <input type="text" size="98"',i+='class="breeze-input-url"',i+=t?'name="breeze-preload-font[]"':e?'name="defer-js[]"':'name="move-to-footer-js[]"',i+='placeholder="Enter URL..."',i+='value="" />',i+=' <span class="sort-handle">',i+=' <span class="dashicons dashicons-arrow-up moveUp"></span>',i+=' <span class="dashicons dashicons-arrow-down moveDown"></span>',i+=" </span>",i+=' <span class="dashicons dashicons-no item-remove" title="Remove"></span>',a.append(i+="</div>"),o(),c(),l(),d()}),r("#breeze-tabs .nav-tab").click(function(e){e.preventDefault(),r("#breeze-tabs .nav-tab").removeClass("active"),r(e.target).addClass("active"),id_tab=r(this).data("tab-id"),r("#tab-"+id_tab).addClass("active"),r("#breeze-tabs-content .tab-pane").removeClass("active"),r("#tab-content-"+id_tab).addClass("active"),document.cookie="breeze_active_tab="+id_tab,"faq"===id_tab?(r("#breeze-and-cloudways").hide(),r("#faq-content").length&&r("#faq-content").accordion({collapsible:!0,animate:200,header:".faq-question",heightStyle:"content"})):r("#breeze-and-cloudways").show()}),e=function(e){for(var t=e+"=",a=document.cookie.split(";"),i=0;i<a.length;i++){for(var s=a[i];" "==s.charAt(0);)s=s.substring(1);if(0==s.indexOf(t))return s.substring(t.length,s.length)}return""}("breeze_active_tab"),0===r("#tab-"+(e="import_export"===(e=e||"basic")?"basic":e)).length?(firstTab=r("#breeze-tabs").find("a:first-child"),firstTab.length&&(tabType=firstTab.attr("id").replace("tab-",""),firstTab.addClass("active"),r("#tab-content-"+tabType).addClass("active"))):(r("#tab-"+e).addClass("active"),r("#tab-content-"+e).addClass("active")),"faq"===e?(r("#breeze-and-cloudways").hide(),r("#faq-content").length&&r("#faq-content").accordion({collapsible:!0,animate:200,header:".faq-question",heightStyle:"content"})):r("#breeze-and-cloudways").show();var a,i=["faq"],s=!0,n=!1,b=r("#breeze-inherit-settings-toggle");function p(e,t){var a=e.split("?");if(2<=a.length){for(var i=encodeURIComponent(t)+"=",s=a[1].split(/[&;]/g),n=s.length;0<n--;)-1!==s[n].lastIndexOf(i,0)&&s.splice(n,1);return a[0]+(0<s.length?"?"+s.join("&"):"")}return e}b.length&&(r("input",b).on("change",function(){var t="1"==r(this).val();r("#breeze-tabs").toggleClass("tabs-hidden",t),r("#breeze-tabs-content").toggleClass("tabs-hidden",t),r("#breeze-tabs .nav-tab").each(function(){var e=r(this).data("tab-id");-1===r.inArray(e,i)&&(r(this).toggleClass("inactive",t),r("#breeze-tabs-content #tab-content-"+e).toggleClass("inactive",t))}),n=!r(this).parents(".radio-field").hasClass("active")}),r("#breeze-tabs-content form").on("submit",function(e){var t=r(this);s&&n&&(e.preventDefault(),r.ajax({url:window.location,method:"post",data:b.serializeArray(),beforeSend:function(){b.addClass("loading")},complete:function(){b.removeClass("loading"),n=!1,t.submit()},success:function(){r("input:checked",b).parents(".radio-field").addClass("active").siblings().removeClass("active")}}))})),r("#breeze-database-optimize").on("click",function(e){s=!1}),r("#tab-content-database .submit input").on("click",function(e){r("#tab-content-database input[type=checkbox]").attr("checked",!1)}),window.history&&"function"==typeof window.history.pushState&&(a=p(window.location.href,"save-settings"),a=p(a,"database-cleanup"),window.history.pushState(null,null,a)),t.on("click tap","#breeze_export_settings",function(){$network=r("#breeze-level").val(),window.location=ajaxurl+"?action=breeze_export_json&network_level="+$network}),r("#breeze_import_btn").attr("disabled","disabled"),t.on("change","#breeze_import_settings",function(){var e=this.files[0],t=r("#file-selected"),a=r("#file-error"),i=r("#breeze_import_btn");t.html(e.name),"application/json"!==e.type?($valid_json=!1,t.removeClass("file_green file_red").addClass("file_red"),a.html("File must be JSON"),i.attr("disabled","disabled")):($valid_json=!0,t.removeClass("file_green file_red").addClass("file_green"),a.html(""),i.removeAttr("disabled")),r(".br-file-text").remove()}),t.on("click tap","#breeze_import_btn",function(){var e,t,a,i,s;!0===$valid_json&&(e=r("#breeze-level").val(),t=r("#breeze_import_settings").get(0).files[0],(a=new FormData).append("action","breeze_import_json"),a.append("network_level",e),a.append("breeze_import_file",t),i=r("#file-selected"),s=r("#file-error"),i.removeClass("file_green file_red").addClass("file_green"),i.html('<div class="br-loader-spinner import_settings"><div></div><div></div><div></div><div></div></div>'),r.ajax({type:"POST",url:ajaxurl,data:a,processData:!1,contentType:!1,enctype:"multipart/form-data",mimeType:"multipart/form-data",cache:!1,dataType:"json",success:function(e){1==e.success?(i.removeClass("file_green file_red").addClass("file_green"),i.html(e.data),s.html(""),alert(e.data),window.location.reload(!0)):(i.removeClass("file_green file_red"),i.html(""),s.html(e.data[0].message))},error:function(e,t,a){},complete:function(e,t){}}))})}),function(n){var s=[];setTimeout(function(){var e=n("#message-clear-cache-top");e.length&&(e.prependTo("#wpbody-content"),e.show())},1e3),n(window).on("resize",function(){632<=n(this).height()&&n(".br-link").removeAttr("style")});function r(e){for(var t=e+"=",a=document.cookie.split(";"),i=0;i<a.length;i++){for(var s=a[i];" "==s.charAt(0);)s=s.substring(1);if(0==s.indexOf(t))return s.substring(t.length,s.length)}return""}n(".breeze-box .br-link").on("click tap","a",function(e){e.preventDefault();var a=this.dataset.tabId,t=n(".br-options");o=(o=r("breeze_active_tab"))||"basic",n(".br-link").removeClass("br-active"),n(".br-link").each(function(e,t){var a=t.dataset.breezeLink,i=n(this).find("img"),t=i.get(0).dataset.path;i.attr("src",t+a+".png")});var i=n(this).closest(".br-link");i.addClass("br-active");e=i.find("img"),i=e.get(0).dataset.path;e.attr("src",i+a+"-active.png"),t.html('<div class="br-loader-spinner loading_tab"><div></div><div></div><div></div><div></div></div>'),!0===n(".br-mobile-menu").is(":visible")&&n(".br-link").fadeOut(),n.ajax({type:"GET",url:ajaxurl,data:{action:"breeze_load_options_tab",request_tab:a,"is-network":n("body").hasClass("network-admin")},contentType:"text/html; charset=UTF-8",dataType:"html",success:function(e){t.html(e)},error:function(e,t,a){},complete:function(e,t){!function(){var t=n(".breeze-per");t.length&&(t.empty(),t.append("<p>Re-checking permissions, please wait...</p>"));n.ajax({type:"GET",url:ajaxurl,data:{action:"breeze_file_permission_check","is-network":n("body").hasClass("network-admin")},dataType:"html",success:function(e){""===e?t.remove():t.length?(n(e).insertBefore(t),t.remove()):n("#wpbody-content").prepend(e)},error:function(e,t,a){},complete:function(e,t){}})}(),document.cookie="breeze_active_tab="+a,"faq"===a&&n("#faq-content").length&&n("#faq-content").accordion({collapsible:!0,animate:200,header:".faq-question",heightStyle:"content"}),s=[]}})});var e,o=r("breeze_active_tab");n("#tab-basic").closest("div.br-link").hasClass("br-hide")?n("#tab-faq").trigger("click"):void 0!==o&&""!==o?(e=n("#tab-"+(o="import_export"===o?"basic":o))).length&&e.trigger("click"):(t=n("#tab-basic")).length&&t.trigger("click");var t=n(".breeze-box");t.on("click",".br-db-item",function(){var e=this.dataset.section;if(n(this).hasClass("br-db-selected")){if(n(this).removeClass("br-db-selected"),s.length){for(var t=[],a=0;a<s.length;a++)e!==s[a]&&t.push(s[a]);s=t}}else n(this).addClass("br-db-selected"),s.push(e);var i=n("#optimize-selected-services");s.length?i.show():i.hide()}),t.on("click","#optimize-selected-services",function(e){var t=!1;!1===(t=s.length?!0:t)?alert("Please select an options first"):confirm("Proceed to optimize the selected items?")&&n.ajax({type:"POST",url:ajaxurl,data:{action:"breeze_purge_database",action_type:"custom",services:JSON.stringify(Object.assign({},s)),security:breeze_token_name.breeze_purge_database,"is-network":n("body").hasClass("network-admin")},dataType:"JSON",success:function(e){n("div.br-db-item").each(function(e,t){var a=t.dataset.section;-1!==n.inArray(a,s)&&(n(t).find("h3").find("span").removeClass("br-has").html("0"),n(t).removeClass("br-db-selected"))}),alert("Optimization process finished"),n("#tab-database").trigger("click")},error:function(e,t,a){},complete:function(e,t){s=[]}})}),t.on("click",".do_clean_action",function(e){e.preventDefault();var e=this.dataset.section,t=n(this).closest("div.br-db-item"),a=t.get(0).dataset.sectionTitle;confirm("Confirm the action to clean "+a)&&(n(this).addClass("opac"),n.ajax({type:"POST",url:ajaxurl,data:{action:"breeze_purge_database",action_type:e,security:breeze_token_name.breeze_purge_database,"is-network":n("body").hasClass("network-admin")},dataType:"JSON",success:function(e){t.find("h3").find("span").removeClass("br-has").html("0"),alert("Data for "+a+" has been cleaned")},error:function(e,t,a){},complete:function(e,t){}}))}),t.on("change","#br-clean-all",function(e){var t=n(this).is(":checked"),a=n("#br-clean-all-cta");!0===t?a.removeAttr("disabled"):a.attr("disabled","disabled")}),t.on("click","#br-clean-all-cta",function(e){!1===n(this).is(":disabled")&&confirm("Proceed to clean all trashed posts and pages?")&&n.ajax({type:"POST",url:ajaxurl,data:{action:"breeze_purge_database",action_type:"all",security:breeze_token_name.breeze_purge_database,"is-network":n("body").hasClass("network-admin")},dataType:"JSON",success:function(e){n(".br-clean-label").find("span").removeClass("br-has").html("( 0 )"),n("div.br-db-item").each(function(e,t){n(t).find("h3").find("span").removeClass("br-has").html("0")});var t=n("#br-clean-all");t.is(":checked")&&t.trigger("click"),alert("Clean all process finished")},error:function(e,t,a){},complete:function(e,t){}})}),t.on("click",".br-mobile-menu",function(){n(".br-link").fadeToggle()}),t.on("click",".br-submit-save",function(e){e.preventDefault();var e=n(this).closest("form"),t=e.get(0).dataset.section,e={action:"save_settings_tab_"+t,security:breeze_token_name.breeze_save_options,"form-data":e.serialize(),"is-network":n("body").hasClass("network-admin")};n(".br-options").html('<div class="br-loader-spinner saving_settings"><div></div><div></div><div></div><div></div></div>'),n.ajax({type:"POST",url:ajaxurl,data:e,dataType:"JSON",success:function(e){n("#tab-"+t).trigger("click")},error:function(e,t,a){},complete:function(e,t){}})}),n(document).on("change",'input:radio[name="inherit-settings"]',function(){var a=n('input:radio[name="inherit-settings"]:checked').val(),i=".br-is-network",s=".br-is-custom",e=n(this).closest("div.change-settings-use").find("input#breeze_inherit_settings_nonce").val();n(".br-overlay-disable").addClass("br-hide");e={action:"save_settings_tab_inherit","is-selected":a,security:e,"is-network":n("body").hasClass("network-admin")};n("<div/>",{class:"br-inherit-wait",html:'<div class="br-loader-spinner switch-to-settings"><div></div><div></div><div></div><div></div></div>'}).appendTo(n("#wpcontent")),n.ajax({type:"POST",url:ajaxurl,data:e,dataType:"JSON",success:function(e){},error:function(e,t,a){},complete:function(e,t){n("#wpcontent").find("div.br-inherit-wait").remove(),"0"===a||!0===a?(n(i).removeClass("br-show").addClass("br-hide"),n(s).removeClass("br-hide").addClass("br-show"),n(".br-link").removeClass("br-hide"),n("#tab-basic").trigger("click")):(n(s).removeClass("br-show").addClass("br-hide"),n(i).removeClass("br-hide").addClass("br-show"),n(".br-link").each(function(e,t){"faq"!==t.dataset.breezeLink&&n(t).addClass("br-hide")}),n("#tab-faq").trigger("click"))}})}),n(document).on("click",".notice-dismiss",function(){var e=n(this).closest("div.notice");e.hasClass("breeze-notice")&&e.fadeOut("fast").remove()})}(jQuery);
|
assets/js/js-front-end/breeze-lazy-load.min.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
/*! Created by Cloudways
|
2 |
-
On 16-
|
3 |
|
4 |
!function(e,t){t=t(e,e.document,Date);"object"==typeof module&&module.exports?module.exports=t:"function"==typeof define&&define.amd?define(t):e.lazySizes=t}(window,function(n,f,s){"use strict";var m,h;if(!function(){var e,t={lazyClass:"br-lazy",loadedClass:"br-loaded",loadingClass:"br-loading",preloadClass:"br-preload",errorClass:"br-error",autosizesClass:"br-autosizes",fastLoadedClass:"ls-is-cached",iframeLoadMode:0,srcAttr:"data-breeze",srcsetAttr:"data-brsrcset",sizesAttr:"data-brsizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};for(e in h=n.lazySizesConfig||n.lazysizesConfig||{},t)e in h||(h[e]=t[e])}(),!f||!f.getElementsByClassName)return{init:function(){},cfg:h,noSupport:!0};function c(e,t){M(e,t)||e.setAttribute("class",(e[g]("class")||"").trim()+" "+t)}function u(e,t){(t=M(e,t))&&e.setAttribute("class",(e[g]("class")||"").replace(t," "))}function z(e,t){var a;!l&&(a=n.picturefill||h.pf)?(t&&t.src&&!e[g]("srcset")&&e.setAttribute("srcset",t.src),a({reevaluate:!0,elements:[e]})):t&&t.src&&(e.src=t.src)}var a,i,t,o,r,y=f.documentElement,l=n.HTMLPictureElement,d="addEventListener",g="getAttribute",e=n[d].bind(n),v=n.setTimeout,p=n.requestAnimationFrame||v,b=n.requestIdleCallback,C=/^picture$/i,A=["load","error","lazyincluded","_lazyloaded"],E={},_=Array.prototype.forEach,M=function(e,t){return E[t]||(E[t]=new RegExp("(\\s|^)"+t+"(\\s|$)")),E[t].test(e[g]("class")||"")&&E[t]},N=function(t,a,e){var n=e?d:"removeEventListener";e&&N(t,a),A.forEach(function(e){t[n](e,a)})},w=function(e,t,a,n,i){var s=f.createEvent("Event");return(a=a||{}).instance=m,s.initEvent(t,!n,!i),s.detail=a,e.dispatchEvent(s),s},L=function(e,t){return(getComputedStyle(e,null)||{})[t]},x=function(e,t,a){for(a=a||e.offsetWidth;a<h.minSize&&t&&!e._lazysizesWidth;)a=t.offsetWidth,t=t.parentNode;return a},W=(o=[],r=t=[],B._lsFlush=S,B);function S(){var e=r;for(r=t.length?o:t,i=!(a=!0);e.length;)e.shift()();a=!1}function B(e,t){a&&!t?e.apply(this,arguments):(r.push(e),i||(i=!0,(f.hidden?v:p)(S)))}function T(a,e){return e?function(){W(a)}:function(){var e=this,t=arguments;W(function(){a.apply(e,t)})}}function F(e){function t(){var e=s.now()-n;e<99?v(t,99-e):(b||i)(i)}var a,n,i=function(){a=null,e()};return function(){n=s.now(),a=a||v(t,99)}}var R,D,k,H,O,P,$,q,I,U,j,G,J,K,Q,V,X,Y,Z,ee,te,ae,ne,ie,se,oe,re,le,de,ce,ue,fe=(Z=/^img$/i,ee=/^iframe$/i,te="onscroll"in n&&!/(gle|ing)bot/.test(navigator.userAgent),ie=-1,se=function(e){return(G=null==G?"hidden"==L(f.body,"visibility"):G)||!("hidden"==L(e.parentNode,"visibility")&&"hidden"==L(e,"visibility"))},J=he,Q=ne=ae=0,V=h.throttleDelay,X=h.ricTimeout,Y=b&&49<X?function(){b(ze,{timeout:X}),X!==h.ricTimeout&&(X=h.ricTimeout)}:T(function(){v(ze)},!0),re=T(ye),le=function(e){re({target:e.target})},de=T(function(t,e,a,n,i){var s,o,r,l,d;(r=w(t,"lazybeforeunveil",e)).defaultPrevented||(n&&(a?c(t,h.autosizesClass):t.setAttribute("sizes",n)),s=t[g](h.srcsetAttr),a=t[g](h.srcAttr),i&&(o=(d=t.parentNode)&&C.test(d.nodeName||"")),l=e.firesLoad||"src"in t&&(s||a||o),r={target:t},c(t,h.loadingClass),l&&(clearTimeout(k),k=v(me,2500),N(t,le,!0)),o&&_.call(d.getElementsByTagName("source"),ge),s?t.setAttribute("srcset",s):a&&!o&&(ee.test(t.nodeName)?(n=a,0==(d=(e=t).getAttribute("data-load-mode")||h.iframeLoadMode)?e.contentWindow.location.replace(n):1==d&&(e.src=n)):t.src=a),i&&(s||o)&&z(t,{src:a})),t._lazyRace&&delete t._lazyRace,u(t,h.lazyClass),W(function(){var e=t.complete&&1<t.naturalWidth;l&&!e||(e&&c(t,h.fastLoadedClass),ye(r),t._lazyCache=!0,v(function(){"_lazyCache"in t&&delete t._lazyCache},9)),"lazy"==t.loading&&ne--},!0)}),ue=F(function(){h.loadMode=3,oe()}),{_:function(){O=s.now(),m.elements=f.getElementsByClassName(h.lazyClass),R=f.getElementsByClassName(h.lazyClass+" "+h.preloadClass),e("scroll",oe,!0),e("resize",oe,!0),e("pageshow",function(e){var t;!e.persisted||(t=f.querySelectorAll("."+h.loadingClass)).length&&t.forEach&&p(function(){t.forEach(function(e){e.complete&&ce(e)})})}),n.MutationObserver?new MutationObserver(oe).observe(y,{childList:!0,subtree:!0,attributes:!0}):(y[d]("DOMNodeInserted",oe,!0),y[d]("DOMAttrModified",oe,!0),setInterval(oe,999)),e("hashchange",oe,!0),["focus","mouseover","click","load","transitionend","animationend"].forEach(function(e){f[d](e,oe,!0)}),/d$|^c/.test(f.readyState)?pe():(e("load",pe),f[d]("DOMContentLoaded",oe),v(pe,2e4)),m.elements.length?(he(),W._lsFlush()):oe()},checkElems:oe=function(e){var t;(e=!0===e)&&(X=33),K||(K=!0,(t=V-(s.now()-Q))<0&&(t=0),e||t<9?Y():v(Y,t))},unveil:ce=function(e){var t,a,n,i;e._lazyRace||(!(i="auto"==(n=(a=Z.test(e.nodeName))&&(e[g](h.sizesAttr)||e[g]("sizes"))))&&D||!a||!e[g]("src")&&!e.srcset||e.complete||M(e,h.errorClass)||!M(e,h.lazyClass))&&(t=w(e,"lazyunveilread").detail,i&&Ee.updateElem(e,!0,e.offsetWidth),e._lazyRace=!0,ne++,de(e,t,i,n,a))},_aLSL:ve});function me(e){ne--,e&&!(ne<0)&&e.target||(ne=0)}function he(){var e,t,a,n,i,s,o,r,l,d,c,u=m.elements;if((H=h.loadMode)&&ne<8&&(e=u.length)){for(t=0,ie++;t<e;t++)if(u[t]&&!u[t]._lazyRace)if(!te||m.prematureUnveil&&m.prematureUnveil(u[t]))ce(u[t]);else if((o=u[t][g]("data-expand"))&&(i=+o)||(i=ae),l||(l=!h.expand||h.expand<1?500<y.clientHeight&&500<y.clientWidth?500:370:h.expand,d=(m._defEx=l)*h.expFactor,c=h.hFac,G=null,ae<d&&ne<1&&2<ie&&2<H&&!f.hidden?(ae=d,ie=0):ae=1<H&&1<ie&&ne<6?l:0),r!==i&&(P=innerWidth+i*c,$=innerHeight+i,s=-1*i,r=i),d=u[t].getBoundingClientRect(),(j=d.bottom)>=s&&(q=d.top)<=$&&(U=d.right)>=s*c&&(I=d.left)<=P&&(j||U||I||q)&&(h.loadHidden||se(u[t]))&&(D&&ne<3&&!o&&(H<3||ie<4)||function(e,t){var a,n=e,i=se(e);for(q-=t,j+=t,I-=t,U+=t;i&&(n=n.offsetParent)&&n!=f.body&&n!=y;)(i=0<(L(n,"opacity")||1))&&"visible"!=L(n,"overflow")&&(a=n.getBoundingClientRect(),i=U>a.left&&I<a.right&&j>a.top-1&&q<a.bottom+1);return i}(u[t],i))){if(ce(u[t]),n=!0,9<ne)break}else!n&&D&&!a&&ne<4&&ie<4&&2<H&&(R[0]||h.preloadAfterLoad)&&(R[0]||!o&&(j||U||I||q||"auto"!=u[t][g](h.sizesAttr)))&&(a=R[0]||u[t]);a&&!n&&ce(a)}}function ze(){K=!1,Q=s.now(),J()}function ye(e){var t=e.target;t._lazyCache?delete t._lazyCache:(me(e),c(t,h.loadedClass),u(t,h.loadingClass),N(t,le),w(t,"lazyloaded"))}function ge(e){var t,a=e[g](h.srcsetAttr);(t=h.customMedia[e[g]("data-media")||e[g]("media")])&&e.setAttribute("media",t),a&&e.setAttribute("srcset",a)}function ve(){3==h.loadMode&&(h.loadMode=2),ue()}function pe(){D||(s.now()-O<999?v(pe,999):(D=!0,h.loadMode=3,oe(),e("scroll",ve,!0)))}var be,Ce,Ae,Ee=(Ce=T(function(e,t,a,n){var i,s,o;if(e._lazysizesWidth=n,e.setAttribute("sizes",n+="px"),C.test(t.nodeName||""))for(s=0,o=(i=t.getElementsByTagName("source")).length;s<o;s++)i[s].setAttribute("sizes",n);a.detail.dataAttr||z(e,a.detail)}),{_:function(){be=f.getElementsByClassName(h.autosizesClass),e("resize",Ae)},checkElems:Ae=F(function(){var e,t=be.length;if(t)for(e=0;e<t;e++)_e(be[e])}),updateElem:_e});function _e(e,t,a){var n=e.parentNode;n&&(a=x(e,n,a),(t=w(e,"lazybeforesizes",{width:a,dataAttr:!!t})).defaultPrevented||(a=t.detail.width)&&a!==e._lazysizesWidth&&Ce(e,n,t,a))}function Me(){!Me.i&&f.getElementsByClassName&&(Me.i=!0,Ee._(),fe._())}return v(function(){h.init&&Me()}),m={cfg:h,autoSizer:Ee,loader:fe,init:Me,uP:z,aC:c,rC:u,hC:M,fire:w,gW:x,rAF:W}});
|
1 |
/*! Created by Cloudways
|
2 |
+
On 16-08-2022 */
|
3 |
|
4 |
!function(e,t){t=t(e,e.document,Date);"object"==typeof module&&module.exports?module.exports=t:"function"==typeof define&&define.amd?define(t):e.lazySizes=t}(window,function(n,f,s){"use strict";var m,h;if(!function(){var e,t={lazyClass:"br-lazy",loadedClass:"br-loaded",loadingClass:"br-loading",preloadClass:"br-preload",errorClass:"br-error",autosizesClass:"br-autosizes",fastLoadedClass:"ls-is-cached",iframeLoadMode:0,srcAttr:"data-breeze",srcsetAttr:"data-brsrcset",sizesAttr:"data-brsizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};for(e in h=n.lazySizesConfig||n.lazysizesConfig||{},t)e in h||(h[e]=t[e])}(),!f||!f.getElementsByClassName)return{init:function(){},cfg:h,noSupport:!0};function c(e,t){M(e,t)||e.setAttribute("class",(e[g]("class")||"").trim()+" "+t)}function u(e,t){(t=M(e,t))&&e.setAttribute("class",(e[g]("class")||"").replace(t," "))}function z(e,t){var a;!l&&(a=n.picturefill||h.pf)?(t&&t.src&&!e[g]("srcset")&&e.setAttribute("srcset",t.src),a({reevaluate:!0,elements:[e]})):t&&t.src&&(e.src=t.src)}var a,i,t,o,r,y=f.documentElement,l=n.HTMLPictureElement,d="addEventListener",g="getAttribute",e=n[d].bind(n),v=n.setTimeout,p=n.requestAnimationFrame||v,b=n.requestIdleCallback,C=/^picture$/i,A=["load","error","lazyincluded","_lazyloaded"],E={},_=Array.prototype.forEach,M=function(e,t){return E[t]||(E[t]=new RegExp("(\\s|^)"+t+"(\\s|$)")),E[t].test(e[g]("class")||"")&&E[t]},N=function(t,a,e){var n=e?d:"removeEventListener";e&&N(t,a),A.forEach(function(e){t[n](e,a)})},w=function(e,t,a,n,i){var s=f.createEvent("Event");return(a=a||{}).instance=m,s.initEvent(t,!n,!i),s.detail=a,e.dispatchEvent(s),s},L=function(e,t){return(getComputedStyle(e,null)||{})[t]},x=function(e,t,a){for(a=a||e.offsetWidth;a<h.minSize&&t&&!e._lazysizesWidth;)a=t.offsetWidth,t=t.parentNode;return a},W=(o=[],r=t=[],B._lsFlush=S,B);function S(){var e=r;for(r=t.length?o:t,i=!(a=!0);e.length;)e.shift()();a=!1}function B(e,t){a&&!t?e.apply(this,arguments):(r.push(e),i||(i=!0,(f.hidden?v:p)(S)))}function T(a,e){return e?function(){W(a)}:function(){var e=this,t=arguments;W(function(){a.apply(e,t)})}}function F(e){function t(){var e=s.now()-n;e<99?v(t,99-e):(b||i)(i)}var a,n,i=function(){a=null,e()};return function(){n=s.now(),a=a||v(t,99)}}var R,D,k,H,O,P,$,q,I,U,j,G,J,K,Q,V,X,Y,Z,ee,te,ae,ne,ie,se,oe,re,le,de,ce,ue,fe=(Z=/^img$/i,ee=/^iframe$/i,te="onscroll"in n&&!/(gle|ing)bot/.test(navigator.userAgent),ie=-1,se=function(e){return(G=null==G?"hidden"==L(f.body,"visibility"):G)||!("hidden"==L(e.parentNode,"visibility")&&"hidden"==L(e,"visibility"))},J=he,Q=ne=ae=0,V=h.throttleDelay,X=h.ricTimeout,Y=b&&49<X?function(){b(ze,{timeout:X}),X!==h.ricTimeout&&(X=h.ricTimeout)}:T(function(){v(ze)},!0),re=T(ye),le=function(e){re({target:e.target})},de=T(function(t,e,a,n,i){var s,o,r,l,d;(r=w(t,"lazybeforeunveil",e)).defaultPrevented||(n&&(a?c(t,h.autosizesClass):t.setAttribute("sizes",n)),s=t[g](h.srcsetAttr),a=t[g](h.srcAttr),i&&(o=(d=t.parentNode)&&C.test(d.nodeName||"")),l=e.firesLoad||"src"in t&&(s||a||o),r={target:t},c(t,h.loadingClass),l&&(clearTimeout(k),k=v(me,2500),N(t,le,!0)),o&&_.call(d.getElementsByTagName("source"),ge),s?t.setAttribute("srcset",s):a&&!o&&(ee.test(t.nodeName)?(n=a,0==(d=(e=t).getAttribute("data-load-mode")||h.iframeLoadMode)?e.contentWindow.location.replace(n):1==d&&(e.src=n)):t.src=a),i&&(s||o)&&z(t,{src:a})),t._lazyRace&&delete t._lazyRace,u(t,h.lazyClass),W(function(){var e=t.complete&&1<t.naturalWidth;l&&!e||(e&&c(t,h.fastLoadedClass),ye(r),t._lazyCache=!0,v(function(){"_lazyCache"in t&&delete t._lazyCache},9)),"lazy"==t.loading&&ne--},!0)}),ue=F(function(){h.loadMode=3,oe()}),{_:function(){O=s.now(),m.elements=f.getElementsByClassName(h.lazyClass),R=f.getElementsByClassName(h.lazyClass+" "+h.preloadClass),e("scroll",oe,!0),e("resize",oe,!0),e("pageshow",function(e){var t;!e.persisted||(t=f.querySelectorAll("."+h.loadingClass)).length&&t.forEach&&p(function(){t.forEach(function(e){e.complete&&ce(e)})})}),n.MutationObserver?new MutationObserver(oe).observe(y,{childList:!0,subtree:!0,attributes:!0}):(y[d]("DOMNodeInserted",oe,!0),y[d]("DOMAttrModified",oe,!0),setInterval(oe,999)),e("hashchange",oe,!0),["focus","mouseover","click","load","transitionend","animationend"].forEach(function(e){f[d](e,oe,!0)}),/d$|^c/.test(f.readyState)?pe():(e("load",pe),f[d]("DOMContentLoaded",oe),v(pe,2e4)),m.elements.length?(he(),W._lsFlush()):oe()},checkElems:oe=function(e){var t;(e=!0===e)&&(X=33),K||(K=!0,(t=V-(s.now()-Q))<0&&(t=0),e||t<9?Y():v(Y,t))},unveil:ce=function(e){var t,a,n,i;e._lazyRace||(!(i="auto"==(n=(a=Z.test(e.nodeName))&&(e[g](h.sizesAttr)||e[g]("sizes"))))&&D||!a||!e[g]("src")&&!e.srcset||e.complete||M(e,h.errorClass)||!M(e,h.lazyClass))&&(t=w(e,"lazyunveilread").detail,i&&Ee.updateElem(e,!0,e.offsetWidth),e._lazyRace=!0,ne++,de(e,t,i,n,a))},_aLSL:ve});function me(e){ne--,e&&!(ne<0)&&e.target||(ne=0)}function he(){var e,t,a,n,i,s,o,r,l,d,c,u=m.elements;if((H=h.loadMode)&&ne<8&&(e=u.length)){for(t=0,ie++;t<e;t++)if(u[t]&&!u[t]._lazyRace)if(!te||m.prematureUnveil&&m.prematureUnveil(u[t]))ce(u[t]);else if((o=u[t][g]("data-expand"))&&(i=+o)||(i=ae),l||(l=!h.expand||h.expand<1?500<y.clientHeight&&500<y.clientWidth?500:370:h.expand,d=(m._defEx=l)*h.expFactor,c=h.hFac,G=null,ae<d&&ne<1&&2<ie&&2<H&&!f.hidden?(ae=d,ie=0):ae=1<H&&1<ie&&ne<6?l:0),r!==i&&(P=innerWidth+i*c,$=innerHeight+i,s=-1*i,r=i),d=u[t].getBoundingClientRect(),(j=d.bottom)>=s&&(q=d.top)<=$&&(U=d.right)>=s*c&&(I=d.left)<=P&&(j||U||I||q)&&(h.loadHidden||se(u[t]))&&(D&&ne<3&&!o&&(H<3||ie<4)||function(e,t){var a,n=e,i=se(e);for(q-=t,j+=t,I-=t,U+=t;i&&(n=n.offsetParent)&&n!=f.body&&n!=y;)(i=0<(L(n,"opacity")||1))&&"visible"!=L(n,"overflow")&&(a=n.getBoundingClientRect(),i=U>a.left&&I<a.right&&j>a.top-1&&q<a.bottom+1);return i}(u[t],i))){if(ce(u[t]),n=!0,9<ne)break}else!n&&D&&!a&&ne<4&&ie<4&&2<H&&(R[0]||h.preloadAfterLoad)&&(R[0]||!o&&(j||U||I||q||"auto"!=u[t][g](h.sizesAttr)))&&(a=R[0]||u[t]);a&&!n&&ce(a)}}function ze(){K=!1,Q=s.now(),J()}function ye(e){var t=e.target;t._lazyCache?delete t._lazyCache:(me(e),c(t,h.loadedClass),u(t,h.loadingClass),N(t,le),w(t,"lazyloaded"))}function ge(e){var t,a=e[g](h.srcsetAttr);(t=h.customMedia[e[g]("data-media")||e[g]("media")])&&e.setAttribute("media",t),a&&e.setAttribute("srcset",a)}function ve(){3==h.loadMode&&(h.loadMode=2),ue()}function pe(){D||(s.now()-O<999?v(pe,999):(D=!0,h.loadMode=3,oe(),e("scroll",ve,!0)))}var be,Ce,Ae,Ee=(Ce=T(function(e,t,a,n){var i,s,o;if(e._lazysizesWidth=n,e.setAttribute("sizes",n+="px"),C.test(t.nodeName||""))for(s=0,o=(i=t.getElementsByTagName("source")).length;s<o;s++)i[s].setAttribute("sizes",n);a.detail.dataAttr||z(e,a.detail)}),{_:function(){be=f.getElementsByClassName(h.autosizesClass),e("resize",Ae)},checkElems:Ae=F(function(){var e,t=be.length;if(t)for(e=0;e<t;e++)_e(be[e])}),updateElem:_e});function _e(e,t,a){var n=e.parentNode;n&&(a=x(e,n,a),(t=w(e,"lazybeforesizes",{width:a,dataAttr:!!t})).defaultPrevented||(a=t.detail.width)&&a!==e._lazysizesWidth&&Ce(e,n,t,a))}function Me(){!Me.i&&f.getElementsByClassName&&(Me.i=!0,Ee._(),fe._())}return v(function(){h.init&&Me()}),m={cfg:h,autoSizer:Ee,loader:fe,init:Me,uP:z,aC:c,rC:u,hC:M,fire:w,gW:x,rAF:W}});
|
assets/js/js-front-end/breeze-prefetch-links.min.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
/*! Created by Cloudways
|
2 |
-
On 16-
|
3 |
|
4 |
var timer,ready=e=>{"loading"!=document.readyState?e():document.addEventListener("DOMContentLoaded",e)};function search_for_banned_links(e,t){var r=!1;if(e.length)for(i=0;i<e.length;i++)-1===t.indexOf(e[i])&&-1===e[i].indexOf(t)||(r=!0);return r}ready(()=>{var i=[];addEventListener("mouseover",function(e){var n;e.target instanceof HTMLAnchorElement&&(n=e.target.attributes.href.value,timer=setTimeout(function(){var e,t,r;"#"!==n&&(r=n.replace(breeze_prefetch.local_url,""),e=new URL(breeze_prefetch.local_url).host,t=new URL(n).host,""!==n.trim()&&!1===i.includes(n)&&e===t&&!1===search_for_banned_links(breeze_prefetch.ignore_list,r)&&(i.push(n.trim()),(r=document.createElement("link")).href=n,r.rel="prefetch",document.head.appendChild(r)))},150))}),addEventListener("mouseout",function(e){clearTimeout(timer)})});
|
1 |
/*! Created by Cloudways
|
2 |
+
On 16-08-2022 */
|
3 |
|
4 |
var timer,ready=e=>{"loading"!=document.readyState?e():document.addEventListener("DOMContentLoaded",e)};function search_for_banned_links(e,t){var r=!1;if(e.length)for(i=0;i<e.length;i++)-1===t.indexOf(e[i])&&-1===e[i].indexOf(t)||(r=!0);return r}ready(()=>{var i=[];addEventListener("mouseover",function(e){var n;e.target instanceof HTMLAnchorElement&&(n=e.target.attributes.href.value,timer=setTimeout(function(){var e,t,r;"#"!==n&&(r=n.replace(breeze_prefetch.local_url,""),e=new URL(breeze_prefetch.local_url).host,t=new URL(n).host,""!==n.trim()&&!1===i.includes(n)&&e===t&&!1===search_for_banned_links(breeze_prefetch.ignore_list,r)&&(i.push(n.trim()),(r=document.createElement("link")).href=n,r.rel="prefetch",document.head.appendChild(r)))},150))}),addEventListener("mouseout",function(e){clearTimeout(timer)})});
|
breeze.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Plugin Name: Breeze
|
4 |
* Description: Breeze is a WordPress cache plugin with extensive options to speed up your website. All the options including Varnish Cache are compatible with Cloudways hosting.
|
5 |
-
* Version: 2.0.
|
6 |
* Text Domain: breeze
|
7 |
* Domain Path: /languages
|
8 |
* Author: Cloudways
|
@@ -37,7 +37,7 @@ if ( ! defined( 'BREEZE_PLUGIN_DIR' ) ) {
|
|
37 |
define( 'BREEZE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
38 |
}
|
39 |
if ( ! defined( 'BREEZE_VERSION' ) ) {
|
40 |
-
define( 'BREEZE_VERSION', '2.0.
|
41 |
}
|
42 |
if ( ! defined( 'BREEZE_SITEURL' ) ) {
|
43 |
define( 'BREEZE_SITEURL', get_site_url() );
|
2 |
/**
|
3 |
* Plugin Name: Breeze
|
4 |
* Description: Breeze is a WordPress cache plugin with extensive options to speed up your website. All the options including Varnish Cache are compatible with Cloudways hosting.
|
5 |
+
* Version: 2.0.8
|
6 |
* Text Domain: breeze
|
7 |
* Domain Path: /languages
|
8 |
* Author: Cloudways
|
37 |
define( 'BREEZE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
38 |
}
|
39 |
if ( ! defined( 'BREEZE_VERSION' ) ) {
|
40 |
+
define( 'BREEZE_VERSION', '2.0.8' );
|
41 |
}
|
42 |
if ( ! defined( 'BREEZE_SITEURL' ) ) {
|
43 |
define( 'BREEZE_SITEURL', get_site_url() );
|
inc/breeze-admin.php
CHANGED
@@ -187,6 +187,7 @@ class Breeze_Admin {
|
|
187 |
'breeze_purge_database' => '',
|
188 |
'breeze_purge_cache' => '',
|
189 |
'breeze_save_options' => '',
|
|
|
190 |
);
|
191 |
|
192 |
// Only create the security nonce if the user has manage_options ( administrator capabilities ).
|
@@ -196,6 +197,7 @@ class Breeze_Admin {
|
|
196 |
'breeze_purge_database' => wp_create_nonce( '_breeze_purge_database' ),
|
197 |
'breeze_purge_cache' => wp_create_nonce( '_breeze_purge_cache' ),
|
198 |
'breeze_save_options' => wp_create_nonce( '_breeze_save_options' ),
|
|
|
199 |
);
|
200 |
}
|
201 |
|
@@ -296,6 +298,14 @@ class Breeze_Admin {
|
|
296 |
);
|
297 |
$wp_admin_bar->add_node( $args );
|
298 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
299 |
// add settings item
|
300 |
$args = array(
|
301 |
'id' => 'breeze-settings',
|
@@ -343,6 +353,7 @@ class Breeze_Admin {
|
|
343 |
add_action( 'wp_ajax_breeze_purge_varnish', array( 'Breeze_Configuration', 'purge_varnish_action' ) );
|
344 |
add_action( 'wp_ajax_breeze_purge_file', array( 'Breeze_Configuration', 'breeze_ajax_clean_cache' ) );
|
345 |
add_action( 'wp_ajax_breeze_purge_database', array( 'Breeze_Configuration', 'breeze_ajax_purge_database' ) );
|
|
|
346 |
}
|
347 |
|
348 |
/*
|
@@ -864,6 +875,7 @@ class Breeze_Admin {
|
|
864 |
Breeze_PurgeCache::breeze_cache_flush( $flush_cache );
|
865 |
//clear varnish cache
|
866 |
$this->breeze_clear_varnish();
|
|
|
867 |
}
|
868 |
|
869 |
/**
|
187 |
'breeze_purge_database' => '',
|
188 |
'breeze_purge_cache' => '',
|
189 |
'breeze_save_options' => '',
|
190 |
+
'breeze_purge_opcache' => '',
|
191 |
);
|
192 |
|
193 |
// Only create the security nonce if the user has manage_options ( administrator capabilities ).
|
197 |
'breeze_purge_database' => wp_create_nonce( '_breeze_purge_database' ),
|
198 |
'breeze_purge_cache' => wp_create_nonce( '_breeze_purge_cache' ),
|
199 |
'breeze_save_options' => wp_create_nonce( '_breeze_save_options' ),
|
200 |
+
'breeze_purge_opcache' => wp_create_nonce( '_breeze_purge_opcache' ),
|
201 |
);
|
202 |
}
|
203 |
|
298 |
);
|
299 |
$wp_admin_bar->add_node( $args );
|
300 |
|
301 |
+
// add child item (Purge Modules)
|
302 |
+
$args = array(
|
303 |
+
'id' => 'breeze-purge-object-cache-group',
|
304 |
+
'title' => esc_html__( 'Purge Object Cache', 'breeze' ),
|
305 |
+
'parent' => 'breeze-purge-modules',
|
306 |
+
);
|
307 |
+
$wp_admin_bar->add_node( $args );
|
308 |
+
|
309 |
// add settings item
|
310 |
$args = array(
|
311 |
'id' => 'breeze-settings',
|
353 |
add_action( 'wp_ajax_breeze_purge_varnish', array( 'Breeze_Configuration', 'purge_varnish_action' ) );
|
354 |
add_action( 'wp_ajax_breeze_purge_file', array( 'Breeze_Configuration', 'breeze_ajax_clean_cache' ) );
|
355 |
add_action( 'wp_ajax_breeze_purge_database', array( 'Breeze_Configuration', 'breeze_ajax_purge_database' ) );
|
356 |
+
add_action( 'wp_ajax_breeze_purge_opcache', array( 'Breeze_Configuration', 'breeze_ajax_purge_opcache' ) );
|
357 |
}
|
358 |
|
359 |
/*
|
875 |
Breeze_PurgeCache::breeze_cache_flush( $flush_cache );
|
876 |
//clear varnish cache
|
877 |
$this->breeze_clear_varnish();
|
878 |
+
Breeze_PurgeCache::__flush_object_cache();
|
879 |
}
|
880 |
|
881 |
/**
|
inc/breeze-configuration.php
CHANGED
@@ -1177,6 +1177,22 @@ class Breeze_Configuration {
|
|
1177 |
exit;
|
1178 |
}
|
1179 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1180 |
/*
|
1181 |
* Ajax purge database
|
1182 |
*/
|
1177 |
exit;
|
1178 |
}
|
1179 |
|
1180 |
+
/**
|
1181 |
+
* Ajax purge Object Cache
|
1182 |
+
*
|
1183 |
+
* @return void
|
1184 |
+
*/
|
1185 |
+
public static function breeze_ajax_purge_opcache() {
|
1186 |
+
breeze_is_restricted_access();
|
1187 |
+
|
1188 |
+
//check security
|
1189 |
+
check_ajax_referer( '_breeze_purge_opcache', 'security' );
|
1190 |
+
|
1191 |
+
echo wp_json_encode( array( 'clear' => Breeze_PurgeCache::__flush_object_cache() ) );
|
1192 |
+
exit;
|
1193 |
+
}
|
1194 |
+
|
1195 |
+
|
1196 |
/*
|
1197 |
* Ajax purge database
|
1198 |
*/
|
inc/cache/execute-cache.php
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
/*
|
3 |
* Based on some work of https://github.com/tlovett1/simple-cache/blob/master/inc/dropins/file-based-page-cache.php
|
4 |
*/
|
|
|
5 |
|
6 |
if ( ! defined( 'ABSPATH' ) ) {
|
7 |
header( 'Status: 403 Forbidden' );
|
@@ -152,7 +153,7 @@ $current_url = $domain . rawurldecode( $_SERVER['REQUEST_URI'] );
|
|
152 |
$opts_config = $GLOBALS['breeze_config'];
|
153 |
$check_exclude = check_exclude_page( $opts_config, $current_url );
|
154 |
|
155 |
-
$query_instance = Breeze_Query_Strings_Rules::get_instance();
|
156 |
$breeze_query_vars_list = $query_instance->check_query_var_group( $current_url );
|
157 |
|
158 |
if ( false === $check_exclude && 0 !== (int) $breeze_query_vars_list['extra_query_no'] ) {
|
@@ -188,7 +189,7 @@ if ( ! $check_exclude ) {
|
|
188 |
}
|
189 |
|
190 |
breeze_serve_cache( $filename, $url_path, $X1, $devices );
|
191 |
-
ob_start( 'breeze_cache' );
|
192 |
} else {
|
193 |
header( 'Cache-Control: no-cache' );
|
194 |
}
|
@@ -262,24 +263,6 @@ function breeze_cache( $buffer, $flags ) {
|
|
262 |
),
|
263 |
);
|
264 |
|
265 |
-
if ( ! isset( $_SERVER['HTTP_X_VARNISH'] ) ) {
|
266 |
-
$headers = array_merge(
|
267 |
-
array(
|
268 |
-
array(
|
269 |
-
'name' => 'Expires',
|
270 |
-
'value' => 'Wed, 17 Aug 2005 00:00:00 GMT',
|
271 |
-
),
|
272 |
-
array(
|
273 |
-
'name' => 'Cache-Control',
|
274 |
-
'value' => 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0',
|
275 |
-
),
|
276 |
-
array(
|
277 |
-
'name' => 'Pragma',
|
278 |
-
'value' => 'no-cache',
|
279 |
-
),
|
280 |
-
)
|
281 |
-
);
|
282 |
-
}
|
283 |
|
284 |
// Lazy load implementation
|
285 |
if ( class_exists( 'Breeze_Lazy_Load' ) ) {
|
@@ -295,7 +278,7 @@ function breeze_cache( $buffer, $flags ) {
|
|
295 |
$is_lazy_load_enabled = filter_var( $GLOBALS['breeze_config']['enabled-lazy-load'], FILTER_VALIDATE_BOOLEAN );
|
296 |
$is_lazy_load_native = filter_var( $GLOBALS['breeze_config']['use-lazy-load-native'], FILTER_VALIDATE_BOOLEAN );
|
297 |
|
298 |
-
$lazy_load = new Breeze_Lazy_Load( $buffer, $is_lazy_load_enabled, $is_lazy_load_native );
|
299 |
$buffer = $lazy_load->apply_lazy_load_feature();
|
300 |
}
|
301 |
|
@@ -319,7 +302,7 @@ function breeze_cache( $buffer, $flags ) {
|
|
319 |
false !== strpos( $html_a_tag, '_blank' )
|
320 |
) {
|
321 |
try {
|
322 |
-
$anchor_attributed = new SimpleXMLElement( $html_a_tag );
|
323 |
// Only apply on valid URLS.
|
324 |
if (
|
325 |
! empty( $anchor_attributed ) &&
|
@@ -420,7 +403,11 @@ function breeze_cache( $buffer, $flags ) {
|
|
420 |
if ( in_array( $ini_output_compression, $array_values ) ) {
|
421 |
return $buffer;
|
422 |
} else {
|
423 |
-
|
|
|
|
|
|
|
|
|
424 |
}
|
425 |
} else {
|
426 |
return $buffer;
|
@@ -440,7 +427,7 @@ function breeze_get_url_path() {
|
|
440 |
|
441 |
$the_url = $domain . rtrim( $host, '/' ) . $_SERVER['REQUEST_URI'];
|
442 |
|
443 |
-
$query_instance = Breeze_Query_Strings_Rules::get_instance();
|
444 |
$breeze_query_vars_list = $query_instance->check_query_var_group( $the_url );
|
445 |
if ( 0 !== (int) $breeze_query_vars_list['ignored_no'] ) {
|
446 |
$the_url = $query_instance->rebuild_url( $the_url, $breeze_query_vars_list );
|
2 |
/*
|
3 |
* Based on some work of https://github.com/tlovett1/simple-cache/blob/master/inc/dropins/file-based-page-cache.php
|
4 |
*/
|
5 |
+
namespace Breeze_Cache_Init;
|
6 |
|
7 |
if ( ! defined( 'ABSPATH' ) ) {
|
8 |
header( 'Status: 403 Forbidden' );
|
153 |
$opts_config = $GLOBALS['breeze_config'];
|
154 |
$check_exclude = check_exclude_page( $opts_config, $current_url );
|
155 |
|
156 |
+
$query_instance = \Breeze_Query_Strings_Rules::get_instance();
|
157 |
$breeze_query_vars_list = $query_instance->check_query_var_group( $current_url );
|
158 |
|
159 |
if ( false === $check_exclude && 0 !== (int) $breeze_query_vars_list['extra_query_no'] ) {
|
189 |
}
|
190 |
|
191 |
breeze_serve_cache( $filename, $url_path, $X1, $devices );
|
192 |
+
\ob_start( 'Breeze_Cache_Init\breeze_cache' );
|
193 |
} else {
|
194 |
header( 'Cache-Control: no-cache' );
|
195 |
}
|
263 |
),
|
264 |
);
|
265 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
266 |
|
267 |
// Lazy load implementation
|
268 |
if ( class_exists( 'Breeze_Lazy_Load' ) ) {
|
278 |
$is_lazy_load_enabled = filter_var( $GLOBALS['breeze_config']['enabled-lazy-load'], FILTER_VALIDATE_BOOLEAN );
|
279 |
$is_lazy_load_native = filter_var( $GLOBALS['breeze_config']['use-lazy-load-native'], FILTER_VALIDATE_BOOLEAN );
|
280 |
|
281 |
+
$lazy_load = new \Breeze_Lazy_Load( $buffer, $is_lazy_load_enabled, $is_lazy_load_native );
|
282 |
$buffer = $lazy_load->apply_lazy_load_feature();
|
283 |
}
|
284 |
|
302 |
false !== strpos( $html_a_tag, '_blank' )
|
303 |
) {
|
304 |
try {
|
305 |
+
$anchor_attributed = new \SimpleXMLElement( $html_a_tag );
|
306 |
// Only apply on valid URLS.
|
307 |
if (
|
308 |
! empty( $anchor_attributed ) &&
|
403 |
if ( in_array( $ini_output_compression, $array_values ) ) {
|
404 |
return $buffer;
|
405 |
} else {
|
406 |
+
if(defined('RedisCachePro\Version')){
|
407 |
+
return $buffer;
|
408 |
+
}else{
|
409 |
+
return ob_gzhandler( $buffer, $flags );
|
410 |
+
}
|
411 |
}
|
412 |
} else {
|
413 |
return $buffer;
|
427 |
|
428 |
$the_url = $domain . rtrim( $host, '/' ) . $_SERVER['REQUEST_URI'];
|
429 |
|
430 |
+
$query_instance = \Breeze_Query_Strings_Rules::get_instance();
|
431 |
$breeze_query_vars_list = $query_instance->check_query_var_group( $the_url );
|
432 |
if ( 0 !== (int) $breeze_query_vars_list['ignored_no'] ) {
|
433 |
$the_url = $query_instance->rebuild_url( $the_url, $breeze_query_vars_list );
|
inc/cache/purge-cache.php
CHANGED
@@ -140,7 +140,10 @@ class Breeze_PurgeCache {
|
|
140 |
}
|
141 |
|
142 |
if ( function_exists( 'wp_cache_flush' ) && true === $flush_cache ) {
|
143 |
-
|
|
|
|
|
|
|
144 |
}
|
145 |
}
|
146 |
|
@@ -183,6 +186,18 @@ class Breeze_PurgeCache {
|
|
183 |
return $instance;
|
184 |
}
|
185 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
}
|
187 |
|
188 |
$breeze_basic_settings = Breeze_Options_Reader::get_option_value( 'breeze-active' );
|
140 |
}
|
141 |
|
142 |
if ( function_exists( 'wp_cache_flush' ) && true === $flush_cache ) {
|
143 |
+
#if ( ! defined( 'RedisCachePro\Version' ) && ! defined( 'WP_REDIS_VERSION' ) ) {
|
144 |
+
wp_cache_flush();
|
145 |
+
#}
|
146 |
+
|
147 |
}
|
148 |
}
|
149 |
|
186 |
return $instance;
|
187 |
}
|
188 |
|
189 |
+
|
190 |
+
public static function __flush_object_cache() {
|
191 |
+
set_as_network_screen();
|
192 |
+
|
193 |
+
if ( is_network_admin() ) {
|
194 |
+
// in case we need to add something specific for network.
|
195 |
+
return wp_cache_flush();
|
196 |
+
}
|
197 |
+
|
198 |
+
return wp_cache_flush();
|
199 |
+
}
|
200 |
+
|
201 |
}
|
202 |
|
203 |
$breeze_basic_settings = Breeze_Options_Reader::get_option_value( 'breeze-active' );
|
inc/cache/purge-varnish.php
CHANGED
@@ -158,13 +158,25 @@ class Breeze_PurgeVarnish {
|
|
158 |
if ( ! empty( $parseUrl['query'] ) && $parseUrl['query'] != 'breeze' ) {
|
159 |
$purgeme .= '?' . $parseUrl['query'];
|
160 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
$request_args = array(
|
162 |
'method' => $purge_method,
|
163 |
'headers' => array(
|
164 |
'Host' => $host,
|
165 |
'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36',
|
166 |
),
|
167 |
-
'sslverify' =>
|
168 |
);
|
169 |
$response = wp_remote_request( $schema . $purgeme, $request_args );
|
170 |
if ( is_wp_error( $response ) || $response['response']['code'] != '200' ) {
|
158 |
if ( ! empty( $parseUrl['query'] ) && $parseUrl['query'] != 'breeze' ) {
|
159 |
$purgeme .= '?' . $parseUrl['query'];
|
160 |
}
|
161 |
+
|
162 |
+
|
163 |
+
$ssl_verification = apply_filters('breeze_ssl_check_certificate', true);
|
164 |
+
|
165 |
+
if ( ! is_bool( $ssl_verification ) ) {
|
166 |
+
$ssl_verification = true;
|
167 |
+
}
|
168 |
+
|
169 |
+
if(defined('WP_DEBUG') && true === WP_DEBUG){
|
170 |
+
$ssl_verification = false;
|
171 |
+
}
|
172 |
+
|
173 |
$request_args = array(
|
174 |
'method' => $purge_method,
|
175 |
'headers' => array(
|
176 |
'Host' => $host,
|
177 |
'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36',
|
178 |
),
|
179 |
+
'sslverify' => $ssl_verification,
|
180 |
);
|
181 |
$response = wp_remote_request( $schema . $purgeme, $request_args );
|
182 |
if ( is_wp_error( $response ) || $response['response']['code'] != '200' ) {
|
inc/helpers.php
CHANGED
@@ -417,6 +417,16 @@ function is_varnish_cache_started( $retry = 1, $time_fresh = 0, $use_headers = f
|
|
417 |
$url_ping = trim( home_url() . '?breeze_check_cache_available=' . $time_fresh );
|
418 |
|
419 |
if ( true === $use_headers ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
420 |
// Making sure the request is only for HEADER info without getting the content from the page
|
421 |
$context_options = array(
|
422 |
'http' => array(
|
@@ -424,7 +434,7 @@ function is_varnish_cache_started( $retry = 1, $time_fresh = 0, $use_headers = f
|
|
424 |
'follow_location' => 1,
|
425 |
),
|
426 |
'ssl' => array(
|
427 |
-
'verify_peer' =>
|
428 |
),
|
429 |
);
|
430 |
|
@@ -491,13 +501,23 @@ function is_varnish_cache_started( $retry = 1, $time_fresh = 0, $use_headers = f
|
|
491 |
* @return array|bool
|
492 |
*/
|
493 |
function breeze_get_headers_via_curl( $url_ping = '' ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
494 |
$connection = curl_init();
|
495 |
$headers = array();
|
496 |
curl_setopt( $connection, CURLOPT_URL, $url_ping );
|
497 |
curl_setopt( $connection, CURLOPT_NOBODY, true );
|
498 |
curl_setopt( $connection, CURLOPT_RETURNTRANSFER, true );
|
499 |
curl_setopt( $connection, CURLOPT_FOLLOWLOCATION, true ); // follow redirects
|
500 |
-
curl_setopt( $connection, CURLOPT_SSL_VERIFYPEER,
|
501 |
curl_setopt( $connection, CURLOPT_HEADER, true );// return just headers
|
502 |
curl_setopt( $connection, CURLOPT_TIMEOUT, 1 );
|
503 |
// this function is called by curl for each header received
|
@@ -717,13 +737,25 @@ function breeze_varnish_purge_cache( $url = '', $purge_varnish = false, $check_v
|
|
717 |
if ( ! empty( $parse_url['query'] ) && 'breeze' !== strtolower( $parse_url['query'] ) ) {
|
718 |
$purgeme .= '?' . $parse_url['query'];
|
719 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
720 |
$request_args = array(
|
721 |
'method' => $purge_method,
|
722 |
'headers' => array(
|
723 |
'Host' => $host,
|
724 |
'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36',
|
725 |
),
|
726 |
-
'sslverify' =>
|
727 |
);
|
728 |
$response = wp_remote_request( $schema . $purgeme, $request_args );
|
729 |
if ( is_wp_error( $response ) || 200 !== (int) $response['response']['code'] ) {
|
@@ -960,10 +992,10 @@ function breeze_migrate_old_settings( $is_sigle = true, $subsite_id = 0, $is_roo
|
|
960 |
'breeze-exclude-js' => ( isset( $options['breeze-exclude-js'] ) ? $options['breeze-exclude-js'] : array() ),
|
961 |
'breeze-move-to-footer-js' => ( isset( $options['breeze-move-to-footer-js'] ) ? $options['breeze-move-to-footer-js'] : array() ),
|
962 |
'breeze-defer-js' => ( isset( $options['breeze-defer-js'] ) ? $options['breeze-defer-js'] : array() ),
|
963 |
-
'breeze-delay-all-js'
|
964 |
'breeze-enable-js-delay' => ( isset( $options['breeze-enable-js-delay'] ) ? $options['breeze-enable-js-delay'] : '0' ),
|
965 |
'breeze-delay-js-scripts' => ( isset( $options['breeze-delay-js-scripts'] ) ? $options['breeze-delay-js-scripts'] : array() ),
|
966 |
-
'no-breeze-no-delay-js'
|
967 |
|
968 |
);
|
969 |
|
417 |
$url_ping = trim( home_url() . '?breeze_check_cache_available=' . $time_fresh );
|
418 |
|
419 |
if ( true === $use_headers ) {
|
420 |
+
|
421 |
+
$ssl_verification = apply_filters( 'breeze_ssl_check_certificate', true );
|
422 |
+
|
423 |
+
if ( ! is_bool( $ssl_verification ) ) {
|
424 |
+
$ssl_verification = true;
|
425 |
+
}
|
426 |
+
|
427 |
+
if ( defined( 'WP_DEBUG' ) && true === WP_DEBUG ) {
|
428 |
+
$ssl_verification = false;
|
429 |
+
}
|
430 |
// Making sure the request is only for HEADER info without getting the content from the page
|
431 |
$context_options = array(
|
432 |
'http' => array(
|
434 |
'follow_location' => 1,
|
435 |
),
|
436 |
'ssl' => array(
|
437 |
+
'verify_peer' => $ssl_verification,
|
438 |
),
|
439 |
);
|
440 |
|
501 |
* @return array|bool
|
502 |
*/
|
503 |
function breeze_get_headers_via_curl( $url_ping = '' ) {
|
504 |
+
|
505 |
+
$ssl_verification = apply_filters( 'breeze_ssl_check_certificate', true );
|
506 |
+
if ( ! is_bool( $ssl_verification ) ) {
|
507 |
+
$ssl_verification = true;
|
508 |
+
}
|
509 |
+
|
510 |
+
if ( defined( 'WP_DEBUG' ) && true === WP_DEBUG ) {
|
511 |
+
$ssl_verification = false;
|
512 |
+
}
|
513 |
+
|
514 |
$connection = curl_init();
|
515 |
$headers = array();
|
516 |
curl_setopt( $connection, CURLOPT_URL, $url_ping );
|
517 |
curl_setopt( $connection, CURLOPT_NOBODY, true );
|
518 |
curl_setopt( $connection, CURLOPT_RETURNTRANSFER, true );
|
519 |
curl_setopt( $connection, CURLOPT_FOLLOWLOCATION, true ); // follow redirects
|
520 |
+
curl_setopt( $connection, CURLOPT_SSL_VERIFYPEER, $ssl_verification );
|
521 |
curl_setopt( $connection, CURLOPT_HEADER, true );// return just headers
|
522 |
curl_setopt( $connection, CURLOPT_TIMEOUT, 1 );
|
523 |
// this function is called by curl for each header received
|
737 |
if ( ! empty( $parse_url['query'] ) && 'breeze' !== strtolower( $parse_url['query'] ) ) {
|
738 |
$purgeme .= '?' . $parse_url['query'];
|
739 |
}
|
740 |
+
|
741 |
+
|
742 |
+
$ssl_verification = apply_filters( 'breeze_ssl_check_certificate', true );
|
743 |
+
|
744 |
+
if ( ! is_bool( $ssl_verification ) ) {
|
745 |
+
$ssl_verification = true;
|
746 |
+
}
|
747 |
+
|
748 |
+
if ( defined( 'WP_DEBUG' ) && true === WP_DEBUG ) {
|
749 |
+
$ssl_verification = false;
|
750 |
+
}
|
751 |
+
|
752 |
$request_args = array(
|
753 |
'method' => $purge_method,
|
754 |
'headers' => array(
|
755 |
'Host' => $host,
|
756 |
'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36',
|
757 |
),
|
758 |
+
'sslverify' => $ssl_verification,
|
759 |
);
|
760 |
$response = wp_remote_request( $schema . $purgeme, $request_args );
|
761 |
if ( is_wp_error( $response ) || 200 !== (int) $response['response']['code'] ) {
|
992 |
'breeze-exclude-js' => ( isset( $options['breeze-exclude-js'] ) ? $options['breeze-exclude-js'] : array() ),
|
993 |
'breeze-move-to-footer-js' => ( isset( $options['breeze-move-to-footer-js'] ) ? $options['breeze-move-to-footer-js'] : array() ),
|
994 |
'breeze-defer-js' => ( isset( $options['breeze-defer-js'] ) ? $options['breeze-defer-js'] : array() ),
|
995 |
+
'breeze-delay-all-js' => ( isset( $options['breeze-delay-all-js'] ) ? $options['breeze-delay-all-js'] : '0' ),
|
996 |
'breeze-enable-js-delay' => ( isset( $options['breeze-enable-js-delay'] ) ? $options['breeze-enable-js-delay'] : '0' ),
|
997 |
'breeze-delay-js-scripts' => ( isset( $options['breeze-delay-js-scripts'] ) ? $options['breeze-delay-js-scripts'] : array() ),
|
998 |
+
'no-breeze-no-delay-js' => ( isset( $options['no-breeze-no-delay-js'] ) ? $options['no-breeze-no-delay-js'] : array() ),
|
999 |
|
1000 |
);
|
1001 |
|
inc/wp-cli/class-breeze-cli-helpers.php
CHANGED
@@ -20,10 +20,22 @@ class Breeze_Cli_Helpers {
|
|
20 |
public static function fetch_remote_json( $url ) {
|
21 |
$rop_user_agent = 'breeze-import-settings-system';
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
$connection = curl_init( $url );
|
24 |
curl_setopt( $connection, CURLOPT_RETURNTRANSFER, true );
|
25 |
-
curl_setopt( $connection, CURLOPT_SSL_VERIFYHOST,
|
26 |
-
curl_setopt( $connection, CURLOPT_SSL_VERIFYPEER,
|
27 |
curl_setopt( $connection, CURLOPT_USERAGENT, $rop_user_agent );
|
28 |
curl_setopt( $connection, CURLOPT_REFERER, home_url() );
|
29 |
curl_setopt( $connection, CURLOPT_MAXREDIRS, 3 );
|
20 |
public static function fetch_remote_json( $url ) {
|
21 |
$rop_user_agent = 'breeze-import-settings-system';
|
22 |
|
23 |
+
$ssl_verification = apply_filters('breeze_ssl_check_certificate', true);
|
24 |
+
$verify_host = 2;
|
25 |
+
|
26 |
+
if ( ! is_bool( $ssl_verification ) ) {
|
27 |
+
$ssl_verification = true;
|
28 |
+
}
|
29 |
+
|
30 |
+
if(defined('WP_DEBUG') && true === WP_DEBUG){
|
31 |
+
$ssl_verification = false;
|
32 |
+
$verify_host = 0;
|
33 |
+
}
|
34 |
+
|
35 |
$connection = curl_init( $url );
|
36 |
curl_setopt( $connection, CURLOPT_RETURNTRANSFER, true );
|
37 |
+
curl_setopt( $connection, CURLOPT_SSL_VERIFYHOST, $verify_host );
|
38 |
+
curl_setopt( $connection, CURLOPT_SSL_VERIFYPEER, $ssl_verification );
|
39 |
curl_setopt( $connection, CURLOPT_USERAGENT, $rop_user_agent );
|
40 |
curl_setopt( $connection, CURLOPT_REFERER, home_url() );
|
41 |
curl_setopt( $connection, CURLOPT_MAXREDIRS, 3 );
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== Breeze - WordPress Cache Plugin ===
|
2 |
Contributors: Cloudways
|
3 |
Tags: cache,caching, performance, wp-cache, cdn, combine, compress, speed plugin, database cache,gzip, http compression, js cache, minify, optimize, page cache, performance, speed, expire headers
|
4 |
-
Requires at least:
|
5 |
Tested up to: 6.0
|
6 |
-
Stable tag: 2.0.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -25,7 +25,6 @@ What makes Breeze WordPress Cache Plugin awesome is that it comes with builtin s
|
|
25 |
|
26 |
**Support:** We love to provide support! Post your questions on the WordPress.org support forums, or if you are a Cloudways Customer you may ask questions on the <a href="https://community.cloudways.com/">Cloudways Community Forum</a>.
|
27 |
|
28 |
-
**Special Thanks:** We would like to give special mention to WP Speed Of Light for being an inspiration for Breeze.
|
29 |
|
30 |
== Installation ==
|
31 |
|
@@ -145,6 +144,15 @@ Using Gzip, Breeze compresses the request files, further reducing the size of th
|
|
145 |
|
146 |
== Changelog ==
|
147 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
= 2.0.7 =
|
149 |
|
150 |
* Fix: In some cases call to undefined function is_plugin_active() shows, it is fixed now by replacing it with a check for class_exist in CURCY and WOOCS plugins.
|
@@ -402,4 +410,4 @@ Update Breeze through WordPress Admin > Dashboard >Updates. The settings will re
|
|
402 |
|
403 |
== Requirements ==
|
404 |
|
405 |
-
PHP 7.x ,PHP 7.4 recommended for better performance, WordPress
|
1 |
=== Breeze - WordPress Cache Plugin ===
|
2 |
Contributors: Cloudways
|
3 |
Tags: cache,caching, performance, wp-cache, cdn, combine, compress, speed plugin, database cache,gzip, http compression, js cache, minify, optimize, page cache, performance, speed, expire headers
|
4 |
+
Requires at least: 5.9
|
5 |
Tested up to: 6.0
|
6 |
+
Stable tag: 2.0.8
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
25 |
|
26 |
**Support:** We love to provide support! Post your questions on the WordPress.org support forums, or if you are a Cloudways Customer you may ask questions on the <a href="https://community.cloudways.com/">Cloudways Community Forum</a>.
|
27 |
|
|
|
28 |
|
29 |
== Installation ==
|
30 |
|
144 |
|
145 |
== Changelog ==
|
146 |
|
147 |
+
|
148 |
+
= 2.0.8=
|
149 |
+
|
150 |
+
* Fix: Enhance compatibility with the Pickingpal plugin to load the orders.
|
151 |
+
* Fix: Remove duplication header calls in Varnish requests.
|
152 |
+
* Fix: Invalid Certificate never accepted and its default value is TRUE now.
|
153 |
+
* Add: Include the option to Clear Object Cache.
|
154 |
+
|
155 |
+
|
156 |
= 2.0.7 =
|
157 |
|
158 |
* Fix: In some cases call to undefined function is_plugin_active() shows, it is fixed now by replacing it with a check for class_exist in CURCY and WOOCS plugins.
|
410 |
|
411 |
== Requirements ==
|
412 |
|
413 |
+
PHP 7.x ,PHP 7.4, PHP 8 recommended for better performance, WordPress 5.9+
|