Prep Plugin for release on WordPress.org (#23)
* Update translation text domain * Escape everything that should be escaped. * Add nonce checks where needed. * Sanitize all inputs. * Apply Code style changes across the codebase. * Correct many deprecation notices. * Optimize load order of many filters. * Add Proper Build script * Use emojii flags * Fix i18n deprecation notice for translating too early * Put all scripts in footer and load async
This commit is contained in:
@ -75,7 +75,7 @@ class Checkout_Steps extends Rule {
|
||||
|
||||
foreach ($required_fields_list as $field_slug) {
|
||||
if (! in_array($field_slug, $all_fields_list, true)) {
|
||||
$this->message = sprintf(__('The %s field must be present in at least one of the checkout form steps.', 'wp-ultimo'), wu_slug_to_name($field_slug));
|
||||
$this->message = sprintf(__('The %s field must be present in at least one of the checkout form steps.', 'wp-multisite-waas'), wu_slug_to_name($field_slug));
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -111,7 +111,7 @@ class Checkout_Steps extends Rule {
|
||||
);
|
||||
|
||||
if (empty($found_submittable_field_types)) {
|
||||
$this->message = sprintf(__('The %s step is missing a submit field', 'wp-ultimo'), $step['name']);
|
||||
$this->message = sprintf(__('The %s step is missing a submit field', 'wp-multisite-waas'), $step['name']);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ class Products extends Rule {
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->message = __('A plan is required.', 'wp-ultimo');
|
||||
$this->message = __('A plan is required.', 'wp-multisite-waas');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -56,14 +56,14 @@ class Site_Template extends Rule {
|
||||
$site = wu_get_site($template_id);
|
||||
|
||||
if (! $site || ($site->get_type() !== Site_Type::SITE_TEMPLATE && $site->get_type() !== Site_Type::CUSTOMER_OWNED)) {
|
||||
$this->message = __('The Template ID does not correspond to a valid Template', 'wp-ultimo');
|
||||
$this->message = __('The Template ID does not correspond to a valid Template', 'wp-multisite-waas');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($site->get_type() === Site_Type::CUSTOMER_OWNED) {
|
||||
if (! wu_get_setting('allow_own_site_as_template')) {
|
||||
$this->message = __('You can not use your sites as template', 'wp-ultimo');
|
||||
$this->message = __('You can not use your sites as template', 'wp-multisite-waas');
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -71,7 +71,7 @@ class Site_Template extends Rule {
|
||||
$customer = wu_get_current_customer();
|
||||
|
||||
if (! $customer || $site->get_customer_id() !== $customer->get_id()) {
|
||||
$this->message = __('The selected template is not available.', 'wp-ultimo');
|
||||
$this->message = __('The selected template is not available.', 'wp-multisite-waas');
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -103,7 +103,7 @@ class Site_Template extends Rule {
|
||||
|
||||
if (is_array($allowed_templates) && !in_array($template_id, $allowed_templates)) { // phpcs:ignore
|
||||
|
||||
$this->message = __('The selected template is not available for this product.', 'wp-ultimo');
|
||||
$this->message = __('The selected template is not available for this product.', 'wp-multisite-waas');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -46,6 +46,9 @@ class Unique extends Rule {
|
||||
*/
|
||||
public function check($value): bool {
|
||||
|
||||
if (empty($value)) {
|
||||
return true;
|
||||
}
|
||||
$this->requireParameters(
|
||||
[
|
||||
'model',
|
||||
@ -78,7 +81,7 @@ class Unique extends Rule {
|
||||
* Customize the error message for the customer.
|
||||
*/
|
||||
if (in_array($model, $user_models, true)) {
|
||||
$this->message = __('A customer with the same email address or username already exists.', 'wp-ultimo');
|
||||
$this->message = __('A customer with the same email address or username already exists.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
if ( ! $existing) {
|
||||
|
Reference in New Issue
Block a user