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:
@ -252,7 +252,7 @@ class General_Compat {
|
||||
*/
|
||||
public function add_wp_typography_warning_message(): void {
|
||||
|
||||
WP_Ultimo()->notices->add(__('WP Typography "Smart Quotes" replacement is not compatible with WP Multisite WaaS and will be automatically disabled.', 'wp-ultimo'), 'warning');
|
||||
WP_Ultimo()->notices->add(__('WP Typography "Smart Quotes" replacement is not compatible with WP Multisite WaaS and will be automatically disabled.', 'wp-multisite-waas'), 'warning');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -65,7 +65,7 @@ class Gutenberg_Support {
|
||||
wp_register_script('wu-gutenberg-support', wu_get_asset('gutenberg-support.js', 'js'), ['jquery'], wu_get_version(), true);
|
||||
|
||||
// translators: the placeholder is replaced with the network name.
|
||||
$preview_message = apply_filters('wu_gutenberg_support_preview_message', sprintf(__('<strong>%s</strong> is generating the preview...', 'wp-ultimo'), get_network_option(null, 'site_name')));
|
||||
$preview_message = apply_filters('wu_gutenberg_support_preview_message', sprintf(__('<strong>%s</strong> is generating the preview...', 'wp-multisite-waas'), get_network_option(null, 'site_name')));
|
||||
|
||||
wp_localize_script(
|
||||
'wu-gutenberg-support',
|
||||
|
@ -215,7 +215,7 @@ class Legacy_Shortcodes {
|
||||
$atts['plan_id'] = ! empty($atts['product_id']) ? $atts['product_id'] : $atts['plan_id'];
|
||||
|
||||
if (empty($atts) || ! $atts['plan_id']) {
|
||||
return __('You need to pass a valid plan ID.', 'wp-ultimo');
|
||||
return __('You need to pass a valid plan ID.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
$query_products = get_query_var('products', []);
|
||||
@ -349,17 +349,17 @@ class Legacy_Shortcodes {
|
||||
[
|
||||
'duration' => 1,
|
||||
'duration_unit' => 'month',
|
||||
'label' => __('Monthly', 'wp-ultimo'),
|
||||
'label' => __('Monthly', 'wp-multisite-waas'),
|
||||
],
|
||||
[
|
||||
'duration' => 3,
|
||||
'duration_unit' => 'month',
|
||||
'label' => __('Quarterly', 'wp-ultimo'),
|
||||
'label' => __('Quarterly', 'wp-multisite-waas'),
|
||||
],
|
||||
[
|
||||
'duration' => 1,
|
||||
'duration_unit' => 'year',
|
||||
'label' => __('Yearly', 'wp-ultimo'),
|
||||
'label' => __('Yearly', 'wp-multisite-waas'),
|
||||
],
|
||||
],
|
||||
];
|
||||
@ -369,7 +369,7 @@ class Legacy_Shortcodes {
|
||||
|
||||
$fields[] = [
|
||||
'step' => 'checkout',
|
||||
'name' => __('Plans', 'wp-ultimo'),
|
||||
'name' => __('Plans', 'wp-multisite-waas'),
|
||||
'type' => 'pricing_table',
|
||||
'id' => 'pricing_table',
|
||||
'required' => true,
|
||||
@ -385,7 +385,7 @@ class Legacy_Shortcodes {
|
||||
if ('legacy' !== $layout) {
|
||||
$fields[] = [
|
||||
'step' => 'checkout',
|
||||
'name' => __('Get Started →', 'wp-ultimo'),
|
||||
'name' => __('Get Started →', 'wp-multisite-waas'),
|
||||
'type' => 'submit_button',
|
||||
'id' => 'checkout',
|
||||
];
|
||||
@ -394,7 +394,7 @@ class Legacy_Shortcodes {
|
||||
$steps = [
|
||||
[
|
||||
'id' => 'checkout',
|
||||
'name' => __('Checkout', 'wp-ultimo'),
|
||||
'name' => __('Checkout', 'wp-multisite-waas'),
|
||||
'desc' => '',
|
||||
'fields' => $fields,
|
||||
],
|
||||
@ -522,7 +522,7 @@ class Legacy_Shortcodes {
|
||||
|
||||
$fields[] = [
|
||||
'step' => 'checkout',
|
||||
'name' => __('Templates', 'wp-ultimo'),
|
||||
'name' => __('Templates', 'wp-multisite-waas'),
|
||||
'type' => 'template_selection',
|
||||
'id' => 'template_selection',
|
||||
'template_selection_sites' => implode(',', $templates ?: wu_get_site_templates($search_arguments)),
|
||||
@ -534,7 +534,7 @@ class Legacy_Shortcodes {
|
||||
$steps = [
|
||||
[
|
||||
'id' => 'checkout',
|
||||
'name' => __('Checkout', 'wp-ultimo'),
|
||||
'name' => __('Checkout', 'wp-multisite-waas'),
|
||||
'desc' => '',
|
||||
'fields' => $fields,
|
||||
],
|
||||
|
@ -260,8 +260,8 @@ class Multiple_Accounts_Compat {
|
||||
'login-and-registration',
|
||||
'multiple_accounts_header',
|
||||
[
|
||||
'title' => __('Multiple Accounts', 'wp-ultimo'),
|
||||
'desc' => __('Options related to the Multiple Accounts feature.', 'wp-ultimo'),
|
||||
'title' => __('Multiple Accounts', 'wp-multisite-waas'),
|
||||
'desc' => __('Options related to the Multiple Accounts feature.', 'wp-multisite-waas'),
|
||||
'type' => 'header',
|
||||
]
|
||||
);
|
||||
@ -270,8 +270,8 @@ class Multiple_Accounts_Compat {
|
||||
'login-and-registration',
|
||||
'enable_multiple_accounts',
|
||||
[
|
||||
'title' => __('Enable Multiple Accounts', 'wp-ultimo'),
|
||||
'desc' => __('Allow users to have accounts in different sites with the same email address. This is useful when running stores with WooCommerce and other plugins, for example.', 'wp-ultimo') . ' ' . sprintf('<a href="%s" target="_blank">%s</a>', wu_get_documentation_url('multiple-accounts'), __('Read More', 'wp-ultimo')),
|
||||
'title' => __('Enable Multiple Accounts', 'wp-multisite-waas'),
|
||||
'desc' => __('Allow users to have accounts in different sites with the same email address. This is useful when running stores with WooCommerce and other plugins, for example.', 'wp-multisite-waas') . ' ' . sprintf('<a href="%s" target="_blank">%s</a>', wu_get_documentation_url('multiple-accounts'), __('Read More', 'wp-multisite-waas')),
|
||||
'type' => 'toggle',
|
||||
'default' => 0,
|
||||
]
|
||||
@ -288,7 +288,7 @@ class Multiple_Accounts_Compat {
|
||||
*/
|
||||
public function add_multiple_account_column($columns) {
|
||||
|
||||
$columns['multiple_accounts'] = __('Multiple Accounts', 'wp-ultimo');
|
||||
$columns['multiple_accounts'] = __('Multiple Accounts', 'wp-multisite-waas');
|
||||
|
||||
return $columns;
|
||||
}
|
||||
@ -320,9 +320,9 @@ class Multiple_Accounts_Compat {
|
||||
);
|
||||
|
||||
// translators: the %d is the account count for that email address.
|
||||
$html = sprintf(__('<strong>%d</strong> accounts using this email.', 'wp-ultimo'), $users->total_users);
|
||||
$html = sprintf(__('<strong>%d</strong> accounts using this email.', 'wp-multisite-waas'), $users->total_users);
|
||||
|
||||
$html .= sprintf("<br><a href='%s' class=''>" . __('See all', 'wp-ultimo') . ' »</a>', network_admin_url('users.php?s=' . $user->user_email));
|
||||
$html .= sprintf("<br><a href='%s' class=''>" . __('See all', 'wp-multisite-waas') . ' »</a>', network_admin_url('users.php?s=' . $user->user_email));
|
||||
|
||||
echo $html;
|
||||
}
|
||||
|
@ -94,8 +94,8 @@ class Product_Compat {
|
||||
public function add_legacy_section($sections, $object) {
|
||||
|
||||
$sections['legacy_options_core'] = [
|
||||
'title' => __('Legacy Options', 'wp-ultimo'),
|
||||
'desc' => __('Options used by old 1.X versions. ', 'wp-ultimo'),
|
||||
'title' => __('Legacy Options', 'wp-multisite-waas'),
|
||||
'desc' => __('Options used by old 1.X versions. ', 'wp-multisite-waas'),
|
||||
'icon' => 'dashicons-wu-spreadsheet',
|
||||
'state' => [
|
||||
'legacy_options' => $object->get_legacy_options(),
|
||||
@ -104,8 +104,8 @@ class Product_Compat {
|
||||
'legacy_options' => [
|
||||
'type' => 'toggle',
|
||||
'value' => $object->get_legacy_options(),
|
||||
'title' => __('Toggle Legacy Options', 'wp-ultimo'),
|
||||
'desc' => __('Toggle this option to edit legacy options.', 'wp-ultimo'),
|
||||
'title' => __('Toggle Legacy Options', 'wp-multisite-waas'),
|
||||
'desc' => __('Toggle this option to edit legacy options.', 'wp-multisite-waas'),
|
||||
'html_attr' => [
|
||||
'v-model' => 'legacy_options',
|
||||
],
|
||||
@ -113,17 +113,17 @@ class Product_Compat {
|
||||
'featured_plan' => [
|
||||
'type' => 'toggle',
|
||||
'value' => $object->is_featured_plan(),
|
||||
'title' => __('Featured Plan', 'wp-ultimo'),
|
||||
'desc' => __('Toggle this option to mark this product as featured on the legacy pricing tables.', 'wp-ultimo'),
|
||||
'title' => __('Featured Plan', 'wp-multisite-waas'),
|
||||
'desc' => __('Toggle this option to mark this product as featured on the legacy pricing tables.', 'wp-multisite-waas'),
|
||||
'wrapper_html_attr' => [
|
||||
'v-show' => 'legacy_options',
|
||||
],
|
||||
],
|
||||
'feature_list' => [
|
||||
'type' => 'textarea',
|
||||
'title' => __('Features List', 'wp-ultimo'),
|
||||
'placeholder' => __('E.g. Feature 1', 'wp-ultimo') . PHP_EOL . __('Feature 2', 'wp-ultimo'),
|
||||
'desc' => __('Add a feature per line. These will be shown on the pricing tables.', 'wp-ultimo'),
|
||||
'title' => __('Features List', 'wp-multisite-waas'),
|
||||
'placeholder' => __('E.g. Feature 1', 'wp-multisite-waas') . PHP_EOL . __('Feature 2', 'wp-multisite-waas'),
|
||||
'desc' => __('Add a feature per line. These will be shown on the pricing tables.', 'wp-multisite-waas'),
|
||||
'value' => $object->get_feature_list(),
|
||||
'wrapper_html_attr' => [
|
||||
'v-show' => 'legacy_options',
|
||||
|
Reference in New Issue
Block a user