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:
@ -62,7 +62,7 @@ class Customer_User_Role_Limits {
|
||||
return;
|
||||
}
|
||||
|
||||
$message = __('You reached your membership users limit.', 'wp-ultimo');
|
||||
$message = __('You reached your membership users limit.', 'wp-multisite-waas');
|
||||
|
||||
/**
|
||||
* Allow developers to change the message about the membership users limit
|
||||
@ -71,7 +71,7 @@ class Customer_User_Role_Limits {
|
||||
*/
|
||||
$message = apply_filters('wu_users_membership_limit_message', $message);
|
||||
|
||||
wp_die($message, __('Limit Reached', 'wp-ultimo'), ['back_link' => true]);
|
||||
wp_die($message, __('Limit Reached', 'wp-multisite-waas'), ['back_link' => true]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -145,7 +145,7 @@ class Plugin_Limits {
|
||||
<span class="dashicons-wu-flash wu-align-text-bottom"></span>%s
|
||||
</span>
|
||||
</span>',
|
||||
__('Always Loaded', 'wp-ultimo')
|
||||
__('Always Loaded', 'wp-multisite-waas')
|
||||
);
|
||||
}
|
||||
|
||||
@ -160,8 +160,8 @@ class Plugin_Limits {
|
||||
'type' => $plugin_file,
|
||||
]
|
||||
),
|
||||
__('Upgrade to unlock', 'wp-ultimo'),
|
||||
__('Upgrade to unlock', 'wp-ultimo')
|
||||
__('Upgrade to unlock', 'wp-multisite-waas'),
|
||||
__('Upgrade to unlock', 'wp-multisite-waas')
|
||||
);
|
||||
|
||||
$actions['upgrade'] = $upgrade;
|
||||
@ -196,7 +196,7 @@ class Plugin_Limits {
|
||||
unset($plugins[ $plugin_slug ]);
|
||||
}
|
||||
|
||||
if (str_starts_with($plugin_slug, 'wp-ultimo')) {
|
||||
if (str_starts_with($plugin_slug, 'wp-multisite-waas')) {
|
||||
unset($plugins[ $plugin_slug ]);
|
||||
}
|
||||
|
||||
@ -236,7 +236,7 @@ class Plugin_Limits {
|
||||
$plugin_limits = wu_get_current_site()->get_limitations()->plugins;
|
||||
|
||||
foreach ($plugins as $plugin_slug => $timestamp) {
|
||||
if (str_contains($plugin_slug, 'wp-ultimo')) {
|
||||
if (str_contains($plugin_slug, 'wp-multisite-waas')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -289,7 +289,7 @@ class Plugin_Limits {
|
||||
$plugin_limits = wu_get_current_site()->get_limitations()->plugins;
|
||||
|
||||
foreach ($plugins as $plugin_slug) {
|
||||
if (str_contains((string) $plugin_slug, 'wp-ultimo')) {
|
||||
if (str_contains((string) $plugin_slug, 'wp-multisite-waas')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -132,18 +132,18 @@ class Post_Type_Limits {
|
||||
$screen = get_current_screen();
|
||||
|
||||
if ( ! wu_get_current_site()->get_limitations()->post_types->{$screen->post_type}->enabled) {
|
||||
$upgrade_message = __('Your plan does not support this post type.', 'wp-ultimo');
|
||||
$upgrade_message = __('Your plan does not support this post type.', 'wp-multisite-waas');
|
||||
|
||||
// translators: %s is the URL.
|
||||
wp_die($upgrade_message, __('Limit Reached', 'wp-ultimo'), ['back_link' => true]);
|
||||
wp_die(esc_html($upgrade_message), esc_html(__('Limit Reached', 'wp-multisite-waas')), ['back_link' => true]);
|
||||
}
|
||||
|
||||
// Check if that is more than our limit
|
||||
if (wu_get_current_site()->get_limitations()->post_types->is_post_above_limit($screen->post_type)) {
|
||||
$upgrade_message = __('You reached your plan\'s post limit.', 'wp-ultimo');
|
||||
$upgrade_message = __('You reached your plan\'s post limit.', 'wp-multisite-waas');
|
||||
|
||||
// translators: %s is the URL
|
||||
wp_die($upgrade_message, __('Limit Reached', 'wp-ultimo'), ['back_link' => true]);
|
||||
wp_die(esc_html($upgrade_message), esc_html__('Limit Reached', 'wp-multisite-waas'), ['back_link' => true]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -196,7 +196,7 @@ class Post_Type_Limits {
|
||||
public function limit_media($file) {
|
||||
|
||||
if ( ! wu_get_current_site()->get_limitations()->post_types->attachment->enabled) {
|
||||
$file['error'] = __('Your plan does not support media upload.', 'wp-ultimo');
|
||||
$file['error'] = __('Your plan does not support media upload.', 'wp-multisite-waas');
|
||||
|
||||
return $file;
|
||||
}
|
||||
@ -223,7 +223,7 @@ class Post_Type_Limits {
|
||||
if ($quota > 0 && $post_count >= $quota) {
|
||||
|
||||
// translators: %d is the number of images allowed.
|
||||
$file['error'] = sprintf(__('You reached your media upload limit of %d images. Upgrade your account to unlock more media uploads.', 'wp-ultimo'), $quota, '#');
|
||||
$file['error'] = sprintf(__('You reached your media upload limit of %d images. Upgrade your account to unlock more media uploads.', 'wp-multisite-waas'), $quota, '#');
|
||||
}
|
||||
|
||||
return $file;
|
||||
|
@ -126,7 +126,7 @@ class Theme_Limits {
|
||||
if ($theme_limitations->allowed($new_theme, 'not_available')) {
|
||||
$response = [
|
||||
'code' => 'not-available',
|
||||
'message' => __('This theme is not available on your current plan.', 'wp-ultimo'),
|
||||
'message' => __('This theme is not available on your current plan.', 'wp-multisite-waas'),
|
||||
];
|
||||
|
||||
wp_send_json($response, 'not-available');
|
||||
@ -168,7 +168,7 @@ class Theme_Limits {
|
||||
}
|
||||
|
||||
$upgrade_button = wu_generate_upgrade_to_unlock_button(
|
||||
__('Upgrade to unlock', 'wp-ultimo'),
|
||||
__('Upgrade to unlock', 'wp-multisite-waas'),
|
||||
[
|
||||
'module' => 'themes',
|
||||
'type' => 'EXTENSION',
|
||||
|
Reference in New Issue
Block a user