PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 4.5.3
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v4.5.3
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
wp-optimize / js / status-4-5-3.min.js

status-4-5-3.min.js in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance 4.5.3, at js/status-4-5-3.min.js

1 lines 3.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var WPO_Status_Report=function(e){var t=!1,o=!1;return function(){function i(){return"undefined"==typeof wp||"undefined"==typeof wp.apiFetch?void n():void wp.apiFetch({path:"wp-site-health/v1/directory-sizes"}).then(function(t){var o;for(var i in t)e("#wpo-value-wp-paths-sizes-"+i).html(t[i].size),o="{{[wp-paths-sizes-"+i+"]}}",c(o,t[i].size),delete s[i];for(var i in s)null!==s[i]&&(c(s[i],wpoptimize.data_not_available),e("#wpo-value-wp-paths-sizes-"+i).html(wpoptimize.data_not_available))})["catch"](function(e){n()})}function n(){var e=document.querySelectorAll(".wpo-ajax-field-wp-paths-sizes");e.forEach(function(e){e.innerHTML=wpoptimize.data_not_available})}function a(){o=!0,e("#wpo-generate-status-report-text").html(wpoptimize.please_wait+' <i id="wpo-preview-loader"><img width="12" height="12" src="'+wpoptimize.spinner_src+'"></i>'),wp_optimize.send_command("generate_status_report",{},function(o){e("#wpo-status-report-container").html(o.html),p(),r(),i(),s=o.replaceable_md_tags,t=!0}).always(function(){o=!1})}function p(){function t(t){e("#wpo-copy-action-result").html(t),e("#wpo-copy-action-result").show(),setTimeout(function(){e("#wpo-copy-action-result").hide()},1500)}var o=e("#wpo-server-info"),i=e("#wpo-show-status-report-btn"),n=e("#wpo-copy-status-report-btn"),a=e("#wpo-server-info-report");i.on("click",function(t){var i=a.is(":hidden");!0===i?(e(this).text(wpoptimize.hide),o.prepend(a),a.show(),a.trigger("select"),setTimeout(function(e){e.scrollTop(0)},50,a)):(e(this).text(wpoptimize.show),o.append(a),a.hide())}),function(o){o.on("click",function(i){i.preventDefault();var n=e("#wpo-server-info-report");try{if(!(clipboard in navigator))throw new Error;navigator.clipboard.writeText(n.val()),t(wpoptimize.clipboard_success)}catch(a){const p=document.createElement("textarea");p.value=n.val(),p.style.opacity=0;var r=o.parent();r.append(p),p.focus(),p.select();try{const c=document.execCommand("copy");if(!c)throw new Error("Exec command failed, could not copy");t(wpoptimize.clipboard_success)}catch(s){console.log(s),t(wpoptimize.clipboard_failed)}e(p).remove()}})}(n),e("#wpo-download-logs").on("click",function(){e("#wpo-generate-zip-file-text").html(wpoptimize.please_wait+' <i id="wpo-preview-loader"><img width="12" height="12" src="'+wpoptimize.spinner_src+'"></i>'),e(this).prop("disabled",!0),wp_optimize.send_command("generate_logs_zip",{},function(t){const o=new JSZip;t.data.forEach(function(e){e.compressed?o.file(e.name+".gz",atob(e.src),{binary:!0}):o.file(e.name,atob(e.src),{binary:!0})}),o.generateAsync({type:"blob",compression:"DEFLATE"}).then(function(t){var o=new Blob([t]);const i=window.URL.createObjectURL(o),n=document.createElement("a");n.style.display="none",n.href=i;var a=(new Date).toJSON().replace(/:/g,"_");n.download="logs-"+a+".zip",document.body.appendChild(n),n.click(),window.URL.revokeObjectURL(i),e("#wpo-generate-zip-file-text").html(""),e("#wpo-download-logs").prop("disabled",!1)})})}),e("#wpo-download-status-report-btn").on("click",function(){var e=new Blob([a.val()]);const t=window.URL.createObjectURL(e),o=document.createElement("a");o.style.display="none",o.href=t;var i=(new Date).toJSON().replace(/:/g,"_");o.download="wp-optimize-report-"+i+".txt",document.body.appendChild(o),o.click(),window.URL.revokeObjectURL(t)})}function r(){var t=JSON.stringify(WP_Optimize.build_settings(),null,2);e("#wpo-general-settings").html(t),c("{{[wpo-general-settings]}}",t)}function c(t,o){var i=e("#wpo-server-info-report").html();i=i.replace(t,o),e("#wpo-server-info-report").html(i)}if(!1===t&&!1===o){var s;e("#wp-optimize-wrap").on("tab-change/wpo_settings/status",function(e){e.preventDefault(),!1===t&&a()})}}}(jQuery);