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

@ -55,7 +55,7 @@ class Signup_Field_Template_Selection extends Base_Signup_Field {
*/
public function get_title() {
return __('Templates', 'wp-ultimo');
return __('Templates', 'wp-multisite-waas');
}
/**
@ -68,7 +68,7 @@ class Signup_Field_Template_Selection extends Base_Signup_Field {
*/
public function get_description() {
return __('Adds a template selection section. This allows the customer to choose a pre-built site to be used as a template for the site being currently created.', 'wp-ultimo');
return __('Adds a template selection section. This allows the customer to choose a pre-built site to be used as a template for the site being currently created.', 'wp-multisite-waas');
}
/**
@ -81,7 +81,7 @@ class Signup_Field_Template_Selection extends Base_Signup_Field {
*/
public function get_tooltip() {
return __('Adds a template selection section. This allows the customer to choose a pre-built site to be used as a template for the site being currently created.', 'wp-ultimo');
return __('Adds a template selection section. This allows the customer to choose a pre-built site to be used as a template for the site being currently created.', 'wp-multisite-waas');
}
/**
@ -139,7 +139,7 @@ class Signup_Field_Template_Selection extends Base_Signup_Field {
return [
'id' => 'template_selection',
'name' => __('Template Selection', 'wp-ultimo'),
'name' => __('Template Selection', 'wp-multisite-waas'),
'required' => true,
];
}
@ -173,8 +173,8 @@ class Signup_Field_Template_Selection extends Base_Signup_Field {
$editor_fields['template_selection_type'] = [
'type' => 'select',
'title' => __('Available templates', 'wp-ultimo'),
'desc' => __('How do you want to choose available which templates will be available.', 'wp-ultimo'),
'title' => __('Available templates', 'wp-multisite-waas'),
'desc' => __('How do you want to choose available which templates will be available.', 'wp-multisite-waas'),
'order' => 20,
'options' => [
'name' => __('Select by names'),
@ -188,9 +188,9 @@ class Signup_Field_Template_Selection extends Base_Signup_Field {
$editor_fields['template_selection_categories'] = [
'type' => 'select',
'title' => __('Template Categories', 'wp-ultimo'),
'placeholder' => __('e.g.: Landing Page, Health...', 'wp-ultimo'),
'desc' => __('Customers will be able to filter by categories during signup.', 'wp-ultimo'),
'title' => __('Template Categories', 'wp-multisite-waas'),
'placeholder' => __('e.g.: Landing Page, Health...', 'wp-multisite-waas'),
'desc' => __('Customers will be able to filter by categories during signup.', 'wp-multisite-waas'),
'order' => 21,
'options' => Site::get_all_categories(),
'html_attr' => [
@ -204,9 +204,9 @@ class Signup_Field_Template_Selection extends Base_Signup_Field {
$editor_fields['template_selection_sites'] = [
'type' => 'model',
'title' => __('Template Sites', 'wp-ultimo'),
'placeholder' => __('e.g. Template Site 1, My Agency', 'wp-ultimo'),
'desc' => __('Be sure to add the templates in the order you want them to show up.', 'wp-ultimo'),
'title' => __('Template Sites', 'wp-multisite-waas'),
'placeholder' => __('e.g. Template Site 1, My Agency', 'wp-multisite-waas'),
'desc' => __('Be sure to add the templates in the order you want them to show up.', 'wp-multisite-waas'),
'order' => 22,
'html_attr' => [
'v-model' => 'template_selection_sites',
@ -231,9 +231,9 @@ class Signup_Field_Template_Selection extends Base_Signup_Field {
$editor_fields['hide_template_selection_when_pre_selected'] = [
'type' => 'toggle',
'title' => __('Hide when Pre-Selected', 'wp-ultimo'),
'desc' => __('Prevent customers from seeing this field when a template was already selected via the URL.', 'wp-ultimo'),
'tooltip' => __('If the template selection field is the only field in the current step, the step will be skipped.', 'wp-ultimo'),
'title' => __('Hide when Pre-Selected', 'wp-multisite-waas'),
'desc' => __('Prevent customers from seeing this field when a template was already selected via the URL.', 'wp-multisite-waas'),
'tooltip' => __('If the template selection field is the only field in the current step, the step will be skipped.', 'wp-multisite-waas'),
'value' => 0,
'order' => 23,
'html_attr' => [
@ -248,8 +248,8 @@ class Signup_Field_Template_Selection extends Base_Signup_Field {
'fields' => [
'template_selection_template' => [
'type' => 'select',
'title' => __('Template Selector Template', 'wp-ultimo'),
'placeholder' => __('Select your Template', 'wp-ultimo'),
'title' => __('Template Selector Template', 'wp-multisite-waas'),
'placeholder' => __('Select your Template', 'wp-multisite-waas'),
'options' => [$this, 'get_template_selection_templates'],
'wrapper_classes' => 'wu-flex-grow',
'html_attr' => [
@ -265,7 +265,7 @@ class Signup_Field_Template_Selection extends Base_Signup_Field {
// 'order' => 99,
// 'wrapper_classes' => 'sm:wu-p-0 sm:wu-block',
// 'classes' => '',
// 'desc' => sprintf('<div class="wu-p-4 wu-bg-blue-100 wu-text-grey-600">%s</div>', __('Want to add customized template selection templates?<br><a target="_blank" class="wu-no-underline" href="https://help.wpultimo.com/article/343-customize-your-checkout-flow-using-field-templates">See how you can do that here</a>.', 'wp-ultimo')),
// 'desc' => sprintf('<div class="wu-p-4 wu-bg-blue-100 wu-text-grey-600">%s</div>', __('Want to add customized template selection templates?<br><a target="_blank" class="wu-no-underline" href="https://help.wpultimo.com/article/343-customize-your-checkout-flow-using-field-templates">See how you can do that here</a>.', 'wp-multisite-waas')),
// );
return $editor_fields;
@ -356,7 +356,7 @@ class Signup_Field_Template_Selection extends Base_Signup_Field {
$template_class = Field_Templates_Manager::get_instance()->get_template_class('template_selection', $attributes['template_selection_template']);
$content = $template_class ? $template_class->render_container($template_attributes, $this) : __('Template does not exist.', 'wp-ultimo');
$content = $template_class ? $template_class->render_container($template_attributes, $this) : __('Template does not exist.', 'wp-multisite-waas');
$checkout_fields[ $attributes['id'] ] = [
'type' => 'note',