Prep Plugin for release on WordPress.org (#23)

* Update translation text domain
* Escape everything that should be escaped.
* Add nonce checks where needed.
* Sanitize all inputs.
* Apply Code style changes across the codebase.
* Correct many deprecation notices.
* Optimize load order of many filters.
* Add Proper Build script
* Use emojii flags
* Fix i18n deprecation  notice for translating too early
* Put all scripts in footer and load async
This commit is contained in:
David Stone
2025-04-14 11:36:46 -06:00
committed by GitHub
parent a31cfcb565
commit d88e50df38
1087 changed files with 12586 additions and 18535 deletions

View File

@ -1 +1 @@
(()=>{"use strict";const e=(e,t,n)=>{let o;if(n){const e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),o="; expires="+e.toUTCString()}else o="";document.cookie=e+"="+t+o+"; path=/"},t=e=>{const t=e+"=",n=document.cookie.split(";");for(let e=0;e<n.length;e++){let o=n[e];for(;" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(t))return o.substring(t.length,o.length)}return null};window.addEventListener("beforeunload",(()=>{var e;return null==(e=window.top)?void 0:e.postMessage("wu_preview_changed","*")})),e("wu_template","");document.addEventListener("DOMContentLoaded",(()=>{var n;((e,n)=>{let o=t(e);setInterval((function(){const l=t(e);l!==o&&(o=l,n(o))}),100)})("wu_selected_products",(()=>document.location.reload()));const o=document.getElementById("iframe"),l=null==o?void 0:o.contentWindow;null==l||l.postMessage("Hello to iframe from parent!","https://"+location.hostname);document.querySelectorAll("#action-select, #action-select2").forEach((t=>t.addEventListener("click",(t=>{t.preventDefault();const n=document.getElementById("template-selector").value;e("wu_template",n),window.close()})))),null==o||o.addEventListener("load",(()=>{var e;if((()=>{var e;window.addEventListener("touchstart",(()=>{}));const t=(null==(e=null==navigator?void 0:navigator.userAgentData)?void 0:e.platform)||(null==navigator?void 0:navigator.platform)||"";return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(t)})()){const t=null==(e=document.getElementById("iframe"))?void 0:e.getElementsByTagName("body")[0];null==t||t.classList.add("wu-fix-safari-preview"),(null==t?void 0:t.style)&&Object.assign(t.style,{position:"fixed",top:0,right:0,bottom:0,left:0,"overflow-y":"scroll","-webkit-overflow-scrolling":"touch"})}}));const i=()=>{var e;const t=(null==(e=document.getElementById("switcher"))?void 0:e.offsetHeight)||0;o.style.height=document.body.offsetHeight-t+"px"};window.addEventListener("resize",i),i();const a=()=>{document.querySelectorAll("#theme_list ul").forEach((e=>e.style.display="none"===e.style.display?"block":"none"))};a(),null==(n=document.getElementById("template_selector"))||n.addEventListener("click",(e=>{e.preventDefault(),a()})),document.querySelectorAll("#theme_list ul li a").forEach((e=>e.addEventListener("click",(e=>{e.preventDefault(),a();const t=e.currentTarget,n=t.getAttribute("href")||"";o.src=t.getAttribute("data-frame")||"";document.getElementById("template_selector").firstChild.nodeValue=t.getAttribute("data-title")||"",window.history.pushState({},"",n)}))));const r=document.getElementById("header-bar");r&&(r.style.display="none");const s={desktop:"100%",tabletlandscape:"1040px",tabletportrait:"788px",mobilelandscape:"500px",mobileportrait:"340px",placebo:"0px"};document.querySelectorAll(".responsive a").forEach((e=>e.addEventListener("click",(e=>{const t=e.currentTarget,n=Array.from(t.classList).reduce(((e,t)=>(s[t]&&(e=s[t]),e)),"");o.style.width=n,o.style.transition="200ms",document.querySelectorAll(".responsive a").forEach((e=>e.classList.remove("active"))),t.classList.add("active")})))),null!==navigator.userAgent.match(/iPad/i)&&(o.style.height="100%")}))})();
(()=>{let t=(e,t,l)=>{let n;var o;n=l?((o=new Date).setTime(o.getTime()+24*l*60*60*1e3),"; expires="+o.toUTCString()):"",document.cookie=e+"="+t+n+"; path=/"},a=e=>{var l=e+"=",n=document.cookie.split(";");for(let t=0;t<n.length;t++){let e=n[t];for(;" "===e.charAt(0);)e=e.substring(1,e.length);if(0===e.indexOf(l))return e.substring(l.length,e.length)}return null};window.addEventListener("beforeunload",()=>{var e;return null==(e=window.top)?void 0:e.postMessage("wu_preview_changed","*")}),t("wu_template","");document.addEventListener("DOMContentLoaded",()=>{((t,l)=>{let n=a(t);setInterval(function(){var e=a(t);e!==n&&(n=e,l(n))},100)})("wu_selected_products",()=>document.location.reload());let n=document.getElementById("iframe");var e=null==n?void 0:n.contentWindow;null!=e&&e.postMessage("Hello to iframe from parent!","https://"+location.hostname);document.querySelectorAll("#action-select, #action-select2").forEach(e=>e.addEventListener("click",e=>{e.preventDefault();e=document.getElementById("template-selector").value;t("wu_template",e),window.close()})),null!=n&&n.addEventListener("load",()=>{var e;window.addEventListener("touchstart",()=>{}),e=(null==(e=null==navigator?void 0:navigator.userAgentData)?void 0:e.platform)||(null==navigator?void 0:navigator.platform)||"",["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(e)&&(null!=(e=null==(e=document.getElementById("iframe"))?void 0:e.getElementsByTagName("body")[0])&&e.classList.add("wu-fix-safari-preview"),null!=e)&&e.style&&Object.assign(e.style,{position:"fixed",top:0,right:0,bottom:0,left:0,"overflow-y":"scroll","-webkit-overflow-scrolling":"touch"})});var e=()=>{var e=(null==(e=document.getElementById("switcher"))?void 0:e.offsetHeight)||0;n.style.height=document.body.offsetHeight-e+"px"};window.addEventListener("resize",e),e();let o=()=>{document.querySelectorAll("#theme_list ul").forEach(e=>e.style.display="none"===e.style.display?"block":"none")};o(),null!=(e=document.getElementById("template_selector"))&&e.addEventListener("click",e=>{e.preventDefault(),o()}),document.querySelectorAll("#theme_list ul li a").forEach(e=>e.addEventListener("click",e=>{e.preventDefault(),o();var e=e.currentTarget,t=e.getAttribute("href")||"",l=(n.src=e.getAttribute("data-frame")||"",document.getElementById("template_selector"));l.firstChild.nodeValue=e.getAttribute("data-title")||"",window.history.pushState({},"",t)}));e=document.getElementById("header-bar");e&&(e.style.display="none");let l={desktop:"100%",tabletlandscape:"1040px",tabletportrait:"788px",mobilelandscape:"500px",mobileportrait:"340px",placebo:"0px"};document.querySelectorAll(".responsive a").forEach(e=>e.addEventListener("click",e=>{var e=e.currentTarget,t=Array.from(e.classList).reduce((e,t)=>e=l[t]?l[t]:e,"");n.style.width=t,n.style.transition="200ms",document.querySelectorAll(".responsive a").forEach(e=>e.classList.remove("active")),e.classList.add("active")})),null!==navigator.userAgent.match(/iPad/i)&&(n.style.height="100%")})})();