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 @@
!function(t,e){e.addAction("wu_checkout_loaded","nextpress/wp-ultimo",(function(){wu_create_cookie("wu_template",!1),wu_listen_to_cookie_change("wu_template",(function(t){window.wu_template_switching.template_id=t}))})),t(document).ready((function(){const i={functional:!0,template:"#dynamic",props:["template"],render(t,e){const i=e.props.template;return t(i?{template:i}:"<div>nbsp;</div>")}};e.doAction("wu_checkout_loaded"),window.wu_template_switching=new Vue({el:"#wp-ultimo-form-wu-template-switching-form",data:()=>({template_id:0,original_template_id:-1,template_category:"",stored_templates:{},confirm_switch:0,ready:!1}),directives:{init:{bind(t,e,i){i.context[e.arg]=e.value}}},components:{dynamic:i},watch:{ready(){const t=this;!1!==t.ready&&t.switch_template()}},methods:{get_template(t,e){void 0===e.id&&(e.id="default");const i=t+"/"+e.id;if(void 0!==this.stored_templates[i])return this.stored_templates[i];const o={duration:this.duration,duration_unit:this.duration_unit,products:this.products,...e};return this.fetch_template(t,o),'<div class="wu-p-4 wu-bg-gray-100 wu-text-center wu-rounded">Loading</div>'},fetch_template(t,e){const i=this;void 0===e.id&&(e.id="default"),this.request("wu_render_field_template",{template:t,attributes:e},(function(o){const a=t+"/"+e.id;o.success?Vue.set(i.stored_templates,a,o.data.html):Vue.set(i.stored_templates,a,"<div>"+o.data[0].message+"</div>")}))},switch_template(){this.block(),this.request("wu_switch_template",{template_id:this.template_id},(function(t){"string"==typeof t.data.redirect_url&&(window.location.href=t.data.redirect_url)}))},block(){const e=jQuery(this.$el).parents().filter((function(){return"rgba(0, 0, 0, 0)"!==t(this).css("backgroundColor")})).first().css("backgroundColor");jQuery(this.$el).wu_block({message:'<div class="spinner is-active wu-float-none" style="float: none !important;"></div>',overlayCSS:{backgroundColor:e||"#ffffff",opacity:.6},css:{padding:0,margin:0,width:"50%",fontSize:"14px !important",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"none",backgroundColor:"none",cursor:"wait"}})},unblock(){jQuery(this.$el).wu_unblock()},request(t,e,i,o){jQuery.ajax({method:"POST",url:wu_template_switching_params.ajaxurl+"&action="+t,data:e,success:i,error:o})}}})}))}(jQuery,wp.hooks);
((e,t)=>{t.addAction("wu_checkout_loaded","nextpress/wp-ultimo",function(){wu_create_cookie("wu_template",!1),wu_listen_to_cookie_change("wu_template",function(t){window.wu_template_switching.template_id=t})}),e(document).ready(function(){t.doAction("wu_checkout_loaded"),window.wu_template_switching=new Vue({el:"#wp-ultimo-form-wu-template-switching-form",data(){return{template_id:0,original_template_id:-1,template_category:"",stored_templates:{},confirm_switch:0,ready:!1}},directives:{init:{bind(t,e,i){i.context[e.arg]=e.value}}},components:{dynamic:{functional:!0,template:"#dynamic",props:["template"],render(t,e){e=e.props.template;return t(e?{template:e}:"<div>nbsp;</div>")}}},watch:{ready(){!1!==this.ready&&this.switch_template()}},methods:{get_template(t,e){void 0===e.id&&(e.id="default");var i=t+"/"+e.id;return void 0!==this.stored_templates[i]?this.stored_templates[i]:(i={duration:this.duration,duration_unit:this.duration_unit,products:this.products,...e},this.fetch_template(t,i),'<div class="wu-p-4 wu-bg-gray-100 wu-text-center wu-rounded">Loading</div>')},fetch_template(i,a){let o=this;void 0===a.id&&(a.id="default"),this.request("wu_render_field_template",{template:i,attributes:a},function(t){var e=i+"/"+a.id;t.success?Vue.set(o.stored_templates,e,t.data.html):Vue.set(o.stored_templates,e,"<div>"+t.data[0].message+"</div>")})},switch_template(){this.block(),this.request("wu_switch_template",{template_id:this.template_id},function(t){"string"==typeof t.data.redirect_url&&(window.location.href=t.data.redirect_url)})},block(){var t=jQuery(this.$el).parents().filter(function(){return"rgba(0, 0, 0, 0)"!==e(this).css("backgroundColor")}).first().css("backgroundColor");jQuery(this.$el).wu_block({message:'<div class="spinner is-active wu-float-none" style="float: none !important;"></div>',overlayCSS:{backgroundColor:t||"#ffffff",opacity:.6},css:{padding:0,margin:0,width:"50%",fontSize:"14px !important",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"none",backgroundColor:"none",cursor:"wait"}})},unblock(){jQuery(this.$el).wu_unblock()},request(t,e,i,a){jQuery.ajax({method:"POST",url:wu_template_switching_params.ajaxurl+"&action="+t,data:e,success:i,error:a})}}})})})(jQuery,wp.hooks);