diff --git a/.phpcs.xml.dist b/.phpcs.xml.dist index 0a870b2..c378b3a 100644 --- a/.phpcs.xml.dist +++ b/.phpcs.xml.dist @@ -36,18 +36,18 @@ + + + + + - - - - - - + /views/ @@ -74,8 +74,24 @@ - + read_notes + + + + + + + + + + + + + + + + diff --git a/assets/css/admin.css b/assets/css/admin.css index e5482f9..2747b5f 100644 --- a/assets/css/admin.css +++ b/assets/css/admin.css @@ -1851,7 +1851,7 @@ a.button.wu-button-delete.wu-border-none { border-width: 0; } a.button.wu-button-delete:hover { - border-width: 1 !important; + border-width: 1px !important; color: #8b0000; background-color: transparent; } @@ -5193,7 +5193,7 @@ td.column-id { padding: 0; margin: -19px 0 0 -19px; background-image: url("../img/loader.svg"); - background-repeat: none; + background-repeat: no-repeat; background-position: center center; width: 38px; height: 38px; diff --git a/assets/img/logo.png b/assets/img/logo.png new file mode 100644 index 0000000..f83e734 Binary files /dev/null and b/assets/img/logo.png differ diff --git a/assets/js/dns-table.js b/assets/js/dns-table.js new file mode 100644 index 0000000..ad2ca8d --- /dev/null +++ b/assets/js/dns-table.js @@ -0,0 +1,45 @@ +(function($) { + + wu_dns_table = new Vue({ + el: '#wu-dns-table', + data: { + error: null, + results: {}, + loading: true, + }, + updated() { + this.$nextTick(function() { + + window.wu_initialize_tooltip(); + + }); + } + }) + + $(document).ready(function() { + + $.ajax({ + url: ajaxurl, + data: { + action: 'wu_get_dns_records', + domain: 'get_domain()); ?>', + }, + success: function(data) { + + Vue.set(wu_dns_table, 'loading', false); + + if (data.success) { + + Vue.set(wu_dns_table, 'results', data.data); + + } else { + + Vue.set(wu_dns_table, 'error', data.data); + + } + + }, + }) + + }); +})(jQuery); diff --git a/assets/js/settings-loader.js b/assets/js/settings-loader.js new file mode 100644 index 0000000..bba1620 --- /dev/null +++ b/assets/js/settings-loader.js @@ -0,0 +1,13 @@ +settings_loader = wu_block_ui('#wp-ultimo-wizard-body'); + +/** + * Remove the block ui after the settings loaded. + * + * @since 2.0.0 + * @return void + */ +function remove_block_ui() { + + settings_loader.unblock(); + +} \ No newline at end of file diff --git a/assets/js/webhook-page.js b/assets/js/webhook-page.js index 5daae17..fd91149 100644 --- a/assets/js/webhook-page.js +++ b/assets/js/webhook-page.js @@ -27,9 +27,9 @@ if (page === 'edit') { - webhook_url = $('input[name=webhook_url').val(); + webhook_url = $('input[name=webhook_url]').val(); - webhook_event = $('select[name=event').val(); + webhook_event = $('select[name=event]').val(); const id = $(this).data('object'); diff --git a/inc/admin-pages/class-broadcast-edit-admin-page.php b/inc/admin-pages/class-broadcast-edit-admin-page.php index 57e0135..6d72a7f 100644 --- a/inc/admin-pages/class-broadcast-edit-admin-page.php +++ b/inc/admin-pages/class-broadcast-edit-admin-page.php @@ -454,7 +454,7 @@ class Broadcast_Edit_Admin_Page extends Edit_Admin_Page { $item = $query->get_item_by('id', $_GET['id']); if ( ! $item) { - wp_redirect(wu_network_admin_url('wp-ultimo-broadcasts')); + wp_safe_redirect(wu_network_admin_url('wp-ultimo-broadcasts')); exit; } diff --git a/inc/admin-pages/class-checkout-form-edit-admin-page.php b/inc/admin-pages/class-checkout-form-edit-admin-page.php index d45a43f..df13637 100644 --- a/inc/admin-pages/class-checkout-form-edit-admin-page.php +++ b/inc/admin-pages/class-checkout-form-edit-admin-page.php @@ -107,7 +107,7 @@ class Checkout_Form_Edit_Admin_Page extends Edit_Admin_Page { */ public function add_width_control_script(): void { - wp_enqueue_script('wu-checkout-form-edit-modal', wu_get_asset('checkout-form-editor-modal.js', 'js'), [], wu_get_version()); + wp_enqueue_script('wu-checkout-form-edit-modal', wu_get_asset('checkout-form-editor-modal.js', 'js'), [], wu_get_version(), true); } /** @@ -544,7 +544,7 @@ class Checkout_Form_Edit_Admin_Page extends Edit_Admin_Page { $default_field['wrapper_html_attr'] = array_merge( wu_get_isset($default_field, 'wrapper_html_attr', []), [ - 'v-if' => sprintf('type && require("type", %s) && require("tab", "%s")', json_encode($reqs), $tab), + 'v-if' => sprintf('type && require("type", %s) && require("tab", "%s")', wp_json_encode($reqs), $tab), 'v-cloak' => '1', ] ); @@ -552,11 +552,11 @@ class Checkout_Form_Edit_Admin_Page extends Edit_Admin_Page { if ('name' === $default_field_slug || 'id' === $default_field_slug || 'default_value' === $default_field_slug) { unset($default_field['wrapper_html_attr']['v-if']); - $default_field['wrapper_html_attr']['v-show'] = sprintf('type && require("type", %s) && require("tab", "%s")', json_encode($reqs), $tab); + $default_field['wrapper_html_attr']['v-show'] = sprintf('type && require("type", %s) && require("tab", "%s")', wp_json_encode($reqs), $tab); } if ('id' === $default_field_slug) { - $default_field['html_attr']['v-bind:required'] = sprintf('type && require("type", %s) && require("tab", "content")', json_encode($reqs)); + $default_field['html_attr']['v-bind:required'] = sprintf('type && require("type", %s) && require("tab", "content")', wp_json_encode($reqs)); } } @@ -1161,10 +1161,10 @@ class Checkout_Form_Edit_Admin_Page extends Edit_Admin_Page { wp_enqueue_script('wu-checkout-form-editor'); - wp_enqueue_script('wu-vue-sortable', '//cdn.jsdelivr.net/npm/sortablejs@1.8.4/Sortable.min.js', [], wu_get_version()); - wp_enqueue_script('wu-vue-draggable', '//cdnjs.cloudflare.com/ajax/libs/Vue.Draggable/2.20.0/vuedraggable.umd.min.js', [], wu_get_version()); + wp_enqueue_script('wu-vue-sortable', '//cdn.jsdelivr.net/npm/sortablejs@1.8.4/Sortable.min.js', [], wu_get_version(), true); + wp_enqueue_script('wu-vue-draggable', '//cdnjs.cloudflare.com/ajax/libs/Vue.Draggable/2.20.0/vuedraggable.umd.min.js', [], wu_get_version(), true); - wp_enqueue_style('wu-checkout-form-editor', wu_get_asset('checkout-editor.css', 'css')); + wp_enqueue_style('wu-checkout-form-editor', wu_get_asset('checkout-editor.css', 'css'), [], wu_get_version()); } /** @@ -1500,7 +1500,7 @@ class Checkout_Form_Edit_Admin_Page extends Edit_Admin_Page { $item = wu_get_checkout_form($item_id); if ( ! $item) { - wp_redirect(wu_network_admin_url('wp-ultimo-checkout-forms')); + wp_safe_redirect(wu_network_admin_url('wp-ultimo-checkout-forms')); exit; } diff --git a/inc/admin-pages/class-checkout-form-list-admin-page.php b/inc/admin-pages/class-checkout-form-list-admin-page.php index 7465210..963169c 100644 --- a/inc/admin-pages/class-checkout-form-list-admin-page.php +++ b/inc/admin-pages/class-checkout-form-list-admin-page.php @@ -163,7 +163,7 @@ class Checkout_Form_List_Admin_Page extends List_Admin_Page { 'field_wrapper_classes' => 'wu-w-full wu-box-border wu-items-center wu-flex wu-justify-between wu-p-4 wu-m-0 wu-border-t wu-border-l-0 wu-border-r-0 wu-border-b-0 wu-border-gray-300 wu-border-solid', 'html_attr' => [ 'data-wu-app' => 'add_checkout_form_field', - 'data-state' => json_encode( + 'data-state' => wp_json_encode( [ 'template' => 'single-step', ] diff --git a/inc/admin-pages/class-customer-edit-admin-page.php b/inc/admin-pages/class-customer-edit-admin-page.php index 4c76fe0..5d616e5 100644 --- a/inc/admin-pages/class-customer-edit-admin-page.php +++ b/inc/admin-pages/class-customer-edit-admin-page.php @@ -765,7 +765,7 @@ class Customer_Edit_Admin_Page extends Edit_Admin_Page { [ 'html_attr' => [ 'data-wu-app' => 'customer_save', - 'data-state' => json_encode( + 'data-state' => wp_json_encode( [ 'original_user_id' => $this->get_object()->get_user_id(), 'user_id' => $this->get_object()->get_user_id(), @@ -797,7 +797,7 @@ class Customer_Edit_Admin_Page extends Edit_Admin_Page { 'data-label-field' => 'display_name', 'data-search-field' => 'display_name', 'data-max-items' => 1, - 'data-selected' => json_encode($this->get_object()->get_user()->data), + 'data-selected' => wp_json_encode($this->get_object()->get_user()->data), ], 'wrapper_html_attr' => [ 'v-cloak' => '1', @@ -1082,7 +1082,7 @@ class Customer_Edit_Admin_Page extends Edit_Admin_Page { $item = wu_get_customer($item_id); if ( ! $item || $item->get_type() !== 'customer') { - wp_redirect(wu_network_admin_url('wp-ultimo-customers')); + wp_safe_redirect(wu_network_admin_url('wp-ultimo-customers')); exit; } @@ -1123,7 +1123,7 @@ class Customer_Edit_Admin_Page extends Edit_Admin_Page { ] ); - wp_redirect($redirect_url); + wp_safe_redirect($redirect_url); exit; } diff --git a/inc/admin-pages/class-customer-list-admin-page.php b/inc/admin-pages/class-customer-list-admin-page.php index e61ecad..41c1d7d 100644 --- a/inc/admin-pages/class-customer-list-admin-page.php +++ b/inc/admin-pages/class-customer-list-admin-page.php @@ -260,7 +260,7 @@ class Customer_List_Admin_Page extends List_Admin_Page { 'field_wrapper_classes' => 'wu-w-full wu-box-border wu-items-center wu-flex wu-justify-between wu-p-4 wu-m-0 wu-border-t wu-border-l-0 wu-border-r-0 wu-border-b-0 wu-border-gray-300 wu-border-solid', 'html_attr' => [ 'data-wu-app' => 'add_new_customer', - 'data-state' => json_encode( + 'data-state' => wp_json_encode( [ 'set_password' => false, 'type' => 'existing', diff --git a/inc/admin-pages/class-customizer-admin-page.php b/inc/admin-pages/class-customizer-admin-page.php index 1f39345..b979340 100644 --- a/inc/admin-pages/class-customizer-admin-page.php +++ b/inc/admin-pages/class-customizer-admin-page.php @@ -89,7 +89,16 @@ abstract class Customizer_Admin_Page extends Edit_Admin_Page { parent::register_scripts(); - wp_enqueue_script('wu-customizer', wu_get_asset('customizer.js', 'js'), ['jquery', 'wu-vue', 'wu-block-ui'], \WP_Ultimo::VERSION, ['async' => true, 'in_footer' => true]); + wp_enqueue_script( + 'wu-customizer', + wu_get_asset('customizer.js', 'js'), + ['jquery', 'wu-vue', 'wu-block-ui'], + \WP_Ultimo::VERSION, + [ + 'async' => true, + 'in_footer' => true, + ] + ); wp_enqueue_style('wp-color-picker'); diff --git a/inc/admin-pages/class-dashboard-admin-page.php b/inc/admin-pages/class-dashboard-admin-page.php index d4c59da..250559b 100644 --- a/inc/admin-pages/class-dashboard-admin-page.php +++ b/inc/admin-pages/class-dashboard-admin-page.php @@ -604,9 +604,9 @@ class Dashboard_Admin_Page extends Base_Admin_Page { $slug = $args['slug']; - $header_strings = json_encode($args['headers']); + $header_strings = wp_json_encode($args['headers']); - $data_strings = json_encode($args['data']); + $data_strings = wp_json_encode($args['data']); $html = "
diff --git a/inc/admin-pages/class-discount-code-edit-admin-page.php b/inc/admin-pages/class-discount-code-edit-admin-page.php index 2a2958d..a220b82 100644 --- a/inc/admin-pages/class-discount-code-edit-admin-page.php +++ b/inc/admin-pages/class-discount-code-edit-admin-page.php @@ -409,7 +409,7 @@ class Discount_Code_Edit_Admin_Page extends Edit_Admin_Page { 'wrapper_classes' => '', 'html_attr' => [ ':name' => "'allowed_products[]'", - ':checked' => json_encode(!$this->get_object()->get_limit_products() || in_array($product_id, $this->get_object()->get_allowed_products())), // phpcs:ignore + ':checked' => wp_json_encode(!$this->get_object()->get_limit_products() || in_array($product_id, $this->get_object()->get_allowed_products())), // phpcs:ignore ':value' => $product_id, ], 'wrapper_html_attr' => [ @@ -609,7 +609,7 @@ class Discount_Code_Edit_Admin_Page extends Edit_Admin_Page { $item = wu_get_discount_code($item_id); if ( ! $item) { - wp_redirect(wu_network_admin_url('wp-ultimo-discount_codes')); + wp_safe_redirect(wu_network_admin_url('wp-ultimo-discount_codes')); exit; } diff --git a/inc/admin-pages/class-domain-edit-admin-page.php b/inc/admin-pages/class-domain-edit-admin-page.php index c334976..980c2ba 100644 --- a/inc/admin-pages/class-domain-edit-admin-page.php +++ b/inc/admin-pages/class-domain-edit-admin-page.php @@ -94,6 +94,26 @@ class Domain_Edit_Admin_Page extends Edit_Admin_Page { add_action('wu_after_delete_domain_modal', [$this, 'domain_after_delete_actions']); } + /** + * Registers the necessary scripts and styles for this admin page. + * + * @since 2.0.0 + * @return void + */ + public function register_scripts(): void { + parent::register_scripts(); + + wp_enqueue_script( + 'wu-dns-table', + wu_get_asset('dns-table.js', 'js'), + ['jquery', 'wu-vue'], + \WP_Ultimo::VERSION, + [ + 'async' => true, + 'in_footer' => true, + ] + ); + } /** * Adds the extra delete fields to the delete form. @@ -126,8 +146,8 @@ class Domain_Edit_Admin_Page extends Edit_Admin_Page { 'data-label-field' => 'domain', 'data-search-field' => 'domain', 'data-max-items' => 1, - 'data-exclude' => json_encode([$domain->get_id()]), - 'data-include' => json_encode($domain->get_blog_id()), + 'data-exclude' => wp_json_encode([$domain->get_id()]), + 'data-include' => wp_json_encode($domain->get_blog_id()), ], 'wrapper_html_attr' => [ 'v-if' => $is_primary_domain && $has_other_domains ? 'true' : 'false', @@ -312,7 +332,7 @@ class Domain_Edit_Admin_Page extends Edit_Admin_Page { 'data-label-field' => 'title', 'data-search-field' => 'title', 'data-max-items' => 1, - 'data-selected' => $this->get_object()->get_site() ? json_encode($this->get_object()->get_site()->to_search_results()) : '', + 'data-selected' => $this->get_object()->get_site() ? wp_json_encode($this->get_object()->get_site()->to_search_results()) : '', ], 'wrapper_html_attr' => [ 'v-cloak' => '1', @@ -322,7 +342,7 @@ class Domain_Edit_Admin_Page extends Edit_Admin_Page { ] ); - $check_for_active_string = sprintf('%s.includes(stage)', json_encode(\WP_Ultimo\Models\Domain::INACTIVE_STAGES)); + $check_for_active_string = sprintf('%s.includes(stage)', wp_json_encode(\WP_Ultimo\Models\Domain::INACTIVE_STAGES)); $this->add_fields_widget( 'basic', @@ -502,7 +522,7 @@ class Domain_Edit_Admin_Page extends Edit_Admin_Page { $item = wu_get_domain($item_id); if ( ! $item) { - wp_redirect(wu_network_admin_url('wp-ultimo-domains')); + wp_safe_redirect(wu_network_admin_url('wp-ultimo-domains')); exit; } diff --git a/inc/admin-pages/class-domain-list-admin-page.php b/inc/admin-pages/class-domain-list-admin-page.php index d008f83..b3a9b72 100644 --- a/inc/admin-pages/class-domain-list-admin-page.php +++ b/inc/admin-pages/class-domain-list-admin-page.php @@ -196,7 +196,7 @@ class Domain_List_Admin_Page extends List_Admin_Page { 'field_wrapper_classes' => 'wu-w-full wu-box-border wu-items-center wu-flex wu-justify-between wu-p-4 wu-m-0 wu-border-t wu-border-l-0 wu-border-r-0 wu-border-b-0 wu-border-gray-300 wu-border-solid', 'html_attr' => [ 'data-wu-app' => 'add_new_domain', - 'data-state' => json_encode( + 'data-state' => wp_json_encode( [ 'type' => 'add', 'primary_domain' => false, diff --git a/inc/admin-pages/class-edit-admin-page.php b/inc/admin-pages/class-edit-admin-page.php index c36bdfd..5c832d7 100644 --- a/inc/admin-pages/class-edit-admin-page.php +++ b/inc/admin-pages/class-edit-admin-page.php @@ -184,7 +184,7 @@ abstract class Edit_Admin_Page extends Base_Admin_Page { */ $this->get_object()->unlock(); - wp_redirect( + wp_safe_redirect( remove_query_arg( [ 'remove-lock', @@ -856,7 +856,7 @@ abstract class Edit_Admin_Page extends Base_Admin_Page { $url = add_query_arg($array_params); - wp_redirect($url); + wp_safe_redirect($url); return true; } @@ -885,7 +885,7 @@ abstract class Edit_Admin_Page extends Base_Admin_Page { $url = str_replace('_', '-', (string) $object->model); $url = wu_network_admin_url("wp-ultimo-{$url}s"); - wp_redirect($url); + wp_safe_redirect($url); exit; } diff --git a/inc/admin-pages/class-email-edit-admin-page.php b/inc/admin-pages/class-email-edit-admin-page.php index a4b6787..23e17fd 100644 --- a/inc/admin-pages/class-email-edit-admin-page.php +++ b/inc/admin-pages/class-email-edit-admin-page.php @@ -528,7 +528,7 @@ class Email_Edit_Admin_Page extends Edit_Admin_Page { $item = $query->get_item_by('id', $_GET['id']); if (! $item) { - wp_redirect(wu_network_admin_url('wp-ultimo-emails')); + wp_safe_redirect(wu_network_admin_url('wp-ultimo-emails')); exit; } diff --git a/inc/admin-pages/class-email-template-customize-admin-page.php b/inc/admin-pages/class-email-template-customize-admin-page.php index 65a5c04..4ba51d9 100644 --- a/inc/admin-pages/class-email-template-customize-admin-page.php +++ b/inc/admin-pages/class-email-template-customize-admin-page.php @@ -496,7 +496,7 @@ class Email_Template_Customize_Admin_Page extends Customizer_Admin_Page { 'style' => 'margin-top: -6px;', 'data-wu-app' => 'email_template_customizer', 'data-wu-customizer-panel' => true, - 'data-state' => json_encode($state), + 'data-state' => wp_json_encode($state), ], ] ); @@ -577,7 +577,7 @@ class Email_Template_Customize_Admin_Page extends Customizer_Admin_Page { $url = add_query_arg('updated', '1'); - wp_redirect($url); + wp_safe_redirect($url); exit; } diff --git a/inc/admin-pages/class-event-view-admin-page.php b/inc/admin-pages/class-event-view-admin-page.php index d7b4cbd..d5f403f 100644 --- a/inc/admin-pages/class-event-view-admin-page.php +++ b/inc/admin-pages/class-event-view-admin-page.php @@ -178,7 +178,7 @@ class Event_View_Admin_Page extends Edit_Admin_Page { [ 'title' => __('Event Payload', 'wp-multisite-waas'), 'loading_text' => __('Loading Payload', 'wp-multisite-waas'), - 'payload' => json_encode($object->get_payload(), JSON_PRETTY_PRINT), + 'payload' => wp_json_encode($object->get_payload(), JSON_PRETTY_PRINT), ] ); } @@ -272,7 +272,7 @@ class Event_View_Admin_Page extends Edit_Admin_Page { } } - wp_redirect(wu_network_admin_url('wp-ultimo-events')); + wp_safe_redirect(wu_network_admin_url('wp-ultimo-events')); exit; } diff --git a/inc/admin-pages/class-hosting-integration-wizard-admin-page.php b/inc/admin-pages/class-hosting-integration-wizard-admin-page.php index 9f02b6b..c6324ae 100644 --- a/inc/admin-pages/class-hosting-integration-wizard-admin-page.php +++ b/inc/admin-pages/class-hosting-integration-wizard-admin-page.php @@ -93,7 +93,7 @@ class Hosting_Integration_Wizard_Admin_Page extends Wizard_Admin_Page { } if ( ! $this->integration) { - wp_redirect(network_admin_url('admin.php?page=wp-ultimo-settings')); + wp_safe_redirect(network_admin_url('admin.php?page=wp-ultimo-settings')); exit; } @@ -294,7 +294,7 @@ class Hosting_Integration_Wizard_Admin_Page extends Wizard_Admin_Page { $this->integration->enable(); - wp_redirect($this->get_next_section_link()); + wp_safe_redirect($this->get_next_section_link()); exit; } @@ -316,7 +316,7 @@ class Hosting_Integration_Wizard_Admin_Page extends Wizard_Admin_Page { ] ); - wp_redirect($redirect_url); + wp_safe_redirect($redirect_url); exit; } @@ -332,7 +332,7 @@ class Hosting_Integration_Wizard_Admin_Page extends Wizard_Admin_Page { $redirect_url = remove_query_arg('manual', $redirect_url); - wp_redirect($redirect_url); + wp_safe_redirect($redirect_url); exit; } diff --git a/inc/admin-pages/class-invoice-template-customize-admin-page.php b/inc/admin-pages/class-invoice-template-customize-admin-page.php index cbb1aaf..5f9f5cd 100644 --- a/inc/admin-pages/class-invoice-template-customize-admin-page.php +++ b/inc/admin-pages/class-invoice-template-customize-admin-page.php @@ -286,7 +286,7 @@ class Invoice_Template_Customize_Admin_Page extends Customizer_Admin_Page { 'style' => 'margin-top: -6px;', 'data-wu-app' => 'invoice_customizer', 'data-wu-customizer-panel' => true, - 'data-state' => json_encode($state), + 'data-state' => wp_json_encode($state), ], ] ); @@ -357,7 +357,7 @@ class Invoice_Template_Customize_Admin_Page extends Customizer_Admin_Page { $url = add_query_arg('updated', '1'); - wp_redirect($url); + wp_safe_redirect($url); exit; } diff --git a/inc/admin-pages/class-membership-edit-admin-page.php b/inc/admin-pages/class-membership-edit-admin-page.php index 0e0e27b..2ea5594 100644 --- a/inc/admin-pages/class-membership-edit-admin-page.php +++ b/inc/admin-pages/class-membership-edit-admin-page.php @@ -259,7 +259,7 @@ class Membership_Edit_Admin_Page extends Edit_Admin_Page { 'field_wrapper_classes' => 'wu-w-full wu-box-border wu-items-center wu-flex wu-justify-between wu-p-4 wu-m-0 wu-border-t wu-border-l-0 wu-border-r-0 wu-border-b-0 wu-border-gray-300 wu-border-solid', 'html_attr' => [ 'data-wu-app' => 'true', - 'data-state' => json_encode( + 'data-state' => wp_json_encode( [ 'confirmed' => false, ] @@ -519,7 +519,7 @@ class Membership_Edit_Admin_Page extends Edit_Admin_Page { 'data-label-field' => 'display_name', 'data-search-field' => 'display_name', 'data-max-items' => 1, - 'data-selected' => $this->get_object()->get_customer() ? json_encode($this->get_object()->get_customer()->to_search_results()) : '', + 'data-selected' => $this->get_object()->get_customer() ? wp_json_encode($this->get_object()->get_customer()->to_search_results()) : '', ], 'wrapper_html_attr' => [ 'v-cloak' => '1', @@ -583,7 +583,7 @@ class Membership_Edit_Admin_Page extends Edit_Admin_Page { [ 'html_attr' => [ 'data-wu-app' => 'membership_save', - 'data-state' => json_encode( + 'data-state' => wp_json_encode( [ 'status' => $this->get_object()->get_status(), 'original_customer_id' => $this->get_object()->get_customer_id(), @@ -602,7 +602,7 @@ class Membership_Edit_Admin_Page extends Edit_Admin_Page { 'title' => __('Billing Amount', 'wp-multisite-waas'), 'html_attr' => [ 'data-wu-app' => 'true', - 'data-state' => json_encode( + 'data-state' => wp_json_encode( [ 'is_recurring' => $this->get_object()->is_recurring(), 'is_auto_renew' => $this->get_object()->should_auto_renew(), @@ -1082,7 +1082,7 @@ class Membership_Edit_Admin_Page extends Edit_Admin_Page { $item = wu_get_membership($item_id); if ( ! $item) { - wp_redirect(wu_network_admin_url('wp-ultimo-memberships')); + wp_safe_redirect(wu_network_admin_url('wp-ultimo-memberships')); exit; } @@ -1162,7 +1162,7 @@ class Membership_Edit_Admin_Page extends Edit_Admin_Page { $url = add_query_arg($array_params); - wp_redirect($url); + wp_safe_redirect($url); return true; } @@ -1227,7 +1227,7 @@ class Membership_Edit_Admin_Page extends Edit_Admin_Page { $url = remove_query_arg('preview-swap', $url); - wp_redirect($url); + wp_safe_redirect($url); return true; } @@ -1583,7 +1583,7 @@ class Membership_Edit_Admin_Page extends Edit_Admin_Page { 'data-label-field' => 'name', 'data-search-field' => 'name', 'data-max-items' => 1, - 'data-selected' => json_encode($product->to_search_results()), + 'data-selected' => wp_json_encode($product->to_search_results()), ], ], 'update_price' => [ diff --git a/inc/admin-pages/class-migration-alert-admin-page.php b/inc/admin-pages/class-migration-alert-admin-page.php index efb0c97..d128a76 100644 --- a/inc/admin-pages/class-migration-alert-admin-page.php +++ b/inc/admin-pages/class-migration-alert-admin-page.php @@ -163,7 +163,7 @@ class Migration_Alert_Admin_Page extends Wizard_Admin_Page { delete_network_option(null, 'wu_setup_finished'); delete_network_option(null, 'wu_is_migration_done'); - wp_redirect(wu_network_admin_url('wp-ultimo-setup')); + wp_safe_redirect(wu_network_admin_url('wp-ultimo-setup')); exit; } diff --git a/inc/admin-pages/class-payment-edit-admin-page.php b/inc/admin-pages/class-payment-edit-admin-page.php index 6865209..7930fd1 100644 --- a/inc/admin-pages/class-payment-edit-admin-page.php +++ b/inc/admin-pages/class-payment-edit-admin-page.php @@ -689,7 +689,7 @@ class Payment_Edit_Admin_Page extends Edit_Admin_Page { 'data-label-field' => 'name', 'data-search-field' => 'name', 'data-max-items' => 1, - 'data-selected' => $line_item->get_product() ? json_encode($line_item->get_product()->to_search_results()) : '', + 'data-selected' => $line_item->get_product() ? wp_json_encode($line_item->get_product()->to_search_results()) : '', ], ], 'title' => [ @@ -1073,7 +1073,7 @@ class Payment_Edit_Admin_Page extends Edit_Admin_Page { 'data-value-field' => 'id', 'data-label-field' => 'reference_code', 'data-max-items' => 1, - 'data-selected' => $this->get_object()->get_membership() ? json_encode($this->get_object()->get_membership()->to_search_results()) : '', + 'data-selected' => $this->get_object()->get_membership() ? wp_json_encode($this->get_object()->get_membership()->to_search_results()) : '', ], 'wrapper_html_attr' => [ 'v-cloak' => '1', @@ -1141,7 +1141,7 @@ class Payment_Edit_Admin_Page extends Edit_Admin_Page { 'value' => $this->get_object()->get_saved_invoice_number(), 'wrapper_classes' => 'wu-w-full', 'wrapper_html_attr' => [ - 'v-show' => json_encode(wu_get_setting('invoice_numbering_scheme', 'reference_code') === 'sequential_number'), + 'v-show' => wp_json_encode(wu_get_setting('invoice_numbering_scheme', 'reference_code') === 'sequential_number'), 'v-cloak' => '1', ], ], @@ -1280,7 +1280,7 @@ class Payment_Edit_Admin_Page extends Edit_Admin_Page { $item = $query->get_item_by('id', $_GET['id']); if ( ! $item || $item->get_parent_id()) { - wp_redirect(wu_network_admin_url('wp-ultimo-payments')); + wp_safe_redirect(wu_network_admin_url('wp-ultimo-payments')); exit; } diff --git a/inc/admin-pages/class-product-edit-admin-page.php b/inc/admin-pages/class-product-edit-admin-page.php index f1fa04a..a55ca78 100644 --- a/inc/admin-pages/class-product-edit-admin-page.php +++ b/inc/admin-pages/class-product-edit-admin-page.php @@ -162,7 +162,7 @@ class Product_Edit_Admin_Page extends Edit_Admin_Page { 'data-label-field' => 'name', 'data-search-field' => 'name', 'data-max-items' => 1, - 'data-exclude' => json_encode([$product->get_id()]), + 'data-exclude' => wp_json_encode([$product->get_id()]), ], ], ]; @@ -270,7 +270,7 @@ class Product_Edit_Admin_Page extends Edit_Admin_Page { [ 'html_attr' => [ 'data-wu-app' => 'product_pricing', - 'data-state' => json_encode( + 'data-state' => wp_json_encode( [ 'is_recurring' => $this->get_object()->is_recurring(), 'pricing_type' => $this->get_object()->get_pricing_type(), @@ -705,7 +705,7 @@ class Product_Edit_Admin_Page extends Edit_Admin_Page { 'data-label-field' => 'name', 'data-search-field' => 'name', 'data-max-items' => 99, - 'data-selected' => json_encode( + 'data-selected' => wp_json_encode( wu_get_products( [ 'id__in' => $this->get_object()->get_available_addons(), @@ -750,7 +750,7 @@ class Product_Edit_Admin_Page extends Edit_Admin_Page { 'fields' => [ 'price_variations_remove' => [ 'type' => 'note', - 'desc' => sprintf('', __('Remove', 'wp-multisite-waas')), + 'desc' => sprintf('', esc_html__('Remove', 'wp-multisite-waas')), 'wrapper_classes' => 'wu-absolute wu-top-0 wu-right-0', ], 'price_variations_duration' => [ @@ -1036,7 +1036,7 @@ class Product_Edit_Admin_Page extends Edit_Admin_Page { $item = $query->get_item_by('id', $_GET['id']); if ( ! $item) { - wp_redirect(wu_network_admin_url('wp-ultimo-products')); + wp_safe_redirect(wu_network_admin_url('wp-ultimo-products')); exit; } diff --git a/inc/admin-pages/class-settings-admin-page.php b/inc/admin-pages/class-settings-admin-page.php index 45815f5..4687b21 100644 --- a/inc/admin-pages/class-settings-admin-page.php +++ b/inc/admin-pages/class-settings-admin-page.php @@ -197,15 +197,15 @@ class Settings_Admin_Page extends Wizard_Admin_Page {
- +
- <?php esc_attr_e('Checkout Forms', 'wp-multisite-waas'); ?> + <?php esc_attr_e('Checkout Forms', 'wp-multisite-waas'); ?>

- +

@@ -213,8 +213,8 @@ class Settings_Admin_Page extends Wizard_Admin_Page { @@ -240,15 +240,15 @@ class Settings_Admin_Page extends Wizard_Admin_Page {
- +
- <?php esc_attr_e('Customize the Template Previewer', 'wp-multisite-waas'); ?> + <?php esc_attr_e('Customize the Template Previewer', 'wp-multisite-waas'); ?>

- +

@@ -256,8 +256,8 @@ class Settings_Admin_Page extends Wizard_Admin_Page { @@ -283,15 +283,15 @@ class Settings_Admin_Page extends Wizard_Admin_Page {
- +
- <?php esc_attr_e('Customize the Template Placeholders', 'wp-multisite-waas'); ?> + <?php esc_attr_e('Customize the Template Placeholders', 'wp-multisite-waas'); ?>

- +

@@ -299,8 +299,8 @@ class Settings_Admin_Page extends Wizard_Admin_Page { @@ -326,15 +326,15 @@ class Settings_Admin_Page extends Wizard_Admin_Page {
- +
- <?php esc_attr_e('Customize the Invoice Template', 'wp-multisite-waas'); ?> + <?php esc_attr_e('Customize the Invoice Template', 'wp-multisite-waas'); ?>

- +

@@ -342,8 +342,8 @@ class Settings_Admin_Page extends Wizard_Admin_Page { @@ -369,15 +369,15 @@ class Settings_Admin_Page extends Wizard_Admin_Page {
- +
- <?php esc_attr_e('Customize System Emails', 'wp-multisite-waas'); ?> + <?php esc_attr_e('Customize System Emails', 'wp-multisite-waas'); ?>

- +

@@ -385,8 +385,8 @@ class Settings_Admin_Page extends Wizard_Admin_Page { @@ -412,15 +412,15 @@ class Settings_Admin_Page extends Wizard_Admin_Page {
- +
- <?php esc_attr_e('Customize Email Template', 'wp-multisite-waas'); ?> + <?php esc_attr_e('Customize Email Template', 'wp-multisite-waas'); ?>

- +

@@ -428,8 +428,8 @@ class Settings_Admin_Page extends Wizard_Admin_Page { @@ -481,6 +481,7 @@ class Settings_Admin_Page extends Wizard_Admin_Page { wp_enqueue_script('media'); wp_enqueue_script('wu-vue'); wp_enqueue_script('wu-selectizer'); + wp_enqueue_script('wu-settings-loader', wu_get_asset('settings-loader.js', 'js'), ['wu-functions'], wu_get_version(), true); do_action('wu_render_settings'); @@ -517,7 +518,7 @@ class Settings_Admin_Page extends Wizard_Admin_Page { public function default_handler(): void { if ( ! current_user_can('wu_edit_settings')) { - wp_die(__('You do not have the permissions required to change settings.', 'wp-multisite-waas')); + wp_die(esc_html__('You do not have the permissions required to change settings.', 'wp-multisite-waas')); } if ( ! isset($_POST['active_gateways']) && 'payment-gateways' === wu_request('tab')) { @@ -526,7 +527,7 @@ class Settings_Admin_Page extends Wizard_Admin_Page { WP_Ultimo()->settings->save_settings($_POST); - wp_redirect(add_query_arg('updated', 1, wu_get_current_url())); + wp_safe_redirect(add_query_arg('updated', 1, wu_get_current_url())); exit; } @@ -577,7 +578,7 @@ class Settings_Admin_Page extends Wizard_Admin_Page { 'style' => '', 'data-on-load' => 'remove_block_ui', 'data-wu-app' => str_replace('-', '_', $section_slug), - 'data-state' => json_encode(wu_array_map_keys('wu_replace_dashes', Settings::get_instance()->get_all(true))), + 'data-state' => wp_json_encode(wu_array_map_keys('wu_replace_dashes', Settings::get_instance()->get_all(true))), ], ] ); diff --git a/inc/admin-pages/class-setup-wizard-admin-page.php b/inc/admin-pages/class-setup-wizard-admin-page.php index 51e61a1..4cd5b75 100644 --- a/inc/admin-pages/class-setup-wizard-admin-page.php +++ b/inc/admin-pages/class-setup-wizard-admin-page.php @@ -219,7 +219,7 @@ class Setup_Wizard_Admin_Page extends Wizard_Admin_Page { public function redirect_to_wizard(): void { if ( ! \WP_Ultimo\Requirements::run_setup() && wu_request('page') !== 'wp-ultimo-setup') { - wp_redirect(wu_network_admin_url('wp-ultimo-setup')); + wp_safe_redirect(wu_network_admin_url('wp-ultimo-setup')); exit; } @@ -713,12 +713,12 @@ class Setup_Wizard_Admin_Page extends Wizard_Admin_Page { public function handle_checks(): void { if (\WP_Ultimo\Requirements::met() === false) { - wp_redirect(add_query_arg()); + wp_safe_redirect(add_query_arg()); exit; } - wp_redirect($this->get_next_section_link()); + wp_safe_redirect($this->get_next_section_link()); exit; } @@ -747,7 +747,7 @@ class Setup_Wizard_Admin_Page extends Wizard_Admin_Page { \WP_Ultimo\Settings::get_instance()->save_settings($settings_to_save); - wp_redirect($this->get_next_section_link()); + wp_safe_redirect($this->get_next_section_link()); exit; } @@ -772,7 +772,7 @@ class Setup_Wizard_Admin_Page extends Wizard_Admin_Page { $url = add_query_arg('dry-run', 0); } - wp_redirect($url); + wp_safe_redirect($url); exit; } @@ -790,7 +790,7 @@ class Setup_Wizard_Admin_Page extends Wizard_Admin_Page { $redirect_url = $this->get_next_section_link(); - wp_redirect($redirect_url); + wp_safe_redirect($redirect_url); exit; } diff --git a/inc/admin-pages/class-site-edit-admin-page.php b/inc/admin-pages/class-site-edit-admin-page.php index 976fd35..a91cf96 100644 --- a/inc/admin-pages/class-site-edit-admin-page.php +++ b/inc/admin-pages/class-site-edit-admin-page.php @@ -227,7 +227,7 @@ class Site_Edit_Admin_Page extends Edit_Admin_Page { 'field_wrapper_classes' => 'wu-w-full wu-box-border wu-items-center wu-flex wu-justify-between wu-p-4 wu-m-0 wu-border-t wu-border-l-0 wu-border-r-0 wu-border-b-0 wu-border-gray-300 wu-border-solid', 'html_attr' => [ 'data-wu-app' => 'transfer_site', - 'data-state' => json_encode( + 'data-state' => wp_json_encode( [ 'confirmed' => false, ] @@ -414,7 +414,7 @@ class Site_Edit_Admin_Page extends Edit_Admin_Page { [ 'html_attr' => [ 'data-wu-app' => 'site_type', - 'data-state' => json_encode( + 'data-state' => wp_json_encode( [ 'type' => $this->get_object()->get_type(), 'original_membership_id' => $this->get_object()->get_membership_id(), @@ -487,7 +487,7 @@ class Site_Edit_Admin_Page extends Edit_Admin_Page { 'data-label-field' => 'reference_code', 'data-search-field' => 'reference_code', 'data-max-items' => 1, - 'data-selected' => json_encode($membership_selected), + 'data-selected' => wp_json_encode($membership_selected), ], ], 'transfer_note' => [ @@ -729,7 +729,7 @@ class Site_Edit_Admin_Page extends Edit_Admin_Page { $item = wu_get_site($item_id); if ( ! $item) { - wp_redirect(wu_network_admin_url('wp-ultimo-sites')); + wp_safe_redirect(wu_network_admin_url('wp-ultimo-sites')); exit; } diff --git a/inc/admin-pages/class-site-list-admin-page.php b/inc/admin-pages/class-site-list-admin-page.php index 7451d79..8778e81 100644 --- a/inc/admin-pages/class-site-list-admin-page.php +++ b/inc/admin-pages/class-site-list-admin-page.php @@ -166,7 +166,7 @@ class Site_List_Admin_Page extends List_Admin_Page { 'field_wrapper_classes' => 'wu-w-full wu-box-border wu-items-center wu-flex wu-justify-between wu-p-4 wu-m-0 wu-border-t wu-border-l-0 wu-border-r-0 wu-border-b-0 wu-border-gray-300 wu-border-solid', 'html_attr' => [ 'data-wu-app' => 'true', - 'data-state' => json_encode( + 'data-state' => wp_json_encode( [ 'confirmed' => false, ] @@ -420,7 +420,7 @@ class Site_List_Admin_Page extends List_Admin_Page { 'value' => $template_id, 'html_attr' => [ 'data-model' => 'site', - 'data-selected' => $site ? json_encode($site->to_search_results()) : '', + 'data-selected' => $site ? wp_json_encode($site->to_search_results()) : '', 'data-value-field' => 'blog_id', 'data-label-field' => 'title', 'data-search-field' => 'title', diff --git a/inc/admin-pages/class-template-previewer-customize-admin-page.php b/inc/admin-pages/class-template-previewer-customize-admin-page.php index 2bb915d..15fd8cb 100644 --- a/inc/admin-pages/class-template-previewer-customize-admin-page.php +++ b/inc/admin-pages/class-template-previewer-customize-admin-page.php @@ -233,7 +233,7 @@ class Template_Previewer_Customize_Admin_Page extends Customizer_Admin_Page { 'style' => 'margin-top: -6px;', 'data-wu-app' => 'site_template_customizer', 'data-wu-customizer-panel' => true, - 'data-state' => json_encode($state), + 'data-state' => wp_json_encode($state), ], ] ); @@ -308,7 +308,7 @@ class Template_Previewer_Customize_Admin_Page extends Customizer_Admin_Page { $url = add_query_arg($array_params); - wp_redirect($url); + wp_safe_redirect($url); exit; } diff --git a/inc/admin-pages/class-top-admin-nav-menu.php b/inc/admin-pages/class-top-admin-nav-menu.php index fb80654..f6e61fe 100644 --- a/inc/admin-pages/class-top-admin-nav-menu.php +++ b/inc/admin-pages/class-top-admin-nav-menu.php @@ -163,32 +163,32 @@ class Top_Admin_Nav_Menu { if (current_user_can('wu_read_sites')) { $wp_admin_bar->add_node($sites); - } //end if; + } if (current_user_can('wu_read_memberships')) { $wp_admin_bar->add_node($memberships); - } //end if; + } if (current_user_can('wu_read_customers')) { $wp_admin_bar->add_node($customers); - } //end if; + } if (current_user_can('wu_read_products')) { $wp_admin_bar->add_node($products); - } //end if; + } if (current_user_can('wu_read_payments')) { $wp_admin_bar->add_node($payments); - } //end if; + } if (current_user_can('wu_read_discount_codes')) { $wp_admin_bar->add_node($discount_codes); - } //end if; + } if (current_user_can('wu_read_settings')) { $wp_admin_bar->add_node($container); $wp_admin_bar->add_node($settings); - } //end if; + } /* * Add the sub-menus. diff --git a/inc/admin-pages/class-view-logs-admin-page.php b/inc/admin-pages/class-view-logs-admin-page.php index aa488fb..a3120ba 100644 --- a/inc/admin-pages/class-view-logs-admin-page.php +++ b/inc/admin-pages/class-view-logs-admin-page.php @@ -358,7 +358,7 @@ class View_Logs_Admin_Page extends Edit_Admin_Page { $url = remove_query_arg('log_file'); - wp_redirect(add_query_arg('deleted', 1, $url)); + wp_safe_redirect(add_query_arg('deleted', 1, $url)); exit; } diff --git a/inc/admin-pages/class-webhook-edit-admin-page.php b/inc/admin-pages/class-webhook-edit-admin-page.php index 51a614f..8abc83b 100644 --- a/inc/admin-pages/class-webhook-edit-admin-page.php +++ b/inc/admin-pages/class-webhook-edit-admin-page.php @@ -259,7 +259,7 @@ class Webhook_Edit_Admin_Page extends Edit_Admin_Page { $event = wu_get_event_type($object_event_slug); - $payload = isset($event['payload']) ? json_encode(wu_maybe_lazy_load_payload($event['payload']), JSON_PRETTY_PRINT) : '{}'; + $payload = isset($event['payload']) ? wp_json_encode(wu_maybe_lazy_load_payload($event['payload']), JSON_PRETTY_PRINT) : '{}'; wu_get_template( 'events/widget-payload', @@ -357,7 +357,7 @@ class Webhook_Edit_Admin_Page extends Edit_Admin_Page { $item = $query->get_item_by('id', wu_request('id')); if ( ! $item) { - wp_redirect(wu_network_admin_url('wp-ultimo-webhooks')); + wp_safe_redirect(wu_network_admin_url('wp-ultimo-webhooks')); exit; } @@ -407,7 +407,7 @@ class Webhook_Edit_Admin_Page extends Edit_Admin_Page { $url = add_query_arg($array_params); - wp_redirect($url); + wp_safe_redirect($url); exit; } diff --git a/inc/admin-pages/class-webhook-list-admin-page.php b/inc/admin-pages/class-webhook-list-admin-page.php index 744fb88..72bbcf5 100644 --- a/inc/admin-pages/class-webhook-list-admin-page.php +++ b/inc/admin-pages/class-webhook-list-admin-page.php @@ -157,7 +157,7 @@ class Webhook_List_Admin_Page extends List_Admin_Page { 'field_wrapper_classes' => 'wu-w-full wu-box-border wu-items-center wu-flex wu-justify-between wu-p-4 wu-m-0 wu-border-t wu-border-l-0 wu-border-r-0 wu-border-b-0 wu-border-gray-300 wu-border-solid', 'html_attr' => [ 'data-wu-app' => 'edit_line_item', - 'data-state' => json_encode( + 'data-state' => wp_json_encode( [ 'event' => '', ] diff --git a/inc/admin-pages/class-wizard-admin-page.php b/inc/admin-pages/class-wizard-admin-page.php index e86abb4..bdcd082 100644 --- a/inc/admin-pages/class-wizard-admin-page.php +++ b/inc/admin-pages/class-wizard-admin-page.php @@ -299,7 +299,7 @@ abstract class Wizard_Admin_Page extends Base_Admin_Page { */ public function default_handler(): void { - wp_redirect($this->get_next_section_link()); + wp_safe_redirect($this->get_next_section_link()); exit; } diff --git a/inc/api/class-register-endpoint.php b/inc/api/class-register-endpoint.php index 8ed9a43..66b54b2 100644 --- a/inc/api/class-register-endpoint.php +++ b/inc/api/class-register-endpoint.php @@ -93,7 +93,7 @@ class Register_Endpoint { * @since 2.0.0 * * @param \WP_REST_Request $request WP Request Object. - * @return array + * @return array|\WP_Error */ public function handle_endpoint($request) { @@ -102,7 +102,7 @@ class Register_Endpoint { $params = json_decode($request->get_body(), true); if (\WP_Ultimo\API::get_instance()->should_log_api_calls()) { - wu_log_add('api-calls', json_encode($params, JSON_PRETTY_PRINT)); + wu_log_add('api-calls', wp_json_encode($params, JSON_PRETTY_PRINT)); } $validation_errors = $this->validate($params); diff --git a/inc/checkout/class-cart.php b/inc/checkout/class-cart.php index 92dea43..c34c13d 100644 --- a/inc/checkout/class-cart.php +++ b/inc/checkout/class-cart.php @@ -1830,7 +1830,7 @@ class Cart implements \JsonSerializable { $where_clauses[] = ['type', $type]; // Cast to array recursively - $line_items = json_decode(json_encode($this->line_items), true); + $line_items = json_decode(wp_json_encode($this->line_items), true); $line_items = Array_Search::find( $line_items, @@ -2353,7 +2353,7 @@ class Cart implements \JsonSerializable { */ public function jsonSerialize(): string { - return json_encode($this->done()); + return wp_json_encode($this->done()); } /** diff --git a/inc/checkout/class-checkout-pages.php b/inc/checkout/class-checkout-pages.php index 89276c4..a942304 100644 --- a/inc/checkout/class-checkout-pages.php +++ b/inc/checkout/class-checkout-pages.php @@ -108,8 +108,8 @@ class Checkout_Pages {
name="_wu_force_elements_loading" /> @@ -243,7 +243,7 @@ class Checkout_Pages { wp_login_url() ); - wp_redirect($url); + wp_safe_redirect($url); exit; } @@ -263,7 +263,7 @@ class Checkout_Pages { public function maybe_redirect_to_confirm_screen(): void { if (wu_request('redirect_to')) { - wp_redirect(wu_request('redirect_to')); + wp_safe_redirect(wu_request('redirect_to')); exit; } @@ -395,7 +395,7 @@ class Checkout_Pages { return; } - wp_redirect($redirect_to); + wp_safe_redirect($redirect_to); exit; } @@ -472,7 +472,7 @@ class Checkout_Pages { die; } else { - wp_redirect($new_login_url); + wp_safe_redirect($new_login_url); exit; } @@ -489,7 +489,7 @@ class Checkout_Pages { $registration_url = $this->get_page_url('register'); if ($registration_url) { - wp_redirect($registration_url); + wp_safe_redirect($registration_url); exit; } diff --git a/inc/checkout/class-checkout.php b/inc/checkout/class-checkout.php index 8b36dcb..987dc6d 100644 --- a/inc/checkout/class-checkout.php +++ b/inc/checkout/class-checkout.php @@ -1960,7 +1960,7 @@ class Checkout { /* * Redirect go burrr! */ - wp_redirect($redirect_url); + wp_safe_redirect($redirect_url); exit; } @@ -2002,7 +2002,7 @@ class Checkout { */ $next_step = $this->get_next_step_name(); - wp_redirect(add_query_arg('step', $next_step)); + wp_safe_redirect(add_query_arg('step', $next_step)); exit; } @@ -2165,7 +2165,7 @@ class Checkout { ); } - wp_redirect($redirect_url); + wp_safe_redirect($redirect_url); exit; } catch (\Throwable $e) { @@ -2286,12 +2286,12 @@ class Checkout { * @since 2.0.0 * * @param string $key Key to retrieve the value for. - * @param mixed $default The default value to return, when nothing is found. + * @param mixed $default_value The default value to return, when nothing is found. * @return mixed */ - public function request_or_session($key, $default = false) { + public function request_or_session($key, $default_value = false) { - $value = $default; + $value = $default_value; if (null !== $this->session) { $session = $this->session->get('signup'); diff --git a/inc/checkout/class-legacy-checkout.php b/inc/checkout/class-legacy-checkout.php index dc72ed8..c228473 100644 --- a/inc/checkout/class-legacy-checkout.php +++ b/inc/checkout/class-legacy-checkout.php @@ -1018,7 +1018,7 @@ class Legacy_Checkout { public function next_step($args = []): void { /** Redirect the user to the next step */ - wp_redirect(esc_url_raw($this->get_next_step_link($args))); + wp_safe_redirect(esc_url_raw($this->get_next_step_link($args))); /** Kill the execution after the redirect */ exit; diff --git a/inc/checkout/class-line-item.php b/inc/checkout/class-line-item.php index a7763af..807abe2 100644 --- a/inc/checkout/class-line-item.php +++ b/inc/checkout/class-line-item.php @@ -1079,6 +1079,13 @@ class Line_Item implements \JsonSerializable { $this->tax_label = $tax_label; } + /** + * @return string + */ + public function get_date_created(): string { + return $this->date_created; + } + /** * Returns the amount recurring in a human-friendly way. * @@ -1164,7 +1171,7 @@ class Line_Item implements \JsonSerializable { } // phpcs:disable; - $query = $wpdb->prepare(" + $query = $wpdb->prepare( " SELECT m.wu_payment_id, m.meta_value as line_items, p.date_created FROM {$wpdb->base_prefix}wu_paymentmeta as m JOIN {$wpdb->base_prefix}wu_payments as p diff --git a/inc/checkout/signup-fields/class-base-signup-field.php b/inc/checkout/signup-fields/class-base-signup-field.php index 7e6730c..fe2c752 100644 --- a/inc/checkout/signup-fields/class-base-signup-field.php +++ b/inc/checkout/signup-fields/class-base-signup-field.php @@ -360,7 +360,7 @@ abstract class Base_Signup_Field { $selected = array_filter($selected); - $field['html_attr']['data-selected'] = json_encode($selected); + $field['html_attr']['data-selected'] = wp_json_encode($selected); } } diff --git a/inc/checkout/signup-fields/class-signup-field-payment.php b/inc/checkout/signup-fields/class-signup-field-payment.php index 5d0874b..97d619e 100644 --- a/inc/checkout/signup-fields/class-signup-field-payment.php +++ b/inc/checkout/signup-fields/class-signup-field-payment.php @@ -200,7 +200,7 @@ class Signup_Field_Payment extends Base_Signup_Field { ], 'wrapper_html_attr' => [ 'v-cloak' => 1, - 'v-show' => sprintf('%s.includes(gateway) && order.should_collect_payment && order.has_recurring', json_encode($auto_renewable_gateways)), + 'v-show' => sprintf('%s.includes(gateway) && order.should_collect_payment && order.has_recurring', wp_json_encode($auto_renewable_gateways)), ], ]; } diff --git a/inc/checkout/signup-fields/class-signup-field-products.php b/inc/checkout/signup-fields/class-signup-field-products.php index a9ca500..8a19c87 100644 --- a/inc/checkout/signup-fields/class-signup-field-products.php +++ b/inc/checkout/signup-fields/class-signup-field-products.php @@ -216,7 +216,7 @@ class Signup_Field_Products extends Base_Signup_Field { });"; if (did_action('wu-checkout')) { - wp_add_inline_script('wu-checkout', sprintf($script, json_encode($products)), 'before'); + wp_add_inline_script('wu-checkout', sprintf($script, wp_json_encode($products)), 'before'); return; } @@ -225,7 +225,7 @@ class Signup_Field_Products extends Base_Signup_Field { 'wp_enqueue_scripts', function () use ($script, $products) { - wp_add_inline_script('wu-checkout', sprintf($script, json_encode($products)), 'before'); + wp_add_inline_script('wu-checkout', sprintf($script, wp_json_encode($products)), 'before'); }, 11 ); diff --git a/inc/class-admin-notices.php b/inc/class-admin-notices.php index 9e02c4f..1b6904e 100644 --- a/inc/class-admin-notices.php +++ b/inc/class-admin-notices.php @@ -129,7 +129,7 @@ class Admin_Notices { */ public function enqueue_scripts(): void { - wp_enqueue_script('wu-admin-notices', wu_get_asset('admin-notices.js', 'js'), ['jquery'], wu_get_version()); + wp_enqueue_script('wu-admin-notices', wu_get_asset('admin-notices.js', 'js'), ['jquery'], wu_get_version(), true); } /** diff --git a/inc/class-ajax.php b/inc/class-ajax.php index 45b73b4..3835f9a 100644 --- a/inc/class-ajax.php +++ b/inc/class-ajax.php @@ -100,7 +100,7 @@ class Ajax { } $args = wp_parse_args( - $_REQUEST, + $_REQUEST, // phpcs:ignore WordPress.Security.NonceVerification.Recommended [ 'model' => 'membership', 'query' => [], diff --git a/inc/class-api.php b/inc/class-api.php index 04f803d..b7706d4 100644 --- a/inc/class-api.php +++ b/inc/class-api.php @@ -96,12 +96,12 @@ class API { return $result; } - $current_route = $_SERVER['REQUEST_URI']; + $current_route = sanitize_text_field(wp_unslash($_SERVER['REQUEST_URI'] ?? '')); $rest_url = rest_url(); - $rest_path = rtrim(parse_url($rest_url, PHP_URL_PATH), '/'); + $rest_path = rtrim(wp_parse_url($rest_url, PHP_URL_PATH), '/'); - if (! str_starts_with((string) $current_route, $rest_path . '/' . $this->get_namespace())) { + if (! str_starts_with($current_route, $rest_path . '/' . $this->get_namespace())) { return $result; } @@ -324,7 +324,7 @@ class API { */ public function validate_credentials($api_key, $api_secret) { - return compact('api_key', 'api_secret') === $this->get_auth(); // phpcs:ignore + return [$api_key, $api_secret] === $this->get_auth(); } /** @@ -355,7 +355,7 @@ class API { 'body_params' => $request->get_body(), ]; - wu_log_add('api-calls', json_encode($payload, JSON_PRETTY_PRINT)); + wu_log_add('api-calls', wp_json_encode($payload, JSON_PRETTY_PRINT)); } } @@ -383,7 +383,7 @@ class API { 'body_params' => $request->get_body(), ]; - wu_log_add('api-errors', json_encode($payload, JSON_PRETTY_PRINT)); + wu_log_add('api-errors', wp_json_encode($payload, JSON_PRETTY_PRINT)); } wu_log_add('api-errors', $result); @@ -401,9 +401,9 @@ class API { */ public function check_authorization($request) { - if (isset($_SERVER['PHP_AUTH_USER']) && $_SERVER['PHP_AUTH_USER']) { - $api_key = $_SERVER['PHP_AUTH_USER']; - $api_secret = $_SERVER['PHP_AUTH_PW']; + if (! empty($_SERVER['PHP_AUTH_USER']) && ! empty($_SERVER['PHP_AUTH_PW'])) { + $api_key = sanitize_text_field(wp_unslash($_SERVER['PHP_AUTH_USER'])); + $api_secret = sanitize_text_field(wp_unslash($_SERVER['PHP_AUTH_PW'])); } else { $params = $request->get_params(); diff --git a/inc/class-async-calls.php b/inc/class-async-calls.php index e410722..be8227c 100644 --- a/inc/class-async-calls.php +++ b/inc/class-async-calls.php @@ -38,13 +38,12 @@ class Async_Calls { /** * Registers a new listener. * + * @since 2.0.7 * @param string $id The id of the listener. * @param callable $callback A callback to be run. * @param mixed ...$args Arguments to be passed to the callback. * * @return void - *@since 2.0.7 - * */ public static function register_listener($id, $callback, ...$args): void { diff --git a/inc/class-dashboard-widgets.php b/inc/class-dashboard-widgets.php index 12a7992..286f603 100644 --- a/inc/class-dashboard-widgets.php +++ b/inc/class-dashboard-widgets.php @@ -281,7 +281,7 @@ class Dashboard_Widgets { public function process_ajax_fetch_rss(): void { $atts = wp_parse_args( - $_GET, + $_GET, // phpcs:ignore WordPress.Security.NonceVerification.Recommended [ 'url' => 'https://community.wpultimo.com/topics/feed', 'title' => __('Forum Discussions', 'wp-multisite-waas'), diff --git a/inc/class-domain-mapping.php b/inc/class-domain-mapping.php index aafdb2a..d6e0caf 100644 --- a/inc/class-domain-mapping.php +++ b/inc/class-domain-mapping.php @@ -75,7 +75,7 @@ class Domain_Mapping { /* * Don't run during installation... */ - if (defined('WP_INSTALLING') && '/wp-activate.php' !== $_SERVER['SCRIPT_NAME']) { + if (defined('WP_INSTALLING') && '/wp-activate.php' !== $_SERVER['SCRIPT_NAME']) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput return; } @@ -132,8 +132,6 @@ class Domain_Mapping { */ add_action('ms_loaded', [$this, 'register_mapped_filters'], 11); - // add_action('allowed_http_origin', array($this, 'add_mapped_domains_as_allowed_origins')); - /** * On WP Ultimo 1.X builds we used Mercator. The Mercator actions and filters are now deprecated. */ @@ -143,7 +141,7 @@ class Domain_Mapping { add_action( 'wu_sso_site_allowed_domains', - function ($list, $site_id): array { + function ($domain_list, $site_id): array { $domains = wu_get_domains( [ @@ -154,7 +152,7 @@ class Domain_Mapping { ] ); - return array_merge($list, $domains); + return array_merge($domain_list, $domains); }, 10, 2 @@ -338,7 +336,7 @@ class Domain_Mapping { /** * Clear mappings for a site when it's deleted * - * @param WP_Site $site Site being deleted. + * @param \WP_Site $site Site being deleted. */ public function clear_mappings_on_delete($site): void { @@ -356,7 +354,7 @@ class Domain_Mapping { // translators: First placeholder is the mapping ID, second is the site ID. $message = sprintf(__('Unable to delete mapping %1$d for site %2$d', 'wp-multisite-waas'), $mapping->get_id(), $site->blog_id); - trigger_error($message, E_USER_WARNING); + trigger_error(esc_html($message), E_USER_WARNING); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error } } } @@ -376,7 +374,7 @@ class Domain_Mapping { } $real_domain = $current_site->domain; - $domain = $_SERVER['HTTP_HOST']; + $domain = $_SERVER['HTTP_HOST']; // phpcs:ignore if ($domain === $real_domain) { @@ -474,7 +472,7 @@ class Domain_Mapping { } // Replace the domain - $domain_base = parse_url($url, PHP_URL_HOST); + $domain_base = wp_parse_url($url, PHP_URL_HOST); $domain = rtrim($domain_base . '/' . $current_mapping->get_site()->get_path(), '/'); $regex = '#^(\w+://)' . preg_quote($domain, '#') . '#i'; $mangled = preg_replace($regex, '${1}' . $current_mapping->get_domain(), $url); diff --git a/inc/class-faker.php b/inc/class-faker.php index 0ed26b6..b1ed72c 100644 --- a/inc/class-faker.php +++ b/inc/class-faker.php @@ -351,7 +351,7 @@ class Faker { ); if (is_wp_error($customer)) { - throw new \Exception($customer->get_error_message()); + throw new \Exception(esc_html($customer->get_error_message())); } else { $this->set_fake_data_generated('customers', $customer); } @@ -411,7 +411,7 @@ class Faker { $product = wu_create_product($product_data); if (is_wp_error($product)) { - throw new \Exception($product->get_error_message()); + throw new \Exception(esc_html($product->get_error_message())); } else { $this->set_fake_data_generated('products', $product); } @@ -460,7 +460,7 @@ class Faker { $membership = wu_create_membership($membership_data); if (is_wp_error($membership)) { - throw new \Exception($membership->get_error_message()); + throw new \Exception(esc_html($membership->get_error_message())); } else { $this->set_fake_data_generated('memberships', $membership); } @@ -502,7 +502,7 @@ class Faker { ); if (is_wp_error($domain)) { - throw new \Exception($domain->get_error_message()); + throw new \Exception(esc_html($domain->get_error_message())); } else { $this->set_fake_data_generated('domains', $domain); } @@ -550,7 +550,7 @@ class Faker { $event_data = wu_create_event($event_data); if (is_wp_error($event_data)) { - throw new \Exception($event_data->get_error_message()); + throw new \Exception(esc_html($event_data->get_error_message())); } else { $this->set_fake_data_generated('events', $event_data); } @@ -599,7 +599,7 @@ class Faker { ); if (is_wp_error($discount_code)) { - throw new \Exception($discount_code->get_error_message()); + throw new \Exception(esc_html($discount_code->get_error_message())); } else { $this->set_fake_data_generated('discount_codes', $discount_code); } @@ -635,7 +635,7 @@ class Faker { $checkout_form = wu_create_checkout_form($checkout_form_data); if (is_wp_error($checkout_form)) { - throw new \Exception($checkout_form->get_error_message()); + throw new \Exception(esc_html($checkout_form->get_error_message())); } else { $this->set_fake_data_generated('checkout_forms', $checkout_form); } @@ -691,7 +691,7 @@ class Faker { $email = wu_create_email($email_data); if (is_wp_error($email)) { - throw new \Exception($email->get_error_message()); + throw new \Exception(esc_html($email->get_error_message())); } else { $this->set_fake_data_generated('emails', $email); } @@ -734,7 +734,7 @@ class Faker { $broadcast = wu_create_broadcast($broadcast_data); if (is_wp_error($broadcast)) { - throw new \Exception($broadcast->get_error_message()); + throw new \Exception(esc_html($broadcast->get_error_message())); } else { $this->set_fake_data_generated('broadcasts', $broadcast); } @@ -777,7 +777,7 @@ class Faker { $webhook = wu_create_webhook($webhook_data); if (is_wp_error($webhook)) { - throw new \Exception($webhook->get_error_message()); + throw new \Exception(esc_html($webhook->get_error_message())); } else { $this->set_fake_data_generated('webhooks', $webhook); } @@ -839,7 +839,7 @@ class Faker { $payment = wu_create_payment($payment_data); if (is_wp_error($payment)) { - throw new \Exception($payment->get_error_message()); + throw new \Exception(esc_html($payment->get_error_message())); } else { $payment->recalculate_totals()->save(); @@ -892,7 +892,7 @@ class Faker { $site = wu_create_site($site_data); if (is_wp_error($site)) { - throw new \Exception($site->get_error_message()); + throw new \Exception(esc_html($site->get_error_message())); } else { $this->set_fake_data_generated('sites', $site); } diff --git a/inc/class-helper.php b/inc/class-helper.php index e6f867a..58fe588 100644 --- a/inc/class-helper.php +++ b/inc/class-helper.php @@ -102,14 +102,14 @@ class Helper { * * @since 1.9.6 * @param string $option_name Option name. - * @param mixed $default The default value. + * @param mixed $default_value The default value. * @return mixed */ - public function get_option($option_name = 'settings', $default = []) { + public function get_option($option_name = 'settings', $default_value = []) { _deprecated_function(__METHOD__, '2.0.11', 'wu_get_option'); - return wu_get_option($option_name, $default); + return wu_get_option($option_name, $default_value); } /** diff --git a/inc/class-light-ajax.php b/inc/class-light-ajax.php index ae3c763..34ff693 100644 --- a/inc/class-light-ajax.php +++ b/inc/class-light-ajax.php @@ -31,7 +31,7 @@ class Light_Ajax { */ public function __construct() { - if (isset($_REQUEST['wu-ajax'])) { + if (isset($_REQUEST['wu-ajax'])) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended $action = $this->get_when_to_run(); wu_x_header("X-Ultimo-Ajax-When: $action"); @@ -101,7 +101,7 @@ class Light_Ajax { ] ); - $action = isset($_REQUEST['wu-when']) ? base64_decode((string) $_REQUEST['wu-when']) : 'plugins_loaded'; + $action = isset($_REQUEST['wu-when']) ? base64_decode((string) $_REQUEST['wu-when']) : 'plugins_loaded'; // phpcs:ignore WordPress return in_array($action, $allowed_list, true) ? $action : 'plugins_loaded'; } @@ -151,7 +151,7 @@ class Light_Ajax { header('Pragma: no-cache'); - $action = esc_attr(trim((string) $_REQUEST['action'])); + $action = esc_attr(trim((string) $_REQUEST['action'])); // phpcs:ignore if (is_user_logged_in()) { do_action('wu_ajax_' . $action); // phpcs:ignore diff --git a/inc/class-logger.php b/inc/class-logger.php index a4896a1..a896da6 100644 --- a/inc/class-logger.php +++ b/inc/class-logger.php @@ -65,7 +65,7 @@ class Logger extends AbstractLogger { * * Here we are converting the PHP error reporting level to the PSR-3 log level. */ - $reporting_level = error_reporting(); + $reporting_level = error_reporting(); // phpcs:ignore WordPress.PHP $psr_log_levels = [ E_ERROR => LogLevel::ERROR, @@ -131,7 +131,7 @@ class Logger extends AbstractLogger { } // read file - $content = file_get_contents($file); + $content = file_get_contents($file); // phpcs:ignore WordPress.WP.AlternativeFunctions // split into lines $arr_content = explode(PHP_EOL, $content); @@ -280,13 +280,13 @@ class Logger extends AbstractLogger { protected function write_to_file($message) { if ( ! file_exists($this->log_file)) { - touch($this->log_file); + touch($this->log_file); // phpcs:ignore WordPress.WP.AlternativeFunctions } - if ( ! is_writable($this->log_file)) { + if ( ! is_writable($this->log_file)) { // phpcs:ignore WordPress.WP.AlternativeFunctions return; } - file_put_contents($this->log_file, $message, FILE_APPEND | LOCK_EX); + file_put_contents($this->log_file, $message, FILE_APPEND | LOCK_EX); // phpcs:ignore WordPress.WP.AlternativeFunctions } } diff --git a/inc/class-maintenance-mode.php b/inc/class-maintenance-mode.php index e79ce73..b4cdb54 100644 --- a/inc/class-maintenance-mode.php +++ b/inc/class-maintenance-mode.php @@ -71,7 +71,7 @@ class Maintenance_Mode { * Add maintenance mode Notice to Admin Bar * * @since 2.0.0 - * @param WP_Admin_Bar $wp_admin_bar The Admin Bar class. + * @param \WP_Admin_Bar $wp_admin_bar The Admin Bar class. * @return void */ public function add_notice_to_admin_bar($wp_admin_bar): void { @@ -118,7 +118,7 @@ class Maintenance_Mode { __('Under Maintenance', 'wp-multisite-waas') ); - wp_die($text, $title, 503); + wp_die(esc_html($text), esc_html($title), 503); } /** @@ -140,11 +140,18 @@ class Maintenance_Mode { */ public function toggle_maintenance_mode() { - check_ajax_referer('wu_toggle_maintenance_mode', $_POST['_wpnonce']); + if ( ! check_ajax_referer('wu_toggle_maintenance_mode', '_wpnonce', false)) { + wp_send_json_error( + [ + 'message' => __('Request failed, please refresh and try again.', 'wp-multisite-waas'), + 'value' => false, + ] + ); + } $site_id = \WP_Ultimo\Helpers\Hash::decode(wu_request('site_hash'), 'site'); - if ( ! current_user_can_for_blog($site_id, 'manage_options')) { + if ( ! current_user_can_for_site($site_id, 'manage_options')) { wp_send_json_error( [ 'message' => __('You do not have the necessary permissions to perform this option.', 'wp-multisite-waas'), diff --git a/inc/class-newsletter.php b/inc/class-newsletter.php index 5a4ebd5..236ae5a 100644 --- a/inc/class-newsletter.php +++ b/inc/class-newsletter.php @@ -39,7 +39,7 @@ class Newsletter { */ public function maybe_update_newsletter_subscription($settings, $settings_to_save, $saved_settings) { - if ( isset($settings_to_save[ self::SETTING_FIELD_SLUG ]) && $settings_to_save[ self::SETTING_FIELD_SLUG ] && $settings_to_save[ self::SETTING_FIELD_SLUG ] != $saved_settings[ self::SETTING_FIELD_SLUG ] ) { + if ( isset($settings_to_save[ self::SETTING_FIELD_SLUG ]) && $settings_to_save[ self::SETTING_FIELD_SLUG ] && $settings_to_save[ self::SETTING_FIELD_SLUG ] !== $saved_settings[ self::SETTING_FIELD_SLUG ] ) { $response = wp_remote_post( 'https://wpmultisitewaas.org/wp-json/newsletter/v2/subscribers', [ @@ -55,7 +55,7 @@ class Newsletter { 'headers' => [ 'Accept' => 'application/json', 'Content-Type' => 'application/json', - 'Authorization' => 'Basic ' . base64_encode('30220d7fb4ec49a7410b3a309b9346c18410bd56:0407cd731d6f074cd0b96f2643b7619e89af1ed2'), + 'Authorization' => 'Basic ' . base64_encode('30220d7fb4ec49a7410b3a309b9346c18410bd56:0407cd731d6f074cd0b96f2643b7619e89af1ed2'), // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode ], ] ); @@ -73,7 +73,7 @@ class Newsletter { 'headers' => [ 'Accept' => 'application/json', 'Content-Type' => 'application/json', - 'Authorization' => 'Basic ' . base64_encode('30220d7fb4ec49a7410b3a309b9346c18410bd56:0407cd731d6f074cd0b96f2643b7619e89af1ed2'), + 'Authorization' => 'Basic ' . base64_encode('30220d7fb4ec49a7410b3a309b9346c18410bd56:0407cd731d6f074cd0b96f2643b7619e89af1ed2'), // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode ], ] ); diff --git a/inc/class-requirements.php b/inc/class-requirements.php index 4ac76d0..483f154 100644 --- a/inc/class-requirements.php +++ b/inc/class-requirements.php @@ -280,10 +280,19 @@ class Requirements { */ public static function notice_unsupported_php_version(): void { - // translators: the %1$s placeholder is the required PHP version, while the %2$s is the current PHP version. - $message = sprintf(__('WP Multisite WaaS requires at least PHP version %1$s to run. Your current PHP version is %2$s. Please, contact your hosting company support to upgrade your PHP version. If you want maximum performance consider upgrading your PHP to version 7.0 or later.', 'wp-multisite-waas'), self::$php_version, phpversion()); - - printf('

%s

', $message); + printf( + '

%s

', + sprintf( + // translators: the %1$s placeholder is the required PHP version, while the %2$s is the current PHP version, and %3$s is the recommended PHP version. + esc_html__( + 'WP Multisite WaaS requires at least PHP version %1$s to run. Your current PHP version is %2$s. Please, contact your hosting company support to upgrade your PHP version. If you want maximum performance consider upgrading your PHP to version %3$s or later.', + 'wp-multisite-waas' + ), + esc_html(self::$php_version), + '' . esc_html(phpversion()) . '', + esc_html(self::$php_recommended_version) + ) + ); } /** @@ -296,10 +305,18 @@ class Requirements { global $wp_version; - // translators: the %1$s placeholder is the required WP version, while the %2$s is the current WP version. - $message = sprintf(__('WP Multisite WaaS requires at least WordPress version %1$s to run. Your current WordPress version is %2$s.', 'wp-multisite-waas'), self::$wp_version, $wp_version); - - printf('

%s

', $message); + printf( + '

%s

', + sprintf( + // translators: the %1$s placeholder is the required WP version, while the %2$s is the current WP version. + esc_html__( + 'WP Multisite WaaS requires at least WordPress version %1$s to run. Your current WordPress version is %2$s.', + 'wp-multisite-waas' + ), + esc_html(self::$wp_version), + '' . esc_html($wp_version) . '' + ) + ); } /** @@ -310,9 +327,7 @@ class Requirements { */ public static function notice_not_multisite(): void { - $message = __('WP Multisite WaaS requires a multisite install to run properly. To know more about WordPress Networks, visit this link: Create a Network →', 'wp-multisite-waas'); - - printf('

%s

', $message); + printf('', esc_html__('WP Multisite WaaS requires a multisite install to run properly. To know more about WordPress Networks, visit this link:', 'wp-multisite-waas'), esc_html__('Create a Network', 'wp-multisite-waas')); } /** @@ -323,9 +338,13 @@ class Requirements { */ public static function notice_not_network_active(): void { - // translators: %s is a placeholder for the Network Admin plugins page URL. - $message = sprintf(__('WP Multisite WaaS needs to be network active to run properly. You can "Network Activate" it here', 'wp-multisite-waas'), network_admin_url('plugins.php')); - - printf('

%s

', $message); + printf( + '

%s

', + sprintf( + // translators: %s is a placeholder for the Network Admin plugins page URL with link text. + esc_html__('WP Multisite WaaS needs to be network active to run properly. You can "Network Activate" it %s', 'wp-multisite-waas'), + '' . esc_html__('here', 'wp-multisite-waas') . '' + ) + ); } } diff --git a/inc/class-session-cookie.php b/inc/class-session-cookie.php index 31d6fcf..db42bd1 100644 --- a/inc/class-session-cookie.php +++ b/inc/class-session-cookie.php @@ -137,7 +137,7 @@ class Session_Cookie implements Session { $expire = HOUR_IN_SECONDS; } - $value = json_encode($this->data, JSON_UNESCAPED_UNICODE); + $value = wp_json_encode($this->data, JSON_UNESCAPED_UNICODE); $cookie = new Cookie($this->get_cookie_name()); $cookie->setValue($value); diff --git a/inc/class-settings.php b/inc/class-settings.php index 216b66c..2c1393e 100644 --- a/inc/class-settings.php +++ b/inc/class-settings.php @@ -178,7 +178,7 @@ class Settings { $settings = $this->get_all(); if (str_contains($setting, '-')) { - _doing_it_wrong($setting, __('Dashes are no longer supported when registering a setting. You should change it to underscores in later versions.', 'wp-multisite-waas'), '2.0.0'); + _doing_it_wrong($setting, esc_html__('Dashes are no longer supported when registering a setting. You should change it to underscores in later versions.', 'wp-multisite-waas'), '2.0.0'); } $setting_value = $settings[ $setting ] ?? $default_value; @@ -388,6 +388,7 @@ class Settings { * @param string $section_slug Section to which this field will be added to. * @param string $field_slug ID of the field. This is used to later retrieve the value saved on this setting. * @param array $atts Field attributes such as title, description, tooltip, default value, etc. + * @param int $priority Priority of the field. This is used to order the fields. * @return void */ public function add_field($section_slug, $field_slug, $atts, $priority = 10): void { @@ -401,7 +402,7 @@ class Settings { * We no longer support settings with hyphens. */ if (str_contains($field_slug, '-')) { - _doing_it_wrong($field_slug, __('Dashes are no longer supported when registering a setting. You should change it to underscores in later versions.', 'wp-multisite-waas'), '2.0.0'); + _doing_it_wrong($field_slug, esc_html__('Dashes are no longer supported when registering a setting. You should change it to underscores in later versions.', 'wp-multisite-waas'), '2.0.0'); } $default_order = (count($fields) + 1) * 10; @@ -466,7 +467,7 @@ class Settings { $new_attrs['data-selected'] = $data_selected->to_search_results(); } - $new_attrs['data-selected'] = json_encode($new_attrs['data-selected']); + $new_attrs['data-selected'] = wp_json_encode($new_attrs['data-selected']); return array_merge($original_html_attr, $new_attrs); }; @@ -479,7 +480,7 @@ class Settings { foreach ($atts['require'] as $attr => $value) { $attr = str_replace('-', '_', $attr); - $value = json_encode($value); + $value = wp_json_encode($value); $require_rules[] = "require('{$attr}', {$value})"; } @@ -496,6 +497,7 @@ class Settings { ); $settings = $this->get_all(); + /* * Makes sure we install the default value if it is not set yet. */ @@ -633,7 +635,6 @@ class Settings { [ 'title' => __('Currency Position', 'wp-multisite-waas'), 'desc' => __('This setting affects all prices displayed across the plugin elements.', 'wp-multisite-waas'), - 'desc' => '', 'type' => 'select', 'default' => '%s %v', 'options' => [ diff --git a/inc/class-sunrise.php b/inc/class-sunrise.php index 80779ac..7c9d8b9 100644 --- a/inc/class-sunrise.php +++ b/inc/class-sunrise.php @@ -26,14 +26,15 @@ class Sunrise { * * @var string */ - static $version = '2.0.0.8'; + + public static $version = '2.0.0.8'; /** * Keeps the sunrise meta cached after the first read. * * @var null|array */ - static $sunrise_meta; + public static $sunrise_meta; /** * Initializes sunrise and loads additional elements if needed. @@ -104,6 +105,7 @@ class Sunrise { */ public static function load_dependencies(): void { + // We can't use JetPack autoloader because WordPress is not fully loaded yet. require_once __DIR__ . '/deprecated/early-deprecated.php'; require_once __DIR__ . '/deprecated/mercator.php'; require_once __DIR__ . '/functions/site.php'; @@ -115,6 +117,8 @@ class Sunrise { require_once __DIR__ . '/objects/class-limitations.php'; require_once __DIR__ . '/models/traits/trait-limitable.php'; require_once __DIR__ . '/models/traits/trait-notable.php'; + require_once __DIR__ . '/models/traits/trait-billable.php'; + require_once __DIR__ . '/traits/trait-wp-ultimo-subscription-deprecated.php'; require_once __DIR__ . '/traits/trait-wp-ultimo-site-deprecated.php'; require_once __DIR__ . '/database/engine/class-enum.php'; require_once __DIR__ . '/database/sites/class-site-type.php'; @@ -132,6 +136,8 @@ class Sunrise { require_once __DIR__ . '/class-settings.php'; require_once __DIR__ . '/limits/class-plugin-limits.php'; require_once __DIR__ . '/limits/class-theme-limits.php'; + require_once __DIR__ . '/limits/class-theme-limits.php'; + require_once __DIR__ . '/models/class-membership.php'; } /** @@ -206,7 +212,7 @@ class Sunrise { */ add_filter('option_active_plugins', fn() => []); - add_filter('site_option_active_sitewide_plugins', fn($plugins) => [basename(dirname(__DIR__)) . '/wp-ultimo.php' => 1]); + add_filter('site_option_active_sitewide_plugins', fn() => [basename(dirname(__DIR__)) . '/wp-ultimo.php' => 1], 10, 0); } } } @@ -255,7 +261,7 @@ class Sunrise { */ public static function try_upgrade() { - $copy_results = @copy( + $copy_results = copy( dirname(WP_ULTIMO_PLUGIN_FILE) . '/sunrise.php', WP_CONTENT_DIR . '/sunrise.php' ); // phpcs:ignore diff --git a/inc/class-views.php b/inc/class-views.php index bc7809b..313eba1 100644 --- a/inc/class-views.php +++ b/inc/class-views.php @@ -42,10 +42,11 @@ class Views { * @since 1.9.0 * @param string|array $template_names Template file(s) to search for, in order. * @param bool $load If true the template file will be loaded if it is found. - * @param bool $require_once Whether to require_once or require. Default true. Has no effect if $load is false. + * @param bool $use_require_once Whether to require_once or require. Default true. Has no effect if $load is false. + * * @return string The template filename if one is located. */ - public function custom_locate_template($template_names, $load = false, $require_once = true) { + public function custom_locate_template($template_names, $load = false, $use_require_once = true) { is_multisite() && switch_to_blog(get_current_site()->blog_id); @@ -76,7 +77,7 @@ class Views { } if ($load && '' !== $located) { - load_template($located, $require_once); + load_template($located, $use_require_once); } return $located; diff --git a/inc/class-whitelabel.php b/inc/class-whitelabel.php index bdbf918..200b0fa 100644 --- a/inc/class-whitelabel.php +++ b/inc/class-whitelabel.php @@ -84,7 +84,6 @@ class Whitelabel { add_action('wp_user_dashboard_setup', [$this, 'remove_dashboard_widgets'], 11); add_action('wp_dashboard_setup', [$this, 'remove_dashboard_widgets'], 11); - } if (wu_get_setting('hide_sites_menu', true)) { @@ -338,16 +337,11 @@ class Whitelabel { global $menu; - $index = ''; - foreach ($menu as $i => $menu_item) { if ('sites.php' === $menu_item[2]) { - $index = $i; - - continue; + unset($menu[ $i ]); + break; } } - - unset($menu[ $index ]); } } diff --git a/inc/debug/class-debug.php b/inc/debug/class-debug.php index 6892864..0281510 100644 --- a/inc/debug/class-debug.php +++ b/inc/debug/class-debug.php @@ -72,37 +72,37 @@ class Debug { - + - + - + - + 'wu-w-full wu-box-border wu-items-center wu-flex wu-justify-between wu-p-4 wu-m-0 wu-border-t wu-border-l-0 wu-border-r-0 wu-border-b-0 wu-border-gray-300 wu-border-solid', 'html_attr' => [ 'data-wu-app' => 'debug_generator', - 'data-state' => json_encode( + 'data-state' => wp_json_encode( [ 'customers' => false, 'products' => false, @@ -430,7 +430,7 @@ class Debug { 'field_wrapper_classes' => 'wu-w-full wu-box-border wu-items-center wu-flex wu-justify-between wu-p-4 wu-m-0 wu-border-t wu-border-l-0 wu-border-r-0 wu-border-b-0 wu-border-gray-300 wu-border-solid', 'html_attr' => [ 'data-wu-app' => 'debug_reset_database_form', - 'data-state' => json_encode( + 'data-state' => wp_json_encode( [ 'reset_only' => true, ] @@ -510,7 +510,7 @@ class Debug { 'field_wrapper_classes' => 'wu-w-full wu-box-border wu-items-center wu-flex wu-justify-between wu-p-4 wu-m-0 wu-border-t wu-border-l-0 wu-border-r-0 wu-border-b-0 wu-border-gray-300 wu-border-solid', 'html_attr' => [ 'data-wu-app' => 'debug_drop_database_form', - 'data-state' => json_encode( + 'data-state' => wp_json_encode( [ 'reset_only' => true, ] diff --git a/inc/development/assets/development.css b/inc/development/assets/development.css index b0e169c..e8e6fc3 100644 --- a/inc/development/assets/development.css +++ b/inc/development/assets/development.css @@ -9,7 +9,7 @@ body { width: 200px; content: " "; position: absolute; - top: 30; + top: 30px; background: url("../../../assets/img/logo.webp"); background-size: contain; height: 40px; diff --git a/inc/development/assets/development.scss b/inc/development/assets/development.scss index 29a5d83..b09a43e 100644 --- a/inc/development/assets/development.scss +++ b/inc/development/assets/development.scss @@ -20,7 +20,7 @@ body { width: 200px; content: " "; position: absolute; - top: 30; + top: 30px; background: url("../../../assets/img/logo.webp"); background-size: contain; height: 40px; diff --git a/inc/development/class-toolkit.php b/inc/development/class-toolkit.php index d4f6836..8dcd2ec 100644 --- a/inc/development/class-toolkit.php +++ b/inc/development/class-toolkit.php @@ -125,7 +125,7 @@ class Toolkit { $args = $manager->get_arguments_schema('update' === $context); - file_put_contents(wu_path("/mpb/data/endpoint/.endpoint-$class_name-$context"), json_encode($args)); // phpcs:ignore + file_put_contents(wu_path("/mpb/data/endpoint/.endpoint-$class_name-$context"), wp_json_encode($args)); // phpcs:ignore } /** diff --git a/inc/functions/compatiblity.php b/inc/functions/compatiblity.php new file mode 100644 index 0000000..9a465e8 --- /dev/null +++ b/inc/functions/compatiblity.php @@ -0,0 +1,35 @@ +ID ); + * current_user_can_for_site( $site_id, 'edit_post_meta', $post->ID, $meta_key ); + * + * @since 6.7.0 + * + * @param int $site_id Site ID. + * @param string $capability Capability name. + * @param mixed ...$args Optional further parameters, typically starting with an object ID. + * @return bool Whether the user has the given capability. + */ + function current_user_can_for_site($site_id, $capability, ...$args) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound + return current_user_can_for_blog($site_id, $capability, ...$args); + } +} diff --git a/inc/functions/date.php b/inc/functions/date.php index 2b7d11d..bb00fcd 100644 --- a/inc/functions/date.php +++ b/inc/functions/date.php @@ -74,9 +74,9 @@ function wu_get_days_ago($date_1, $date_2 = false) { $datetime_2 = wu_date($date_2); - $dateIntervar = $datetime_1->diff($datetime_2, false); + $date_intervar = $datetime_1->diff($datetime_2, false); - return - $dateIntervar->days; + return - $date_intervar->days; } /** @@ -90,7 +90,7 @@ function wu_get_current_time($type = 'mysql', $gmt = false) { switch_to_blog(wu_get_main_site_id()); - $time = current_time($type, $gmt); // phpcs:ignore + $time = current_time($type, $gmt); // phpcs:ignore restore_current_blog(); @@ -121,7 +121,6 @@ function wu_filter_duration_unit($unit, $length) { $new_unit = $length > 1 ? __('Years', 'wp-multisite-waas') : __('Year', 'wp-multisite-waas'); break; default: - $new_unit = $new_unit; break; } @@ -181,10 +180,10 @@ function wu_convert_php_date_format_to_moment_js_format($php_date_format): strin 'g' => 'h', 'H' => 'HH', 'h' => 'hh', - 'I' => '', // Daylight Saving Time? => moment().isDST(); + 'I' => '', // Daylight Saving Time?: moment().isDST(). 'i' => 'mm', 'j' => 'D', - 'L' => '', // Leap year? => moment().isLeapYear(); + 'L' => '', // Is Leap year?: moment().isLeapYear(). 'l' => 'dddd', 'M' => 'MMM', 'm' => 'MM', diff --git a/inc/functions/financial.php b/inc/functions/financial.php index f300ca5..9a16806 100644 --- a/inc/functions/financial.php +++ b/inc/functions/financial.php @@ -358,7 +358,7 @@ function wu_calculate_taxes_by_day($start_date = false, $end_date = false, $incl foreach ($line_items_groups as $line_items_group) { foreach ($line_items_group as $line_item) { - $date = gmdate('Y-m-d', strtotime((string) $line_item->date_created)); + $date = gmdate('Y-m-d', strtotime($line_item->get_date_created())); if ( ! wu_get_isset($data, $date)) { $data[ $date ] = [ diff --git a/inc/functions/legacy.php b/inc/functions/legacy.php index 4f6140d..edb2e51 100644 --- a/inc/functions/legacy.php +++ b/inc/functions/legacy.php @@ -149,7 +149,7 @@ function wu_print_signup_field($field_slug, $field, $results) { diff --git a/views/base/wizard.php b/views/base/wizard.php index 8317d16..0198f1b 100644 --- a/views/base/wizard.php +++ b/views/base/wizard.php @@ -8,26 +8,26 @@

- +

-
+
-
+
- + -
+
-

labels['deleted_message']; ?>

+

labels['deleted_message']); ?>

-
+
@@ -35,11 +35,11 @@
-
+
- get_title(); ?> + get_title()); ?> @@ -53,105 +53,105 @@ do_action('wu_page_wizard_after_title', $page); ?> - -
    + +
      - + ?> - $section) : ?> + $section) : ?> - + ?> - + - -
    •  
    • + +
    •  
    • - + - -
    • + +
    • - - - - - + + + + + - + - -
        + + + + + + + + + + -
      - +
    + - +
- - +
- +
- + - + /** + * Print Side Metaboxes + * + * Allow plugin developers to add new metaboxes + * + * @since 1.8.2 + * @param object Object being edited right now + */ + do_meta_boxes($screen->id, 'normal', false); -
+ ?> -
+ - + - - /** - * Print Side Metaboxes - * - * Allow plugin developers to add new metaboxes - * - * @since 1.8.2 - * @param object Object being edited right now - */ - do_meta_boxes($screen->id, 'normal', false); - - ?> - - - - - - - -
+
diff --git a/views/base/wizard/submit-box.php b/views/base/wizard/submit-box.php index 01f2bf1..aa27836 100644 --- a/views/base/wizard/submit-box.php +++ b/views/base/wizard/submit-box.php @@ -9,13 +9,13 @@
- + diff --git a/views/broadcast/emails/base.php b/views/broadcast/emails/base.php index 2af4326..f992720 100644 --- a/views/broadcast/emails/base.php +++ b/views/broadcast/emails/base.php @@ -17,7 +17,7 @@ if ( ! defined('ABSPATH')) { exit; // Exit if accessed directly -} // end if; +} ?> @@ -78,7 +78,7 @@ if ( ! defined('ABSPATH')) { -

+

@@ -89,7 +89,7 @@ if ( ! defined('ABSPATH')) { -

+


@@ -99,7 +99,7 @@ if ( ! defined('ABSPATH')) { -

+

diff --git a/views/broadcast/widget-targets.php b/views/broadcast/widget-targets.php index 698491c..c3a78cd 100644 --- a/views/broadcast/widget-targets.php +++ b/views/broadcast/widget-targets.php @@ -9,47 +9,47 @@ -

-
    +
      -
    • +
    • -
      +
      -   +   -
      +
      @@ -57,13 +57,13 @@ -
      +
      -
      +
      -
    • + -
    +
diff --git a/views/checkout/fields/field-checkbox-multi.php b/views/checkout/fields/field-checkbox-multi.php index 37e53a3..79ed536 100644 --- a/views/checkout/fields/field-checkbox-multi.php +++ b/views/checkout/fields/field-checkbox-multi.php @@ -5,10 +5,9 @@ * @since 2.0.0 */ ?> -
get_wrapper_html_attributes(); ?>> +
get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> $field, ] ); - ?> options as $option_value => $option_name) : ?> - - - + $field, ] ); - ?>
diff --git a/views/checkout/fields/field-checkbox.php b/views/checkout/fields/field-checkbox.php index 6ff28af..3a99a4c 100644 --- a/views/checkout/fields/field-checkbox.php +++ b/views/checkout/fields/field-checkbox.php @@ -5,22 +5,18 @@ * @since 2.0.0 */ ?> -
get_wrapper_html_attributes(); ?>> +
get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> $field, ] ); - ?> -
diff --git a/views/checkout/fields/field-group.php b/views/checkout/fields/field-group.php index e9c7bfe..31e3e93 100644 --- a/views/checkout/fields/field-group.php +++ b/views/checkout/fields/field-group.php @@ -5,72 +5,57 @@ * @since 2.0.0 */ ?> -
get_wrapper_html_attributes(); ?>> - +
get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> - - $field, - ] - ); - - ?> - - id, - $field->fields, - [ - 'views' => 'checkout/fields', - 'classes' => 'wu-flex wu-my-1', - 'field_wrapper_classes' => 'wu-bg-transparent', - 'wrap_tag' => 'span', - 'step' => (object) [ - 'classes' => '', - ], - ] - ); - - $form->render(); - - /** - * Adds the partial error template. - * - * @since 2.0.0 - */ - wu_get_template( - 'checkout/fields/partials/field-errors', - [ - 'field' => $field, - ] - ); - - ?> - - desc) : ?> - - - - desc; ?> - - - + $field, + ] + ); + ?> + id, + $field->fields, + [ + 'views' => 'checkout/fields', + 'classes' => 'wu-flex wu-my-1', + 'field_wrapper_classes' => 'wu-bg-transparent', + 'wrap_tag' => 'span', + 'step' => (object) [ + 'classes' => '', + ], + ] + ); + $form->render(); + /** + * Adds the partial error template. + * + * @since 2.0.0 + */ + wu_get_template( + 'checkout/fields/partials/field-errors', + [ + 'field' => $field, + ] + ); + ?> + desc) : ?> + + desc); ?> + - -
diff --git a/views/checkout/fields/field-hidden.php b/views/checkout/fields/field-hidden.php index d436e47..b4bb010 100644 --- a/views/checkout/fields/field-hidden.php +++ b/views/checkout/fields/field-hidden.php @@ -1,27 +1,12 @@ - - value)) : ?> - value as $index => $value) : ?> - - get_html_attributes(); ?>> - + get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> - - - get_html_attributes(); ?>> - + get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> $field, ] ); - ?> diff --git a/views/checkout/fields/field-html.php b/views/checkout/fields/field-html.php index 713e6ea..8016573 100644 --- a/views/checkout/fields/field-html.php +++ b/views/checkout/fields/field-html.php @@ -6,7 +6,7 @@ */ ?> -
get_wrapper_html_attributes(); ?>> +
get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
@@ -24,41 +24,31 @@ ] ); - /** - * Adds the partial description template. - * - * @since 2.0.0 - */ - wu_get_template( - 'checkout/fields/partials/field-description', - [ - 'field' => $field, - ] - ); + /** + * Adds the partial description template. + * + * @since 2.0.0 + */ + wu_get_template( + 'checkout/fields/partials/field-description', + [ + 'field' => $field, + ] + ); - ?> + /** + * Adds the partial errors template. + * + * @since 2.0.0 + */ + wu_get_template( + 'checkout/fields/partials/field-errors', + [ + 'field' => $field, + ] + ); -
- - content; ?> - -
- - $field, - ] - ); - - ?> + ?>
diff --git a/views/checkout/fields/field-note.php b/views/checkout/fields/field-note.php index d503edb..32d1cdc 100644 --- a/views/checkout/fields/field-note.php +++ b/views/checkout/fields/field-note.php @@ -6,8 +6,8 @@ */ ?> -
get_wrapper_html_attributes(); ?>> +
get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> - desc; ?> + desc; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
diff --git a/views/checkout/fields/field-password.php b/views/checkout/fields/field-password.php index 8f6ccd9..eba3efe 100644 --- a/views/checkout/fields/field-password.php +++ b/views/checkout/fields/field-password.php @@ -5,10 +5,9 @@ * @since 2.0.0 */ ?> -
get_wrapper_html_attributes(); ?>> +
get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> $field, ] ); - ?> - get_html_attributes(); ?>> + get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> meter) : ?> - - - - - - - + + + + - - - $field, ] ); - ?> - -
diff --git a/views/checkout/fields/field-payment-methods.php b/views/checkout/fields/field-payment-methods.php index dedb8ff..5232c67 100644 --- a/views/checkout/fields/field-payment-methods.php +++ b/views/checkout/fields/field-payment-methods.php @@ -8,7 +8,7 @@ $active_gateways = wu_get_active_gateway_as_options(); ?> -
get_wrapper_html_attributes(); ?>> +
get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> - get_html_attributes(); ?> - > + get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> + > - + - - + @@ -78,7 +78,7 @@ $active_gateways = wu_get_active_gateway_as_options(); /** * Load Gateway fields - * + * * @since 2.0.0 */ do_action('wu_checkout_gateway_fields'); diff --git a/views/checkout/fields/field-products.php b/views/checkout/fields/field-products.php index c65d6b1..b36b1bc 100644 --- a/views/checkout/fields/field-products.php +++ b/views/checkout/fields/field-products.php @@ -5,10 +5,9 @@ * @since 2.0.0 */ ?> -
get_wrapper_html_attributes(); ?>> +
get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> $field, ] ); - ?> - - - + $field, ] ); - ?> -
diff --git a/views/checkout/fields/field-radio.php b/views/checkout/fields/field-radio.php index 522ae88..edfd111 100644 --- a/views/checkout/fields/field-radio.php +++ b/views/checkout/fields/field-radio.php @@ -5,10 +5,9 @@ * @since 2.0.0 */ ?> -
get_wrapper_html_attributes(); ?>> +
get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> $field, ] ); - ?> options as $option_value => $option_name) : ?> - - - + $field, ] ); - ?>
diff --git a/views/checkout/fields/field-select.php b/views/checkout/fields/field-select.php index a37ea64..afba4a8 100644 --- a/views/checkout/fields/field-select.php +++ b/views/checkout/fields/field-select.php @@ -5,7 +5,7 @@ * @since 2.0.0 */ ?> -
get_wrapper_html_attributes(); ?>> +
get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> id); ?>" name="id); ?>" value="value); ?>" - get_html_attributes(); ?> + get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> > placeholder) : ?> - + @@ -43,14 +43,14 @@ value="" value); ?> > - + options_template) : ?> - options_template; ?> + options_template; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> diff --git a/views/checkout/fields/field-submit.php b/views/checkout/fields/field-submit.php index 4247d21..dbd1396 100644 --- a/views/checkout/fields/field-submit.php +++ b/views/checkout/fields/field-submit.php @@ -5,12 +5,8 @@ * @since 2.0.0 */ ?> -
get_wrapper_html_attributes(); ?>> - - -
diff --git a/views/checkout/fields/field-text.php b/views/checkout/fields/field-text.php index e92ce6f..b09fc5e 100644 --- a/views/checkout/fields/field-text.php +++ b/views/checkout/fields/field-text.php @@ -5,7 +5,7 @@ * @since 2.0.0 */ ?> -
get_wrapper_html_attributes(); ?>> +
get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> -
prefix_html_attr ?? []); ?>> - prefix; ?> +
prefix_html_attr ?? []); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> + prefix; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
- + - get_html_attributes(); ?>> + get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> - suffix) : ?> + suffix) : ?> -
suffix_html_attr ?? []); ?>> - suffix; ?> -
+
suffix_html_attr ?? []); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> + suffix; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> +
- + - prefix || $field->suffix) : ?> + prefix || $field->suffix) : ?>
- + -
get_wrapper_html_attributes(); ?>> +
get_wrapper_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> $field, ] ); - ?> -
diff --git a/views/checkout/fields/form.php b/views/checkout/fields/form.php index d1f7111..061bc70 100644 --- a/views/checkout/fields/form.php +++ b/views/checkout/fields/form.php @@ -7,21 +7,21 @@ ?> wrap_in_form_tag) : ?> -
get_html_attributes(); ?>> + get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> - <wrap_tag; ?> class="classes ? $form->classes . ' ' . $step->classes . ' wu-mt-2' : $step->classes . ' wu-mt-2')); ?>" get_html_attributes(); ?>> + <wrap_tag; ?> class="classes ? $form->classes . ' ' . $step->classes . ' wu-mt-2' : $step->classes . ' wu-mt-2')); ?>" get_html_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> title) : ?> -

title; ?>

+

title); ?>

- + wrap_in_form_tag) : ?> @@ -29,6 +29,6 @@ - wrap_tag; ?>> + wrap_tag; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> diff --git a/views/checkout/partials/pricing-table-list.php b/views/checkout/partials/pricing-table-list.php index 5beffa8..38af1fa 100644 --- a/views/checkout/partials/pricing-table-list.php +++ b/views/checkout/partials/pricing-table-list.php @@ -9,60 +9,33 @@ * * @since 2.0.0 * @param array $products List of product objects. - * @param string $name ID of the field. - * @param string $label The field label. */ ?> -
- - - +
-
- - -
get_id()}"; ?> wu-bg-gray-100 wu-m-2 wu-px-4 wu-py-4 wu-border wu-border-solid wu-rounded wu-border-gray-400 wu-box-border wu-flex-1 wu-flex wu-flex-col wu-justify-end" - > - -
- - get_name(); ?> - get_price_description(false); ?> - +
+
+ get_name()); ?> + get_price_description(false)); ?> +
+
+
    + get_pricing_table_lines() as $key => $line) : ?> +
  • + +
+
+
+ +
+
- -
- -
    - get_pricing_table_lines() as $key => $line) : ?> - -
  • - - -
- -
- -
- - - - - -
- - - -
- -
diff --git a/views/checkout/paypal/confirm.php b/views/checkout/paypal/confirm.php index 48724c8..5c8c2e1 100644 --- a/views/checkout/paypal/confirm.php +++ b/views/checkout/paypal/confirm.php @@ -15,7 +15,7 @@ if ($is_trial_setup) { $date = wp_date(get_option('date_format'), strtotime($membership->get_date_trial_end(), wu_get_current_time('timestamp', true))); $notes[] = sprintf(__('Your trial period will end on %1$s.', 'wp-multisite-waas'), $date); -} // end if; +} $original_cart = $payment->get_meta('wu_original_cart'); @@ -39,14 +39,14 @@ if ($membership->is_recurring() && $should_auto_renew) { $date_renew = wp_date(get_option('date_format'), strtotime($membership->get_date_expiration(), wu_get_current_time('timestamp', true))); $notes[] = sprintf(__('Your updated membership will start on %1$s, from that date you will be billed %2$s %3$s.', 'wp-multisite-waas'), $date_renew, $subtotal, $desc); - } // end if; + } } elseif ($is_trial_setup) { $initial_amount_format = wu_format_currency($membership->get_initial_amount(), $payment->get_currency()); $notes[] = sprintf(__('After the first payment of %1$s you will be billed %2$s %3$s.', 'wp-multisite-waas'), $initial_amount_format, $recurring_total_format, $desc); } else { $notes[] = sprintf(__('After this payment you will be billed %1$s %2$s.', 'wp-multisite-waas'), $recurring_total_format, $desc); - } // end if; + } } else { $recurring_total_format = wu_format_currency($recurring_total, $payment->get_currency()); @@ -54,9 +54,9 @@ if ($membership->is_recurring() && $should_auto_renew) { $notes[] = sprintf(__('From that date, you will be billed %1$s %2$s.', 'wp-multisite-waas'), $recurring_total_format, $desc); } else { $notes[] = sprintf(__('After this payment you will be billed %1$s.', 'wp-multisite-waas'), $desc); - } // end if; - } // end if; -} // end if; + } + } +} $note = implode(' ', $notes); @@ -66,7 +66,7 @@ $subtotal = 0;
-

+

@@ -75,8 +75,8 @@ $subtotal = 0;

- -
+ +

@@ -85,8 +85,8 @@ $subtotal = 0; - - + + @@ -112,7 +112,7 @@ $subtotal = 0; - + diff --git a/views/checkout/templates/order-bump/simple.php b/views/checkout/templates/order-bump/simple.php index 5e095d9..81bdae2 100644 --- a/views/checkout/templates/order-bump/simple.php +++ b/views/checkout/templates/order-bump/simple.php @@ -4,7 +4,7 @@ * * @since 2.0.0 */ - +//phpcs:disable WordPress.NamingConventions.PrefixAllGlobals $duration = $duration ?: 1; $duration_unit = $duration_unit ?: 'month'; @@ -14,58 +14,39 @@ $product_variation = $product->get_as_variation($duration, $duration_unit); if (false !== $product_variation) { $product = $product_variation; -} // end if; - +} ?>
- - get_featured_image('thumbnail'); - ?> - + + get_featured_image('thumbnail'); ?> - -
- -
- +
+ +
+ - +
+ get_name()) : esc_html($name); ?> + get_description()) : ?> +
+

get_description()); ?>

+
+ +
+

get_price_description()); ?>

+
+
+
+ +
+ +
+ +
+ + +
- -
- get_name() : $name; ?> - - get_description()) : ?> -
-

- get_description(); ?> -

-
- - -
-

- get_price_description(); ?> -

-
-
-
- -
- -
-
- - -
- - + diff --git a/views/checkout/templates/order-summary/simple.php b/views/checkout/templates/order-summary/simple.php index 50c5c83..393c749 100644 --- a/views/checkout/templates/order-summary/simple.php +++ b/views/checkout/templates/order-summary/simple.php @@ -9,7 +9,7 @@
- +
@@ -22,31 +22,31 @@ @@ -61,7 +61,7 @@ @@ -71,13 +71,13 @@ @@ -183,7 +183,7 @@ @@ -201,7 +201,7 @@ @@ -224,7 +224,7 @@ @@ -245,7 +245,7 @@
  • - +
  • @@ -253,12 +253,12 @@ - + diff --git a/views/checkout/templates/period-selection/clean.php b/views/checkout/templates/period-selection/clean.php index 9af5e71..fa30974 100644 --- a/views/checkout/templates/period-selection/clean.php +++ b/views/checkout/templates/period-selection/clean.php @@ -24,12 +24,12 @@ defined('ABSPATH') || exit; $period_option) : ?>
  • - - +
  • diff --git a/views/checkout/templates/period-selection/legacy.php b/views/checkout/templates/period-selection/legacy.php index 3bed1f1..2162437 100644 --- a/views/checkout/templates/period-selection/legacy.php +++ b/views/checkout/templates/period-selection/legacy.php @@ -27,8 +27,8 @@ defined('ABSPATH') || exit; $period_option) : ?>
  • - - + +
  • diff --git a/views/checkout/templates/pricing-table/legacy.php b/views/checkout/templates/pricing-table/legacy.php index c40100f..09efc31 100644 --- a/views/checkout/templates/pricing-table/legacy.php +++ b/views/checkout/templates/pricing-table/legacy.php @@ -19,9 +19,9 @@ $first_recurring_product = array_reduce( $products_to_reduce, function ($chosen_product, $product) { - if ($product && $product->is_recurring() && false == $chosen_product) { + if ($product && $product->is_recurring() && ! $chosen_product) { $chosen_product = $product; - } // end if; + } return $chosen_product; } @@ -32,8 +32,8 @@ $legacy_mode = array_reduce( function ($all_have_same_duration, $product) use ($first_recurring_product) { if ($product && $product->is_recurring()) { - $all_have_same_duration = $first_recurring_product->get_recurring_description() == $product->get_recurring_description(); - } // end if; + $all_have_same_duration = $first_recurring_product->get_recurring_description() === $product->get_recurring_description(); + } return $all_have_same_duration; } @@ -52,8 +52,8 @@ wp_add_inline_script( window.wu_legacy_mode = %s; ', - json_encode($force_different_durations), - json_encode($legacy_mode) + wp_json_encode($force_different_durations), + wp_json_encode($legacy_mode) ), 'after' ); @@ -76,21 +76,21 @@ if (null !== $first_recurring_product) { data.duration = %s; - } // end if; + } if (!data.duration_unit && !wu_force_different_durations) { data.duration_unit = %s; - } // end if; + } return data; }); ", - json_encode($first_recurring_product->get_duration()), - json_encode($first_recurring_product->get_duration_unit()) + wp_json_encode($first_recurring_product->get_duration()), + wp_json_encode($first_recurring_product->get_duration_unit()) ), 'after' ); @@ -101,7 +101,7 @@ if (null !== $first_recurring_product) {
    - +
    @@ -115,8 +115,8 @@ if (null !== $first_recurring_product) {
    get_id()}"; ?> lift wu-plan plan-tier wu-flex-1 is_featured_plan() ? 'callout' : ''); ?> wu-flex wu-flex-col wu-justify-between" - v-show="wu_force_different_durations || (duration && wu_legacy_mode) || (( (!duration) || duration == get_duration(); ?> && duration_unit == 'get_duration_unit(); ?>' ) || get_pricing_type() !== 'paid'); ?>)" + class="get_id()}"); ?> lift wu-plan plan-tier wu-flex-1 is_featured_plan() ? 'callout' : ''); ?> wu-flex wu-flex-col wu-justify-between" + v-show="wu_force_different_durations || (duration && wu_legacy_mode) || (( (!duration) || duration == get_duration()); ?> && duration_unit == 'get_duration_unit()); ?>' ) || get_pricing_type() !== 'paid'); ?>)" >
    @@ -130,7 +130,7 @@ if (null !== $first_recurring_product) { /** * Featured tag. */ - echo apply_filters('wu_featured_plan_label', __('Featured Plan', 'wp-multisite-waas'), $product); + echo esc_html(apply_filters('wu_featured_plan_label', __('Featured Plan', 'wp-multisite-waas'), $product)); ?> @@ -140,7 +140,7 @@ if (null !== $first_recurring_product) {

    - get_name(); ?> + get_name()); ?>

    @@ -158,7 +158,7 @@ if (null !== $first_recurring_product) { - + @@ -178,7 +178,7 @@ if (null !== $first_recurring_product) { - + @@ -195,7 +195,7 @@ if (null !== $first_recurring_product) { * Price display. */ - $symbol_left = in_array(wu_get_setting('currency_position', '%s%v'), ['%s%v', '%s %v']); + $symbol_left = in_array(wu_get_setting('currency_position', '%s%v'), ['%s%v', '%s %v'], true); ?> @@ -203,19 +203,19 @@ if (null !== $first_recurring_product) { - get_currency()); ?> + get_currency())); ?> - + get_amount(); - echo str_replace(wu_get_currency_symbol(), '', wu_format_currency($n)); + echo esc_html(str_replace(wu_get_currency_symbol(), '', wu_format_currency($n))); ?> @@ -227,21 +227,21 @@ if (null !== $first_recurring_product) { if ( ! $price_variation) { continue; - } // end if; + } ?> - + @@ -249,7 +249,7 @@ if (null !== $first_recurring_product) { - + get_price_variation($freq, 'month'); if ( ! $price_variation || $product->get_pricing_type() == 'free' || $product->get_pricing_type() == 'contact_us') { - echo "
  • -
  • "; + echo "
  • -
  • "; } else { $text = sprintf(__('%1$s, billed %2$s', 'wp-multisite-waas'), wu_format_currency($price_variation['amount']), $string); @@ -320,11 +320,11 @@ if (null !== $first_recurring_product) { if (12 === $freq) { $extra_check_for_annual = ' || (duration == "1" && duration_unit == "year")'; - } // end if; + } echo "
  • $text
  • "; - } // end if; - } // end foreach; + } + } ?> @@ -337,14 +337,14 @@ if (null !== $first_recurring_product) {
  • diff --git a/views/checkout/templates/pricing-table/list.php b/views/checkout/templates/pricing-table/list.php index 1303cba..016fbde 100644 --- a/views/checkout/templates/pricing-table/list.php +++ b/views/checkout/templates/pricing-table/list.php @@ -17,8 +17,8 @@ foreach ($products as $index => &$_product) { unset($products[ $index ]); $_product = $product_variation; - } // end if; -} // end foreach; + } +} ?>
    @@ -31,7 +31,7 @@ foreach ($products as $index => &$_product) { id="wu-product-get_id(); ?>" class="wu-relative wu-block wu-rounded-lg wu-border wu-border-gray-300 wu-bg-white wu-border-solid wu-shadow-sm wu-px-6 wu-py-4 wu-cursor-pointer hover:wu-border-gray-400 sm:wu-flex sm:wu-justify-between focus-within:wu-ring-1 focus-within:wu-ring-offset-2 focus-within:wu-ring-indigo-500"> - + diff --git a/views/checkout/templates/steps/clean.php b/views/checkout/templates/steps/clean.php index e6a7ef6..70d7a21 100644 --- a/views/checkout/templates/steps/clean.php +++ b/views/checkout/templates/steps/clean.php @@ -43,7 +43,7 @@ if ( ! defined('ABSPATH')) { } elseif (array_search($current_step, array_column($steps, 'id')) > array_search($step_key, array_column($steps, 'id'))) { $container_class = 'wu-opacity-50'; $color = 'blue'; - } // end if; + } ?> diff --git a/views/checkout/templates/steps/legacy.php b/views/checkout/templates/steps/legacy.php index bd13c2f..4b130b5 100644 --- a/views/checkout/templates/steps/legacy.php +++ b/views/checkout/templates/steps/legacy.php @@ -38,7 +38,7 @@ if ( ! defined('ABSPATH')) { $class = 'active'; } elseif (array_search($current_step, array_column($steps, 'id')) > array_search($step_key, array_column($steps, 'id'))) { $class = 'done'; - } // end if; + } ?> diff --git a/views/checkout/templates/steps/minimal.php b/views/checkout/templates/steps/minimal.php index adfeb2c..6fdc670 100644 --- a/views/checkout/templates/steps/minimal.php +++ b/views/checkout/templates/steps/minimal.php @@ -41,7 +41,7 @@ if ( ! defined('ABSPATH')) { $class = 'step-current'; } elseif (array_search($current_step, array_column($steps, 'id')) > array_search($step_key, array_column($steps, 'id'))) { $class = 'step-done'; - } // end if; + } ?> diff --git a/views/checkout/templates/template-selection/clean.php b/views/checkout/templates/template-selection/clean.php index 628de88..32862e2 100644 --- a/views/checkout/templates/template-selection/clean.php +++ b/views/checkout/templates/template-selection/clean.php @@ -8,6 +8,7 @@ * See more here: https://help.wpultimo.com/article/335-template-overrides. * * @since 2.0.0 + * @package WP_Ultimo/Views * @param array $products List of product objects. * @param string $name ID of the field. * @param string $label The field label. @@ -23,7 +24,7 @@ if (isset($should_display) && ! $should_display) { -
  • - - - -
  • - - - -
  • - -
  • - - - - - - - -
  • +
  • + href="#" + data-category="" + :class="$parent.template_category === '' ? 'current wu-font-semibold' : ''" + v-on:click.prevent="$parent.template_category = ''" + > + +
  • - + - +
  • + +
  • + + + + + + + +
  • + + +
  • + + + + -
    - +
    - get_type() !== 'site_template' && ! in_array($site_template->get_id(), $customer_sites, true)) { - continue; } - ?> + - get_type() === 'site_template'; ?> + get_type() !== 'site_template' && ! in_array($site_template->get_id(), $customer_sites, true)) { + continue; } + ?> - get_categories(), ! $is_template ? [$customer_sites_category] : []); ?> + get_type() === 'site_template'; ?> -
    + get_categories(), ! $is_template ? [$customer_sites_category] : []); ?> - + - +
    + +
    + +
    diff --git a/views/checkout/templates/template-selection/legacy.php b/views/checkout/templates/template-selection/legacy.php index 9724176..0e78415 100644 --- a/views/checkout/templates/template-selection/legacy.php +++ b/views/checkout/templates/template-selection/legacy.php @@ -2,26 +2,28 @@ /** * Template File: Basic Pricing Table. * - * To see what methods are available on the product variable, @see inc/models/class-products.php. + * To see what methods are available on the product variable, @param array $products List of product objects. + * + * @param string $name ID of the field. + * @param string $label The field label. + * + * @see inc/models/class-products.php. * * This template can also be overridden using template overrides. * See more here: https://help.wpultimo.com/article/335-template-overrides. * * @since 2.0.0 - * @param array $products List of product objects. - * @param string $name ID of the field. - * @param string $label The field label. + * @package WP_Ultimo/Views */ // Exit if accessed directly defined('ABSPATH') || exit; -if ( ! $should_display) { +if ( ! $should_display ) { echo '
    '; return; -} // end if; - +} $sites = array_map('wu_get_site', $sites ?? []); $categories ??= []; @@ -32,234 +34,232 @@ $customer_sites = isset($customer_sites) ? array_map('intval', $customer_sites) ?> - + -
    - - - -
    +
    + +
    -
    +
    -
    +
    - + ?> -

    +

    - + - + + + - - - - -

    - - - -
    - -
    - -

    - - + -
    +
    -
    +
    - get_preview_url_attrs() : sprintf('href="%s" target="_blank"', $site->get_active_site_url()); ?> - class="more-details" - id="get_id(); ?>-action" - > +
    - - +
    -
    + -

    + get_type() !== 'site_template' && ! in_array($site->get_id(), $customer_sites, true) ) { + continue; + } + ?> - get_title(); ?> - -

    + get_type() === 'site_template'; ?> -
    + get_categories(), ! $is_template ? [$customer_sites_category] : []); ?> - + get_preview_url_attrs() : sprintf('href="%s" target="_blank"', $site->get_active_site_url()); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> + class="more-details" + id="get_id()); ?>-action" + > + + + +
    + + +

    + get_title()); ?> +

    + +
    + + + +
    + +
    + +
    + +
    -
    +
    - +

    + +

    -
    - -

    - - - -

    - -
    - -
    - diff --git a/views/checkout/templates/template-selection/minimal.php b/views/checkout/templates/template-selection/minimal.php index 43a045e..8437664 100644 --- a/views/checkout/templates/template-selection/minimal.php +++ b/views/checkout/templates/template-selection/minimal.php @@ -20,8 +20,7 @@ defined('ABSPATH') || exit; if ( ! $should_display) { return; -} // end if; - +} $sites = array_map('wu_get_site', $sites ?? []); $categories ??= []; @@ -35,107 +34,103 @@ $customer_sites = isset($customer_sites) ? array_map('intval', $customer_sites)
      -
    • - - - -
    • - - - -
    • - -
    • - - - - - - - -
    • +
    • + href="#" + data-category="" + :class="$parent.template_category === '' ? 'current wu-font-semibold' : ''" + v-on:click.prevent="$parent.template_category = ''" + > + +
    • - + - +
    • + + +
    • + + + + + + + +
    • + + +
    • + + + +
    - + - get_type() !== 'site_template' && ! in_array($site_template->get_id(), $customer_sites, true)) { - continue; } - ?> + get_type() !== 'site_template' && ! in_array($site_template->get_id(), $customer_sites, true)) { + continue; } + ?> - get_type() === 'site_template'; ?> + get_type() === 'site_template'; ?> - get_categories(), ! $is_template ? [$customer_sites_category] : []); ?> + get_categories(), ! $is_template ? [$customer_sites_category] : []); ?> -
    +
    - <?php echo $site_template->get_title(); ?> + <?php echo esc_attr($site_template->get_title()); ?> -

    +

    + get_title()); ?> +

    - get_title(); ?> +

    + get_description()); ?> +

    - + -

    + -
    - - - - - - - - - - -
    - - +
    diff --git a/views/customers/widget-avatar.php b/views/customers/widget-avatar.php index 56ad16c..328c239 100644 --- a/views/customers/widget-avatar.php +++ b/views/customers/widget-avatar.php @@ -44,13 +44,13 @@
    - display_name; ?> + display_name); ?>
    @@ -62,16 +62,16 @@ - + @@ -79,7 +79,7 @@ - + diff --git a/views/dashboard-statistics/filter.php b/views/dashboard-statistics/filter.php index f611ade..ad08e97 100644 --- a/views/dashboard-statistics/filter.php +++ b/views/dashboard-statistics/filter.php @@ -6,20 +6,14 @@ */ ?>
    - -
    diff --git a/views/dashboard-statistics/widget-countries.php b/views/dashboard-statistics/widget-countries.php index 821785d..30479e9 100644 --- a/views/dashboard-statistics/widget-countries.php +++ b/views/dashboard-statistics/widget-countries.php @@ -7,37 +7,37 @@ ?>
    -
    +
    - $count) { - $line = [ - wu_get_country_name($country_code), - $count, - ]; + foreach ($countries as $country_code => $count) { + $line = [ + wu_get_country_name($country_code), + $count, + ]; - $data[] = $line; -} + $data[] = $line; + } -$page->render_csv_button( - [ - 'headers' => $headers, - 'data' => $data, - 'slug' => $slug, - ] -); + $page->render_csv_button( + [ + 'headers' => $headers, + 'data' => $data, + 'slug' => $slug, + ] + ); -?> + ?> -
    +
    @@ -45,68 +45,61 @@ $page->render_csv_button(
    -
    get_currency()); ?>
    - + - + - + - + - + - + - + - + - + @@ -93,7 +93,7 @@ - + @@ -167,7 +167,7 @@ - + - + - + - +
    - - - - - - - - - - - $count) : ?> +
    + - + + + + + + + $count) : ?> + + + + + + %s', - wu_tooltip_text(wu_get_country_name($country_code)), // phpcs:ignore WordPress.Security.EscapeOutput - esc_html(wu_get_flag_emoji($country_code)), - ); + $state_list = wu_get_states_of_customers($country_code); + $_state_count = 0; ?> - - - - - $state_count) : ?> + + + + + - $state_list = wu_get_states_of_customers($country_code); - $_state_count = 0; - - ?> - - $state_count) : - $_state_count += $state_count; - ?> - - - - - + = 0) : ?> + + + + + - = 0) : ?> + - - - - - - - - - - - -
    +
    + %s', + wu_tooltip_text(esc_html(wu_get_country_name($country_code))), // phpcs:ignore WordPress.Security.EscapeOutput + esc_html(wu_get_flag_emoji($country_code)), + ); + + ?> + +
    |⟶
    |⟶
    |⟶
    |⟶
    +
    @@ -114,7 +107,7 @@ $page->render_csv_button(
    - +
    diff --git a/views/dashboard-statistics/widget-forms.php b/views/dashboard-statistics/widget-forms.php index 30e0b83..5befb81 100644 --- a/views/dashboard-statistics/widget-forms.php +++ b/views/dashboard-statistics/widget-forms.php @@ -8,37 +8,35 @@
    -
    +
    -signup_form), + intval($form->count), // Ensure count is an integer and properly escaped + ]; -foreach ($forms as $form) { - $line = [ - $form->signup_form, - $form->count, - ]; + $data[] = $line; + } - $data[] = $line; -} // end foreach; + $page->render_csv_button( + [ + 'headers' => $headers, + 'data' => $data, + 'slug' => $slug, + ] + ); + ?> -$page->render_csv_button( - [ - 'headers' => $headers, - 'data' => $data, - 'slug' => $slug, - ] -); - -?> - -
    +
    @@ -46,34 +44,34 @@ $page->render_csv_button(
    - - - - - - - - - - - - +
    + - - + + + - + - + -
    - signup_form; ?> - signup_form) : ?> - - - count; ?>
    + + + signup_form); ?> + signup_form) : ?> + + + + count); ?> + + + + + + +
    @@ -81,7 +79,7 @@ $page->render_csv_button(
    - +
    diff --git a/views/dashboard-statistics/widget-most-visited-sites.php b/views/dashboard-statistics/widget-most-visited-sites.php index 4314934..7b2ce71 100644 --- a/views/dashboard-statistics/widget-most-visited-sites.php +++ b/views/dashboard-statistics/widget-most-visited-sites.php @@ -28,7 +28,7 @@ foreach ($sites as $site_visits) { ]; $data[] = $line; -} // end foreach; +} $page->render_csv_button( [ @@ -52,8 +52,8 @@ $page->render_csv_button( - - + + @@ -64,22 +64,22 @@ $page->render_csv_button( - site->get_title(); ?> + site->get_title()); ?>
    - + - + - + - + @@ -102,7 +102,7 @@ $page->render_csv_button(
    - +
    diff --git a/views/dashboard-statistics/widget-mrr-growth.php b/views/dashboard-statistics/widget-mrr-growth.php index 755de5d..a5a2136 100644 --- a/views/dashboard-statistics/widget-mrr-growth.php +++ b/views/dashboard-statistics/widget-mrr-growth.php @@ -11,7 +11,7 @@ - + diff --git a/views/dashboard-statistics/widget-new-accounts.php b/views/dashboard-statistics/widget-new-accounts.php index a08ca53..6d006a9 100644 --- a/views/dashboard-statistics/widget-new-accounts.php +++ b/views/dashboard-statistics/widget-new-accounts.php @@ -6,70 +6,42 @@ */ ?>
    -
      - -
    • - -
      - - - - - -
      - -
      - -
      - -
    • - +
    • +
      + + + +
      +
      + +
      +
    -
    - - - - - - - - - - - - - - - - - +
    + - - + + - - - - - - - - - - - - - -
    - name; ?> - - count; ?> -
    - -
    - + + + + + + name); ?> + count); ?> + + + + + + + + + + +
    -
    diff --git a/views/dashboard-statistics/widget-revenue.php b/views/dashboard-statistics/widget-revenue.php index 18b571f..2440135 100644 --- a/views/dashboard-statistics/widget-revenue.php +++ b/views/dashboard-statistics/widget-revenue.php @@ -20,7 +20,7 @@
    - +
    @@ -36,7 +36,7 @@
    - +
    @@ -52,7 +52,7 @@
    - +
    @@ -65,8 +65,8 @@ - - + + @@ -91,7 +91,7 @@ - + diff --git a/views/dashboard-statistics/widget-tax-by-code.php b/views/dashboard-statistics/widget-tax-by-code.php index 62d0ebb..5186ae7 100644 --- a/views/dashboard-statistics/widget-tax-by-code.php +++ b/views/dashboard-statistics/widget-tax-by-code.php @@ -29,7 +29,7 @@ ]; $data[] = $line; - } // end foreach; + } $page->render_csv_button( [ @@ -45,10 +45,10 @@ - - - - + + + + @@ -59,18 +59,10 @@ - - - - - % - - - - - - - + + % + + @@ -79,7 +71,7 @@ - + diff --git a/views/dashboard-statistics/widget-tax-by-day.php b/views/dashboard-statistics/widget-tax-by-day.php index 65820d6..65801ef 100644 --- a/views/dashboard-statistics/widget-tax-by-day.php +++ b/views/dashboard-statistics/widget-tax-by-day.php @@ -31,7 +31,7 @@ ]; $data[] = $line; - } // end foreach; + } $page->render_csv_button( [ @@ -47,11 +47,11 @@ - - - - - + + + + + @@ -62,21 +62,11 @@ $tax_line) : ?> - - - - - - - - - - - - - - - + + + + + @@ -85,7 +75,7 @@ - + diff --git a/views/dashboard-statistics/widget-tax-graph.php b/views/dashboard-statistics/widget-tax-graph.php index 755de5d..a5a2136 100644 --- a/views/dashboard-statistics/widget-tax-graph.php +++ b/views/dashboard-statistics/widget-tax-graph.php @@ -11,7 +11,7 @@ - + diff --git a/views/dashboard-statistics/widget-taxes.php b/views/dashboard-statistics/widget-taxes.php index 755de5d..a5a2136 100644 --- a/views/dashboard-statistics/widget-taxes.php +++ b/views/dashboard-statistics/widget-taxes.php @@ -11,7 +11,7 @@ - + diff --git a/views/dashboard-widgets/account-summary.php b/views/dashboard-widgets/account-summary.php index e887891..6012227 100644 --- a/views/dashboard-widgets/account-summary.php +++ b/views/dashboard-widgets/account-summary.php @@ -16,7 +16,7 @@

    - +

    @@ -32,7 +32,7 @@ href="get_manage_url($site->get_id()); ?>" > - + @@ -53,15 +53,15 @@ - get_name(); ?> + get_name()); ?>
    - - + +
    @@ -75,14 +75,14 @@
    - +
    - - + +
    @@ -98,7 +98,7 @@ /** * Display space used */ - printf($message, size_format($space_used), size_format($space_allowed)); + printf(esc_html($message), esc_html(size_format($space_used)), esc_html(size_format($space_allowed))); ?> @@ -113,8 +113,8 @@
    - - + +
    diff --git a/views/dashboard-widgets/activity-stream.php b/views/dashboard-widgets/activity-stream.php index c04dc05..12a7057 100644 --- a/views/dashboard-widgets/activity-stream.php +++ b/views/dashboard-widgets/activity-stream.php @@ -11,11 +11,11 @@
    - +
    - +
    @@ -91,17 +91,17 @@ class='wu-feed-pagination wu-m-0 wu-flex wu-justify-between'>
  • - +
  • - ← + ←
  • - +
  • @@ -173,7 +173,7 @@ Vue.set(wuActivityStream, 'queried', data.data); - } // end if; + } }, }) diff --git a/views/dashboard-widgets/billing-info.php b/views/dashboard-widgets/billing-info.php index 9db36fb..c850b1f 100644 --- a/views/dashboard-widgets/billing-info.php +++ b/views/dashboard-widgets/billing-info.php @@ -20,7 +20,7 @@

    - +

    @@ -34,7 +34,7 @@ href="" > - + @@ -49,7 +49,7 @@
    - here to add one.', 'wp-multisite-waas'), __('Update Billing Address', 'wp-multisite-waas'), $update_billing_address_link); ?> + here to add one.', 'wp-multisite-waas')), esc_html__('Update Billing Address', 'wp-multisite-waas'), esc_url($update_billing_address_link)); ?>
    @@ -66,10 +66,10 @@
    - +
    - +
    @@ -113,7 +113,7 @@ href="" > - + diff --git a/views/dashboard-widgets/current-membership-product-details.php b/views/dashboard-widgets/current-membership-product-details.php index 075cc6d..271eac4 100644 --- a/views/dashboard-widgets/current-membership-product-details.php +++ b/views/dashboard-widgets/current-membership-product-details.php @@ -38,7 +38,7 @@ - + @@ -48,7 +48,7 @@ - + diff --git a/views/dashboard-widgets/current-membership.php b/views/dashboard-widgets/current-membership.php index 180d6ee..b116151 100644 --- a/views/dashboard-widgets/current-membership.php +++ b/views/dashboard-widgets/current-membership.php @@ -116,7 +116,7 @@
    - +
    @@ -134,7 +134,7 @@
    - +
    @@ -148,7 +148,7 @@
    - +
    @@ -164,7 +164,7 @@
    - +
    diff --git a/views/dashboard-widgets/current-site.php b/views/dashboard-widgets/current-site.php index 1fc42d1..48ce45a 100644 --- a/views/dashboard-widgets/current-site.php +++ b/views/dashboard-widgets/current-site.php @@ -42,7 +42,7 @@ - +
    diff --git a/views/dashboard-widgets/domain-mapping.php b/views/dashboard-widgets/domain-mapping.php index 968b2db..4008a03 100644 --- a/views/dashboard-widgets/domain-mapping.php +++ b/views/dashboard-widgets/domain-mapping.php @@ -24,9 +24,9 @@
    - + - + @@ -58,7 +58,7 @@ if ( ! $item->is_active()) { $label = sprintf('%s (%s)', $label, __('Inactive', 'wp-multisite-waas')); - } // end if; + } $class = $item->get_stage_class(); @@ -74,7 +74,7 @@ 'url' => $domain['primary_link'], 'value' => __('Make Primary', 'wp-multisite-waas'), ]; - } // end if; + } $second_row_actions['remove'] = [ 'wrapper_classes' => 'wu-text-red-500 wubox', diff --git a/views/dashboard-widgets/first-steps.php b/views/dashboard-widgets/first-steps.php index 79a3801..d209c7a 100644 --- a/views/dashboard-widgets/first-steps.php +++ b/views/dashboard-widgets/first-steps.php @@ -12,11 +12,11 @@
    - + - +
    @@ -24,7 +24,7 @@
    - +
    @@ -41,7 +41,7 @@
    - +
    @@ -49,7 +49,7 @@ - + @@ -59,7 +59,7 @@ - +
    @@ -68,7 +68,7 @@
     
    - +
    @@ -92,7 +92,7 @@ endforeach; class="button wu-text-center hide-postbox-tog" id="wp-ultimo-setup-hide" > - +
    diff --git a/views/dashboard-widgets/invoices.php b/views/dashboard-widgets/invoices.php index 78afa5f..eb6aeb4 100644 --- a/views/dashboard-widgets/invoices.php +++ b/views/dashboard-widgets/invoices.php @@ -17,7 +17,7 @@

    - +

    @@ -47,15 +47,15 @@ ', $payment->get_invoice_url(), - esc_attr__('Download Invoice', 'wp-multisite-waas') + esc_html__('Download Invoice', 'wp-multisite-waas') ); $payment_column = $payment->get_status() === 'pending' ? [ 'pay_now' => [ 'url' => add_query_arg(['payment' => $payment->get_hash()], wu_get_registration_url()), 'icon' => 'dashicons-wu-credit-card wu-align-middle wu-mr-1', - 'label' => __('Go to payment', 'wp-multisite-waas'), - 'value' => __('Pay Now', 'wp-multisite-waas'), + 'label' => esc_html__('Go to payment', 'wp-multisite-waas'), + 'value' => esc_html__('Pay Now', 'wp-multisite-waas'), ], ] : []; diff --git a/views/dashboard-widgets/limits-and-quotas.php b/views/dashboard-widgets/limits-and-quotas.php index 92f4991..95d1d18 100644 --- a/views/dashboard-widgets/limits-and-quotas.php +++ b/views/dashboard-widgets/limits-and-quotas.php @@ -16,7 +16,7 @@

    - +

    @@ -37,7 +37,7 @@ if (is_array($items_to_display) && ! in_array($post_type_slug, $items_to_display, true)) { continue; - } // end if; + } if ($post_type_limits->{$post_type_slug}->enabled) : $post_count = $post_type_limits->get_post_count($post_type_slug); @@ -48,11 +48,11 @@ $width = 5; } else { $width = ($post_count / $post_type_limits->{$post_type_slug}->number * 100); - } // end if; + } if ($width > 100) { $width = 100; - } // end if; + } ?> @@ -60,7 +60,7 @@ - label; ?> + label); ?> @@ -72,9 +72,9 @@
    - + / - {$post_type_slug}->number) ? __('Unlimited', 'wp-multisite-waas') : $post_type_limits->{$post_type_slug}->number; ?> + {$post_type_slug}->number) ? esc_html__('Unlimited', 'wp-multisite-waas') : esc_html($post_type_limits->{$post_type_slug}->number); ?>
    @@ -113,7 +113,7 @@ endforeach;
    - + diff --git a/views/dashboard-widgets/login-form.php b/views/dashboard-widgets/login-form.php index 02504f1..8e459d2 100644 --- a/views/dashboard-widgets/login-form.php +++ b/views/dashboard-widgets/login-form.php @@ -16,7 +16,7 @@ Log in using your account.', 'wp-multisite-waas'), wp_get_current_user()->display_name, $login_url); + printf(wp_kses_post(__('Not %1$s? Log in using your account.', 'wp-multisite-waas')), esc_html(wp_get_current_user()->display_name), esc_url($login_url)); ?> @@ -33,7 +33,7 @@

    - +

    @@ -49,7 +49,7 @@ href="" > - + diff --git a/views/dashboard-widgets/my-sites.php b/views/dashboard-widgets/my-sites.php index 9e63f67..f84d81d 100644 --- a/views/dashboard-widgets/my-sites.php +++ b/views/dashboard-widgets/my-sites.php @@ -69,7 +69,7 @@ $show_add_new = apply_filters('wp_ultimo_my_sites_show_add_new', $show_add_new); - + @@ -139,7 +139,7 @@ $show_add_new = apply_filters('wp_ultimo_my_sites_show_add_new', $show_add_new);
  • - +
  • @@ -148,7 +148,7 @@ $show_add_new = apply_filters('wp_ultimo_my_sites_show_add_new', $show_add_new);
  • - +
  • @@ -170,7 +170,7 @@ $show_add_new = apply_filters('wp_ultimo_my_sites_show_add_new', $show_add_new); - + diff --git a/views/dashboard-widgets/site-actions.php b/views/dashboard-widgets/site-actions.php index ea8e82d..0455208 100644 --- a/views/dashboard-widgets/site-actions.php +++ b/views/dashboard-widgets/site-actions.php @@ -37,7 +37,7 @@ class=" wu-px-4 wu-py-3 wu-inline-block wu-no-underline" > diff --git a/views/dashboard-widgets/summary.php b/views/dashboard-widgets/summary.php index 593d118..84736ac 100644 --- a/views/dashboard-widgets/summary.php +++ b/views/dashboard-widgets/summary.php @@ -20,7 +20,7 @@
    - +
    @@ -36,7 +36,7 @@
    - +
    diff --git a/views/dashboard-widgets/thank-you.php b/views/dashboard-widgets/thank-you.php index 3a1abd1..f37928e 100644 --- a/views/dashboard-widgets/thank-you.php +++ b/views/dashboard-widgets/thank-you.php @@ -45,7 +45,7 @@ - + @@ -69,7 +69,7 @@ - + @@ -87,7 +87,7 @@ - + @@ -141,7 +141,7 @@ - + @@ -159,7 +159,7 @@ - + @@ -177,7 +177,7 @@ - + @@ -195,7 +195,7 @@ - + @@ -227,7 +227,7 @@

    - +

    @@ -277,7 +277,7 @@ - + @@ -302,23 +302,23 @@ - +
    - +
    - + - + @@ -357,7 +357,7 @@

    - +

    @@ -374,8 +374,8 @@ - - + + @@ -404,7 +404,7 @@ - + get_subtotal(), $payment->get_currency()); ?> @@ -418,7 +418,7 @@ - + get_total(), $payment->get_currency()); ?> @@ -442,7 +442,7 @@

    - +

    diff --git a/views/domain/dns-table.php b/views/domain/dns-table.php index 6775708..ffdc0d7 100644 --- a/views/domain/dns-table.php +++ b/views/domain/dns-table.php @@ -11,10 +11,10 @@ - - - - + + + + @@ -24,7 +24,7 @@ - + @@ -70,7 +70,7 @@ - + {{ results.network_ip }} @@ -79,53 +79,3 @@
    - - diff --git a/views/domain/log.php b/views/domain/log.php index 9ad90dd..61166c6 100644 --- a/views/domain/log.php +++ b/views/domain/log.php @@ -8,7 +8,7 @@
    -	
    +	
     	
    @@ -16,7 +16,7 @@
    diff --git a/views/email/widget-placeholders.php b/views/email/widget-placeholders.php index 8b3ad0f..8bc7994 100644 --- a/views/email/widget-placeholders.php +++ b/views/email/widget-placeholders.php @@ -9,11 +9,11 @@
    -
    +
    - +
    @@ -23,45 +23,33 @@ - + - + - + - - - - - - - - - + - + - + - + - {{ placeholder.name.replace('Id', 'ID').replace('Url', 'URL') }} + - - - - - + class="wu-no-underline wp-ui-text-highlight wu-copy" href="#" data-clipboard-action="copy" :data-clipboard-target="'#payload_event_placeholder_' + placeholder.placeholder"> - + @@ -69,9 +57,9 @@ - + - + @@ -87,7 +75,7 @@ - + diff --git a/views/emails/admin/domain-created.php b/views/emails/admin/domain-created.php index 0122196..50f40e4 100644 --- a/views/emails/admin/domain-created.php +++ b/views/emails/admin/domain-created.php @@ -5,132 +5,132 @@ * @since 2.0.0 */ ?> -

    +

    -

    +

    - + - + - + - + - + - + - +
    {{domain_domain}}
    {{domain_id}}
    {{domain_stage}}
    {{domain_active}}
    {{domain_primary}}
    {{domain_secure}}
    - +
    -

    +

    - + - + - + - + - +
    {{site_title}}
    {{site_id}}
    - +
    - +
    - +
    -

    +

    - + - + - + - + - + - + diff --git a/views/emails/admin/payment-received.php b/views/emails/admin/payment-received.php index 68b16a6..ece689d 100644 --- a/views/emails/admin/payment-received.php +++ b/views/emails/admin/payment-received.php @@ -5,153 +5,153 @@ * @since 2.0.0 */ ?> -

    +

    -

    +

    -

    +

    {{membership_description}}
    {{membership_initial_amount}}
    {{membership_id}}
    {{membership_reference_code}}
    {{membership_date_expiration}}
    - +
    - + - + - + - + - + - + - + - + - + - + - +
    {{payment_product_names}}
    {{payment_subtotal}}
    {{payment_tax_total}}
    {{payment_total}}
    {{payment_gateway}}
    {{payment_id}}
    {{payment_reference_code}}
    {{payment_date_created}}
    - +
    Initial Payment
    - +
    -

    +

    - + - + - + - + - + - +
    {{membership_description}}
    {{membership_initial_amount}}
    {{membership_id}}
    {{membership_reference_code}}
    {{membership_date_expiration}}
    - +
    -

    +

    - + - + - + - + - + diff --git a/views/emails/admin/site-published.php b/views/emails/admin/site-published.php index 3f76e1a..5a99a61 100644 --- a/views/emails/admin/site-published.php +++ b/views/emails/admin/site-published.php @@ -5,119 +5,119 @@ * @since 2.0.0 */ ?> -

    +

    + +

    %1$s (%2$s), was created successfully on your network!', 'wp-multisite-waas'), '{{site_title}}', '{{site_url}}'), 'pre_user_description'); ?>

    -

    %1$s (%2$s), was created successfully on your network!', 'wp-multisite-waas'), '{{site_title}}', '{{site_url}}'); ?>

    - -

    +

    {{customer_avatar}}
    {{customer_name}}
    {{customer_user_email}}
    {{customer_id}}
    {{customer_billing_address}}
    - +
    - + - + - + - + - +
    {{site_title}}
    {{site_id}}
    - +
    - +
    - +
    -

    +

    - + - + - + - + - + - +
    {{membership_description}}
    {{membership_initial_amount}}
    {{membership_id}}
    {{membership_reference_code}}
    {{membership_date_expiration}}
    - +
    -

    +

    - + - + - + - + - + diff --git a/views/emails/customer/confirm-email-address.php b/views/emails/customer/confirm-email-address.php index 1d72a34..a2a940c 100644 --- a/views/emails/customer/confirm-email-address.php +++ b/views/emails/customer/confirm-email-address.php @@ -5,14 +5,16 @@ * @since 2.0.0 */ ?> -

    + +

    -

    +

    -

    +

    - +
    - {{verification_link}}'); ?> + + {{verification_link}}'), ''); ?>

    diff --git a/views/emails/customer/payment-received.php b/views/emails/customer/payment-received.php index 2fceb69..8b820ce 100644 --- a/views/emails/customer/payment-received.php +++ b/views/emails/customer/payment-received.php @@ -5,54 +5,54 @@ * @since 2.0.0 */ ?> -

    +

    -

    +

    -

    +

    -

    +

    {{customer_avatar}}
    {{customer_name}}
    {{customer_user_email}}
    {{customer_id}}
    {{customer_billing_address}}
    - +
    - + - + - + - + - + - + - + diff --git a/views/emails/customer/renewal-payment-created.php b/views/emails/customer/renewal-payment-created.php index 9c310ef..2335177 100644 --- a/views/emails/customer/renewal-payment-created.php +++ b/views/emails/customer/renewal-payment-created.php @@ -5,42 +5,42 @@ * @since 2.0.19 */ ?> -

    +

    -

    +

    -

    +

    -

    +

    {{payment_product_names}}
    {{payment_subtotal}}
    {{payment_tax_total}}
    {{payment_total}}
    {{payment_date_created}}
    - +
    Initial Payment
    - + - + - + - + - + diff --git a/views/emails/customer/site-published.php b/views/emails/customer/site-published.php index 60b4054..0004bd4 100644 --- a/views/emails/customer/site-published.php +++ b/views/emails/customer/site-published.php @@ -5,30 +5,31 @@ * @since 2.0.0 */ ?> -

    + +

    + +

    %1$s (%2$s) was created successfully and is ready!', 'wp-multisite-waas'), '{{site_title}}', '{{site_url}}'),'pre_user_description'); ?>

    -

    %1$s (%2$s) was created successfully and is ready!', 'wp-multisite-waas'), '{{site_title}}', '{{site_url}}'); ?>

    - -

    +

    {{payment_product_names}}
    {{payment_subtotal}}
    {{payment_tax_total}}
    {{payment_total}}
    {{payment_date_created}}
    - + - + - + diff --git a/views/events/widget-initiator.php b/views/events/widget-initiator.php index 912d971..f2ee76c 100644 --- a/views/events/widget-initiator.php +++ b/views/events/widget-initiator.php @@ -11,7 +11,7 @@
  • -

    +

    get_initiator() == 'manual') : ?> @@ -46,9 +46,9 @@
    - get_author_display_name(); ?> (#get_author_id(); ?>) + get_author_display_name()); ?> (#get_author_id()); ?>) - get_author_email_address(); ?> + get_author_email_address()); ?>
    @@ -72,9 +72,9 @@
    - get_initiator()); ?> + get_initiator())); ?> - +
    @@ -88,7 +88,7 @@
  • -

    get_object_type())); ?>

    +

    get_object_type()))); ?>

    column_payment($object); break; - } // end switch; + } ?> diff --git a/views/events/widget-message.php b/views/events/widget-message.php index b815c75..4d1fe46 100644 --- a/views/events/widget-message.php +++ b/views/events/widget-message.php @@ -9,10 +9,10 @@
  • -

    +

    - get_message(); ?> + get_message()); ?>
  • diff --git a/views/events/widget-payload.php b/views/events/widget-payload.php index 4bb1924..8cc3606 100644 --- a/views/events/widget-payload.php +++ b/views/events/widget-payload.php @@ -17,7 +17,7 @@ - + @@ -27,11 +27,11 @@
    - + diff --git a/views/invoice/template.php b/views/invoice/template.php index a16340d..29743cc 100644 --- a/views/invoice/template.php +++ b/views/invoice/template.php @@ -53,7 +53,7 @@ $has_tax_included = false; } .invoice-box table { - border-collapse: 1; + border-collapse: 1px; } .invoice-box table tr.heading th { @@ -150,12 +150,12 @@ $has_tax_included = false;
    {{site_title}}
    - +
    - +
    -
    +
    get_invoice_number()); ?>
    - get_date_created())))); ?>
    + get_date_created())))); ?>
    -
    +
    @@ -191,7 +191,7 @@ $has_tax_included = false; - +
    - + - + - + - + - + @@ -237,23 +237,23 @@ $has_tax_included = false; - get_title(); ?> + get_title()); ?>
    - get_description(); ?> + get_description()); ?> - get_subtotal(), $payment->get_currency()); ?> + get_subtotal(), $payment->get_currency())); ?> - get_discount_total(), $payment->get_currency()); ?> + get_discount_total(), $payment->get_currency())); ?> - get_tax_total(), $payment->get_currency()); ?> + get_tax_total(), $payment->get_currency())); ?>
    - get_tax_label(); ?> (get_tax_rate(); ?>%) + get_tax_label()); ?> (get_tax_rate()); ?>%) get_tax_inclusive()) : ?> * @@ -261,7 +261,7 @@ $has_tax_included = false; - get_total(), $payment->get_currency()); ?> + get_total(), $payment->get_currency())); ?> @@ -271,11 +271,11 @@ $has_tax_included = false; - * + * - get_total(), $payment->get_currency())); ?> + get_total(), $payment->get_currency()))); ?> @@ -283,13 +283,13 @@ $has_tax_included = false; - + - get_payment_method(); ?> + get_payment_method()); ?> diff --git a/views/legacy/signup/pricing-table/coupon-code.php b/views/legacy/signup/pricing-table/coupon-code.php index 5590af4..08d5b6b 100644 --- a/views/legacy/signup/pricing-table/coupon-code.php +++ b/views/legacy/signup/pricing-table/coupon-code.php @@ -21,14 +21,14 @@ if (isset($_GET['coupon']) && wu_get_coupon($_GET['coupon']) !== false && isset( el: "#coupon-code-app", data: { coupon_id: '', - coupon: '', - type : 'id, 'wpu_type', true)); ?>', - value : parseFloat(id, 'wpu_value', true)); ?>), - applies_to_setup_fee : id, 'wpu_applies_to_setup_fee', true)); ?>, - setup_fee_discount_value : parseFloat(id, 'wpu_setup_fee_discount_value', true)); ?>), - setup_fee_discount_type : 'id, 'wpu_setup_fee_discount_type', true)); ?>', - allowed_plans : 'id, 'wpu_allowed_plans', true)); ?>', - allowed_freqs : 'id, 'wpu_allowed_freqs', true)); ?>', + coupon: '', + type : 'id, 'wpu_type', true)); ?>', + value : parseFloat(id, 'wpu_value', true)); ?>), + applies_to_setup_fee : id, 'wpu_applies_to_setup_fee', true)); ?>, + setup_fee_discount_value : parseFloat(id, 'wpu_setup_fee_discount_value', true)); ?>), + setup_fee_discount_type : 'id, 'wpu_setup_fee_discount_type', true)); ?>', + allowed_plans : 'id, 'wpu_allowed_plans', true)); ?>', + allowed_freqs : 'id, 'wpu_allowed_freqs', true)); ?>', success: false, }, mounted: function() { @@ -87,7 +87,7 @@ if (isset($_GET['coupon']) && wu_get_coupon($_GET['coupon']) !== false && isset( $(this).find('h4').after('
    --
    '); - } // end if; + } let plan_id = $(this).data('plan'); @@ -104,7 +104,7 @@ if (isset($_GET['coupon']) && wu_get_coupon($_GET['coupon']) !== false && isset( is_allowed_plan = true; } - } // end for; + } } else { is_allowed_plan = true; @@ -120,7 +120,7 @@ if (isset($_GET['coupon']) && wu_get_coupon($_GET['coupon']) !== false && isset( is_allowed_freq = true; } - } // end for; + } } else { is_allowed_freq = true; @@ -131,7 +131,7 @@ if (isset($_GET['coupon']) && wu_get_coupon($_GET['coupon']) !== false && isset( $("body").unblock(); return; - } // end if; + } if (!is_allowed_freq) { @@ -172,7 +172,7 @@ if (isset($_GET['coupon']) && wu_get_coupon($_GET['coupon']) !== false && isset( $(this).find('.old-price').html(accounting.formatMoney(parseFloat(old_price))); if (!$(this).find('.off-value').get(0)) { - $(this).find('.old-price').after('
    (' + off_with_symbol + ' ' + '' + ')
    '); + $(this).find('.old-price').after('
    (' + off_with_symbol + ' ' + '' + ')
    '); } @@ -185,7 +185,7 @@ if (isset($_GET['coupon']) && wu_get_coupon($_GET['coupon']) !== false && isset( if (!$(this).find('.setupfee-off-value').get(0)) { - $(this).find('.pricing-table-setupfee').after(' (' + setupfee_off_with_symbol + ' ' + '' + ')'); + $(this).find('.pricing-table-setupfee').after(' (' + setupfee_off_with_symbol + ' ' + '' + ')'); } @@ -215,7 +215,7 @@ if (isset($_GET['coupon']) && wu_get_coupon($_GET['coupon']) !== false && isset( } - } // end if; + } if (applies_to_setup_fee) { @@ -227,13 +227,13 @@ if (isset($_GET['coupon']) && wu_get_coupon($_GET['coupon']) !== false && isset( new_setupfee = old_setupfee - parseFloat(setup_fee_discount_value); - } // end if; + } } else { new_setupfee = old_setupfee; - } // end if; + } if (new_yearly_value > 0) { diff --git a/views/legacy/signup/pricing-table/no-plans.php b/views/legacy/signup/pricing-table/no-plans.php index 1f1ea9c..8326c2f 100644 --- a/views/legacy/signup/pricing-table/no-plans.php +++ b/views/legacy/signup/pricing-table/no-plans.php @@ -22,5 +22,5 @@ if ( ! defined('ABSPATH')) { ?>
    -


    +


    diff --git a/views/legacy/signup/pricing-table/plan.php b/views/legacy/signup/pricing-table/plan.php index aacf1c1..9763e24 100644 --- a/views/legacy/signup/pricing-table/plan.php +++ b/views/legacy/signup/pricing-table/plan.php @@ -33,7 +33,7 @@ $plan_attrs = ''; foreach ([1, 3, 12] as $type) { $price = $plan->free ? __('Free!', 'wp-multisite-waas') : str_replace(wu_get_currency_symbol(), '', wu_format_currency((((float) $plan->{'price_' . $type}) / $type))); $plan_attrs .= " data-price-$type='$price'"; -} // end foreach; +} $plan_attrs = apply_filters('wu_pricing_table_plan', $plan_attrs, $plan); @@ -53,7 +53,7 @@ $plan_attrs = apply_filters('wu_pricing_table_plan', $plan_attrs, $plan); is_free()) : ?>
    - +
    is_contact_us()) : ?> @@ -101,7 +101,7 @@ $plan_attrs = apply_filters('wu_pricing_table_plan', $plan_attrs, $plan); } else { echo "
  • $text
  • "; } - } // end foreach; + } /** * Loop and Displays Pricing Table Lines diff --git a/views/legacy/signup/pricing-table/pricing-table.php b/views/legacy/signup/pricing-table/pricing-table.php index 1592d3f..e05c64f 100644 --- a/views/legacy/signup/pricing-table/pricing-table.php +++ b/views/legacy/signup/pricing-table/pricing-table.php @@ -60,7 +60,7 @@ $accent_color_2 = wu_color($accent_color->darken(4)); */ if ( ! isset($is_shortcode) || ! $is_shortcode || $atts['show_selector']) { wu_get_template('/legacy/signup/pricing-table/frequency-selector'); -} // end if; +} /** * Displays error message if there are no plans @@ -103,7 +103,7 @@ if (empty($plans)) { 'current_plan' => $current_plan, ] ); - } // end foreach; + } ?> diff --git a/views/legacy/signup/signup-main.php b/views/legacy/signup/signup-main.php index ce41734..4be91fa 100644 --- a/views/legacy/signup/signup-main.php +++ b/views/legacy/signup/signup-main.php @@ -45,9 +45,9 @@ foreach ($admin_actions as $action => $handlers) { foreach ($handlers as $handler => $priority) { if ( ! has_action($action, $handler) && function_exists($handler)) { add_action($action, $handler, $priority); - } // end foreach; - } // end foreach; -} // end foreach; + } + } +} do_action('wu_checkout_scripts'); diff --git a/views/legacy/signup/signup-nav-links.php b/views/legacy/signup/signup-nav-links.php index a2d7833..adf3128 100644 --- a/views/legacy/signup/signup-nav-links.php +++ b/views/legacy/signup/signup-nav-links.php @@ -38,7 +38,7 @@ $nav_links = apply_filters( if ( ! isset($signup->step)) { return; -} // end if; +} ?> diff --git a/views/legacy/signup/signup-steps-navigation.php b/views/legacy/signup/signup-steps-navigation.php index 4163b32..cb46700 100644 --- a/views/legacy/signup/signup-steps-navigation.php +++ b/views/legacy/signup/signup-steps-navigation.php @@ -21,7 +21,7 @@ if ( ! defined('ABSPATH')) { if ( ! $signup) { return; -} // end if; +} ?> @@ -52,7 +52,7 @@ $percent = 100 / $count; $class = 'active'; } elseif (array_search($signup->step, array_keys($signup->steps)) > array_search($step_key, array_keys($signup->steps))) { $class = 'done'; - } // end if; + } ?> @@ -72,7 +72,7 @@ $percent = 100 / $count; diff --git a/views/legacy/signup/steps/step-default.php b/views/legacy/signup/steps/step-default.php index d7e69bb..cc28cdc 100644 --- a/views/legacy/signup/steps/step-default.php +++ b/views/legacy/signup/steps/step-default.php @@ -21,7 +21,7 @@ if ( ! defined('ABSPATH')) { ?> -
    +
    @@ -31,14 +27,14 @@
    - +
    @@ -46,7 +42,7 @@
     
    @@ -83,7 +79,7 @@ - {{data[tax_category].rates.length}} + {{data[tax_category].rates.length}} @@ -102,7 +98,7 @@ $label) : ?> - - + + @@ -130,7 +126,7 @@
    - +
    @@ -144,7 +140,7 @@
    - +
    @@ -170,7 +166,7 @@ @@ -180,7 +176,7 @@ $label) : ?> - + - - - - $tax_rate_type_label) : ?> - @@ -213,19 +208,19 @@ - + - $country_name) : ?> - @@ -233,9 +228,8 @@ - - - @@ -249,9 +243,9 @@ placeholder="" > - + @@ -265,9 +259,8 @@ v-cloak > - - - @@ -277,9 +270,8 @@
    - - - @@ -288,13 +280,14 @@ name="" type="text" placeholder="*" - v-model="item." + v-model="item." v-cloak /> - - - + @@ -312,7 +305,7 @@ @@ -323,9 +316,9 @@ $label) : ?> - + - + @@ -345,13 +338,13 @@ @@ -377,11 +370,11 @@ - + - + - + diff --git a/views/ui/branding/footer.php b/views/ui/branding/footer.php index 293b89c..164f8ea 100644 --- a/views/ui/branding/footer.php +++ b/views/ui/branding/footer.php @@ -17,12 +17,12 @@
  • - +
  • - +
  • @@ -32,7 +32,7 @@
  • - +
  • @@ -42,7 +42,7 @@
  • - +
  • diff --git a/views/ui/container-toggle.php b/views/ui/container-toggle.php index d313972..b2fdaec 100644 --- a/views/ui/container-toggle.php +++ b/views/ui/container-toggle.php @@ -7,7 +7,7 @@ ?> - ' href="#" class="wu-tooltip wu-inline-block wu-py-1 wu-pl-2 md:wu-pr-3 wu-uppercase wu-text-gray-600 wu-no-underline"> + ' href="#" class="wu-tooltip wu-inline-block wu-py-1 wu-pl-2 md:wu-pr-3 wu-uppercase wu-text-gray-600 wu-no-underline"> diff --git a/views/ui/jumper.php b/views/ui/jumper.php index 4f63127..908b9d4 100644 --- a/views/ui/jumper.php +++ b/views/ui/jumper.php @@ -24,7 +24,7 @@ @@ -91,13 +91,13 @@
    - +
    - +
    diff --git a/views/ui/selectize-templates.php b/views/ui/selectize-templates.php index 7f60725..b56f71b 100644 --- a/views/ui/selectize-templates.php +++ b/views/ui/selectize-templates.php @@ -180,7 +180,7 @@ {{ text }} - → {{ group }} + → {{ group }}
    @@ -216,7 +216,7 @@ {{ domain }} - +
    @@ -324,7 +324,7 @@
    - +
    diff --git a/views/ui/template-previewer.php b/views/ui/template-previewer.php index 1e5a5ff..87c4f83 100644 --- a/views/ui/template-previewer.php +++ b/views/ui/template-previewer.php @@ -18,7 +18,7 @@ if ( ! defined('ABSPATH')) { exit; // Exit if accessed directly -} // end if; +} /** * Allow developers to run code before the template previewer is loaded. @@ -85,7 +85,7 @@ do_action('wu_template_previewer_before');
    - + @@ -202,7 +202,7 @@ do_action('wu_template_previewer_before');
    - +
    diff --git a/views/ui/toolbox.php b/views/ui/toolbox.php index e664058..ea946eb 100644 --- a/views/ui/toolbox.php +++ b/views/ui/toolbox.php @@ -102,7 +102,7 @@ if (typeof jQuery !== 'undefined') { }); }); })(jQuery); -} // end if; +}