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

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

View File

@ -620,11 +620,11 @@ class Product extends Base_Model {
public function get_formatted_amount($key = 'amount') {
if ($this->is_free()) {
return __('Free!', 'wp-ultimo');
return __('Free!', 'wp-multisite-waas');
}
if ($this->get_pricing_type() === 'contact_us') {
return $this->get_contact_us_label() ?: __('Contact Us', 'wp-ultimo');
return $this->get_contact_us_label() ?: __('Contact Us', 'wp-multisite-waas');
}
return wu_format_currency($this->get_amount(), $this->get_currency());
@ -697,11 +697,11 @@ class Product extends Base_Model {
$pricing = [];
if ($this->get_pricing_type() === 'contact_us') {
return __('Contact us', 'wp-ultimo');
return __('Contact us', 'wp-multisite-waas');
}
if ($this->is_free()) {
return __('Free!', 'wp-ultimo');
return __('Free!', 'wp-multisite-waas');
}
if ($this->is_recurring()) {
@ -709,7 +709,7 @@ class Product extends Base_Model {
$message = sprintf(
// translators: %1$s is the formatted price, %2$s the duration, and %3$s the duration unit (day, week, month, etc)
_n('%1$s every %3$s', '%1$s every %2$s %3$s', $duration, 'wp-ultimo'), // phpcs:ignore
_n('%1$s every %3$s', '%1$s every %2$s %3$s', $duration, 'wp-multisite-waas'), // phpcs:ignore
wu_format_currency($this->get_amount(), $this->get_currency()),
$duration,
wu_get_translatable_string($duration <= 1 ? $this->get_duration_unit() : $this->get_duration_unit() . 's')
@ -720,7 +720,7 @@ class Product extends Base_Model {
if ( ! $this->is_forever_recurring()) {
$billing_cycles_message = sprintf(
// translators: %s is the number of billing cycles.
_n('for %s cycle', 'for %s cycles', $this->get_billing_cycles(), 'wp-ultimo'),
_n('for %s cycle', 'for %s cycles', $this->get_billing_cycles(), 'wp-multisite-waas'),
$this->get_billing_cycles()
);
@ -729,7 +729,7 @@ class Product extends Base_Model {
} else {
$pricing['subscription'] = sprintf(
// translators: %1$s is the formatted price of the product
__('%1$s one time payment', 'wp-ultimo'),
__('%1$s one time payment', 'wp-multisite-waas'),
wu_format_currency($this->get_amount(), $this->get_currency())
);
}
@ -737,7 +737,7 @@ class Product extends Base_Model {
if ($this->has_setup_fee() && $include_fees) {
$pricing['fee'] = sprintf(
// translators: %1$s is the formatted price of the setup fee
__('Setup Fee of %1$s', 'wp-ultimo'),
__('Setup Fee of %1$s', 'wp-multisite-waas'),
wu_format_currency($this->get_setup_fee(), $this->get_currency())
);
}
@ -758,12 +758,12 @@ class Product extends Base_Model {
}
if ( ! $this->is_recurring()) {
return __('one-time payment', 'wp-ultimo');
return __('one-time payment', 'wp-multisite-waas');
}
$description = sprintf(
// translators: %1$s the duration, and %2$s the duration unit (day, week, month, etc)
_n('every %2$s', 'every %1$s %2$s', $this->get_duration(), 'wp-ultimo'), // phpcs:ignore
_n('every %2$s', 'every %1$s %2$s', $this->get_duration(), 'wp-multisite-waas'), // phpcs:ignore
$this->get_duration(),
wu_get_translatable_string($this->get_duration() <= 1 ? $this->get_duration_unit() : $this->get_duration_unit() . 's')
);