PK œqhYî¶J‚ßF ßF ) nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/
Dir : /home/trave494/watchpalace.kerihosting.com/wp-content/plugins/wp-optimize/js/ |
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 IP: 209.182.202.254 |
Dir : /home/trave494/watchpalace.kerihosting.com/wp-content/plugins/wp-optimize/js/wpoadmin-3-3-1.min.js |
jQuery(function(t){WP_Optimize=WP_Optimize(),"undefined"!=typeof WP_Optimize_Cache&&(WP_Optimize_Cache=WP_Optimize_Cache()),"undefined"!=typeof wp_optimize.minify&&(WP_Optimize_Minify=wp_optimize.minify.init())}),function(t){var e=[];t.fn.form_errors=function(){return this},t.fn.form_errors.add=function(t,i){!1===this.has_error(t)&&e.push({type:t,message:i})},t.fn.form_errors.remove=function(t){var i=this.has_error(t);i!==!1&&e.splice(i,1)},t.fn.form_errors.has_error=function(i){var o=!1;return t.each(e,function(t,e){console.log(t,e),i==e.type&&(o=t)}.bind(this)),o},t.fn.form_errors.has_errors=function(){return e.length>0}}(jQuery);var WP_Optimize=function(){function t(){if(A("#enable-schedule").length){var t=A("#enable-schedule").is(":checked");t?A("#wp-optimize-auto-options").css("opacity","1"):A("#wp-optimize-auto-options").css("opacity","0.5")}}function e(t,e,i){e="undefined"==typeof e?"#wp-optimize-wrap":e,i="undefined"==typeof i?15:i,A(t).hide().prependTo(e).slideDown("fast").delay(1e3*i).slideUp("fast",function(){A(this).remove()})}function i(t,i){var o={type:t,enable:i?1:0};A("#"+t+"_spinner").show(),S("enable_or_disable_feature",o,function(i){if(A("#"+t+"_spinner").hide(),i&&i.hasOwnProperty("output"))for(var o=0,n=i.output.length;o<n;o++){var a='<div class="updated"><p>'+i.output[o]+"</p></div>";e(a,"#"+t+"_notice")}i&&i.hasOwnProperty("messages")&&A("#"+t+"_actionmsg").html(i.messages.join(" - "))})}function o(t){t?A("#wp-optimize-wrap").addClass("wpo-mobile-menu-opened"):A("#wp-optimize-wrap").removeClass("wpo-mobile-menu-opened")}function n(){if(!J&&!M){var t=A(".wpo-page[data-whichpage=WP-Optimize]"),e=t.find(".wpo_shade");e.removeClass("hidden"),J=!0,S("get_database_tabs",{},function(e){M=!0,e.hasOwnProperty("optimizations")&&t.find(".wp-optimize-optimizations-table-placeholder").replaceWith(e.optimizations),b(e),A(document).trigger("wpo_database_tabs_loaded")}).always(function(){J=!1,e.addClass("hidden")})}}function a(t){var e="",t="undefined"==typeof t?"string":t,i=A("#wp-optimize-database-settings form input[name!='action'], #wp-optimize-database-settings form select, #wp-optimize-database-settings form textarea, #wp-optimize-general-settings form input[name!='action'], #wp-optimize-general-settings form textarea, #wp-optimize-general-settings form select, #wp-optimize-nav-tab-contents-optimize input[type='checkbox'], .wp-optimize-nav-tab-contents input[name^='enable-auto-backup-']");return"object"==t?e=i.serializeJSON({useIntKeysAsArrayIndex:!0}):(e=i.serialize(),A.each(A('#wp-optimize-database-settings form input[type=checkbox], #wp-optimize-general-settings form input[type=checkbox], .wp-optimize-nav-tab-contents input[name^="enable-auto-backup-"]').filter(function(t){return 0==A(this).prop("checked")}),function(t,i){var o="0";e+="&"+A(i).attr("name")+"="+o})),e}function s(){S("optimizations_done",{},function(){}),Q=!1}function p(){if(!F.get_lock())return void(U>0&&console.log("WP-Optimize: process_queue(): queue is currently locked - exiting"));U>0&&console.log("WP-Optimize: process_queue(): got queue lock");var t=F.peek(),e=0,i=A("#wpo_all_sites"),o=i.data("active_site");if("object"==typeof t){if(data=t,t=t.optimization_id,e=data.blog_id,"undefined"==typeof o)i.data("active_site",e),r(e,0);else if(o!=e){var n=o;i.data("active_site",e),r(e,n)}}else data={};if("undefined"==typeof t){U>0&&console.log("WP-Optimize: process_queue(): queue is apparently empty - exiting"),F.unlock();var n=i.data("active_site");return r(0,n),void s()}if(U>0&&console.log("WP-Optimize: process_queue(): processing item: "+t),F.dequeue(),A(document).trigger(["do_optimization_",t,"_start"].join("")),"optimizetables"===t){A("#optimization_info_"+t).html(wpoptimize.optimizing_table+" "+data.optimization_table);var a=parseInt(wpoptimize.table_optimization_timeout)?parseInt(wpoptimize.table_optimization_timeout):12e4,l={timeout:a,error:function(e,o){if(Q=!0,"timeout"===o?console.warn("The request to optimize the table "+data.optimization_table+" timed out after "+a/1e3+" seconds"):console.warn('There was an error when running the optimization "'+t+'".',o,e,data),F.is_empty()){var n=i.data("active_site");r(n,0),A("#optimization_spinner_"+t).hide(),A("#optimization_checkbox_"+t).show(),A(".optimization_button_"+t).prop("disabled",!1),A("#optimization_info_"+t).html(wpoptimize.optimization_complete+" "+wpoptimize.with_warnings)}setTimeout(function(){F.unlock(),p()},500)}}}else var l={};S("do_optimization",{optimization_id:t,data:data},function(e){if(A("#optimization_spinner_"+t).hide(),A("#optimization_checkbox_"+t).show(),A(".optimization_button_"+t).prop("disabled",!1),A(document).trigger(["do_optimization_",t,"_done"].join(""),e),e){for(var i="",o=0,n=e.errors.length;o<n;o++)i+='<span class="error">'+e.errors[o]+"</span><br>";for(var o=0,n=e.messages.length;o<n;o++)i+=e.errors[o]+"<br>";for(var o=0,n=e.result.output.length;o<n;o++)i+=e.result.output[o]+"<br>";A("#optimization_info_"+t).html(i),e.hasOwnProperty("status_box_contents")&&A("#wp_optimize_status_box").css("opacity","1").find(".inside").html(e.status_box_contents),e.hasOwnProperty("table_list")&&A("#wpoptimize_table_list tbody").html(A(e.table_list).find("tbody").html()),e.hasOwnProperty("total_size")&&A("#optimize_current_db_size").html(e.total_size);const a="optimizetables";if(F.contains_id(a)?(A("#optimization_checkbox_optimizetables").hide(),A("#optimization_spinner_optimizetables").show(),A(".optimization_button_optimizetables").prop("disabled",!0)):(A("#optimization_checkbox_optimizetables").show(),A("#optimization_spinner_optimizetables").hide(),A(".optimization_button_optimizetables").prop("disabled",!1),A("#optimization_info_optimizetables").html(wpoptimize.optimization_complete+(Q?" "+wpoptimize.with_warnings:""))),e.result.meta&&e.result.meta.hasOwnProperty("awaiting_mod")){var s=e.result.meta.awaiting_mod;s>0?A("#adminmenu .awaiting-mod .pending-count").remove(s):A("#adminmenu .awaiting-mod").remove()}}setTimeout(function(){F.unlock(),p()},500)},!0,l)}function r(t,e){0!=e&&(A("#site-"+e).show(),A("#optimization_spinner_site-"+e).hide()),A("#site-"+t).hide(),A("#optimization_spinner_site-"+t).show()}function l(t){var e=A("#wp-optimize-nav-tab-contents-optimize .wp-optimize-settings-"+t);e||console.log("do_optimization: row corresponding to this optimization ("+t+") not found");var i={},o=0;if(A('input[type="checkbox"]',A("#optimization_info_"+t)).each(function(){var t=A(this);t.is(":checked")&&(i[t.attr("name")]=t.val(),o++)}),1!=A(".optimization_button_"+t).prop("disabled")){var n=!1;if("optimizetables"==t){var a=A("#wpoptimize_table_list #the-list tr"),s=A("#wpo_sitelist_moreoptions").length>0&&A("#wpo_sitelist_moreoptions").is(":visible"),r=[];s&&(r=A('#wpo_sitelist_moreoptions input[type="checkbox"]:checked').map(function(){return parseInt(A(this).val())}).get()),n=!0,A(a).each(function(e){var i=(A(this).find("td"),A(this).data("type")),o=A(this).data("tablename"),a=A(this).data("optimizable"),p=A(this).data("blog_id")?parseInt(A(this).data("blog_id")):1,l=!0;if(s&&-1==r.indexOf(p)&&(l=!1),""!=o&&l&&(1==parseInt(a)||$)){var c={optimization_id:t,blog_id:p,optimization_table:o,optimization_table_type:i,optimization_force:$};F.enqueue(c),n=!1}})}else{if(data={optimization_id:t},o>0)for(var l in i)i.hasOwnProperty(l)&&(data[l]=i[l]);F.enqueue(data)}n||(A("#optimization_checkbox_"+t).hide(),A("#optimization_spinner_"+t).show(),A(".optimization_button_"+t).prop("disabled",!0),A("#optimization_info_"+t).html("..."),p())}}function c(t){A("#wpo_settings_sites_list").length?S("save_site_settings",{"wpo-sites":_()},function(){t&&t()}):t&&t()}function _(){var t=[];return A('#wpo_settings_sites_list input[type="checkbox"]').each(function(){var e=A(this);e.is(":checked")&&t.push(e.attr("value"))}),t}function d(){var t=!1;A("#enable-auto-backup").is(":checked")&&(t=!0),u(),1==t?m(h):h()}function m(t,e){"undefined"==typeof e&&(e="");var i=e?0:1;"function"==typeof updraft_backupnow_inpage_go?updraft_backupnow_inpage_go(function(){A("#updraft-backupnow-inpage-modal").dialog("close"),t&&t()},e,"autobackup",0,i,0,wpoptimize.automatic_backup_before_optimizations):t&&t()}function u(){var t=a("object");t.auto_backup=A("#enable-auto-backup").is(":checked"),S("save_auto_backup_option",t)}function g(t,e,i,o){t.on("click",function(){return e.hasClass("wpo_always_visible")||e.toggleClass("wpo_hidden"),!1}),f(i,o)}function f(t,e){t.on("change",function(){t.is(":checked")?e.prop("checked",!0):e.prop("checked",!1),w(t,e)}),e.on("change",function(){w(t,e)}),w(t,e)}function w(t,e){var i=0,o=0;if(e.each(function(){A(this).is(":checked")&&o++,i++}),t.next().is("label")&&t.next().data("label")){var n=t.next(),a=n.data("label");i==o?n.text(a):n.text(a.replace("all",[o," of ",i].join("")))}i==o?t.prop("checked",!0):t.prop("checked",!1)}function h(){$optimizations=A("#optimizations_list .optimization_checkbox:checked"),$optimizations.sort(function(t,e){return t=A(t).closest(".wp-optimize-settings").data("optimization_run_sort_order"),e=A(e).closest(".wp-optimize-settings").data("optimization_run_sort_order"),t>e?1:t<e?-1:0});var t={};$optimizations.each(function(e){var i=A(this).closest(".wp-optimize-settings").data("optimization_id");return i?(t[i]={active:1},void l(i)):void console.log("Optimization ID corresponding to pressed button not found")}),S("save_manual_run_optimization_options",t)}function b(t){if(t.hasOwnProperty("table_list")){var e=!0,i=function(t){A("#wpoptimize_table_list tbody").css("opacity","1")};A("#wpoptimize_table_list tbody").remove(),A("#wpoptimize_table_list thead").after(t.table_list),A("#wpoptimize_table_list").trigger("updateAll",[e,i])}t.hasOwnProperty("total_size")&&A("#optimize_current_db_size").html(t.total_size),t.hasOwnProperty("show_innodb_force_optimize")&&A(".innodb_force_optimize--container").toggleClass("hidden",!t.show_innodb_force_optimize),T(),y(N)}function z(t){var e=t.next(),i=e.next(),o=t.data("table"),n=t.data("type"),a={optimization_id:"optimizetables",optimization_table:o,optimization_table_type:n};t.hide(),N&&(a.optimization_force=!0),e.removeClass("visibility-hidden"),S("do_optimization",{optimization_id:"optimizetables",data:a},function(o){if(o.result.meta.error)t.closest("tr").html('<td colspan="8" class="no-table"><p>'+o.result.meta.message+"</p></td>"),setTimeout(function(){A("#wp_optimize_table_list_refresh").trigger("click")},2e3);else if(o.result.meta.tableinfo){var n=t.closest("tr"),a=o.result.meta,s=a.tableinfo;v(n,s),A("#wpoptimize_table_list > tbody:last th:eq(6)").html(['<span style="color:',a.overhead>0?"#0000FF":"#004600",'">',a.overhead_formatted,"</span>"].join(""))}t.prop("disabled",!1),e.addClass("visibility-hidden"),i.show().removeClass("visibility-hidden").delay(2500).fadeOut("fast",function(){t.show()})})}function v(t,e){A("td:eq(2)",t).text(e.rows),A("td:eq(3)",t).text(e.data_size),A("td:eq(4)",t).text(e.index_size),A("td:eq(5)",t).text(e.type),e.is_optimizable?A("td:eq(6)",t).html(['<span style="color:',e.overhead>0?"#0000FF":"#004600",'">',e.overhead,"</span>"].join("")):A("td:eq(6)",t).html('<span color="#0000FF">-</span>')}function y(t){A(".run-single-table-optimization").each(function(){var e=A(this);e.data("disabled")&&(t?e.prop("disabled",!1):e.prop("disabled",!0))})}function k(t){var e,i,o;if(t)for(e in t)t.hasOwnProperty(e)&&(i=["#wp-optimize-settings-",t[e].dom_id].join(""),o=t[e].info?t[e].info.join("<br>"):"",A(i+" .wp-optimize-settings-optimization-info").html(o))}function x(){var t=["",_().join("_")].join("");ot.hasOwnProperty(t)?k(ot[t]):S("get_optimizations_info",{"wpo-sites":_()},function(e){e&&(ot[t]=e,k(e))})}function O(t){var e=A("#wpo_import_spinner"),i=A("#wpo_import_success_message"),o=A("#wpo_import_error_message");e.show(),S("import_settings",{settings:t},function(t){e.hide(),t&&t.errors&&t.errors.length?(o.text(t.errors.join("<br>")),o.slideDown()):t&&t.messages&&t.messages.length&&(i.text(t.messages.join("<br>")),i.slideDown(),setTimeout(function(){window.location.reload()},500)),A("#wpo_import_settings_btn").prop("disabled",!1)})}function C(t,e){var i=document.body.appendChild(document.createElement("a")),o=new Date,n=o.getFullYear(),a=o.getMonth()<10?["0",o.getMonth()].join(""):o.getMonth(),s=o.getDay()<10?["0",o.getDay()].join(""):o.getDay();e=e?e:["wpo-settings-",n,"-",a,"-",s,".json"].join(""),i.setAttribute("download",e),i.setAttribute("style","display:none;"),i.setAttribute("href","data:text/json;charset=UTF-8,"+encodeURIComponent(JSON.stringify(t))),i.click()}function j(t){var e=t.next(),i=e.next(),o=t.data("table"),n={optimization_id:"orphanedtables",optimization_table:o,optimization_action:"toinnodb"};e.removeClass("visibility-hidden"),S("do_optimization",{optimization_id:"orphanedtables",data:n},function(e){if(e.result.meta.error)return t.closest("tr").html('<td colspan="8" class="no-table"><p>'+e.result.meta.message+"</p></td>"),void setTimeout(function(){A("#wp_optimize_table_list_refresh").trigger("click")},2e3);if(e.result.meta.success){var n=t.closest("tr");i.show().removeClass("visibility-hidden"),n.find(".toinnodb").remove(),setTimeout(function(){i.fadeOut("slow",function(){n.find("[data-colname='Type']").text("InnoDB")})},500)}else{var a=wpoptimize.table_was_not_converted.replace("%s",o);e.result.meta.message&&(a+="("+e.result.meta.message+")"),alert(a)}}).always(function(){t.prop("disabled",!1),e.addClass("visibility-hidden")})}function P(){var t=at.next(),e=t.next(),i=at.data("table"),o={optimization_id:"orphanedtables",optimization_table:i};t.removeClass("visibility-hidden"),S("do_optimization",{optimization_id:"orphanedtables",data:o},function(t){if(t.result.meta.success){var o=at.closest("tr");e.show().removeClass("visibility-hidden"),setTimeout(function(){o.fadeOut("slow",function(){o.remove(),T()})},500)}else{var n=wpoptimize.table_was_not_deleted.replace("%s",i);t.result.meta.message&&(n+="("+t.result.meta.message+")"),alert(n)}}).always(function(){at.prop("disabled",!1),t.addClass("visibility-hidden")})}function T(){var t=A("#wpoptimize_table_list"),e=!0;A("tr",t).each(function(){var t=A(this);if(A("button",t).length>0)return e=!1,!1}),A("tr",t).each(function(){var t=A(this);e?A("td:last, th:last",t).hide():A("td:last, th:last",t).show()})}function D(t,e){var i=t.val(),o=t.data("validate");if(!o&&e)return""!=i.trim();if(o&&!e&&""==i.trim())return!0;var n=!0;switch(o){case"email":for(var a=/\S+@\S+\.\S+/,s=i.split(","),p="",r=0;r<s.length;r++)p=s[r].trim(),""!=p&&a.test(p)||(n=!1);break;case"url":var a=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?: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*)?$/i;n=a.test(i)}return n}function W(){A.blockUI({css:{width:"300px",border:"none","border-radius":"10px",left:"calc(50% - 150px)",padding:"20px"},message:'<div style="margin: 8px; font-size:150%;" class="updraft_saving_popup"><img src="'+wpoptimize.spinner_src+'" height="80" width="80" style="padding-bottom:10px;"><br>'+wpoptimize.importing+"</div>"})}function I(t){t.preventDefault();var e=new Date;form_data=JSON.stringify({epoch_date:e.getTime(),local_date:e.toLocaleString(),network_site_url:wpoptimize.network_site_url,data:{cache_settings:wp_optimize.cache_settings(),minify_settings:wp_optimize.minify_settings(),smush_settings:wp_optimize.smush_settings(),database_settings:a("string")}});var i=document.body.appendChild(document.createElement("a"));i.setAttribute("download",wpoptimize.export_settings_file_name),i.setAttribute("style","display:none;"),i.setAttribute("href","data:text/json;charset=UTF-8,"+encodeURIComponent(form_data)),i.click()}function q(t){var e=new FileReader;e.onload=function(){O(this.result)},e.readAsText(t)}function O(t){var e;try{e=wpo_parse_json(t)}catch(i){return A.unblockUI(),jQuery("#import_settings").val(""),console.log(t),console.log(i),void alert(wpoptimize.import_invalid_json_file)}if(window.confirm(wpoptimize.importing_data_from+" "+e.network_site_url+"\n"+wpoptimize.exported_on+" "+e.local_date+"\n"+wpoptimize.continue_import)){var o=JSON.stringify(e.data);S("import_settings",{settings:o},function(t){A.unblockUI(),t&&t.errors?alert(t.errors.join("<br />")):t&&t.success&&(alert(t.message),setTimeout(function(){window.location.reload()},200))})}else A.unblockUI()}var A=jQuery,U=0,F=new Updraft_Queue,S=wp_optimize.send_command,$=!1,Q=!1,N=!1,E=WP_Optimize_Heartbeat();f(A("#select_all_optimizations"),A("#optimizations_list .optimization_checkbox")),t(),A("#enable-schedule").on("change",function(){t()}),A.tablesorter.addParser({id:"sizes",is:function(t){return!1},format:function(t,e,i){var o=A(i).data("raw_value");return o||(o=0),parseInt(o)},type:"numeric"}),A(document).on("wpo_database_tabs_loaded",function(){var t=A("#wpoptimize_table_list_filter"),e=A("#wpoptimize_table_list"),i=A("#wpoptimize_table_list tbody:last"),o=A("#wpoptimize_table_list_tables_not_found");e.tablesorter({theme:"default",widgets:["zebra","rows","filter"],cssInfoBlock:"tablesorter-no-sort",headers:{2:{sorter:"digit"},3:{sorter:"sizes"},4:{sorter:"sizes"},7:{sorter:!1}},widgetOptions:{filter_external:t,filter_defaultFilter:{2:"~{query}"}}}),e.on("filterEnd",function(){var n=t.val().trim();""==n?i.show():i.hide(),0==A("#the-list tr:visible",e).length?o.show():o.hide()});var n=A("#innodb_force_optimize"),a=n.closest("tr"),s=A("#innodb_force_optimize_single");n.on("change",function(){A('button, input[type="checkbox"]',a).each(function(){$=n.is(":checked");var t=A(this);t.data("disabled")&&($?t.prop("disabled",!1):t.prop("disabled",!0))})}),s.on("change",function(){N=A(this).is(":checked"),y(N)}),N=s.is(":checked"),$=n.is(":checked"),y(N)}),A("#wp-optimize-disable-enable-trackbacks-enable").on("click",function(){i("trackbacks",!0)}),A("#wp-optimize-disable-enable-trackbacks-disable").on("click",function(){i("trackbacks",!1)}),A("#wp-optimize-disable-enable-comments-enable").on("click",function(){i("comments",!0)}),A("#wp-optimize-disable-enable-comments-disable").on("click",function(){i("comments",!1)}),A(".wpo-pages-menu").on("click","a",function(t){t.preventDefault(),A(this).is(".active")||(A(".wpo-pages-menu a.active").removeClass("active"),A(".wpo-page.active").removeClass("active"),A(this).addClass("active"),A('.wpo-page[data-whichpage="'+A(this).data("menuslug")+'"]').addClass("active"),window.scroll(0,0),A("#wp-optimize-wrap").trigger("page-change",{page:A(this).data("menuslug")})),A("#wp-optimize-nav-page-menu").trigger("click")}),A("#wp-optimize-wrap").on("page-change",function(t,e){var i=A(".wpo-page[data-whichpage="+e.page+"]").find(".nav-tab-wrapper .nav-tab-active");A("#wp-optimize-wrap").trigger("tab-change",{page:e.page,tab:i.data("tab")}),A("#wp-optimize-wrap").trigger("tab-change/"+e.page+"/"+i.data("tab"),{content:A("#"+i.attr("id")+"-contents")})}),setTimeout(function(){A("#wp-optimize-wrap").trigger("page-change",{page:A(".wpo-pages-menu a.active").data("menuslug")})},500),A(".nav-tab-wrapper .nav-tab").on("click",function(t){t.preventDefault();var e=A(this).attr("id"),i=A(this).closest(".nav-tab-wrapper");if(e){if(o(!1),A(this).is('[role="toggle-menu"]'))return void o(!0);i.find(".nav-tab:not(#wp-optimize-nav-tab-"+e+")").removeClass("nav-tab-active"),A(this).addClass("nav-tab-active"),A(this).closest(".wpo-page").find(".wp-optimize-nav-tab-contents").hide(),A("#"+e+"-contents").show(),A("#wp-optimize-wrap").trigger("tab-change",{page:A(this).data("page"),tab:A(this).data("tab")}),A("#wp-optimize-wrap").trigger("tab-change/"+A(this).data("page")+"/"+A(this).data("tab"),{content:A("#"+e+"-contents")})}}),A("#wp-optimize-nav-page-menu").on("click",function(t){t.preventDefault(),A(this).toggleClass("opened")}),A("#wp-optimize-wrap").on("click",".js--wpo-goto",function(t){t.preventDefault();var e=A(this).data("page"),i=A(this).data("tab");e&&A('.wpo-pages-menu a[data-menuslug="'+e+'"]').trigger("click"),i&&A('.wpo-page.active .nav-tab-wrapper a[data-tab="'+i+'"]').trigger("click")});var J=!1,M=!1;A("#wp-optimize-wrap").on("tab-change/WP-Optimize/tables",function(t){n()}),A("#wp-optimize-wrap").on("tab-change/WP-Optimize/optimize",function(t,e){n()}),A("#wp-optimize-wrap").on("tab-change/wpo_settings/settings",function(t,e){e.content.find(".innodb_force_optimize--container").length&&n()}),A("#wp-optimize-nav-tab-WP-Optimize-optimize-contents").on("click","button.wp-optimize-settings-optimization-run-button",function(){var t=A(this).closest(".wp-optimize-settings").data("optimization_id");return t?void(1!=A(".optimization_button_"+t).prop("disabled")&&(A(".optimization_button_"+t).prop("disabled",!0),c(function(){A(".optimization_button_"+t).prop("disabled",!1),l(t)}))):void console.log("Optimization ID corresponding to pressed button not found")}),A("#wp-optimize-nav-tab-WP-Optimize-optimize-contents").on("click","#wp-optimize",function(t){var e=A(this);t.preventDefault(),e.prop("disabled",!0),c(function(){e.prop("disabled",!1),d()})});var R=A("#wpo_settings_sites_list"),B=R.find("ul").first(),Y=A('input[type="checkbox"]',B),H=R.find("#wpo_all_sites"),K=A("#wpo_sitelist_show_moreoptions"),L=A("#wpo_sitelist_moreoptions"),G=A("#wpo_settings_sites_list_cron"),V=G.find("ul").first(),X=A('input[type="checkbox"]',V),Z=G.find("#wpo_all_sites_cron"),tt=A("#wpo_sitelist_show_moreoptions_cron"),et=A("#wpo_sitelist_moreoptions_cron");g(K,L,H,Y);var it=0;A([H,Y]).each(function(){A(this).on("change",function(){it++,setTimeout(function(){it--,0==it&&x()},1e3)})}),g(tt,et,Z,X),A("#wp_optimize_table_list_refresh").on("click",function(t){t.preventDefault();var e=A(this).closest(".wpo-tab-postbox").find(".wpo_shade");e.removeClass("hidden"),A("#wpoptimize_table_list tbody").css("opacity","0.5"),S("get_table_list",{refresh_plugin_json:!0},b).always(function(){e.addClass("hidden")})}),A("#database_settings_form, #settings_form").on("click",".wpo-save-settings",function(t){t.preventDefault();var i=A(this).closest("form"),o=i.find(".wpo-saving-settings"),n=a();i.trigger("wpo-saving-form-data"),i.form_errors.has_errors()||(o.show(),A.blockUI(),A("#optimizations_list").length&&A("#optimizations_list .optimization_checkbox:checked").each(function(){var t=A(this).closest(".wp-optimize-settings").data("optimization_id");t&&(n+="&optimization-options["+t+"][active]=1")}),A("#purge_cache_permissions").length&&(A("#purge_cache_permissions").val()||(n+="&purge_cache_permissions[]")),S("save_settings",n,function(t){if(o.closest("div").find(".save-done").show().delay(5e3).fadeOut(),t&&t.hasOwnProperty("save_results")&&t.save_results&&t.save_results.hasOwnProperty("errors"))for(var i=0,n=t.save_results.errors.length;i<n;i++){var a='<div class="error">'+t.errors[i]+"</div>";e(a,"#wp-optimize-settings-save-results")}t&&t.hasOwnProperty("status_box_contents")&&A(t.status_box_contents).each(function(t,e){A(e).is("#wp_optimize_status_box")&&A("#wp_optimize_status_box").replaceWith(A(e))}),t&&t.hasOwnProperty("optimizations_table")&&A("#optimizations_list").replaceWith(t.optimizations_table),t&&t.hasOwnProperty("settings_auto_cleanup_contents")&&A("#wpo_auto_cleanup").replaceWith(t.settings_auto_cleanup_contents),t&&t.hasOwnProperty("logging_settings_contents")&&A("#wpo_logging_settings").replaceWith(t.logging_settings_contents),t.save_results.refresh&&location.reload()}).always(function(){o.hide(),A.unblockUI()}))}),A("#database_settings_form").on("click",".wpo_save_event",function(){setTimeout(function(){A("#wp-optimize-save-database-settings").trigger("click")},500)}),A("#settings_form").on("click",".wpo_save_logging",function(){setTimeout(function(){A("#wp-optimize-save-main-settings").trigger("click")},500)}),A("#settings_form").on("click",".wpo-wipe-settings",function(){var t=A(this).parent().find(".wpo_spinner");t.show(),S("wipe_settings",{},function(){t.next().removeClass("display-none").delay(5e3).fadeOut(),alert(wpoptimize.settings_have_been_deleted_successfully),location.replace(wpoptimize.settings_page_url)}).always(function(){t.hide()})}),A("#wp-optimize-wrap").on("click","#wp_optimize_status_box_refresh",function(t){t.preventDefault(),A("#wp_optimize_status_box").css("opacity","0.5"),S("get_status_box_contents",null,function(t){A("#wp_optimize_status_box").css("opacity","1"),A(t).each(function(t,e){A(e).is("#wp_optimize_status_box")&&A("#wp_optimize_status_box").replaceWith(A(e))})})});var ot={};A("#wpo_import_settings_btn").on("click",function(t){var e=A("#wpo_import_settings_file"),i=e.val(),o=e[0].files[0],n=new FileReader;return A("#wpo_import_settings_btn").prop("disabled",!0),/\.json$/.test(i)?(n.onload=function(){O(this.result)},n.readAsText(o),!1):(t.preventDefault(),A("#wpo_import_settings_btn").prop("disabled",!1),A("#wpo_import_error_message").text(wpoptimize.please_select_settings_file).slideDown(),!1)}),A("#wpo_import_settings_file").on("change",function(){A("#wpo_import_error_message").slideUp()}),A("#wpo_export_settings_btn").on("click",function(t){return C(a("object")),!1});var nt=function(t,e,i){return S("get_optimization_info",{optimization_id:e,data:i},function(i){var o=i&&i.result&&i.result.meta?i.result.meta:{},n=i&&i.result&&i.result.output?i.result.output.join("<br>"):"...";A(document).trigger(["optimization_get_info_",e].join(""),[n,o]),t.html(n),o.finished?A(document).trigger(["optimization_get_info_",e,"_done"].join(""),i):setTimeout(function(){var i=nt(t,e,o);A(document).trigger(["optimization_get_info_xhr_",e].join(""),[i,o])},1)})};A("#wpoptimize_table_list").on("click",".run-single-table-optimization",function(){var t=A("#enable-auto-backup-1"),e=A(this);t.is(":checked")?m(function(){z(e)}):z(e)}),A("#wpoptimize_table_list").on("click",".run-single-table-repair",function(){var t=A(this),e=t.next(),i=e.next(),o=t.data("table"),n={optimization_id:"repairtables",optimization_table:o};e.removeClass("visibility-hidden"),S("do_optimization",{optimization_id:"repairtables",data:n},function(n){if(n.result.meta.success){var a=t.closest("tr"),s=n.result.meta.tableinfo;t.prop("disabled",!1),e.addClass("visibility-hidden"),i.show().removeClass("visibility-hidden"),v(a,s),setTimeout(function(){var e=t.closest("td"),i=t.closest(".wpo_button_wrap");i.fadeOut("fast",function(){i.closest(".wpo_button_wrap").remove(),s.is_type_supported&&A(".wpo_button_wrap",e).removeClass("wpo_hidden")}),T()},1e3)}else t.prop("disabled",!1),e.addClass("visibility-hidden"),alert(wpoptimize.table_was_not_repaired.replace("%s",o))})}),A("#wpoptimize_table_list").on("click",".toinnodb",function(){j(A(this))});var at;return A("#wpoptimize_table_list").on("click",".run-single-table-delete",function(){at=A(this);var t=A("#enable-auto-backup-1");""==wpoptimize.user_always_ignores_table_delete_warning||"1"!==wpoptimize.user_always_ignores_table_delete_warning?wp_optimize.modal.open({className:"wpo-confirm",events:{"click .wpo-modal--bg":"close","click .delete-table":"deleteTable","change #confirm_deletion_without_backup":"changeConfirm","change #confirm_table_deletion":"changeConfirm"},content:function(){var e=wp.template("wpo-table-delete"),i=at.closest("tr").find(".table-plugins").html();return e({no_backup:!t.is(":checked"),plugins_list:i,table_name:at.data("table")})},changeConfirm:function(){var t=!0,e=this.$("#confirm_deletion_without_backup"),i=this.$("#confirm_table_deletion");e.length&&!e.is(":checked")&&(t=!1),i.is(":checked")||(t=!1),this.$(".delete-table").prop("disabled",!t)},deleteTable:function(){var e=this.$("#ignores_table_delete_warning");e.is(":checked")&&S("user_ignores_table_delete_warning",{},function(t){t.success&&(wpoptimize.user_always_ignores_table_delete_warning="1")}),t.is(":checked")?m(P):P(),this.close()}}):t.is(":checked")?m(P):P()}),T(),A("#wp-optimize-general-settings").on("wpo-saving-form-data",function(){var t=!0,e=A(this);A(".wpo_logger_addition_option, .wpo_logger_type").each(function(){D(A(this),!0)?A(this).removeClass("wpo_error_field"):(t=!1,A(this).addClass("wpo_error_field"))}),t?(e.form_errors.remove("missing-fields"),A("#wp-optimize-logger-settings .save_settings_reminder").slideUp()):(e.form_errors.add("missing-fields",""),A("#wp-optimize-settings-save-results").show().addClass("wpo_alert_notice").text(wpoptimize.fill_all_settings_fields).delay(5e3).fadeOut(3e3,function(){A(this).removeClass("wpo_alert_notice")}))}),setTimeout(function(){S("check_overdue_crons",null,function(t){t&&t.hasOwnProperty("m")&&A("#wpo_settings_warnings").append(t.m)})},11e3),A(".wpo-introduction-notice .notice-dismiss, .wpo-introduction-notice .close").on("click",function(t){A(".wpo-introduction-notice").remove(),S("dismiss_install_or_update_notice",null,function(t){t&&t.hasOwnProperty("error")&&console.log("There was an error dismissing the install or update notice (dismiss_install_or_update_notice)",t)})}),A("#wpo-settings-export").on("click",I),A("#wpo-settings-import").on("click",function(t){t.preventDefault(),W();var e=document.getElementById("import_settings");return 0===e.files.length?(alert(wpoptimize.import_select_file),void A.unblockUI()):void q(e.files[0])}),E.setup(),{send_command:S,optimization_get_info:nt,take_a_backup_with_updraftplus:m,save_auto_backup_options:u}};jQuery(function(t){function e(e){var i=["#",e.data("additional")].join("");e.is(":checked")?t(i).show():t(i).hide()}function i(){var e=t("#wp-optimize-logger-settings .save_settings_reminder");e.is(":visible")||e.slideDown("normal")}function o(){t(".wpo_logger_type").each(function(){n(t(this))})}function n(e){var i,o,n=a();for(i in n)o=n[i],wpoptimize.loggers_classes_info[o].allow_multiple?t('option[value="'+o+'"]',e).show():t('option[value="'+o+'"]',e).hide()}function a(){var e=[];return t(".wpo_logging_row, .wpo_logger_type").each(function(){var i=t(this).is("select")?t(this).val():t(this).data("id");i&&e.push(i)}),e}function s(){var t,e=['<option value="">'+wpoptimize.select_destination+"</option>"];for(t in wpoptimize.loggers_classes_info)wpoptimize.loggers_classes_info.hasOwnProperty(t)&&wpoptimize.loggers_classes_info[t].available&&e.push(['<option value="',t,'">',wpoptimize.loggers_classes_info[t].description,"</option>"].join(""));return['<div class="wpo_add_logger_form">','<select class="wpo_logger_type" name="wpo-logger-type[]">',e.join(""),"</select>",'<div class="wpo_logging_edit_row" style="display:block;"><span class="wpo_delete_logger button button-secondary" title="'+wpoptimize.cancel+'">'+wpoptimize.cancel+"</span>",'<span class="wpo_save_logging button button-primary" title="'+wpoptimize.add+'">'+wpoptimize.add+"</span></div>",'<div class="wpo_additional_logger_options"></div>',"</div>"].join("")}function p(t){if(!wpoptimize.loggers_classes_info[t].options)return"";var e,i=wpoptimize.loggers_classes_info[t].options,o=[],n="",a="";for(e in i)i.hasOwnProperty(e)&&(Array.isArray(i[e])?(n=i[e][0].trim(),a=i[e][1].trim()):(n=i[e].trim(),a=""),o.push(['<input class="wpo_logger_addition_option" type="text" name="wpo-logger-options[',e,'][]" value="" ','placeholder="',n,'" ',""!==a?'data-validate="'+a+'"':"","/>"].join("")));return o.push('<input type="hidden" name="wpo-logger-options[active][]" value="1" />'),o.join("")}t(".wp-optimize-logging-settings").each(function(){var i=t(this);e(i),i.on("change",function(){e(i)})});var r=t("#settings_form");r.on("click","#wpo_add_logger_link",function(e){e.preventDefault(),t("#wp-optimize-logger-settings .save_settings_reminder").after(s()),n(t(".wpo_logger_type").first())}),t("#wp-optimize-general-settings").on("change",".wpo_logger_type",function(){var e=t(this),o=e.val(),n=e.parent().find(".wpo_additional_logger_options");n.html(p(o)),e.val()&&i()}),t("#settings_form").on("click",".wpo_logging_actions_row .wpo_edit_logger",function(){var e=t(this),i=e.closest(".wpo_logging_row"); return t(".wpo_additional_logger_options",i).removeClass("wpo_hidden"),t(".wpo_logging_options_row",i).hide(),t(".wpo_logging_status_row",i).hide(),e.parent(".wpo_logging_actions_row").hide(),t(i).children(".wpo_logging_edit_row").show(),!1}),t("#settings_form").on("click",".wpo_logging_edit_row .wpo_cancel_logging",function(){var e=t(this),i=e.closest(".wpo_logging_row");return t(i).children(".wpo_logging_edit_row").hide(),t(i).children(".wpo_logging_options_row").show(),t(i).children(".wpo_logging_status_row").show(),t(i).children(".wpo_logging_actions_row").show(),t(i).children(".wpo_additional_logger_options").addClass("wpo_hidden"),!1}),t("#wp-optimize-logger-settings").on("change",".wpo_logger_addition_option",function(){i()}),t("#settings_form").on("change",".wpo_logger_active_checkbox",function(){var e=t(this),i=e.closest("label").find('input[type="hidden"]');i.val(e.is(":checked")?"1":"0")}),t("#wp-optimize-general-settings").on("click",".wpo_delete_logger",function(){if(!confirm(wpoptimize.are_you_sure_you_want_to_remove_logging_destination))return!1;var e=t(this);return e.closest(".wpo_logging_row, .wpo_add_logger_form").remove(),o(),0==t("#wp-optimize-logging-options .wpo_logging_row").length&&t("#wp-optimize-logging-options").hide(),setTimeout(function(){t("#wp-optimize-save-main-settings").trigger("click")},500),!1});var l=!1;t(window).on("scroll",function(e){window.requestAnimationFrame(function(){var e=t(".wpo-main-header").length?t(".wpo-main-header")[0].offsetTop:0;window.pageYOffset>e-20!=l&&(l=!l,t("body").toggleClass("is-scrolled",l))})}),t(".wpo-info__trigger").on("click",function(e){e.preventDefault();var i=t(this).closest(".wpo-info");i.toggleClass("opened")}),t(".wpo-video-preview a").on("click",function(e){var i=t(this).data("embed");if(i){e.preventDefault();var o=t('<iframe width="356" height="200" allowfullscreen webkitallowfullscreen mozallowfullscreen>').attr("src",i);o.insertAfter(t(this)),t(this).remove(),o.focus()}})});