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:
@ -100,14 +100,14 @@ class Account_Summary_Element extends Base_Element {
|
||||
*
|
||||
* This is used on the Blocks list of Gutenberg.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('My Element', 'wp-ultimo').
|
||||
* e.g. return __('My Element', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return __('Account Summary', 'wp-ultimo');
|
||||
return __('Account Summary', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -116,14 +116,14 @@ class Account_Summary_Element extends Base_Element {
|
||||
* This is also used on the Gutenberg block list
|
||||
* to explain what this block is about.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-ultimo').
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
|
||||
return __('Adds a account summary block to the page.', 'wp-ultimo');
|
||||
return __('Adds a account summary block to the page.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -148,16 +148,16 @@ class Account_Summary_Element extends Base_Element {
|
||||
$fields = [];
|
||||
|
||||
$fields['header'] = [
|
||||
'title' => __('General', 'wp-ultimo'),
|
||||
'desc' => __('General', 'wp-ultimo'),
|
||||
'title' => __('General', 'wp-multisite-waas'),
|
||||
'desc' => __('General', 'wp-multisite-waas'),
|
||||
'type' => 'header',
|
||||
];
|
||||
|
||||
$fields['title'] = [
|
||||
'type' => 'text',
|
||||
'title' => __('Title', 'wp-ultimo'),
|
||||
'value' => __('About this Site', 'wp-ultimo'),
|
||||
'desc' => __('Leave blank to hide the title completely.', 'wp-ultimo'),
|
||||
'title' => __('Title', 'wp-multisite-waas'),
|
||||
'value' => __('About this Site', 'wp-multisite-waas'),
|
||||
'desc' => __('Leave blank to hide the title completely.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
];
|
||||
|
||||
@ -208,7 +208,7 @@ class Account_Summary_Element extends Base_Element {
|
||||
public function defaults() {
|
||||
|
||||
return [
|
||||
'title' => __('About this Site', 'wp-ultimo'),
|
||||
'title' => __('About this Site', 'wp-multisite-waas'),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ abstract class Base_Element {
|
||||
*
|
||||
* This is used on the Blocks list of Gutenberg.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('My Element', 'wp-ultimo').
|
||||
* e.g. return __('My Element', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
@ -133,7 +133,7 @@ abstract class Base_Element {
|
||||
* This is also used on the Gutenberg block list
|
||||
* to explain what this block is about.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-ultimo').
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
@ -237,11 +237,14 @@ abstract class Base_Element {
|
||||
|
||||
add_action('wu_element_preview', [$this, 'setup_preview']);
|
||||
|
||||
// Init should be the correct time to call this to avoid the deprecated notice from I18N.
|
||||
// But it doesn't work for some reason, fix later.
|
||||
// add_action('init', function () {
|
||||
do_action('wu_element_loaded', $this);
|
||||
// } );
|
||||
add_action(
|
||||
'init',
|
||||
function () {
|
||||
do_action('wu_element_loaded', $this);
|
||||
},
|
||||
5,
|
||||
0
|
||||
);
|
||||
|
||||
if ($this->public) {
|
||||
self::register_public_element($this);
|
||||
@ -608,16 +611,17 @@ abstract class Base_Element {
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param string $name The parameter name.
|
||||
* @param mixed $default The default value.
|
||||
* @param mixed $default_value The default value.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_pre_loaded_attribute($name, $default = false) {
|
||||
public function get_pre_loaded_attribute($name, $default_value = false) {
|
||||
|
||||
if (false === $this->pre_loaded_attributes || ! is_array($this->pre_loaded_attributes)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return wu_get_isset($this->pre_loaded_attributes, $name, $default);
|
||||
return wu_get_isset($this->pre_loaded_attributes, $name, $default_value);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -740,12 +744,12 @@ abstract class Base_Element {
|
||||
$fields['shortcode_result'] = [
|
||||
'type' => 'note',
|
||||
'wrapper_classes' => 'sm:wu-block',
|
||||
'desc' => '<div class="wu-w-full"><span class="wu-my-1 wu-text-2xs wu-uppercase wu-font-bold wu-block">' . __('Result', 'wp-ultimo') . '</span><pre v-html="shortcode" id="wu-shortcode" style="overflow-x: scroll !important;" class="wu-text-center wu-p-4 wu-m-0 wu-mt-2 wu-rounded wu-content-center wu-bg-gray-800 wu-text-white wu-font-mono wu-border wu-border-solid wu-border-gray-300 wu-max-h-screen wu-overflow-x-scroll"></pre></div>',
|
||||
'desc' => '<div class="wu-w-full"><span class="wu-my-1 wu-text-2xs wu-uppercase wu-font-bold wu-block">' . __('Result', 'wp-multisite-waas') . '</span><pre v-html="shortcode" id="wu-shortcode" style="overflow-x: scroll !important;" class="wu-text-center wu-p-4 wu-m-0 wu-mt-2 wu-rounded wu-content-center wu-bg-gray-800 wu-text-white wu-font-mono wu-border wu-border-solid wu-border-gray-300 wu-max-h-screen wu-overflow-x-scroll"></pre></div>',
|
||||
];
|
||||
|
||||
$fields['submit_copy'] = [
|
||||
'type' => 'submit',
|
||||
'title' => __('Copy Shortcode', 'wp-ultimo'),
|
||||
'title' => __('Copy Shortcode', 'wp-multisite-waas'),
|
||||
'value' => 'edit',
|
||||
'classes' => 'button button-primary wu-w-full wu-copy',
|
||||
'wrapper_classes' => 'wu-items-end',
|
||||
@ -794,8 +798,8 @@ abstract class Base_Element {
|
||||
|
||||
$fields['hide'] = [
|
||||
'type' => 'toggle',
|
||||
'title' => __('Hide Element', 'wp-ultimo'),
|
||||
'desc' => __('Be careful. Hiding an element from the account page might remove important functionality from your customers\' reach.', 'wp-ultimo'),
|
||||
'title' => __('Hide Element', 'wp-multisite-waas'),
|
||||
'desc' => __('Be careful. Hiding an element from the account page might remove important functionality from your customers\' reach.', 'wp-multisite-waas'),
|
||||
'value' => $this->hidden_by_default,
|
||||
'classes' => 'button button-primary wu-w-full',
|
||||
'wrapper_classes' => 'wu-items-end',
|
||||
@ -830,14 +834,14 @@ abstract class Base_Element {
|
||||
'fields' => [
|
||||
'restore' => [
|
||||
'type' => 'submit',
|
||||
'title' => __('Reset Settings', 'wp-ultimo'),
|
||||
'title' => __('Reset Settings', 'wp-multisite-waas'),
|
||||
'value' => 'edit',
|
||||
'classes' => 'button',
|
||||
'wrapper_classes' => 'wu-mb-0',
|
||||
],
|
||||
'submit' => [
|
||||
'type' => 'submit',
|
||||
'title' => __('Save Changes', 'wp-ultimo'),
|
||||
'title' => __('Save Changes', 'wp-multisite-waas'),
|
||||
'value' => 'edit',
|
||||
'classes' => 'button button-primary',
|
||||
'wrapper_classes' => 'wu-mb-0',
|
||||
@ -968,7 +972,6 @@ abstract class Base_Element {
|
||||
|
||||
if ( ! $this->should_display()) {
|
||||
return; // bail if the display was set to false.
|
||||
|
||||
}
|
||||
|
||||
$this->dependencies();
|
||||
@ -1049,7 +1052,7 @@ abstract class Base_Element {
|
||||
public function as_inline_content($screen_id, $hook = 'admin_notices', $atts = []): void {
|
||||
|
||||
if ( ! function_exists('get_current_screen')) {
|
||||
_doing_it_wrong(__METHOD__, esc_html__('An element can not be loaded as inline content unless the get_current_screen() function is already available.', 'wp-ultimo'), '2.0.0');
|
||||
_doing_it_wrong(__METHOD__, esc_html__('An element can not be loaded as inline content unless the get_current_screen() function is already available.', 'wp-multisite-waas'), '2.0.0');
|
||||
|
||||
return;
|
||||
}
|
||||
@ -1092,7 +1095,7 @@ abstract class Base_Element {
|
||||
|
||||
echo '<div class="wu-inline-widget-body ' . esc_attr($control_classes) . '">';
|
||||
|
||||
echo $this->display($atts);
|
||||
echo $this->display($atts); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
|
||||
echo '</div>';
|
||||
|
||||
@ -1171,9 +1174,9 @@ abstract class Base_Element {
|
||||
$this->get_title(),
|
||||
function () use ($atts, $control_classes) {
|
||||
|
||||
echo '<div class="wu-metabox-widget ' . $control_classes . '">';
|
||||
echo '<div class="wu-metabox-widget ' . esc_attr($control_classes) . '">';
|
||||
|
||||
echo $this->display($atts);
|
||||
echo $this->display($atts); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
|
||||
echo '</div>';
|
||||
|
||||
@ -1201,32 +1204,23 @@ abstract class Base_Element {
|
||||
$should_display = $this->should_display_customize_controls();
|
||||
|
||||
if ($should_display) {
|
||||
|
||||
// translators: %1$s is the URL to the customize modal. %2$s is the URL of the shortcode generation modal
|
||||
$message = __('<a class="wubox wu-no-underline" title="Customize" href="%1$s">Customize this element</a>, or <a class="wubox wu-no-underline" title="Shortcode" href="%2$s">generate a shortcode</a> to use it on the front-end!', 'wp-ultimo');
|
||||
|
||||
$message .= wu_tooltip(__('You are seeing this because you are a super admin', 'wp-ultimo'));
|
||||
|
||||
$link_shortcode = wu_get_form_url("shortcode_{$this->id}");
|
||||
$link_customize = wu_get_form_url("customize_{$this->id}");
|
||||
|
||||
$text = sprintf(
|
||||
$message,
|
||||
$link_customize,
|
||||
$link_shortcode
|
||||
);
|
||||
|
||||
$html = '
|
||||
?>
|
||||
<div class="wu-styling">
|
||||
<div class="wu-widget-inset">
|
||||
<div class="wubox wu-no-underline wu-p-4 wu-bg-gray-200 wu-block wu-mt-4 wu-text-center wu-text-sm wu-text-gray-600 wu-m-auto wu-border-solid wu-border-0 wu-border-t wu-border-gray-400">
|
||||
' . $text . '
|
||||
<a class="wubox wu-no-underline" title="Customize" href="<?php echo esc_attr(wu_get_form_url("shortcode_{$this->id}")); ?>">
|
||||
<?php esc_html_e('Customize this element', 'wp-multisite-waas'); ?>
|
||||
</a>
|
||||
<?php esc_html_e(', or'); ?>
|
||||
<a class="wubox wu-no-underline" title="Shortcode" href="<?php echo esc_attr(wu_get_form_url("customize_{$this->id}")); ?>">
|
||||
<?php esc_html_e('generate a shortcode', 'wp-multisite-waas'); ?>
|
||||
</a>
|
||||
<?php esc_html_e('to use it on the front-end!', 'wp-multisite-waas'); ?>
|
||||
<?php echo wu_tooltip(__('You are seeing this because you are a super admin', 'wp-multisite-waas')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
|
||||
echo $html;
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -114,14 +114,14 @@ class Billing_Info_Element extends Base_Element {
|
||||
*
|
||||
* This is used on the Blocks list of Gutenberg.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('My Element', 'wp-ultimo').
|
||||
* e.g. return __('My Element', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return __('Billing Information', 'wp-ultimo');
|
||||
return __('Billing Information', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -130,14 +130,14 @@ class Billing_Info_Element extends Base_Element {
|
||||
* This is also used on the Gutenberg block list
|
||||
* to explain what this block is about.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-ultimo').
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
|
||||
return __('Adds a checkout form block to the page.', 'wp-ultimo');
|
||||
return __('Adds a checkout form block to the page.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -162,16 +162,16 @@ class Billing_Info_Element extends Base_Element {
|
||||
$fields = [];
|
||||
|
||||
$fields['header'] = [
|
||||
'title' => __('General', 'wp-ultimo'),
|
||||
'desc' => __('General', 'wp-ultimo'),
|
||||
'title' => __('General', 'wp-multisite-waas'),
|
||||
'desc' => __('General', 'wp-multisite-waas'),
|
||||
'type' => 'header',
|
||||
];
|
||||
|
||||
$fields['title'] = [
|
||||
'type' => 'text',
|
||||
'title' => __('Title', 'wp-ultimo'),
|
||||
'value' => __('Billing Address', 'wp-ultimo'),
|
||||
'desc' => __('Leave blank to hide the title completely.', 'wp-ultimo'),
|
||||
'title' => __('Title', 'wp-multisite-waas'),
|
||||
'value' => __('Billing Address', 'wp-multisite-waas'),
|
||||
'desc' => __('Leave blank to hide the title completely.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
];
|
||||
|
||||
@ -223,7 +223,7 @@ class Billing_Info_Element extends Base_Element {
|
||||
public function defaults() {
|
||||
|
||||
return [
|
||||
'title' => __('Billing Address', 'wp-ultimo'),
|
||||
'title' => __('Billing Address', 'wp-multisite-waas'),
|
||||
];
|
||||
}
|
||||
|
||||
@ -325,8 +325,8 @@ class Billing_Info_Element extends Base_Element {
|
||||
$fields['billing-title'] = [
|
||||
'type' => 'header',
|
||||
'order' => 1,
|
||||
'title' => __('Your Address', 'wp-ultimo'),
|
||||
'desc' => __('Enter your billing address here. This info will be used on your invoices.', 'wp-ultimo'),
|
||||
'title' => __('Your Address', 'wp-multisite-waas'),
|
||||
'desc' => __('Enter your billing address here. This info will be used on your invoices.', 'wp-multisite-waas'),
|
||||
'wrapper_classes' => 'wu-col-span-2',
|
||||
];
|
||||
|
||||
@ -336,7 +336,7 @@ class Billing_Info_Element extends Base_Element {
|
||||
|
||||
$fields['submit'] = [
|
||||
'type' => 'submit',
|
||||
'title' => __('Save Changes', 'wp-ultimo'),
|
||||
'title' => __('Save Changes', 'wp-multisite-waas'),
|
||||
'value' => 'save',
|
||||
'classes' => 'button button-primary wu-w-full',
|
||||
'wrapper_classes' => 'wu-col-span-2',
|
||||
@ -375,7 +375,7 @@ class Billing_Info_Element extends Base_Element {
|
||||
$membership = wu_get_membership_by_hash(wu_request('membership'));
|
||||
|
||||
if ( ! $membership) {
|
||||
$error = new \WP_Error('membership-dont-exist', __('Something went wrong.', 'wp-ultimo'));
|
||||
$error = new \WP_Error('membership-dont-exist', __('Something went wrong.', 'wp-multisite-waas'));
|
||||
|
||||
wp_send_json_error($error);
|
||||
}
|
||||
|
@ -9,7 +9,6 @@
|
||||
|
||||
namespace WP_Ultimo\UI;
|
||||
|
||||
use WP_Ultimo\UI\Base_Element;
|
||||
use ScssPhp\ScssPhp\Compiler;
|
||||
use WP_Ultimo\Database\Memberships\Membership_Status;
|
||||
|
||||
@ -101,14 +100,14 @@ class Checkout_Element extends Base_Element {
|
||||
*
|
||||
* This is used on the Blocks list of Gutenberg.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('My Element', 'wp-ultimo').
|
||||
* e.g. return __('My Element', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return __('Checkout', 'wp-ultimo');
|
||||
return __('Checkout', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -117,14 +116,14 @@ class Checkout_Element extends Base_Element {
|
||||
* This is also used on the Gutenberg block list
|
||||
* to explain what this block is about.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-ultimo').
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
|
||||
return __('Adds a checkout form block to the page.', 'wp-ultimo');
|
||||
return __('Adds a checkout form block to the page.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -149,14 +148,14 @@ class Checkout_Element extends Base_Element {
|
||||
$fields = [];
|
||||
|
||||
$fields['header'] = [
|
||||
'title' => __('General', 'wp-ultimo'),
|
||||
'desc' => __('General', 'wp-ultimo'),
|
||||
'title' => __('General', 'wp-multisite-waas'),
|
||||
'desc' => __('General', 'wp-multisite-waas'),
|
||||
'type' => 'header',
|
||||
];
|
||||
|
||||
$fields['slug'] = [
|
||||
'title' => __('Slug', 'wp-ultimo'),
|
||||
'desc' => __('The checkout form slug.', 'wp-ultimo'),
|
||||
'title' => __('Slug', 'wp-multisite-waas'),
|
||||
'desc' => __('The checkout form slug.', 'wp-multisite-waas'),
|
||||
'type' => 'text',
|
||||
];
|
||||
|
||||
@ -266,7 +265,7 @@ class Checkout_Element extends Base_Element {
|
||||
}"
|
||||
)->getCss();
|
||||
|
||||
printf('<style>%s</style>', $custom_css);
|
||||
printf('<style>%s</style>', $custom_css); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
}
|
||||
|
||||
@ -316,7 +315,7 @@ class Checkout_Element extends Base_Element {
|
||||
/**
|
||||
* Allow developers bypass the output and set a new one
|
||||
*
|
||||
* @param string|boll $bypass If we should bypass the checkout form or a string to return instead of the form.
|
||||
* @param string|bool $bypass If we should bypass the checkout form or a string to return instead of the form.
|
||||
* @param array $atts Parameters of the checkout block/shortcode.
|
||||
*/
|
||||
$bypass = apply_filters('wu_bypass_checkout_form', false, $atts);
|
||||
@ -336,7 +335,7 @@ class Checkout_Element extends Base_Element {
|
||||
*/
|
||||
|
||||
// Translators: Placeholder receives the customer display name
|
||||
$message = sprintf(__('Hi %s. You have a pending payment for your membership!', 'wp-ultimo'), $customer->get_display_name());
|
||||
$message = sprintf(__('Hi %s. You have a pending payment for your membership!', 'wp-multisite-waas'), $customer->get_display_name());
|
||||
|
||||
$payment_url = add_query_arg(
|
||||
[
|
||||
@ -346,7 +345,7 @@ class Checkout_Element extends Base_Element {
|
||||
);
|
||||
|
||||
// Translators: The link to registration url with payment hash
|
||||
$message .= '<br>' . sprintf(__('Click <a href="%s">here</a> to pay.', 'wp-ultimo'), $payment_url);
|
||||
$message .= '<br>' . sprintf(__('Click <a href="%s">here</a> to pay.', 'wp-multisite-waas'), $payment_url);
|
||||
|
||||
$message = '<p>' . $message . '</p>';
|
||||
|
||||
@ -354,8 +353,8 @@ class Checkout_Element extends Base_Element {
|
||||
* Allow developers to change the message if membership have a pending payment
|
||||
*
|
||||
* @param string $message The HTML message to print in screen.
|
||||
* @param WP_Ultimo\Models\Membership $membership The membership in use.
|
||||
* @param WP_Ultimo\Models\Customer $customer The active customer in use.
|
||||
* @param \WP_Ultimo\Models\Membership $membership The membership in use.
|
||||
* @param \WP_Ultimo\Models\Customer $customer The active customer in use.
|
||||
*/
|
||||
return apply_filters('wu_checkout_pending_payment_error_message', $message, $membership, $customer);
|
||||
}
|
||||
@ -367,13 +366,13 @@ class Checkout_Element extends Base_Element {
|
||||
if ( ! $membership->is_active() && $membership->get_status() !== Membership_Status::TRIALING && in_array($atts['slug'], $membership_blocked_forms, true)) {
|
||||
|
||||
// Translators: Placeholder receives the customer display name
|
||||
$message = sprintf(__('Hi %s. You cannot take action on your membership while it is not active!', 'wp-ultimo'), $customer->get_display_name());
|
||||
$message = sprintf(__('Hi %s. You cannot take action on your membership while it is not active!', 'wp-multisite-waas'), $customer->get_display_name());
|
||||
|
||||
if ($membership->get_status() === Membership_Status::PENDING && $customer->get_email_verification() === 'pending') {
|
||||
/**
|
||||
* Enqueue thank you page scripts to handle resend email verification link
|
||||
*/
|
||||
wp_register_script('wu-thank-you', wu_get_asset('thank-you.js', 'js'), [], wu_get_version());
|
||||
wp_register_script('wu-thank-you', wu_get_asset('thank-you.js', 'js'), [], wu_get_version(), true);
|
||||
|
||||
wp_localize_script(
|
||||
'wu-thank-you',
|
||||
@ -383,17 +382,17 @@ class Checkout_Element extends Base_Element {
|
||||
'resend_verification_email_nonce' => wp_create_nonce('wu_resend_verification_email_nonce'),
|
||||
'membership_hash' => $membership->get_hash(),
|
||||
'i18n' => [
|
||||
'resending_verification_email' => __('Resending verification email...', 'wp-ultimo'),
|
||||
'email_sent' => __('Verification email sent!', 'wp-ultimo'),
|
||||
'resending_verification_email' => __('Resending verification email...', 'wp-multisite-waas'),
|
||||
'email_sent' => __('Verification email sent!', 'wp-multisite-waas'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
wp_enqueue_script('wu-thank-you');
|
||||
|
||||
$message .= '<p>' . __('Check your inbox and verify your email address.', 'wp-ultimo') . '</p>';
|
||||
$message .= '<p>' . __('Check your inbox and verify your email address.', 'wp-multisite-waas') . '</p>';
|
||||
$message .= '<span class="wu-styling">';
|
||||
$message .= sprintf('<a href="#" class="wu-mr-2 wu-resend-verification-email wu-no-underline button button-primary">%s</a>', __('Resend verification email', 'wp-ultimo'));
|
||||
$message .= sprintf('<a href="#" class="wu-mr-2 wu-resend-verification-email wu-no-underline button button-primary">%s</a>', __('Resend verification email', 'wp-multisite-waas'));
|
||||
$message .= '</span>';
|
||||
}
|
||||
|
||||
@ -401,8 +400,8 @@ class Checkout_Element extends Base_Element {
|
||||
* Allow developers to change the message if membership have a pending payment
|
||||
*
|
||||
* @param string $message The HTML message to print in screen.
|
||||
* @param WP_Ultimo\Models\Membership $membership The membership in use.
|
||||
* @param WP_Ultimo\Models\Customer $customer The active customer in use.
|
||||
* @param \WP_Ultimo\Models\Membership $membership The membership in use.
|
||||
* @param \WP_Ultimo\Models\Customer $customer The active customer in use.
|
||||
*/
|
||||
return apply_filters('wu_checkout_membership_status_error_message', $message, $membership, $customer);
|
||||
}
|
||||
@ -423,11 +422,11 @@ class Checkout_Element extends Base_Element {
|
||||
);
|
||||
|
||||
if ( ! in_array($slug, $allowed_forms, true) && ! wu_request('payment')) {
|
||||
$message = sprintf('<p>%s</p>', __('You already have a membership!', 'wp-ultimo'));
|
||||
$message = sprintf('<p>%s</p>', __('You already have a membership!', 'wp-multisite-waas'));
|
||||
|
||||
if (isset($published_sites[0])) {
|
||||
$account_link = get_admin_url($published_sites[0]->get_id(), 'admin.php?page=account');
|
||||
$button_text = __('Go to my account', 'wp-ultimo');
|
||||
$button_text = __('Go to my account', 'wp-multisite-waas');
|
||||
|
||||
$message .= "<p><a class=\"wu-no-underline button button-primary\" href=\"$account_link\">$button_text</a><p>";
|
||||
}
|
||||
@ -436,21 +435,21 @@ class Checkout_Element extends Base_Element {
|
||||
* Allow developers to change the message about the limitation of a single membership for customer.
|
||||
*
|
||||
* @param string $message The HTML message to print in screen.
|
||||
* @param WP_Ultimo\Models\Customer $customer The active customer in use.
|
||||
* @param \WP_Ultimo\Models\Customer $customer The active customer in use.
|
||||
*/
|
||||
return apply_filters('wu_checkout_single_membership_message', $message, $customer);
|
||||
}
|
||||
}
|
||||
|
||||
if ($membership && $membership->get_customer_id() !== $customer->get_id()) {
|
||||
$message = sprintf('<p>%s</p>', __('You are not allowed to change this membership!', 'wp-ultimo'));
|
||||
$message = sprintf('<p>%s</p>', __('You are not allowed to change this membership!', 'wp-multisite-waas'));
|
||||
|
||||
/**
|
||||
* Allow developers to change the message if customer is not part of the membership
|
||||
*
|
||||
* @param string $message The HTML message to print in screen.
|
||||
* @param WP_Ultimo\Models\Membership $membership The membership in use.
|
||||
* @param WP_Ultimo\Models\Customer $customer The active customer in use.
|
||||
* @param \WP_Ultimo\Models\Membership $membership The membership in use.
|
||||
* @param \WP_Ultimo\Models\Customer $customer The active customer in use.
|
||||
*/
|
||||
return apply_filters('wu_checkout_customer_error_message', $message, $membership, $customer);
|
||||
}
|
||||
@ -482,13 +481,13 @@ class Checkout_Element extends Base_Element {
|
||||
if ($used_limit >= $limit_max) {
|
||||
|
||||
// Translators: Placeholder receives the limit name
|
||||
$message = '<p>' . sprintf(__('You reached your membership %s limit!', 'wp-ultimo'), $limitation) . '</p>';
|
||||
$message = '<p>' . sprintf(__('You reached your membership %s limit!', 'wp-multisite-waas'), $limitation) . '</p>';
|
||||
|
||||
$message .= '<span class="wu-styling">';
|
||||
|
||||
if (wu_multiple_memberships_enabled()) {
|
||||
$register_page = wu_get_registration_url();
|
||||
$button_text = __('Buy a new membership', 'wp-ultimo');
|
||||
$button_text = __('Buy a new membership', 'wp-multisite-waas');
|
||||
|
||||
$message .= "<a class=\"wu-no-underline button button-primary wu-mr-2\" href=\"$register_page\">$button_text</a>";
|
||||
}
|
||||
@ -514,7 +513,7 @@ class Checkout_Element extends Base_Element {
|
||||
}
|
||||
|
||||
if ( ! empty($update_link)) {
|
||||
$button_text = __('Upgrade your account', 'wp-ultimo');
|
||||
$button_text = __('Upgrade your account', 'wp-multisite-waas');
|
||||
|
||||
$message .= "<a class=\"wu-no-underline button button-primary wu-mr-2\" href=\"$update_link\">$button_text</a>";
|
||||
}
|
||||
@ -529,8 +528,8 @@ class Checkout_Element extends Base_Element {
|
||||
* @param string $limitation The limitation name.
|
||||
* @param int $limit_max The allowed limit.
|
||||
* @param int $used_limit The limit used in membership.
|
||||
* @param WP_Ultimo\Models\Membership $membership The membership in use.
|
||||
* @param WP_Ultimo\Models\Customer $customer The active customer in use.
|
||||
* @param \WP_Ultimo\Models\Membership $membership The membership in use.
|
||||
* @param \WP_Ultimo\Models\Customer $customer The active customer in use.
|
||||
*/
|
||||
return apply_filters('wu_checkout_membership_limit_message', $message, $limitation, $limit_max, $used_limit, $membership, $customer);
|
||||
}
|
||||
@ -538,12 +537,12 @@ class Checkout_Element extends Base_Element {
|
||||
}
|
||||
} elseif ( ! $customer && 'wu-finish-checkout' === $slug) {
|
||||
if (is_user_logged_in()) {
|
||||
$message = __('You need to be the account owner to complete this payment.', 'wp-ultimo');
|
||||
$message = __('You need to be the account owner to complete this payment.', 'wp-multisite-waas');
|
||||
} else {
|
||||
$message = __('You need to be logged in to complete a payment', 'wp-ultimo');
|
||||
$message = __('You need to be logged in to complete a payment', 'wp-multisite-waas');
|
||||
|
||||
// Translators: The link to login url with redirect_to url
|
||||
$message .= '<br>' . sprintf(__('Click <a href="%s">here</a> sign in.', 'wp-ultimo'), wp_login_url(wu_get_current_url()));
|
||||
$message .= '<br>' . sprintf(__('Click <a href="%s">here</a> sign in.', 'wp-multisite-waas'), wp_login_url(wu_get_current_url()));
|
||||
}
|
||||
|
||||
$message = '<p>' . $message . '</p>';
|
||||
@ -561,24 +560,24 @@ class Checkout_Element extends Base_Element {
|
||||
if ( ! $checkout_form) {
|
||||
|
||||
// translators: %s is the id of the form. e.g. main-form
|
||||
return sprintf(__('Checkout form %s not found.', 'wp-ultimo'), $slug);
|
||||
return sprintf(__('Checkout form %s not found.', 'wp-multisite-waas'), $slug);
|
||||
}
|
||||
|
||||
if ($checkout_form->get_field_count() === 0) {
|
||||
|
||||
// translators: %s is the id of the form. e.g. main-form
|
||||
return sprintf(__('Checkout form %s contains no fields.', 'wp-ultimo'), $slug);
|
||||
return sprintf(__('Checkout form %s contains no fields.', 'wp-multisite-waas'), $slug);
|
||||
}
|
||||
|
||||
if ( ! $checkout_form->is_active() || ! wu_get_setting('enable_registration')) {
|
||||
return sprintf('<p>%s</p>', __('Registration is not available at this time.', 'wp-ultimo'));
|
||||
if ( ! $checkout_form->is_active() || ! wu_get_setting('enable_registration', true)) {
|
||||
return sprintf('<p>%s</p>', __('Registration is not available at this time.', 'wp-multisite-waas'));
|
||||
}
|
||||
|
||||
if ($checkout_form->has_country_lock()) {
|
||||
$geolocation = \WP_Ultimo\Geolocation::geolocate_ip('', true);
|
||||
|
||||
if ( ! in_array($geolocation['country'], $checkout_form->get_allowed_countries(), true)) {
|
||||
return sprintf('<p>%s</p>', __('Registration is closed for your location.', 'wp-ultimo'));
|
||||
return sprintf('<p>%s</p>', __('Registration is closed for your location.', 'wp-multisite-waas'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -683,7 +682,7 @@ class Checkout_Element extends Base_Element {
|
||||
window.wu_auto_submittable_field = %s;
|
||||
|
||||
',
|
||||
json_encode($auto_submittable_field)
|
||||
wp_json_encode($auto_submittable_field)
|
||||
),
|
||||
'after'
|
||||
);
|
||||
|
@ -123,14 +123,14 @@ class Current_Membership_Element extends Base_Element {
|
||||
*
|
||||
* This is used on the Blocks list of Gutenberg.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('My Element', 'wp-ultimo').
|
||||
* e.g. return __('My Element', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return __('Membership', 'wp-ultimo');
|
||||
return __('Membership', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -139,14 +139,14 @@ class Current_Membership_Element extends Base_Element {
|
||||
* This is also used on the Gutenberg block list
|
||||
* to explain what this block is about.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-ultimo').
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
|
||||
return __('Adds a checkout form block to the page.', 'wp-ultimo');
|
||||
return __('Adds a checkout form block to the page.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -171,31 +171,31 @@ class Current_Membership_Element extends Base_Element {
|
||||
$fields = [];
|
||||
|
||||
$fields['header'] = [
|
||||
'title' => __('General', 'wp-ultimo'),
|
||||
'desc' => __('General', 'wp-ultimo'),
|
||||
'title' => __('General', 'wp-multisite-waas'),
|
||||
'desc' => __('General', 'wp-multisite-waas'),
|
||||
'type' => 'header',
|
||||
];
|
||||
|
||||
$fields['title'] = [
|
||||
'type' => 'text',
|
||||
'title' => __('Title', 'wp-ultimo'),
|
||||
'value' => __('Your Membership', 'wp-ultimo'),
|
||||
'desc' => __('Leave blank to hide the title completely.', 'wp-ultimo'),
|
||||
'title' => __('Title', 'wp-multisite-waas'),
|
||||
'value' => __('Your Membership', 'wp-multisite-waas'),
|
||||
'desc' => __('Leave blank to hide the title completely.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
];
|
||||
|
||||
$fields['display_images'] = [
|
||||
'type' => 'toggle',
|
||||
'title' => __('Display Product Images?', 'wp-ultimo'),
|
||||
'desc' => __('Toggle to show/hide the product images on the element.', 'wp-ultimo'),
|
||||
'title' => __('Display Product Images?', 'wp-multisite-waas'),
|
||||
'desc' => __('Toggle to show/hide the product images on the element.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'value' => 1,
|
||||
];
|
||||
|
||||
$fields['columns'] = [
|
||||
'type' => 'number',
|
||||
'title' => __('Columns', 'wp-ultimo'),
|
||||
'desc' => __('How many columns to use.', 'wp-ultimo'),
|
||||
'title' => __('Columns', 'wp-multisite-waas'),
|
||||
'desc' => __('How many columns to use.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'value' => 2,
|
||||
'min' => 1,
|
||||
@ -250,7 +250,7 @@ class Current_Membership_Element extends Base_Element {
|
||||
public function defaults() {
|
||||
|
||||
return [
|
||||
'title' => __('Your Membership', 'wp-ultimo'),
|
||||
'title' => __('Your Membership', 'wp-multisite-waas'),
|
||||
'display_images' => 1,
|
||||
'columns' => 2,
|
||||
];
|
||||
@ -370,19 +370,19 @@ class Current_Membership_Element extends Base_Element {
|
||||
$error = '';
|
||||
|
||||
if ( ! $membership) {
|
||||
$error = __('Membership not selected.', 'wp-ultimo');
|
||||
$error = __('Membership not selected.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
$product = wu_get_product_by_slug(wu_request('product'));
|
||||
|
||||
if ( ! $product) {
|
||||
$error = __('Product not selected.', 'wp-ultimo');
|
||||
$error = __('Product not selected.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
$customer = wu_get_current_customer();
|
||||
|
||||
if (empty($error) && ! is_super_admin() && (! $customer || $customer->get_id() !== $membership->get_customer_id())) {
|
||||
$error = __('You are not allowed to do this.', 'wp-ultimo');
|
||||
$error = __('You are not allowed to do this.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
if ( ! empty($error)) {
|
||||
@ -439,7 +439,7 @@ class Current_Membership_Element extends Base_Element {
|
||||
],
|
||||
'quantity' => [
|
||||
'type' => 'number',
|
||||
'title' => __('Quantity to Cancel', 'wp-ultimo'),
|
||||
'title' => __('Quantity to Cancel', 'wp-multisite-waas'),
|
||||
'value' => 1,
|
||||
'placeholder' => 1,
|
||||
'wrapper_classes' => 'wu-w-1/2',
|
||||
@ -455,8 +455,8 @@ class Current_Membership_Element extends Base_Element {
|
||||
],
|
||||
'confirm' => [
|
||||
'type' => 'toggle',
|
||||
'title' => __('Confirm Product Cancellation', 'wp-ultimo'),
|
||||
'desc' => __('This action can not be undone.', 'wp-ultimo'),
|
||||
'title' => __('Confirm Product Cancellation', 'wp-multisite-waas'),
|
||||
'desc' => __('This action can not be undone.', 'wp-multisite-waas'),
|
||||
'html_attr' => [
|
||||
'v-model' => 'confirmed',
|
||||
],
|
||||
@ -468,8 +468,8 @@ class Current_Membership_Element extends Base_Element {
|
||||
],
|
||||
'submit_button' => [
|
||||
'type' => 'submit',
|
||||
'title' => __('Cancel Product Subscription', 'wp-ultimo'),
|
||||
'placeholder' => __('Cancel Product Subscription', 'wp-ultimo'),
|
||||
'title' => __('Cancel Product Subscription', 'wp-multisite-waas'),
|
||||
'placeholder' => __('Cancel Product Subscription', 'wp-multisite-waas'),
|
||||
'value' => 'save',
|
||||
'classes' => 'wu-w-full button button-primary',
|
||||
'wrapper_classes' => 'wu-items-end',
|
||||
@ -513,7 +513,7 @@ class Current_Membership_Element extends Base_Element {
|
||||
public function handle_edit_membership_product_modal(): void {
|
||||
|
||||
if ( ! wu_request('confirm')) {
|
||||
$error = new \WP_Error('not-confirmed', __('Please confirm the cancellation.', 'wp-ultimo'));
|
||||
$error = new \WP_Error('not-confirmed', __('Please confirm the cancellation.', 'wp-multisite-waas'));
|
||||
|
||||
wp_send_json_error($error);
|
||||
}
|
||||
@ -521,7 +521,7 @@ class Current_Membership_Element extends Base_Element {
|
||||
$membership = wu_get_membership_by_hash(wu_request('membership'));
|
||||
|
||||
if ( ! $membership) {
|
||||
$error = new \WP_Error('membership-not-found', __('Membership not found.', 'wp-ultimo'));
|
||||
$error = new \WP_Error('membership-not-found', __('Membership not found.', 'wp-multisite-waas'));
|
||||
|
||||
wp_send_json_error($error);
|
||||
}
|
||||
@ -529,7 +529,7 @@ class Current_Membership_Element extends Base_Element {
|
||||
$product = wu_get_product_by_slug(wu_request('product'));
|
||||
|
||||
if ( ! $product) {
|
||||
$error = new \WP_Error('product-not-found', __('Product not found.', 'wp-ultimo'));
|
||||
$error = new \WP_Error('product-not-found', __('Product not found.', 'wp-multisite-waas'));
|
||||
|
||||
wp_send_json_error($error);
|
||||
}
|
||||
@ -537,7 +537,7 @@ class Current_Membership_Element extends Base_Element {
|
||||
$customer = wu_get_current_customer();
|
||||
|
||||
if ( ! is_super_admin() && (! $customer || $customer->get_id() !== $membership->get_customer_id())) {
|
||||
$error = __('You are not allowed to do this.', 'wp-ultimo');
|
||||
$error = __('You are not allowed to do this.', 'wp-multisite-waas');
|
||||
|
||||
wp_send_json_error($error);
|
||||
}
|
||||
@ -587,7 +587,7 @@ class Current_Membership_Element extends Base_Element {
|
||||
$removed_quantity = $quantity + $existing_difference;
|
||||
|
||||
// translators: %1$s is the quantity removed, %2$s is the product name.
|
||||
$description = sprintf(__('remove %1$s %2$s from membership', 'wp-ultimo'), $removed_quantity, $product->get_name());
|
||||
$description = sprintf(__('remove %1$s %2$s from membership', 'wp-multisite-waas'), $removed_quantity, $product->get_name());
|
||||
|
||||
$cart->set_cart_descriptor($description);
|
||||
|
||||
|
@ -9,8 +9,6 @@
|
||||
|
||||
namespace WP_Ultimo\UI;
|
||||
|
||||
use WP_Ultimo\UI\Base_Element;
|
||||
|
||||
// Exit if accessed directly
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@ -103,14 +101,14 @@ class Current_Site_Element extends Base_Element {
|
||||
*
|
||||
* This is used on the Blocks list of Gutenberg.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('My Element', 'wp-ultimo').
|
||||
* e.g. return __('My Element', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return __('Site', 'wp-ultimo');
|
||||
return __('Site', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -119,14 +117,14 @@ class Current_Site_Element extends Base_Element {
|
||||
* This is also used on the Gutenberg block list
|
||||
* to explain what this block is about.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-ultimo').
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
|
||||
return __('Adds a block to display the current site being managed.', 'wp-ultimo');
|
||||
return __('Adds a block to display the current site being managed.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -151,15 +149,15 @@ class Current_Site_Element extends Base_Element {
|
||||
$fields = [];
|
||||
|
||||
$fields['header'] = [
|
||||
'title' => __('General', 'wp-ultimo'),
|
||||
'desc' => __('General', 'wp-ultimo'),
|
||||
'title' => __('General', 'wp-multisite-waas'),
|
||||
'desc' => __('General', 'wp-multisite-waas'),
|
||||
'type' => 'header',
|
||||
];
|
||||
|
||||
$fields['display_breadcrumbs'] = [
|
||||
'type' => 'toggle',
|
||||
'title' => __('Display Breadcrumbs?', 'wp-ultimo'),
|
||||
'desc' => __('Toggle to show/hide the breadcrumbs block.', 'wp-ultimo'),
|
||||
'title' => __('Display Breadcrumbs?', 'wp-multisite-waas'),
|
||||
'desc' => __('Toggle to show/hide the breadcrumbs block.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'value' => 1,
|
||||
];
|
||||
@ -172,7 +170,7 @@ class Current_Site_Element extends Base_Element {
|
||||
|
||||
$pages = $pages ?: [];
|
||||
|
||||
$pages_list = [0 => __('Current Page', 'wp-ultimo')];
|
||||
$pages_list = [0 => __('Current Page', 'wp-multisite-waas')];
|
||||
|
||||
foreach ($pages as $page) {
|
||||
$pages_list[ $page->ID ] = $page->post_title;
|
||||
@ -180,31 +178,31 @@ class Current_Site_Element extends Base_Element {
|
||||
|
||||
$fields['breadcrumbs_my_sites_page'] = [
|
||||
'type' => 'select',
|
||||
'title' => __('My Sites Page', 'wp-ultimo'),
|
||||
'title' => __('My Sites Page', 'wp-multisite-waas'),
|
||||
'value' => 0,
|
||||
'desc' => __('The page with the customer sites list.', 'wp-ultimo'),
|
||||
'desc' => __('The page with the customer sites list.', 'wp-multisite-waas'),
|
||||
'options' => $pages_list,
|
||||
];
|
||||
|
||||
$fields['display_description'] = [
|
||||
'type' => 'toggle',
|
||||
'title' => __('Display Site Description?', 'wp-ultimo'),
|
||||
'desc' => __('Toggle to show/hide the site description on the element.', 'wp-ultimo'),
|
||||
'title' => __('Display Site Description?', 'wp-multisite-waas'),
|
||||
'desc' => __('Toggle to show/hide the site description on the element.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'value' => 0,
|
||||
];
|
||||
|
||||
$fields['display_image'] = [
|
||||
'type' => 'toggle',
|
||||
'title' => __('Display Site Screenshot?', 'wp-ultimo'),
|
||||
'desc' => __('Toggle to show/hide the site screenshots on the element.', 'wp-ultimo'),
|
||||
'title' => __('Display Site Screenshot?', 'wp-multisite-waas'),
|
||||
'desc' => __('Toggle to show/hide the site screenshots on the element.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'value' => 1,
|
||||
];
|
||||
|
||||
$fields['screenshot_size'] = [
|
||||
'type' => 'number',
|
||||
'title' => __('Screenshot Size', 'wp-ultimo'),
|
||||
'title' => __('Screenshot Size', 'wp-multisite-waas'),
|
||||
'desc' => '',
|
||||
'tooltip' => '',
|
||||
'value' => 200,
|
||||
@ -217,10 +215,10 @@ class Current_Site_Element extends Base_Element {
|
||||
|
||||
$fields['screenshot_position'] = [
|
||||
'type' => 'select',
|
||||
'title' => __('Screenshot Position', 'wp-ultimo'),
|
||||
'title' => __('Screenshot Position', 'wp-multisite-waas'),
|
||||
'options' => [
|
||||
'right' => __('Right', 'wp-ultimo'),
|
||||
'left' => __('Left', 'wp-ultimo'),
|
||||
'right' => __('Right', 'wp-multisite-waas'),
|
||||
'left' => __('Left', 'wp-multisite-waas'),
|
||||
],
|
||||
'desc' => '',
|
||||
'tooltip' => '',
|
||||
@ -232,8 +230,8 @@ class Current_Site_Element extends Base_Element {
|
||||
|
||||
$fields['show_admin_link'] = [
|
||||
'type' => 'toggle',
|
||||
'title' => __('Show Admin Link?', 'wp-ultimo'),
|
||||
'desc' => __('Toggle to show/hide the WP admin link on the element.', 'wp-ultimo'),
|
||||
'title' => __('Show Admin Link?', 'wp-multisite-waas'),
|
||||
'desc' => __('Toggle to show/hide the WP admin link on the element.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'value' => 1,
|
||||
];
|
||||
@ -356,13 +354,13 @@ class Current_Site_Element extends Base_Element {
|
||||
|
||||
$actions = [
|
||||
'visit_site' => [
|
||||
'label' => __('Visit Site', 'wp-ultimo'),
|
||||
'label' => __('Visit Site', 'wp-multisite-waas'),
|
||||
'icon_classes' => 'dashicons-wu-browser wu-align-text-bottom',
|
||||
'classes' => '',
|
||||
'href' => $this->site->get_active_site_url(),
|
||||
],
|
||||
'edit_site' => [
|
||||
'label' => __('Edit Site', 'wp-ultimo'),
|
||||
'label' => __('Edit Site', 'wp-multisite-waas'),
|
||||
'icon_classes' => 'dashicons-wu-edit wu-align-text-bottom',
|
||||
'classes' => 'wubox',
|
||||
'href' => wu_get_form_url(
|
||||
@ -376,7 +374,7 @@ class Current_Site_Element extends Base_Element {
|
||||
|
||||
if ($atts['show_admin_link']) {
|
||||
$actions['site_admin'] = [
|
||||
'label' => __('Admin Panel', 'wp-ultimo'),
|
||||
'label' => __('Admin Panel', 'wp-multisite-waas'),
|
||||
'icon_classes' => 'dashicons-wu-grid wu-align-text-bottom',
|
||||
'classes' => '',
|
||||
'href' => get_admin_url($this->site->get_id()),
|
||||
@ -413,8 +411,8 @@ class Current_Site_Element extends Base_Element {
|
||||
$fields = [
|
||||
'site_title' => [
|
||||
'type' => 'text',
|
||||
'title' => __('Site Title', 'wp-ultimo'),
|
||||
'placeholder' => __('e.g. My Awesome Site', 'wp-ultimo'),
|
||||
'title' => __('Site Title', 'wp-multisite-waas'),
|
||||
'placeholder' => __('e.g. My Awesome Site', 'wp-multisite-waas'),
|
||||
'value' => $site->get_title(),
|
||||
'html_attr' => [
|
||||
'v-model' => 'site_title',
|
||||
@ -422,8 +420,8 @@ class Current_Site_Element extends Base_Element {
|
||||
],
|
||||
'site_description' => [
|
||||
'type' => 'textarea',
|
||||
'title' => __('Site Description', 'wp-ultimo'),
|
||||
'placeholder' => __('e.g. My Awesome Site description.', 'wp-ultimo'),
|
||||
'title' => __('Site Description', 'wp-multisite-waas'),
|
||||
'placeholder' => __('e.g. My Awesome Site description.', 'wp-multisite-waas'),
|
||||
'value' => $site->get_description(),
|
||||
'html_attr' => [
|
||||
'rows' => 5,
|
||||
@ -435,7 +433,7 @@ class Current_Site_Element extends Base_Element {
|
||||
],
|
||||
'submit_button' => [
|
||||
'type' => 'submit',
|
||||
'title' => __('Save Changes', 'wp-ultimo'),
|
||||
'title' => __('Save Changes', 'wp-multisite-waas'),
|
||||
'value' => 'save',
|
||||
'classes' => 'button button-primary wu-w-full',
|
||||
'wrapper_classes' => 'wu-items-end',
|
||||
@ -479,7 +477,7 @@ class Current_Site_Element extends Base_Element {
|
||||
$site = wu_get_site_by_hash(wu_request('site'));
|
||||
|
||||
if ( ! $site) {
|
||||
$error = new \WP_Error('site-dont-exist', __('Something went wrong.', 'wp-ultimo'));
|
||||
$error = new \WP_Error('site-dont-exist', __('Something went wrong.', 'wp-multisite-waas'));
|
||||
|
||||
wp_send_json_error($error);
|
||||
}
|
||||
@ -487,7 +485,7 @@ class Current_Site_Element extends Base_Element {
|
||||
$new_title = wu_request('site_title');
|
||||
|
||||
if ( ! $new_title) {
|
||||
$error = new \WP_Error('title_empty', __('Site title can not be empty.', 'wp-ultimo'));
|
||||
$error = new \WP_Error('title_empty', __('Site title can not be empty.', 'wp-multisite-waas'));
|
||||
|
||||
wp_send_json_error($error);
|
||||
}
|
||||
|
@ -87,14 +87,14 @@ class Domain_Mapping_Element extends Base_Element {
|
||||
*
|
||||
* This is used on the Blocks list of Gutenberg.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('My Element', 'wp-ultimo').
|
||||
* e.g. return __('My Element', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return __('Domains', 'wp-ultimo');
|
||||
return __('Domains', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -103,14 +103,14 @@ class Domain_Mapping_Element extends Base_Element {
|
||||
* This is also used on the Gutenberg block list
|
||||
* to explain what this block is about.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-ultimo').
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
|
||||
return __('Adds the site\'s domains block.', 'wp-ultimo');
|
||||
return __('Adds the site\'s domains block.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -135,16 +135,16 @@ class Domain_Mapping_Element extends Base_Element {
|
||||
$fields = [];
|
||||
|
||||
$fields['header'] = [
|
||||
'title' => __('General', 'wp-ultimo'),
|
||||
'desc' => __('General', 'wp-ultimo'),
|
||||
'title' => __('General', 'wp-multisite-waas'),
|
||||
'desc' => __('General', 'wp-multisite-waas'),
|
||||
'type' => 'header',
|
||||
];
|
||||
|
||||
$fields['title'] = [
|
||||
'type' => 'text',
|
||||
'title' => __('Title', 'wp-ultimo'),
|
||||
'value' => __('Domains', 'wp-ultimo'),
|
||||
'desc' => __('Leave blank to hide the title completely.', 'wp-ultimo'),
|
||||
'title' => __('Title', 'wp-multisite-waas'),
|
||||
'value' => __('Domains', 'wp-multisite-waas'),
|
||||
'desc' => __('Leave blank to hide the title completely.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
];
|
||||
|
||||
@ -194,7 +194,7 @@ class Domain_Mapping_Element extends Base_Element {
|
||||
public function defaults() {
|
||||
|
||||
return [
|
||||
'title' => __('Domains', 'wp-ultimo'),
|
||||
'title' => __('Domains', 'wp-multisite-waas'),
|
||||
];
|
||||
}
|
||||
|
||||
@ -291,7 +291,7 @@ class Domain_Mapping_Element extends Base_Element {
|
||||
$fields = [
|
||||
'instructions_note' => [
|
||||
'type' => 'note',
|
||||
'desc' => sprintf('<a href="#" class="wu-no-underline" v-on:click.prevent="ready = false">%s</a>', __('← Back to the Instructions', 'wp-ultimo')),
|
||||
'desc' => sprintf('<a href="#" class="wu-no-underline" v-on:click.prevent="ready = false">%s</a>', __('← Back to the Instructions', 'wp-multisite-waas')),
|
||||
'wrapper_html_attr' => [
|
||||
'v-if' => 'ready',
|
||||
'v-cloak' => '1',
|
||||
@ -300,7 +300,7 @@ class Domain_Mapping_Element extends Base_Element {
|
||||
'instructions' => [
|
||||
'type' => 'text-display',
|
||||
'copy' => false,
|
||||
'title' => __('Instructions', 'wp-ultimo'),
|
||||
'title' => __('Instructions', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'display_value' => sprintf('<div class="wu--mt-2 wu--mb-2">%s</div>', wpautop($instructions)),
|
||||
'wrapper_html_attr' => [
|
||||
@ -310,7 +310,7 @@ class Domain_Mapping_Element extends Base_Element {
|
||||
],
|
||||
'ready' => [
|
||||
'type' => 'submit',
|
||||
'title' => __('Next Step →', 'wp-ultimo'),
|
||||
'title' => __('Next Step →', 'wp-multisite-waas'),
|
||||
'value' => 'save',
|
||||
'classes' => 'button button-primary wu-w-full',
|
||||
'wrapper_classes' => 'wu-items-end',
|
||||
@ -328,8 +328,8 @@ class Domain_Mapping_Element extends Base_Element {
|
||||
],
|
||||
'domain' => [
|
||||
'type' => 'text',
|
||||
'title' => __('Domain', 'wp-ultimo'),
|
||||
'placeholder' => __('mydomain.com', 'wp-ultimo'),
|
||||
'title' => __('Domain', 'wp-multisite-waas'),
|
||||
'placeholder' => __('mydomain.com', 'wp-multisite-waas'),
|
||||
'wrapper_html_attr' => [
|
||||
'v-show' => 'ready',
|
||||
'v-cloak' => 1,
|
||||
@ -337,8 +337,8 @@ class Domain_Mapping_Element extends Base_Element {
|
||||
],
|
||||
'primary_domain' => [
|
||||
'type' => 'toggle',
|
||||
'title' => __('Primary Domain', 'wp-ultimo'),
|
||||
'desc' => __('Check to set this domain as the primary', 'wp-ultimo'),
|
||||
'title' => __('Primary Domain', 'wp-multisite-waas'),
|
||||
'desc' => __('Check to set this domain as the primary', 'wp-multisite-waas'),
|
||||
'html_attr' => [
|
||||
'v-model' => 'primary_domain',
|
||||
],
|
||||
@ -349,7 +349,7 @@ class Domain_Mapping_Element extends Base_Element {
|
||||
],
|
||||
'primary_note' => [
|
||||
'type' => 'note',
|
||||
'desc' => __('By making this the primary domain, we will convert the previous primary domain for this site, if one exists, into an alias domain.', 'wp-ultimo'),
|
||||
'desc' => __('By making this the primary domain, we will convert the previous primary domain for this site, if one exists, into an alias domain.', 'wp-multisite-waas'),
|
||||
'wrapper_html_attr' => [
|
||||
'v-if' => "require('primary_domain', true) && ready",
|
||||
'v-cloak' => 1,
|
||||
@ -357,7 +357,7 @@ class Domain_Mapping_Element extends Base_Element {
|
||||
],
|
||||
'submit_button_new' => [
|
||||
'type' => 'submit',
|
||||
'title' => __('Add Domain', 'wp-ultimo'),
|
||||
'title' => __('Add Domain', 'wp-multisite-waas'),
|
||||
'value' => 'save',
|
||||
'classes' => 'button button-primary wu-w-full',
|
||||
'wrapper_classes' => 'wu-items-end',
|
||||
@ -377,7 +377,7 @@ class Domain_Mapping_Element extends Base_Element {
|
||||
'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(
|
||||
[
|
||||
'ready' => 0,
|
||||
'primary_domain' => false,
|
||||
@ -406,7 +406,7 @@ class Domain_Mapping_Element extends Base_Element {
|
||||
|
||||
if ( ! is_super_admin() && (! $current_site || $current_site->get_customer()->get_user_id() !== $current_user_id)) {
|
||||
wp_send_json_error(
|
||||
new \WP_Error('no-permissions', __('You do not have permissions to perform this action.', 'wp-ultimo'))
|
||||
new \WP_Error('no-permissions', __('You do not have permissions to perform this action.', 'wp-multisite-waas'))
|
||||
);
|
||||
|
||||
exit;
|
||||
@ -470,8 +470,8 @@ class Domain_Mapping_Element extends Base_Element {
|
||||
$fields = [
|
||||
'confirm' => [
|
||||
'type' => 'toggle',
|
||||
'title' => __('Confirm Deletion', 'wp-ultimo'),
|
||||
'desc' => __('This action can not be undone.', 'wp-ultimo'),
|
||||
'title' => __('Confirm Deletion', 'wp-multisite-waas'),
|
||||
'desc' => __('This action can not be undone.', 'wp-multisite-waas'),
|
||||
'html_attr' => [
|
||||
'v-model' => 'confirmed',
|
||||
],
|
||||
@ -482,8 +482,8 @@ class Domain_Mapping_Element extends Base_Element {
|
||||
],
|
||||
'submit_button' => [
|
||||
'type' => 'submit',
|
||||
'title' => __('Delete', 'wp-ultimo'),
|
||||
'placeholder' => __('Delete', 'wp-ultimo'),
|
||||
'title' => __('Delete', 'wp-multisite-waas'),
|
||||
'placeholder' => __('Delete', 'wp-multisite-waas'),
|
||||
'value' => 'save',
|
||||
'classes' => 'button button-primary wu-w-full',
|
||||
'wrapper_classes' => 'wu-items-end',
|
||||
@ -502,7 +502,7 @@ class Domain_Mapping_Element extends Base_Element {
|
||||
'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' => 'user_delete_domain_modal',
|
||||
'data-state' => json_encode(
|
||||
'data-state' => wp_json_encode(
|
||||
[
|
||||
'confirmed' => false,
|
||||
]
|
||||
@ -554,8 +554,8 @@ class Domain_Mapping_Element extends Base_Element {
|
||||
$fields = [
|
||||
'confirm' => [
|
||||
'type' => 'toggle',
|
||||
'title' => __('Confirm Action', 'wp-ultimo'),
|
||||
'desc' => __('This action will also convert the previous primary domain (if any) to an alias to prevent unexpected behavior.', 'wp-ultimo'),
|
||||
'title' => __('Confirm Action', 'wp-multisite-waas'),
|
||||
'desc' => __('This action will also convert the previous primary domain (if any) to an alias to prevent unexpected behavior.', 'wp-multisite-waas'),
|
||||
'html_attr' => [
|
||||
'v-model' => 'confirmed',
|
||||
],
|
||||
@ -566,8 +566,8 @@ class Domain_Mapping_Element extends Base_Element {
|
||||
],
|
||||
'submit_button' => [
|
||||
'type' => 'submit',
|
||||
'title' => __('Make it Primary', 'wp-ultimo'),
|
||||
'placeholder' => __('Make it Primary', 'wp-ultimo'),
|
||||
'title' => __('Make it Primary', 'wp-multisite-waas'),
|
||||
'placeholder' => __('Make it Primary', 'wp-multisite-waas'),
|
||||
'value' => 'save',
|
||||
'classes' => 'button button-primary wu-w-full',
|
||||
'wrapper_classes' => 'wu-items-end',
|
||||
@ -586,7 +586,7 @@ class Domain_Mapping_Element extends Base_Element {
|
||||
'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' => 'user_delete_domain_modal',
|
||||
'data-state' => json_encode(
|
||||
'data-state' => wp_json_encode(
|
||||
[
|
||||
'confirmed' => false,
|
||||
]
|
||||
@ -642,7 +642,7 @@ class Domain_Mapping_Element extends Base_Element {
|
||||
);
|
||||
}
|
||||
|
||||
wp_send_json_error(new \WP_Error('error', __('Something wrong happenned.', 'wp-ultimo')));
|
||||
wp_send_json_error(new \WP_Error('error', __('Something wrong happenned.', 'wp-multisite-waas')));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -712,12 +712,12 @@ class Domain_Mapping_Element extends Base_Element {
|
||||
|
||||
$secure = 'dashicons-wu-lock-open';
|
||||
|
||||
$secure_message = __('Domain not secured with HTTPS', 'wp-ultimo');
|
||||
$secure_message = __('Domain not secured with HTTPS', 'wp-multisite-waas');
|
||||
|
||||
if ($domain->is_secure()) {
|
||||
$secure = 'dashicons-wu-lock wu-text-green-500';
|
||||
|
||||
$secure_message = __('Domain secured with HTTPS', 'wp-ultimo');
|
||||
$secure_message = __('Domain secured with HTTPS', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
$url_atts = [
|
||||
@ -749,7 +749,7 @@ class Domain_Mapping_Element extends Base_Element {
|
||||
$other_atts = [
|
||||
'domains' => $domains,
|
||||
'modal' => [
|
||||
'label' => __('Add Domain', 'wp-ultimo'),
|
||||
'label' => __('Add Domain', 'wp-multisite-waas'),
|
||||
'icon' => 'wu-circle-with-plus',
|
||||
'classes' => 'wubox',
|
||||
'url' => wu_get_form_url('user_add_new_domain', $url_atts),
|
||||
|
@ -76,14 +76,14 @@ class Invoices_Element extends Base_Element {
|
||||
*
|
||||
* This is used on the Blocks list of Gutenberg.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('My Element', 'wp-ultimo').
|
||||
* e.g. return __('My Element', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return __('Invoices', 'wp-ultimo');
|
||||
return __('Invoices', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -92,14 +92,14 @@ class Invoices_Element extends Base_Element {
|
||||
* This is also used on the Gutenberg block list
|
||||
* to explain what this block is about.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-ultimo').
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
|
||||
return __('Adds a checkout form block to the page.', 'wp-ultimo');
|
||||
return __('Adds a checkout form block to the page.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -124,24 +124,24 @@ class Invoices_Element extends Base_Element {
|
||||
$fields = [];
|
||||
|
||||
$fields['header'] = [
|
||||
'title' => __('General', 'wp-ultimo'),
|
||||
'desc' => __('General', 'wp-ultimo'),
|
||||
'title' => __('General', 'wp-multisite-waas'),
|
||||
'desc' => __('General', 'wp-multisite-waas'),
|
||||
'type' => 'header',
|
||||
];
|
||||
|
||||
$fields['title'] = [
|
||||
'type' => 'text',
|
||||
'title' => __('Title', 'wp-ultimo'),
|
||||
'value' => __('Invoices', 'wp-ultimo'),
|
||||
'desc' => __('Leave blank to hide the title completely.', 'wp-ultimo'),
|
||||
'title' => __('Title', 'wp-multisite-waas'),
|
||||
'value' => __('Invoices', 'wp-multisite-waas'),
|
||||
'desc' => __('Leave blank to hide the title completely.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
];
|
||||
|
||||
$fields['limit'] = [
|
||||
'type' => 'int',
|
||||
'title' => __('Limit', 'wp-ultimo'),
|
||||
'title' => __('Limit', 'wp-multisite-waas'),
|
||||
'value' => 10,
|
||||
'desc' => __('Limit the number of invoices to show.', 'wp-ultimo'),
|
||||
'desc' => __('Limit the number of invoices to show.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
];
|
||||
|
||||
@ -193,7 +193,7 @@ class Invoices_Element extends Base_Element {
|
||||
public function defaults() {
|
||||
|
||||
return [
|
||||
'title' => __('Invoices', 'wp-ultimo'),
|
||||
'title' => __('Invoices', 'wp-multisite-waas'),
|
||||
'limit' => 0,
|
||||
];
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ class Jumper {
|
||||
*/
|
||||
public function __construct() {
|
||||
|
||||
add_action('wp_ultimo_load', [$this, 'add_settings'], 20);
|
||||
add_action('init', [$this, 'add_settings'], 20);
|
||||
|
||||
add_action('init', [$this, 'load_jumper']);
|
||||
}
|
||||
@ -136,10 +136,10 @@ class Jumper {
|
||||
*/
|
||||
public function rebuild_menu(): void {
|
||||
|
||||
if (isset($_GET[ $this->reset_slug ]) && current_user_can('manage_network')) {
|
||||
if (isset($_GET[ $this->reset_slug ]) && isset($_GET['nonce']) && current_user_can('manage_network') && wp_verify_nonce(sanitize_text_field(wp_unslash($_GET['nonce'])), 'reset_password')) {
|
||||
delete_site_transient($this->transient_key);
|
||||
|
||||
wp_redirect(network_admin_url());
|
||||
wp_safe_redirect(network_admin_url());
|
||||
|
||||
exit;
|
||||
}
|
||||
@ -185,7 +185,7 @@ class Jumper {
|
||||
$custom_links = $this->get_user_custom_links();
|
||||
|
||||
if ( ! empty($custom_links)) {
|
||||
$links[ __('Custom Links', 'wp-ultimo') ] = $custom_links;
|
||||
$links[ __('Custom Links', 'wp-multisite-waas') ] = $custom_links;
|
||||
}
|
||||
|
||||
return $links;
|
||||
@ -203,27 +203,27 @@ class Jumper {
|
||||
|
||||
if (isset($links['WP Ultimo'])) {
|
||||
$settings_tabs = [
|
||||
'general' => __('General', 'wp-ultimo'),
|
||||
'network' => __('Network Settings', 'wp-ultimo'),
|
||||
'gateways' => __('Payment Gateways', 'wp-ultimo'),
|
||||
'domain_mapping' => __('Domain Mapping & SSL', 'wp-ultimo'),
|
||||
'emails' => __('Emails', 'wp-ultimo'),
|
||||
'styling' => __('Styling', 'wp-ultimo'),
|
||||
'tools' => __('Tools', 'wp-ultimo'),
|
||||
'advanced' => __('Advanced', 'wp-ultimo'),
|
||||
'activation' => __('Activation & Support', 'wp-ultimo'),
|
||||
'general' => __('General', 'wp-multisite-waas'),
|
||||
'network' => __('Network Settings', 'wp-multisite-waas'),
|
||||
'gateways' => __('Payment Gateways', 'wp-multisite-waas'),
|
||||
'domain_mapping' => __('Domain Mapping & SSL', 'wp-multisite-waas'),
|
||||
'emails' => __('Emails', 'wp-multisite-waas'),
|
||||
'styling' => __('Styling', 'wp-multisite-waas'),
|
||||
'tools' => __('Tools', 'wp-multisite-waas'),
|
||||
'advanced' => __('Advanced', 'wp-multisite-waas'),
|
||||
'activation' => __('Activation & Support', 'wp-multisite-waas'),
|
||||
];
|
||||
|
||||
foreach ($settings_tabs as $tab => $tab_label) {
|
||||
$url = network_admin_url('admin.php?page=wp-ultimo-settings&wu-tab=' . $tab);
|
||||
|
||||
// translators: The placeholder represents the title of the Settings tab.
|
||||
$links['WP Ultimo'][ $url ] = sprintf(__('Settings: %s', 'wp-ultimo'), $tab_label);
|
||||
$links['WP Ultimo'][ $url ] = sprintf(__('Settings: %s', 'wp-multisite-waas'), $tab_label);
|
||||
}
|
||||
|
||||
$links['WP Ultimo'][ network_admin_url('admin.php?page=wp-ultimo-settings&wu-tab=tools') ] = __('Settings: Webhooks', 'wp-ultimo');
|
||||
$links['WP Ultimo'][ network_admin_url('admin.php?page=wp-ultimo-settings&wu-tab=tools') ] = __('Settings: Webhooks', 'wp-multisite-waas');
|
||||
|
||||
$links['WP Ultimo'][ network_admin_url('admin.php?page=wp-ultimo-system-info&wu-tab=logs') ] = __('System Info: Logs', 'wp-ultimo');
|
||||
$links['WP Ultimo'][ network_admin_url('admin.php?page=wp-ultimo-system-info&wu-tab=logs') ] = __('System Info: Logs', 'wp-multisite-waas');
|
||||
|
||||
/**
|
||||
* Adds Main Site Dashboard
|
||||
@ -231,7 +231,7 @@ class Jumper {
|
||||
if (isset($links[ __('Sites') ])) {
|
||||
$main_site_url = get_admin_url(get_current_site()->blog_id);
|
||||
|
||||
$links[ __('Sites') ][ $main_site_url ] = __('Main Site Dashboard', 'wp-ultimo');
|
||||
$links[ __('Sites') ][ $main_site_url ] = __('Main Site Dashboard', 'wp-multisite-waas');
|
||||
}
|
||||
}
|
||||
|
||||
@ -243,7 +243,7 @@ class Jumper {
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
function get_defined_trigger_key(): string {
|
||||
public function get_defined_trigger_key(): string {
|
||||
|
||||
return substr((string) wu_get_setting('jumper_key', 'g'), 0, 1);
|
||||
}
|
||||
@ -259,7 +259,7 @@ class Jumper {
|
||||
* @param string $os OS to get the key combination for. Options: win or osx.
|
||||
* @return array
|
||||
*/
|
||||
function get_keys($os = 'win') {
|
||||
public function get_keys($os = 'win') {
|
||||
|
||||
$trigger_key = $this->get_defined_trigger_key();
|
||||
|
||||
@ -285,7 +285,7 @@ class Jumper {
|
||||
return $text;
|
||||
}
|
||||
|
||||
$os = stristr((string) $_SERVER['HTTP_USER_AGENT'], 'mac') ? 'osx' : 'win';
|
||||
$os = isset($_SERVER['HTTP_USER_AGENT']) && stristr(sanitize_text_field(wp_unslash($_SERVER['HTTP_USER_AGENT'])), 'mac') ? 'osx' : 'win';
|
||||
|
||||
$keys = $this->get_keys($os);
|
||||
|
||||
@ -298,7 +298,7 @@ class Jumper {
|
||||
$html = trim($html, '+');
|
||||
|
||||
// translators: the %s placeholder is the key combination to trigger the Jumper.
|
||||
return '<span class="wu-keys">' . sprintf(__('<strong>Quick Tip:</strong> Use %s to jump between pages.', 'wp-ultimo'), $html) . '</span>' . $text;
|
||||
return '<span class="wu-keys">' . sprintf(__('<strong>Quick Tip:</strong> Use %s to jump between pages.', 'wp-multisite-waas'), $html) . '</span>' . $text;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -317,7 +317,7 @@ class Jumper {
|
||||
'wu-jumper',
|
||||
'wu_jumper_vars',
|
||||
[
|
||||
'not_found_message' => __('Nothing found for', 'wp-ultimo'),
|
||||
'not_found_message' => __('Nothing found for', 'wp-multisite-waas'),
|
||||
'trigger_key' => $this->get_defined_trigger_key(),
|
||||
'network_base_url' => network_admin_url(),
|
||||
'ajaxurl' => wu_ajax_url(),
|
||||
@ -406,7 +406,7 @@ class Jumper {
|
||||
|
||||
return Logger::track_time(
|
||||
'jumper',
|
||||
__('Regenerating Jumper menu items', 'wp-ultimo'),
|
||||
__('Regenerating Jumper menu items', 'wp-multisite-waas'),
|
||||
function () {
|
||||
|
||||
global $menu, $submenu;
|
||||
@ -425,7 +425,7 @@ class Jumper {
|
||||
|
||||
$string = wu_get_isset($title, 0, '');
|
||||
|
||||
$title = preg_replace('/[0-9]+/', '', strip_tags($string));
|
||||
$title = preg_replace('/[0-9]+/', '', wp_strip_all_tags($string));
|
||||
|
||||
// If parent does not exists, skip
|
||||
if ( ! empty($title) && is_array($submenu_items)) {
|
||||
@ -435,7 +435,6 @@ class Jumper {
|
||||
$url = $this->get_target_url($submenu_item[2]);
|
||||
|
||||
// Add to our choices the admin urls
|
||||
$choices[ $title ][ $url ] = preg_replace('/[0-9]+/', '', strip_tags((string) $submenu_item[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -487,8 +486,8 @@ class Jumper {
|
||||
wu_register_settings_section(
|
||||
'tools',
|
||||
[
|
||||
'title' => __('Tools', 'wp-ultimo'),
|
||||
'desc' => __('Tools', 'wp-ultimo'),
|
||||
'title' => __('Tools', 'wp-multisite-waas'),
|
||||
'desc' => __('Tools', 'wp-multisite-waas'),
|
||||
'icon' => 'dashicons-wu-tools',
|
||||
]
|
||||
);
|
||||
@ -497,8 +496,8 @@ class Jumper {
|
||||
'tools',
|
||||
'tools_header',
|
||||
[
|
||||
'title' => __('Jumper', 'wp-ultimo'),
|
||||
'desc' => __('Spotlight-like search bar that allows you to easily access everything on your network.', 'wp-ultimo'),
|
||||
'title' => __('Jumper', 'wp-multisite-waas'),
|
||||
'desc' => __('Spotlight-like search bar that allows you to easily access everything on your network.', 'wp-multisite-waas'),
|
||||
'type' => 'header',
|
||||
]
|
||||
);
|
||||
@ -507,8 +506,8 @@ class Jumper {
|
||||
'tools',
|
||||
'enable_jumper',
|
||||
[
|
||||
'title' => __('Enable Jumper', 'wp-ultimo'),
|
||||
'desc' => __('Turn this option on to make the Jumper available on your network.', 'wp-ultimo'),
|
||||
'title' => __('Enable Jumper', 'wp-multisite-waas'),
|
||||
'desc' => __('Turn this option on to make the Jumper available on your network.', 'wp-multisite-waas'),
|
||||
'type' => 'toggle',
|
||||
'default' => 1,
|
||||
]
|
||||
@ -518,8 +517,8 @@ class Jumper {
|
||||
'tools',
|
||||
'jumper_key',
|
||||
[
|
||||
'title' => __('Trigger Key', 'wp-ultimo'),
|
||||
'desc' => __('Change the keyboard key used in conjunction with ctrl + alt (or cmd + option), to trigger the Jumper box.', 'wp-ultimo'),
|
||||
'title' => __('Trigger Key', 'wp-multisite-waas'),
|
||||
'desc' => __('Change the keyboard key used in conjunction with ctrl + alt (or cmd + option), to trigger the Jumper box.', 'wp-multisite-waas'),
|
||||
'type' => 'text',
|
||||
'default' => 'g',
|
||||
'require' => [
|
||||
@ -532,9 +531,9 @@ class Jumper {
|
||||
'tools',
|
||||
'jumper_custom_links',
|
||||
[
|
||||
'title' => __('Custom Links', 'wp-ultimo'),
|
||||
'desc' => __('Use this textarea to add custom links to the Jumper. Add one per line, with the format "Title : url".', 'wp-ultimo'),
|
||||
'placeholder' => __('Tile of Custom Link : http://link.com', 'wp-ultimo'),
|
||||
'title' => __('Custom Links', 'wp-multisite-waas'),
|
||||
'desc' => __('Use this textarea to add custom links to the Jumper. Add one per line, with the format "Title : url".', 'wp-multisite-waas'),
|
||||
'placeholder' => __('Tile of Custom Link : http://link.com', 'wp-multisite-waas'),
|
||||
'type' => 'textarea',
|
||||
'html_attr' => [
|
||||
'rows' => 4,
|
||||
|
@ -75,14 +75,14 @@ class Limits_Element extends Base_Element {
|
||||
*
|
||||
* This is used on the Blocks list of Gutenberg.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('My Element', 'wp-ultimo').
|
||||
* e.g. return __('My Element', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return __('Limits & Quotas', 'wp-ultimo');
|
||||
return __('Limits & Quotas', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -91,14 +91,14 @@ class Limits_Element extends Base_Element {
|
||||
* This is also used on the Gutenberg block list
|
||||
* to explain what this block is about.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-ultimo').
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
|
||||
return __('Adds a checkout form block to the page.', 'wp-ultimo');
|
||||
return __('Adds a checkout form block to the page.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -123,23 +123,23 @@ class Limits_Element extends Base_Element {
|
||||
$fields = [];
|
||||
|
||||
$fields['header'] = [
|
||||
'title' => __('General', 'wp-ultimo'),
|
||||
'desc' => __('General', 'wp-ultimo'),
|
||||
'title' => __('General', 'wp-multisite-waas'),
|
||||
'desc' => __('General', 'wp-multisite-waas'),
|
||||
'type' => 'header',
|
||||
];
|
||||
|
||||
$fields['title'] = [
|
||||
'type' => 'text',
|
||||
'title' => __('Title', 'wp-ultimo'),
|
||||
'value' => __('Site Limits', 'wp-ultimo'),
|
||||
'desc' => __('Leave blank to hide the title completely.', 'wp-ultimo'),
|
||||
'title' => __('Title', 'wp-multisite-waas'),
|
||||
'value' => __('Site Limits', 'wp-multisite-waas'),
|
||||
'desc' => __('Leave blank to hide the title completely.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
];
|
||||
|
||||
$fields['columns'] = [
|
||||
'type' => 'number',
|
||||
'title' => __('Columns', 'wp-ultimo'),
|
||||
'desc' => __('How many columns to use.', 'wp-ultimo'),
|
||||
'title' => __('Columns', 'wp-multisite-waas'),
|
||||
'desc' => __('How many columns to use.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'value' => 1,
|
||||
'min' => 1,
|
||||
@ -195,7 +195,7 @@ class Limits_Element extends Base_Element {
|
||||
|
||||
return [
|
||||
'columns' => 1,
|
||||
'title' => __('Site Limits', 'wp-ultimo'),
|
||||
'title' => __('Site Limits', 'wp-multisite-waas'),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,6 @@
|
||||
|
||||
namespace WP_Ultimo\UI;
|
||||
|
||||
use WP_Ultimo\UI\Base_Element;
|
||||
use WP_Ultimo\Checkout\Checkout_Pages;
|
||||
|
||||
// Exit if accessed directly
|
||||
@ -90,14 +89,14 @@ class Login_Form_Element extends Base_Element {
|
||||
*
|
||||
* This is used on the Blocks list of Gutenberg.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('My Element', 'wp-ultimo').
|
||||
* e.g. return __('My Element', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return __('Login Form', 'wp-ultimo');
|
||||
return __('Login Form', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -106,14 +105,14 @@ class Login_Form_Element extends Base_Element {
|
||||
* This is also used on the Gutenberg block list
|
||||
* to explain what this block is about.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-ultimo').
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
|
||||
return __('Adds a login form to the page.', 'wp-ultimo');
|
||||
return __('Adds a login form to the page.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -138,23 +137,23 @@ class Login_Form_Element extends Base_Element {
|
||||
$fields = [];
|
||||
|
||||
$fields['header'] = [
|
||||
'title' => __('General', 'wp-ultimo'),
|
||||
'desc' => __('General', 'wp-ultimo'),
|
||||
'title' => __('General', 'wp-multisite-waas'),
|
||||
'desc' => __('General', 'wp-multisite-waas'),
|
||||
'type' => 'header',
|
||||
];
|
||||
|
||||
$fields['display_title'] = [
|
||||
'type' => 'toggle',
|
||||
'title' => __('Display Title?', 'wp-ultimo'),
|
||||
'desc' => __('Toggle to show/hide the title element.', 'wp-ultimo'),
|
||||
'title' => __('Display Title?', 'wp-multisite-waas'),
|
||||
'desc' => __('Toggle to show/hide the title element.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'value' => 1,
|
||||
];
|
||||
|
||||
$fields['title'] = [
|
||||
'type' => 'text',
|
||||
'title' => __('Title', 'wp-ultimo'),
|
||||
'value' => __('Login', 'wp-ultimo'),
|
||||
'title' => __('Title', 'wp-multisite-waas'),
|
||||
'value' => __('Login', 'wp-multisite-waas'),
|
||||
'desc' => '',
|
||||
'tooltip' => '',
|
||||
'required' => [
|
||||
@ -164,22 +163,22 @@ class Login_Form_Element extends Base_Element {
|
||||
|
||||
$fields['redirect_type'] = [
|
||||
'type' => 'select',
|
||||
'title' => __('Redirect Type', 'wp-ultimo'),
|
||||
'desc' => __('The behavior after login', 'wp-ultimo'),
|
||||
'title' => __('Redirect Type', 'wp-multisite-waas'),
|
||||
'desc' => __('The behavior after login', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'default' => 'default',
|
||||
'options' => [
|
||||
'default' => __('Wordpress Default', 'wp-ultimo'),
|
||||
'customer_site' => __('Send To Customer Site', 'wp-ultimo'),
|
||||
'main_site' => __('Send To Main Site', 'wp-ultimo'),
|
||||
'default' => __('Wordpress Default', 'wp-multisite-waas'),
|
||||
'customer_site' => __('Send To Customer Site', 'wp-multisite-waas'),
|
||||
'main_site' => __('Send To Main Site', 'wp-multisite-waas'),
|
||||
],
|
||||
];
|
||||
|
||||
$fields['customer_redirect_path'] = [
|
||||
'type' => 'text',
|
||||
'title' => __('Customer Redirect Path', 'wp-ultimo'),
|
||||
'value' => __('/wp-admin', 'wp-ultimo'),
|
||||
'desc' => __('e.g. /wp-admin', 'wp-ultimo'),
|
||||
'title' => __('Customer Redirect Path', 'wp-multisite-waas'),
|
||||
'value' => __('/wp-admin', 'wp-multisite-waas'),
|
||||
'desc' => __('e.g. /wp-admin', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'required' => [
|
||||
'redirect_type' => 'customer_site',
|
||||
@ -188,9 +187,9 @@ class Login_Form_Element extends Base_Element {
|
||||
|
||||
$fields['main_redirect_path'] = [
|
||||
'type' => 'text',
|
||||
'title' => __('Main Site Redirect Path', 'wp-ultimo'),
|
||||
'value' => __('/wp-admin', 'wp-ultimo'),
|
||||
'desc' => __('e.g. /wp-admin', 'wp-ultimo'),
|
||||
'title' => __('Main Site Redirect Path', 'wp-multisite-waas'),
|
||||
'value' => __('/wp-admin', 'wp-multisite-waas'),
|
||||
'desc' => __('e.g. /wp-admin', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'required' => [
|
||||
'redirect_type' => 'main_site',
|
||||
@ -198,66 +197,66 @@ class Login_Form_Element extends Base_Element {
|
||||
];
|
||||
|
||||
$fields['header_username'] = [
|
||||
'title' => __('Username Field', 'wp-ultimo'),
|
||||
'desc' => __('Username Field', 'wp-ultimo'),
|
||||
'title' => __('Username Field', 'wp-multisite-waas'),
|
||||
'desc' => __('Username Field', 'wp-multisite-waas'),
|
||||
'type' => 'header',
|
||||
];
|
||||
|
||||
$fields['label_username'] = [
|
||||
'type' => 'text',
|
||||
'title' => __('Username Field Label', 'wp-ultimo'),
|
||||
'value' => __('Username or Email Address', 'wp-ultimo'),
|
||||
'desc' => __('Leave blank to hide.', 'wp-ultimo'),
|
||||
'title' => __('Username Field Label', 'wp-multisite-waas'),
|
||||
'value' => __('Username or Email Address', 'wp-multisite-waas'),
|
||||
'desc' => __('Leave blank to hide.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
];
|
||||
|
||||
$fields['placeholder_username'] = [
|
||||
'type' => 'text',
|
||||
'title' => __('Username Field Placeholder', 'wp-ultimo'),
|
||||
'desc' => __('e.g. Username Here', 'wp-ultimo'),
|
||||
'title' => __('Username Field Placeholder', 'wp-multisite-waas'),
|
||||
'desc' => __('e.g. Username Here', 'wp-multisite-waas'),
|
||||
'value' => '',
|
||||
'tooltip' => '',
|
||||
];
|
||||
|
||||
$fields['header_password'] = [
|
||||
'title' => __('Password Field', 'wp-ultimo'),
|
||||
'desc' => __('Password Field', 'wp-ultimo'),
|
||||
'title' => __('Password Field', 'wp-multisite-waas'),
|
||||
'desc' => __('Password Field', 'wp-multisite-waas'),
|
||||
'type' => 'header',
|
||||
];
|
||||
|
||||
$fields['label_password'] = [
|
||||
'type' => 'text',
|
||||
'title' => __('Password Field Label', 'wp-ultimo'),
|
||||
'value' => __('Password', 'wp-ultimo'),
|
||||
'desc' => __('Leave blank to hide.', 'wp-ultimo'),
|
||||
'title' => __('Password Field Label', 'wp-multisite-waas'),
|
||||
'value' => __('Password', 'wp-multisite-waas'),
|
||||
'desc' => __('Leave blank to hide.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
];
|
||||
|
||||
$fields['placeholder_password'] = [
|
||||
'type' => 'text',
|
||||
'title' => __('Password Field Placeholder', 'wp-ultimo'),
|
||||
'desc' => __('e.g. Your Password', 'wp-ultimo'),
|
||||
'title' => __('Password Field Placeholder', 'wp-multisite-waas'),
|
||||
'desc' => __('e.g. Your Password', 'wp-multisite-waas'),
|
||||
'value' => '',
|
||||
'tooltip' => '',
|
||||
];
|
||||
|
||||
$fields['header_remember'] = [
|
||||
'title' => __('Remember Me', 'wp-ultimo'),
|
||||
'desc' => __('Remember Me', 'wp-ultimo'),
|
||||
'title' => __('Remember Me', 'wp-multisite-waas'),
|
||||
'desc' => __('Remember Me', 'wp-multisite-waas'),
|
||||
'type' => 'header',
|
||||
];
|
||||
|
||||
$fields['remember'] = [
|
||||
'type' => 'toggle',
|
||||
'title' => __('Display Remember Toggle?', 'wp-ultimo'),
|
||||
'desc' => __('Toggle to show/hide the remember me checkbox.', 'wp-ultimo'),
|
||||
'title' => __('Display Remember Toggle?', 'wp-multisite-waas'),
|
||||
'desc' => __('Toggle to show/hide the remember me checkbox.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'value' => 1,
|
||||
];
|
||||
|
||||
$fields['label_remember'] = [
|
||||
'type' => 'text',
|
||||
'title' => __('Remember Me Label', 'wp-ultimo'),
|
||||
'title' => __('Remember Me Label', 'wp-multisite-waas'),
|
||||
'value' => __('Remember Me'),
|
||||
'desc' => '',
|
||||
'tooltip' => '',
|
||||
@ -268,8 +267,8 @@ class Login_Form_Element extends Base_Element {
|
||||
|
||||
$fields['desc_remember'] = [
|
||||
'type' => 'text',
|
||||
'title' => __('Remember Me Description', 'wp-ultimo'),
|
||||
'value' => __('Keep me logged in for two weeks.', 'wp-ultimo'),
|
||||
'title' => __('Remember Me Description', 'wp-multisite-waas'),
|
||||
'value' => __('Keep me logged in for two weeks.', 'wp-multisite-waas'),
|
||||
'desc' => '',
|
||||
'tooltip' => '',
|
||||
'required' => [
|
||||
@ -278,15 +277,15 @@ class Login_Form_Element extends Base_Element {
|
||||
];
|
||||
|
||||
$fields['header_submit'] = [
|
||||
'title' => __('Submit Button', 'wp-ultimo'),
|
||||
'desc' => __('Submit Button', 'wp-ultimo'),
|
||||
'title' => __('Submit Button', 'wp-multisite-waas'),
|
||||
'desc' => __('Submit Button', 'wp-multisite-waas'),
|
||||
'type' => 'header',
|
||||
];
|
||||
|
||||
$fields['label_log_in'] = [
|
||||
'type' => 'text',
|
||||
'title' => __('Submit Button Label', 'wp-ultimo'),
|
||||
'value' => __('Log In', 'wp-ultimo'),
|
||||
'title' => __('Submit Button Label', 'wp-multisite-waas'),
|
||||
'value' => __('Log In', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
];
|
||||
|
||||
@ -352,7 +351,7 @@ class Login_Form_Element extends Base_Element {
|
||||
|
||||
return [
|
||||
'display_title' => 1,
|
||||
'title' => __('Login', 'wp-ultimo'),
|
||||
'title' => __('Login', 'wp-multisite-waas'),
|
||||
|
||||
'redirect_type' => 'default',
|
||||
'customer_redirect_path' => '/wp-admin',
|
||||
@ -368,7 +367,7 @@ class Login_Form_Element extends Base_Element {
|
||||
'placeholder_password' => '',
|
||||
|
||||
'label_remember' => __('Remember Me'),
|
||||
'desc_remember' => __('Keep me logged in for two weeks.', 'wp-ultimo'),
|
||||
'desc_remember' => __('Keep me logged in for two weeks.', 'wp-multisite-waas'),
|
||||
|
||||
'label_log_in' => __('Log In'),
|
||||
|
||||
@ -398,7 +397,7 @@ class Login_Form_Element extends Base_Element {
|
||||
$rp_cookie = 'wp-resetpass-' . COOKIEHASH;
|
||||
|
||||
if (isset($_GET['key']) && isset($_GET['login'])) {
|
||||
$value = sprintf('%s:%s', wp_unslash($_GET['login']), wp_unslash($_GET['key']));
|
||||
$value = sprintf('%s:%s', sanitize_text_field(wp_unslash($_GET['login'])), sanitize_text_field(wp_unslash($_GET['key'])));
|
||||
|
||||
setcookie(
|
||||
$rp_cookie,
|
||||
@ -494,8 +493,7 @@ class Login_Form_Element extends Base_Element {
|
||||
}
|
||||
|
||||
// In this case, WP will not redirect, so we need to do it here
|
||||
wp_redirect($redirect_to);
|
||||
|
||||
wp_safe_redirect($redirect_to);
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -512,10 +510,9 @@ class Login_Form_Element extends Base_Element {
|
||||
} elseif ('customer_site' === $redirect_type) {
|
||||
$user_site = get_active_blog_for_user($user->ID);
|
||||
|
||||
wp_redirect($user_site->siteurl . $requested_redirect_to);
|
||||
wp_safe_redirect($user_site->siteurl . $requested_redirect_to);
|
||||
exit;
|
||||
} elseif ('main_site' === $redirect_type) {
|
||||
wp_redirect(network_site_url($requested_redirect_to));
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -603,12 +600,12 @@ class Login_Form_Element extends Base_Element {
|
||||
} elseif ($this->is_reset_password_page()) {
|
||||
$rp_cookie = 'wp-resetpass-' . COOKIEHASH;
|
||||
|
||||
if (isset($_COOKIE[ $rp_cookie ]) && 0 < strpos((string) $_COOKIE[ $rp_cookie ], ':')) {
|
||||
[$rp_login, $rp_key] = explode(':', wp_unslash($_COOKIE[ $rp_cookie ]), 2);
|
||||
if (isset($_COOKIE[ $rp_cookie ]) && str_contains(sanitize_text_field(wp_unslash($_COOKIE[ $rp_cookie ])), ':')) {
|
||||
[$rp_login, $rp_key] = explode(':', sanitize_text_field(wp_unslash($_COOKIE[ $rp_cookie ])), 2);
|
||||
|
||||
$user = check_password_reset_key($rp_key, $rp_login);
|
||||
|
||||
if (isset($_POST['pass1']) && ! hash_equals($rp_key, $_POST['rp_key'])) {
|
||||
if (isset($_POST['pass1']) && isset($_POST['rp_key']) && ! hash_equals(wp_unslash($_POST['rp_key']), wp_unslash($_POST['rp_key']))) {
|
||||
$user = false;
|
||||
}
|
||||
} else {
|
||||
@ -747,8 +744,7 @@ class Login_Form_Element extends Base_Element {
|
||||
];
|
||||
|
||||
if (isset($_GET['redirect_to'])) {
|
||||
$atts['redirect_type'] = 'query_redirect';
|
||||
$fields['redirect_to']['value'] = $_GET['redirect_to'];
|
||||
$atts['redirect_type'] = 'query_redirect';
|
||||
} elseif ('customer_site' === $atts['redirect_type']) {
|
||||
$fields['redirect_to']['value'] = $atts['customer_redirect_path'];
|
||||
} elseif ('main_site' === $atts['redirect_type']) {
|
||||
|
@ -85,14 +85,14 @@ class My_Sites_Element extends Base_Element {
|
||||
*
|
||||
* This is used on the Blocks list of Gutenberg.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('My Element', 'wp-ultimo').
|
||||
* e.g. return __('My Element', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return __('My Sites', 'wp-ultimo');
|
||||
return __('My Sites', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -101,14 +101,14 @@ class My_Sites_Element extends Base_Element {
|
||||
* This is also used on the Gutenberg block list
|
||||
* to explain what this block is about.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-ultimo').
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
|
||||
return __('Adds a block to display the sites owned by the current customer.', 'wp-ultimo');
|
||||
return __('Adds a block to display the sites owned by the current customer.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -133,33 +133,33 @@ class My_Sites_Element extends Base_Element {
|
||||
$fields = [];
|
||||
|
||||
$fields['header'] = [
|
||||
'title' => __('General', 'wp-ultimo'),
|
||||
'desc' => __('General', 'wp-ultimo'),
|
||||
'title' => __('General', 'wp-multisite-waas'),
|
||||
'desc' => __('General', 'wp-multisite-waas'),
|
||||
'type' => 'header',
|
||||
];
|
||||
|
||||
$fields['site_manage_type'] = [
|
||||
'type' => 'select',
|
||||
'title' => __('Site Manage Type', 'wp-ultimo'),
|
||||
'desc' => __('The page to manage a site.', 'wp-ultimo'),
|
||||
'title' => __('Site Manage Type', 'wp-multisite-waas'),
|
||||
'desc' => __('The page to manage a site.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'default' => 'default',
|
||||
'options' => [
|
||||
'default' => __('Same Page', 'wp-ultimo'),
|
||||
'wp_admin' => __('WP Admin', 'wp-ultimo'),
|
||||
'custom_page' => __('Custom Page', 'wp-ultimo'),
|
||||
'default' => __('Same Page', 'wp-multisite-waas'),
|
||||
'wp_admin' => __('WP Admin', 'wp-multisite-waas'),
|
||||
'custom_page' => __('Custom Page', 'wp-multisite-waas'),
|
||||
],
|
||||
];
|
||||
|
||||
$fields['site_show'] = [
|
||||
'type' => 'select',
|
||||
'title' => __('Which sites to show?', 'wp-ultimo'),
|
||||
'desc' => __('Select which sites should be listed for user.', 'wp-ultimo'),
|
||||
'title' => __('Which sites to show?', 'wp-multisite-waas'),
|
||||
'desc' => __('Select which sites should be listed for user.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'default' => 'all',
|
||||
'options' => [
|
||||
'all' => __('All', 'wp-ultimo'),
|
||||
'owned' => __('Owned', 'wp-ultimo'),
|
||||
'all' => __('All', 'wp-multisite-waas'),
|
||||
'owned' => __('Owned', 'wp-multisite-waas'),
|
||||
],
|
||||
];
|
||||
|
||||
@ -171,7 +171,7 @@ class My_Sites_Element extends Base_Element {
|
||||
|
||||
$pages = $pages ?: [];
|
||||
|
||||
$pages_list = [0 => __('Current Page', 'wp-ultimo')];
|
||||
$pages_list = [0 => __('Current Page', 'wp-multisite-waas')];
|
||||
|
||||
foreach ($pages as $page) {
|
||||
$pages_list[ $page->ID ] = $page->post_title;
|
||||
@ -179,9 +179,9 @@ class My_Sites_Element extends Base_Element {
|
||||
|
||||
$fields['custom_manage_page'] = [
|
||||
'type' => 'select',
|
||||
'title' => __('Manage Redirect Page', 'wp-ultimo'),
|
||||
'title' => __('Manage Redirect Page', 'wp-multisite-waas'),
|
||||
'value' => 0,
|
||||
'desc' => __('The page to redirect user after select a site.', 'wp-ultimo'),
|
||||
'desc' => __('The page to redirect user after select a site.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'required' => [
|
||||
'site_manage_type' => 'custom_page',
|
||||
@ -191,8 +191,8 @@ class My_Sites_Element extends Base_Element {
|
||||
|
||||
$fields['columns'] = [
|
||||
'type' => 'number',
|
||||
'title' => __('Columns', 'wp-ultimo'),
|
||||
'desc' => __('How many columns to use.', 'wp-ultimo'),
|
||||
'title' => __('Columns', 'wp-multisite-waas'),
|
||||
'desc' => __('How many columns to use.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'value' => 4,
|
||||
'min' => 1,
|
||||
@ -201,8 +201,8 @@ class My_Sites_Element extends Base_Element {
|
||||
|
||||
$fields['display_images'] = [
|
||||
'type' => 'toggle',
|
||||
'title' => __('Display Site Screenshot?', 'wp-ultimo'),
|
||||
'desc' => __('Toggle to show/hide the site screenshots on the element.', 'wp-ultimo'),
|
||||
'title' => __('Display Site Screenshot?', 'wp-multisite-waas'),
|
||||
'desc' => __('Toggle to show/hide the site screenshots on the element.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'value' => 1,
|
||||
];
|
||||
|
@ -60,14 +60,14 @@ class Payment_Methods_Element extends Base_Element {
|
||||
*
|
||||
* This is used on the Blocks list of Gutenberg.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('My Element', 'wp-ultimo').
|
||||
* e.g. return __('My Element', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return __('Payment Methods', 'wp-ultimo');
|
||||
return __('Payment Methods', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -76,14 +76,14 @@ class Payment_Methods_Element extends Base_Element {
|
||||
* This is also used on the Gutenberg block list
|
||||
* to explain what this block is about.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-ultimo').
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
|
||||
return __('Adds a checkout form block to the page.', 'wp-ultimo');
|
||||
return __('Adds a checkout form block to the page.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -108,23 +108,23 @@ class Payment_Methods_Element extends Base_Element {
|
||||
$fields = [];
|
||||
|
||||
$fields['header'] = [
|
||||
'title' => __('General', 'wp-ultimo'),
|
||||
'desc' => __('General', 'wp-ultimo'),
|
||||
'title' => __('General', 'wp-multisite-waas'),
|
||||
'desc' => __('General', 'wp-multisite-waas'),
|
||||
'type' => 'header',
|
||||
];
|
||||
|
||||
$fields['password_strength'] = [
|
||||
'type' => 'toggle',
|
||||
'title' => __('Password Strength Meter', 'wp-ultimo'),
|
||||
'desc' => __('Set this customer as a VIP.', 'wp-ultimo'),
|
||||
'title' => __('Password Strength Meter', 'wp-multisite-waas'),
|
||||
'desc' => __('Set this customer as a VIP.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'value' => 1,
|
||||
];
|
||||
|
||||
$fields['apply_styles'] = [
|
||||
'type' => 'toggle',
|
||||
'title' => __('Apply Styles', 'wp-ultimo'),
|
||||
'desc' => __('Set this customer as a VIP.', 'wp-ultimo'),
|
||||
'title' => __('Apply Styles', 'wp-multisite-waas'),
|
||||
'desc' => __('Set this customer as a VIP.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'value' => 1,
|
||||
];
|
||||
|
@ -76,14 +76,14 @@ class Simple_Text_Element extends Base_Element {
|
||||
*
|
||||
* This is used on the Blocks list of Gutenberg.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('My Element', 'wp-ultimo').
|
||||
* e.g. return __('My Element', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return __('Simple Text', 'wp-ultimo');
|
||||
return __('Simple Text', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -92,14 +92,14 @@ class Simple_Text_Element extends Base_Element {
|
||||
* This is also used on the Gutenberg block list
|
||||
* to explain what this block is about.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-ultimo').
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
|
||||
return __('Adds a simple text block to the page.', 'wp-ultimo');
|
||||
return __('Adds a simple text block to the page.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -124,16 +124,16 @@ class Simple_Text_Element extends Base_Element {
|
||||
$fields = [];
|
||||
|
||||
$fields['header'] = [
|
||||
'title' => __('General', 'wp-ultimo'),
|
||||
'desc' => __('General', 'wp-ultimo'),
|
||||
'title' => __('General', 'wp-multisite-waas'),
|
||||
'desc' => __('General', 'wp-multisite-waas'),
|
||||
'type' => 'header',
|
||||
];
|
||||
|
||||
$fields['simple_text'] = [
|
||||
'type' => 'textarea',
|
||||
'title' => __('Content', 'wp-ultimo'),
|
||||
'placeholder' => __('E.g. Text, HTML or shortcode.', 'wp-ultimo'),
|
||||
'desc' => __('You can insert plain text, HTML or a shortcode in this block.', 'wp-ultimo'),
|
||||
'title' => __('Content', 'wp-multisite-waas'),
|
||||
'placeholder' => __('E.g. Text, HTML or shortcode.', 'wp-multisite-waas'),
|
||||
'desc' => __('You can insert plain text, HTML or a shortcode in this block.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'html_attr' => [
|
||||
'rows' => 6,
|
||||
@ -200,7 +200,7 @@ class Simple_Text_Element extends Base_Element {
|
||||
public function defaults() {
|
||||
|
||||
return [
|
||||
'simple_text' => __('Text, HTML or shortcode.', 'wp-ultimo'),
|
||||
'simple_text' => __('Text, HTML or shortcode.', 'wp-multisite-waas'),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,6 @@
|
||||
|
||||
namespace WP_Ultimo\UI;
|
||||
|
||||
use WP_Ultimo\UI\Base_Element;
|
||||
use WP_Ultimo\Database\Memberships\Membership_Status;
|
||||
use WP_Ultimo\Models\Site;
|
||||
use WP_Ultimo\Models\Membership;
|
||||
@ -97,14 +96,14 @@ class Site_Actions_Element extends Base_Element {
|
||||
*
|
||||
* This is used on the Blocks list of Gutenberg.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('My Element', 'wp-ultimo').
|
||||
* e.g. return __('My Element', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return __('Actions', 'wp-ultimo');
|
||||
return __('Actions', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -113,14 +112,14 @@ class Site_Actions_Element extends Base_Element {
|
||||
* This is also used on the Gutenberg block list
|
||||
* to explain what this block is about.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-ultimo').
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
|
||||
return __('Adds a checkout form block to the page.', 'wp-ultimo');
|
||||
return __('Adds a checkout form block to the page.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -145,31 +144,31 @@ class Site_Actions_Element extends Base_Element {
|
||||
$fields = [];
|
||||
|
||||
$fields['header'] = [
|
||||
'title' => __('General', 'wp-ultimo'),
|
||||
'desc' => __('General', 'wp-ultimo'),
|
||||
'title' => __('General', 'wp-multisite-waas'),
|
||||
'desc' => __('General', 'wp-multisite-waas'),
|
||||
'type' => 'header',
|
||||
];
|
||||
|
||||
$fields['show_change_password'] = [
|
||||
'type' => 'toggle',
|
||||
'title' => __('Show Change Password', 'wp-ultimo'),
|
||||
'desc' => __('Toggle to show/hide the password link.', 'wp-ultimo'),
|
||||
'title' => __('Show Change Password', 'wp-multisite-waas'),
|
||||
'desc' => __('Toggle to show/hide the password link.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'value' => 1,
|
||||
];
|
||||
|
||||
$fields['show_change_default_site'] = [
|
||||
'type' => 'toggle',
|
||||
'title' => __('Show Change Default Site', 'wp-ultimo'),
|
||||
'desc' => __('Toggle to show/hide the change default site link.', 'wp-ultimo'),
|
||||
'title' => __('Show Change Default Site', 'wp-multisite-waas'),
|
||||
'desc' => __('Toggle to show/hide the change default site link.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'value' => 1,
|
||||
];
|
||||
|
||||
$fields['show_change_payment_method'] = [
|
||||
'type' => 'toggle',
|
||||
'title' => __('Show Change Payment Method', 'wp-ultimo'),
|
||||
'desc' => __('Toggle to show/hide the option to cancel the current payment method.', 'wp-ultimo'),
|
||||
'title' => __('Show Change Payment Method', 'wp-multisite-waas'),
|
||||
'desc' => __('Toggle to show/hide the option to cancel the current payment method.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'value' => 1,
|
||||
];
|
||||
@ -182,7 +181,7 @@ class Site_Actions_Element extends Base_Element {
|
||||
|
||||
$pages = $pages ?: [];
|
||||
|
||||
$pages_list = [0 => __('Default', 'wp-ultimo')];
|
||||
$pages_list = [0 => __('Default', 'wp-multisite-waas')];
|
||||
|
||||
foreach ($pages as $page) {
|
||||
$pages_list[ $page->ID ] = $page->post_title;
|
||||
@ -190,9 +189,9 @@ class Site_Actions_Element extends Base_Element {
|
||||
|
||||
$fields['redirect_after_delete'] = [
|
||||
'type' => 'select',
|
||||
'title' => __('Redirect After Delete', 'wp-ultimo'),
|
||||
'title' => __('Redirect After Delete', 'wp-multisite-waas'),
|
||||
'value' => 0,
|
||||
'desc' => __('The page to redirect user after delete current site.', 'wp-ultimo'),
|
||||
'desc' => __('The page to redirect user after delete current site.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'options' => $pages_list,
|
||||
];
|
||||
@ -372,7 +371,7 @@ class Site_Actions_Element extends Base_Element {
|
||||
|
||||
if ($is_template_switching_enabled && $this->site) {
|
||||
$actions['template_switching'] = [
|
||||
'label' => __('Change Site Template', 'wp-ultimo'),
|
||||
'label' => __('Change Site Template', 'wp-multisite-waas'),
|
||||
'icon_classes' => 'dashicons-wu-edit wu-align-middle',
|
||||
'href' => add_query_arg(
|
||||
[
|
||||
@ -385,7 +384,7 @@ class Site_Actions_Element extends Base_Element {
|
||||
|
||||
if (count($all_blogs) > 1 && wu_get_isset($atts, 'show_change_default_site')) {
|
||||
$actions['default_site'] = [
|
||||
'label' => __('Change Default Site', 'wp-ultimo'),
|
||||
'label' => __('Change Default Site', 'wp-multisite-waas'),
|
||||
'icon_classes' => 'dashicons-wu-edit wu-align-middle',
|
||||
'classes' => 'wubox',
|
||||
'href' => wu_get_form_url('change_default_site'),
|
||||
@ -394,7 +393,7 @@ class Site_Actions_Element extends Base_Element {
|
||||
|
||||
if (wu_get_isset($atts, 'show_change_password')) {
|
||||
$actions['change_password'] = [
|
||||
'label' => __('Change Password', 'wp-ultimo'),
|
||||
'label' => __('Change Password', 'wp-multisite-waas'),
|
||||
'icon_classes' => 'dashicons-wu-edit wu-align-middle',
|
||||
'classes' => 'wubox',
|
||||
'href' => wu_get_form_url('change_password'),
|
||||
@ -405,7 +404,7 @@ class Site_Actions_Element extends Base_Element {
|
||||
|
||||
if (wu_get_isset($atts, 'show_change_payment_method') && $payment_gateway) {
|
||||
$actions['cancel_payment_method'] = [
|
||||
'label' => __('Cancel Current Payment Method', 'wp-ultimo'),
|
||||
'label' => __('Cancel Current Payment Method', 'wp-multisite-waas'),
|
||||
'icon_classes' => 'dashicons-wu-edit wu-align-middle',
|
||||
'classes' => 'wubox',
|
||||
'href' => wu_get_form_url(
|
||||
@ -436,7 +435,7 @@ class Site_Actions_Element extends Base_Element {
|
||||
$actions = array_merge(
|
||||
[
|
||||
'delete_site' => [
|
||||
'label' => __('Delete Site', 'wp-ultimo'),
|
||||
'label' => __('Delete Site', 'wp-multisite-waas'),
|
||||
'icon_classes' => 'dashicons-wu-edit wu-align-middle',
|
||||
'classes' => 'wubox wu-text-red-500',
|
||||
'href' => wu_get_form_url(
|
||||
@ -456,7 +455,7 @@ class Site_Actions_Element extends Base_Element {
|
||||
$actions = array_merge(
|
||||
[
|
||||
'cancel_membership' => [
|
||||
'label' => __('Cancel Membership', 'wp-ultimo'),
|
||||
'label' => __('Cancel Membership', 'wp-multisite-waas'),
|
||||
'icon_classes' => 'dashicons-wu-edit wu-align-middle',
|
||||
'classes' => 'wubox wu-text-red-500',
|
||||
'href' => wu_get_form_url(
|
||||
@ -488,13 +487,13 @@ class Site_Actions_Element extends Base_Element {
|
||||
$error = '';
|
||||
|
||||
if ( ! $site) {
|
||||
$error = __('Site not selected.', 'wp-ultimo');
|
||||
$error = __('Site not selected.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
$customer = wu_get_current_customer();
|
||||
|
||||
if ( ! $customer || $customer->get_id() !== $site->get_customer_id()) {
|
||||
$error = __('You are not allowed to do this.', 'wp-ultimo');
|
||||
$error = __('You are not allowed to do this.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
if ( ! empty($error)) {
|
||||
@ -531,16 +530,16 @@ class Site_Actions_Element extends Base_Element {
|
||||
],
|
||||
'confirm' => [
|
||||
'type' => 'toggle',
|
||||
'title' => __('Confirm Site Deletion', 'wp-ultimo'),
|
||||
'desc' => __('This action can not be undone.', 'wp-ultimo'),
|
||||
'title' => __('Confirm Site Deletion', 'wp-multisite-waas'),
|
||||
'desc' => __('This action can not be undone.', 'wp-multisite-waas'),
|
||||
'html_attr' => [
|
||||
'v-model' => 'confirmed',
|
||||
],
|
||||
],
|
||||
'submit_button' => [
|
||||
'type' => 'submit',
|
||||
'title' => __('Delete Site', 'wp-ultimo'),
|
||||
'placeholder' => __('Delete Site', 'wp-ultimo'),
|
||||
'title' => __('Delete Site', 'wp-multisite-waas'),
|
||||
'placeholder' => __('Delete Site', 'wp-multisite-waas'),
|
||||
'value' => 'save',
|
||||
'classes' => 'button button-primary wu-w-full',
|
||||
'wrapper_classes' => 'wu-items-end',
|
||||
@ -585,32 +584,30 @@ class Site_Actions_Element extends Base_Element {
|
||||
$site = wu_get_site_by_hash(wu_request('site'));
|
||||
|
||||
if ( ! $site || ! $site->is_customer_allowed()) {
|
||||
return new \WP_Error('error', __('An unexpected error happened.', 'wp-ultimo'));
|
||||
return new \WP_Error('error', __('An unexpected error happened.', 'wp-multisite-waas'));
|
||||
}
|
||||
|
||||
$customer = wu_get_current_customer();
|
||||
|
||||
if ( ! $customer || $customer->get_id() !== $site->get_customer_id()) {
|
||||
return new \WP_Error('error', __('You are not allowed to do this.', 'wp-ultimo'));
|
||||
return new \WP_Error('error', __('You are not allowed to do this.', 'wp-multisite-waas'));
|
||||
}
|
||||
|
||||
$wpdb->query('START TRANSACTION');
|
||||
$wpdb->query('START TRANSACTION'); // phpcs:ignore WordPress.DB.DirectDatabaseQuery
|
||||
|
||||
try {
|
||||
$saved = $site->delete();
|
||||
|
||||
if (is_wp_error($saved)) {
|
||||
$wpdb->query('ROLLBACK');
|
||||
|
||||
return $saved;
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
$wpdb->query('ROLLBACK');
|
||||
$wpdb->query('ROLLBACK'); // phpcs:ignore WordPress.DB.DirectDatabaseQuery
|
||||
|
||||
return new \WP_Error('exception', $e->getMessage());
|
||||
}
|
||||
|
||||
$wpdb->query('COMMIT');
|
||||
$wpdb->query('COMMIT'); // phpcs:ignore WordPress.DB.DirectDatabaseQuery
|
||||
|
||||
$redirect_url = wu_request('redirect_url');
|
||||
|
||||
@ -639,29 +636,27 @@ class Site_Actions_Element extends Base_Element {
|
||||
$fields = [
|
||||
'password' => [
|
||||
'type' => 'password',
|
||||
'title' => __('Current Password', 'wp-ultimo'),
|
||||
'placeholder' => __('******', 'wp-ultimo'),
|
||||
'title' => __('Current Password', 'wp-multisite-waas'),
|
||||
'placeholder' => __('******', 'wp-multisite-waas'),
|
||||
],
|
||||
'new_password' => [
|
||||
'type' => 'password',
|
||||
'title' => __('New Password', 'wp-ultimo'),
|
||||
'placeholder' => __('******', 'wp-ultimo'),
|
||||
'title' => __('New Password', 'wp-multisite-waas'),
|
||||
'placeholder' => __('******', 'wp-multisite-waas'),
|
||||
'meter' => true,
|
||||
],
|
||||
'new_password_conf' => [
|
||||
'type' => 'password',
|
||||
'placeholder' => __('******', 'wp-ultimo'),
|
||||
'title' => __('Confirm New Password', 'wp-ultimo'),
|
||||
'placeholder' => __('******', 'wp-multisite-waas'),
|
||||
'title' => __('Confirm New Password', 'wp-multisite-waas'),
|
||||
],
|
||||
'submit_button' => [
|
||||
'type' => 'submit',
|
||||
'title' => __('Reset Password', 'wp-ultimo'),
|
||||
'title' => __('Reset Password', 'wp-multisite-waas'),
|
||||
'value' => 'save',
|
||||
'classes' => 'button button-primary wu-w-full',
|
||||
'wrapper_classes' => 'wu-items-end',
|
||||
'html_attr' => [
|
||||
// 'v-bind:disabled' => '!confirmed',
|
||||
],
|
||||
'html_attr' => [],
|
||||
],
|
||||
];
|
||||
|
||||
@ -693,7 +688,7 @@ class Site_Actions_Element extends Base_Element {
|
||||
$user = wp_get_current_user();
|
||||
|
||||
if ( ! $user) {
|
||||
$error = new \WP_Error('user-dont-exist', __('Something went wrong.', 'wp-ultimo'));
|
||||
$error = new \WP_Error('user-dont-exist', __('Something went wrong.', 'wp-multisite-waas'));
|
||||
|
||||
wp_send_json_error($error);
|
||||
}
|
||||
@ -701,7 +696,7 @@ class Site_Actions_Element extends Base_Element {
|
||||
$current_password = wu_request('password');
|
||||
|
||||
if ( ! wp_check_password($current_password, $user->user_pass, $user->ID)) {
|
||||
$error = new \WP_Error('wrong-password', __('Your current password is wrong.', 'wp-ultimo'));
|
||||
$error = new \WP_Error('wrong-password', __('Your current password is wrong.', 'wp-multisite-waas'));
|
||||
|
||||
wp_send_json_error($error);
|
||||
}
|
||||
@ -710,13 +705,13 @@ class Site_Actions_Element extends Base_Element {
|
||||
$new_password_conf = wu_request('new_password_conf');
|
||||
|
||||
if ( ! $new_password || strlen((string) $new_password) < 6) {
|
||||
$error = new \WP_Error('password-min-length', __('The new password must be at least 6 characters long.', 'wp-ultimo'));
|
||||
$error = new \WP_Error('password-min-length', __('The new password must be at least 6 characters long.', 'wp-multisite-waas'));
|
||||
|
||||
wp_send_json_error($error);
|
||||
}
|
||||
|
||||
if ($new_password !== $new_password_conf) {
|
||||
$error = new \WP_Error('passwords-dont-match', __('New passwords do not match.', 'wp-ultimo'));
|
||||
$error = new \WP_Error('passwords-dont-match', __('New passwords do not match.', 'wp-multisite-waas'));
|
||||
|
||||
wp_send_json_error($error);
|
||||
}
|
||||
@ -726,11 +721,11 @@ class Site_Actions_Element extends Base_Element {
|
||||
// Log-in again.
|
||||
wp_set_auth_cookie($user->ID);
|
||||
wp_set_current_user($user->ID);
|
||||
do_action('wp_login', $user->user_login, $user); // PHPCS:ignore
|
||||
do_action('wp_login', $user->user_login, $user); // PHPCS:ignore WordPress.NamingConventions
|
||||
|
||||
wp_send_json_success(
|
||||
[
|
||||
'redirect_url' => add_query_arg('updated', 1, $_SERVER['HTTP_REFERER']),
|
||||
'redirect_url' => add_query_arg('updated', 1, $_SERVER['HTTP_REFERER']), // phpcs:ignore WordPress.Security.ValidatedSanitizedInput
|
||||
]
|
||||
);
|
||||
}
|
||||
@ -756,8 +751,8 @@ class Site_Actions_Element extends Base_Element {
|
||||
$fields = [
|
||||
'new_primary_site' => [
|
||||
'type' => 'select',
|
||||
'title' => __('Primary Site', 'wp-ultimo'),
|
||||
'desc' => __('Change the primary site of your network.', 'wp-ultimo'),
|
||||
'title' => __('Primary Site', 'wp-multisite-waas'),
|
||||
'desc' => __('Change the primary site of your network.', 'wp-multisite-waas'),
|
||||
'options' => $option_blogs,
|
||||
'value' => $primary_blog,
|
||||
'html_attr' => [
|
||||
@ -766,7 +761,7 @@ class Site_Actions_Element extends Base_Element {
|
||||
],
|
||||
'submit_button' => [
|
||||
'type' => 'submit',
|
||||
'title' => __('Change Default Site', 'wp-ultimo'),
|
||||
'title' => __('Change Default Site', 'wp-multisite-waas'),
|
||||
'value' => 'save',
|
||||
'classes' => 'button button-primary wu-w-full',
|
||||
'wrapper_classes' => 'wu-items-end',
|
||||
@ -812,12 +807,12 @@ class Site_Actions_Element extends Base_Element {
|
||||
|
||||
wp_send_json_success(
|
||||
[
|
||||
'redirect_url' => add_query_arg('updated', 1, $_SERVER['HTTP_REFERER']),
|
||||
'redirect_url' => add_query_arg('updated', 1, $_SERVER['HTTP_REFERER']), // phpcs:ignore WordPress.Security.ValidatedSanitizedInput
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
$error = new \WP_Error('no-site-selected', __('You need to select a new primary site.', 'wp-ultimo'));
|
||||
$error = new \WP_Error('no-site-selected', __('You need to select a new primary site.', 'wp-multisite-waas'));
|
||||
|
||||
wp_send_json_error($error);
|
||||
}
|
||||
@ -835,13 +830,13 @@ class Site_Actions_Element extends Base_Element {
|
||||
$error = '';
|
||||
|
||||
if ( ! $membership) {
|
||||
$error = __('Membership not selected.', 'wp-ultimo');
|
||||
$error = __('Membership not selected.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
$customer = wu_get_current_customer();
|
||||
|
||||
if ( ! is_super_admin() && (! $customer || $customer->get_id() !== $membership->get_customer_id())) {
|
||||
$error = __('You are not allowed to do this.', 'wp-ultimo');
|
||||
$error = __('You are not allowed to do this.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
if ( ! empty($error)) {
|
||||
@ -878,16 +873,16 @@ class Site_Actions_Element extends Base_Element {
|
||||
],
|
||||
'confirm' => [
|
||||
'type' => 'toggle',
|
||||
'title' => __('Confirm Payment Method Cancellation', 'wp-ultimo'),
|
||||
'desc' => __('This action can not be undone.', 'wp-ultimo'),
|
||||
'title' => __('Confirm Payment Method Cancellation', 'wp-multisite-waas'),
|
||||
'desc' => __('This action can not be undone.', 'wp-multisite-waas'),
|
||||
'html_attr' => [
|
||||
'v-model' => 'confirmed',
|
||||
],
|
||||
],
|
||||
'submit_button' => [
|
||||
'type' => 'submit',
|
||||
'title' => __('Cancel Payment Method', 'wp-ultimo'),
|
||||
'placeholder' => __('Cancel Payment Method', 'wp-ultimo'),
|
||||
'title' => __('Cancel Payment Method', 'wp-multisite-waas'),
|
||||
'placeholder' => __('Cancel Payment Method', 'wp-multisite-waas'),
|
||||
'value' => 'save',
|
||||
'classes' => 'button button-primary wu-w-full',
|
||||
'wrapper_classes' => 'wu-items-end',
|
||||
@ -929,7 +924,7 @@ class Site_Actions_Element extends Base_Element {
|
||||
$membership = wu_get_membership_by_hash(wu_request('membership'));
|
||||
|
||||
if ( ! $membership) {
|
||||
$error = new \WP_Error('error', __('An unexpected error happened.', 'wp-ultimo'));
|
||||
$error = new \WP_Error('error', __('An unexpected error happened.', 'wp-multisite-waas'));
|
||||
|
||||
wp_send_json_error($error);
|
||||
|
||||
@ -939,7 +934,7 @@ class Site_Actions_Element extends Base_Element {
|
||||
$customer = wu_get_current_customer();
|
||||
|
||||
if ( ! is_super_admin() && (! $customer || $customer->get_id() !== $membership->get_customer_id())) {
|
||||
$error = new \WP_Error('error', __('You are not allowed to do this.', 'wp-ultimo'));
|
||||
$error = new \WP_Error('error', __('You are not allowed to do this.', 'wp-multisite-waas'));
|
||||
|
||||
wp_send_json_error($error);
|
||||
|
||||
@ -982,13 +977,13 @@ class Site_Actions_Element extends Base_Element {
|
||||
$error = '';
|
||||
|
||||
if ( ! $membership) {
|
||||
$error = __('Membership not selected.', 'wp-ultimo');
|
||||
$error = __('Membership not selected.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
$customer = wu_get_current_customer();
|
||||
|
||||
if ( ! is_super_admin() && (! $customer || $customer->get_id() !== $membership->get_customer_id())) {
|
||||
$error = __('You are not allowed to do this.', 'wp-ultimo');
|
||||
$error = __('You are not allowed to do this.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
if ( ! empty($error)) {
|
||||
@ -1025,33 +1020,33 @@ class Site_Actions_Element extends Base_Element {
|
||||
],
|
||||
'cancellation_reason' => [
|
||||
'type' => 'select',
|
||||
'title' => __('Please tell us why you are cancelling.', 'wp-ultimo'),
|
||||
'desc' => __('We would love your feedback.', 'wp-ultimo'),
|
||||
'title' => __('Please tell us why you are cancelling.', 'wp-multisite-waas'),
|
||||
'desc' => __('We would love your feedback.', 'wp-multisite-waas'),
|
||||
'html_attr' => [
|
||||
'v-model' => 'cancellation_reason',
|
||||
],
|
||||
'default' => '',
|
||||
'options' => [
|
||||
'' => __('Select a reason', 'wp-ultimo'),
|
||||
'unused' => __('I no longer need it', 'wp-ultimo'),
|
||||
'too_expensive' => __('It\'s too expensive', 'wp-ultimo'),
|
||||
'missing_features' => __('I need more features', 'wp-ultimo'),
|
||||
'switched_service' => __('Switched to another service', 'wp-ultimo'),
|
||||
'customer_service' => __('Customer support is less than expected', 'wp-ultimo'),
|
||||
'too_complex' => __('Too complex', 'wp-ultimo'),
|
||||
'other' => __('Other', 'wp-ultimo'),
|
||||
'' => __('Select a reason', 'wp-multisite-waas'),
|
||||
'unused' => __('I no longer need it', 'wp-multisite-waas'),
|
||||
'too_expensive' => __('It\'s too expensive', 'wp-multisite-waas'),
|
||||
'missing_features' => __('I need more features', 'wp-multisite-waas'),
|
||||
'switched_service' => __('Switched to another service', 'wp-multisite-waas'),
|
||||
'customer_service' => __('Customer support is less than expected', 'wp-multisite-waas'),
|
||||
'too_complex' => __('Too complex', 'wp-multisite-waas'),
|
||||
'other' => __('Other', 'wp-multisite-waas'),
|
||||
],
|
||||
],
|
||||
'cancellation_explanation' => [
|
||||
'type' => 'textarea',
|
||||
'title' => __('Please provide additional details.', 'wp-ultimo'),
|
||||
'title' => __('Please provide additional details.', 'wp-multisite-waas'),
|
||||
'wrapper_html_attr' => [
|
||||
'v-show' => 'cancellation_reason === "other"',
|
||||
],
|
||||
],
|
||||
'confirm' => [
|
||||
'type' => 'text',
|
||||
'title' => __('Type <code class="wu-text-red-600">CANCEL</code> to confirm this membership cancellation.', 'wp-ultimo'),
|
||||
'title' => __('Type <code class="wu-text-red-600">CANCEL</code> to confirm this membership cancellation.', 'wp-multisite-waas'),
|
||||
'html_attr' => [
|
||||
'v-model' => 'confirmation',
|
||||
],
|
||||
@ -1068,19 +1063,19 @@ class Site_Actions_Element extends Base_Element {
|
||||
$fields['next_charge'] = [
|
||||
'type' => 'note',
|
||||
// translators: %s: Next charge date.
|
||||
'desc' => sprintf(__('Your sites will stay working until %s.', 'wp-ultimo'), date_i18n(get_option('date_format'), $next_charge)),
|
||||
'desc' => sprintf(__('Your sites will stay working until %s.', 'wp-multisite-waas'), date_i18n(get_option('date_format'), $next_charge)),
|
||||
];
|
||||
}
|
||||
|
||||
$fields['submit_button'] = [
|
||||
'type' => 'submit',
|
||||
'title' => __('Cancel Membership', 'wp-ultimo'),
|
||||
'placeholder' => __('Cancel Membership', 'wp-ultimo'),
|
||||
'title' => __('Cancel Membership', 'wp-multisite-waas'),
|
||||
'placeholder' => __('Cancel Membership', 'wp-multisite-waas'),
|
||||
'value' => 'save',
|
||||
'classes' => 'button button-primary wu-w-full',
|
||||
'wrapper_classes' => 'wu-items-end',
|
||||
'html_attr' => [
|
||||
'v-bind:disabled' => 'confirmation !== "' . __('CANCEL', 'wp-ultimo') . '" || cancellation_reason === ""',
|
||||
'v-bind:disabled' => 'confirmation !== "' . __('CANCEL', 'wp-multisite-waas') . '" || cancellation_reason === ""',
|
||||
],
|
||||
];
|
||||
|
||||
@ -1117,7 +1112,7 @@ class Site_Actions_Element extends Base_Element {
|
||||
$membership = wu_get_membership_by_hash(wu_request('membership'));
|
||||
|
||||
if ( ! $membership) {
|
||||
$error = new \WP_Error('error', __('An unexpected error happened.', 'wp-ultimo'));
|
||||
$error = new \WP_Error('error', __('An unexpected error happened.', 'wp-multisite-waas'));
|
||||
|
||||
wp_send_json_error($error);
|
||||
|
||||
@ -1127,7 +1122,7 @@ class Site_Actions_Element extends Base_Element {
|
||||
$customer = wu_get_current_customer();
|
||||
|
||||
if ( ! is_super_admin() && (! $customer || $customer->get_id() !== $membership->get_customer_id())) {
|
||||
$error = new \WP_Error('error', __('You are not allowed to do this.', 'wp-ultimo'));
|
||||
$error = new \WP_Error('error', __('You are not allowed to do this.', 'wp-multisite-waas'));
|
||||
|
||||
wp_send_json_error($error);
|
||||
|
||||
@ -1135,12 +1130,12 @@ class Site_Actions_Element extends Base_Element {
|
||||
}
|
||||
|
||||
$cancellation_options = [
|
||||
'unused' => __('I no longer need it', 'wp-ultimo'),
|
||||
'too_expensive' => __('It\'s too expensive', 'wp-ultimo'),
|
||||
'missing_features' => __('I need more features', 'wp-ultimo'),
|
||||
'switched_service' => __('Switched to another service', 'wp-ultimo'),
|
||||
'customer_service' => __('Customer support is less than expected', 'wp-ultimo'),
|
||||
'too_complex' => __('Too complex', 'wp-ultimo'),
|
||||
'unused' => __('I no longer need it', 'wp-multisite-waas'),
|
||||
'too_expensive' => __('It\'s too expensive', 'wp-multisite-waas'),
|
||||
'missing_features' => __('I need more features', 'wp-multisite-waas'),
|
||||
'switched_service' => __('Switched to another service', 'wp-multisite-waas'),
|
||||
'customer_service' => __('Customer support is less than expected', 'wp-multisite-waas'),
|
||||
'too_complex' => __('Too complex', 'wp-multisite-waas'),
|
||||
'other' => wu_request('cancellation_explanation'),
|
||||
];
|
||||
|
||||
|
@ -9,8 +9,6 @@
|
||||
|
||||
namespace WP_Ultimo\UI;
|
||||
|
||||
use WP_Ultimo\UI\Base_Element;
|
||||
|
||||
// Exit if accessed directly
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@ -46,6 +44,8 @@ class Site_Maintenance_Element extends Base_Element {
|
||||
*/
|
||||
protected $public = true;
|
||||
|
||||
private \WP_Ultimo\Models\Site $site;
|
||||
|
||||
/**
|
||||
* Initializes the singleton.
|
||||
*
|
||||
@ -81,14 +81,14 @@ class Site_Maintenance_Element extends Base_Element {
|
||||
*
|
||||
* This is used on the Blocks list of Gutenberg.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('My Element', 'wp-ultimo').
|
||||
* e.g. return __('My Element', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return __('Site Maintenance', 'wp-ultimo');
|
||||
return __('Site Maintenance', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -97,14 +97,14 @@ class Site_Maintenance_Element extends Base_Element {
|
||||
* This is also used on the Gutenberg block list
|
||||
* to explain what this block is about.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-ultimo').
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
|
||||
return __('Adds the toggle control to turn maintenance mode on.', 'wp-ultimo');
|
||||
return __('Adds the toggle control to turn maintenance mode on.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -129,23 +129,23 @@ class Site_Maintenance_Element extends Base_Element {
|
||||
$fields = [];
|
||||
|
||||
$fields['header'] = [
|
||||
'title' => __('General', 'wp-ultimo'),
|
||||
'desc' => __('General', 'wp-ultimo'),
|
||||
'title' => __('General', 'wp-multisite-waas'),
|
||||
'desc' => __('General', 'wp-multisite-waas'),
|
||||
'type' => 'header',
|
||||
];
|
||||
|
||||
$fields['title'] = [
|
||||
'type' => 'text',
|
||||
'title' => __('Label', 'wp-ultimo'),
|
||||
'value' => __('Toggle Maintenance Mode', 'wp-ultimo'),
|
||||
'placeholder' => __('e.g. Toggle Maintenance Mode', 'wp-ultimo'),
|
||||
'title' => __('Label', 'wp-multisite-waas'),
|
||||
'value' => __('Toggle Maintenance Mode', 'wp-multisite-waas'),
|
||||
'placeholder' => __('e.g. Toggle Maintenance Mode', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
];
|
||||
|
||||
$fields['desc'] = [
|
||||
'type' => 'textarea',
|
||||
'title' => __('Description', 'wp-ultimo'),
|
||||
'value' => __('Put your site on maintenance mode. When activated, the front-end will only be accessible to logged users.', 'wp-ultimo'),
|
||||
'title' => __('Description', 'wp-multisite-waas'),
|
||||
'value' => __('Put your site on maintenance mode. When activated, the front-end will only be accessible to logged users.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
];
|
||||
|
||||
@ -196,8 +196,8 @@ class Site_Maintenance_Element extends Base_Element {
|
||||
public function defaults() {
|
||||
|
||||
return [
|
||||
'title' => __('Toggle Maintenance Mode', 'wp-ultimo'),
|
||||
'desc' => __('Put your site on maintenance mode. When activated, the front-end will only be accessible to logged users.', 'wp-ultimo'),
|
||||
'title' => __('Toggle Maintenance Mode', 'wp-multisite-waas'),
|
||||
'desc' => __('Put your site on maintenance mode. When activated, the front-end will only be accessible to logged users.', 'wp-multisite-waas'),
|
||||
];
|
||||
}
|
||||
|
||||
@ -209,12 +209,12 @@ class Site_Maintenance_Element extends Base_Element {
|
||||
*/
|
||||
public function setup(): void {
|
||||
|
||||
$this->site = WP_Ultimo()->currents->get_site();
|
||||
$site = WP_Ultimo()->currents->get_site();
|
||||
|
||||
if ( ! $this->site || ! $this->site->is_customer_allowed()) {
|
||||
if ( ! $site || ! $site->is_customer_allowed()) {
|
||||
$this->set_display(false);
|
||||
|
||||
return;
|
||||
} else {
|
||||
$this->site = $site;
|
||||
}
|
||||
}
|
||||
|
||||
@ -237,7 +237,7 @@ class Site_Maintenance_Element extends Base_Element {
|
||||
*/
|
||||
public function register_scripts(): void {
|
||||
|
||||
wp_register_script('wu-site-maintenance', wu_get_asset('site-maintenance.js', 'js'), ['jquery', 'wu-functions'], wu_get_version());
|
||||
wp_register_script('wu-site-maintenance', wu_get_asset('site-maintenance.js', 'js'), ['jquery', 'wu-functions'], wu_get_version(), true);
|
||||
|
||||
wp_localize_script(
|
||||
'wu-site-maintenance',
|
||||
|
@ -240,7 +240,7 @@ class Template_Previewer {
|
||||
* Check if this is a site template
|
||||
*/
|
||||
if ( ! $selected_template || ($selected_template->get_type() !== Site_Type::SITE_TEMPLATE && ! wu_request('customizer'))) {
|
||||
wp_die(__('This template is not available', 'wp-ultimo'));
|
||||
wp_die(__('This template is not available', 'wp-multisite-waas'));
|
||||
}
|
||||
|
||||
$categories = [];
|
||||
@ -360,7 +360,7 @@ class Template_Previewer {
|
||||
'bg_color' => '#f9f9f9',
|
||||
'button_bg_color' => '#00a1ff',
|
||||
'logo_url' => wu_get_network_logo(),
|
||||
'button_text' => __('Use this Template', 'wp-ultimo'),
|
||||
'button_text' => __('Use this Template', 'wp-multisite-waas'),
|
||||
'preview_url_parameter' => 'template-preview',
|
||||
'display_responsive_controls' => true,
|
||||
'use_custom_logo' => false,
|
||||
@ -394,12 +394,13 @@ class Template_Previewer {
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param string $setting The setting key.
|
||||
* @param mixed $default Default value, if it is not found.
|
||||
* @param mixed $default_value Default value, if it is not found.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_setting($setting, $default = false) {
|
||||
|
||||
return wu_get_isset($this->get_settings(), $setting, $default);
|
||||
public function get_setting($setting, $default_value = false) {
|
||||
$settings = wu_get_option(self::KEY, []);
|
||||
return wu_get_isset($settings, $setting, $default_value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -82,7 +82,7 @@ class Template_Switching_Element extends Base_Element {
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return __('Template Switching', 'wp-ultimo');
|
||||
return __('Template Switching', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -93,7 +93,7 @@ class Template_Switching_Element extends Base_Element {
|
||||
*/
|
||||
public function get_description() {
|
||||
|
||||
return __('Adds the template switching form to this page.', 'wp-ultimo');
|
||||
return __('Adds the template switching form to this page.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -142,8 +142,8 @@ class Template_Switching_Element extends Base_Element {
|
||||
$fields = [];
|
||||
|
||||
$fields['header'] = [
|
||||
'title' => __('Layout', 'wp-ultimo'),
|
||||
'desc' => __('Layout', 'wp-ultimo'),
|
||||
'title' => __('Layout', 'wp-multisite-waas'),
|
||||
'desc' => __('Layout', 'wp-multisite-waas'),
|
||||
'type' => 'header',
|
||||
];
|
||||
|
||||
@ -153,8 +153,8 @@ class Template_Switching_Element extends Base_Element {
|
||||
'fields' => [
|
||||
'template_selection_template' => [
|
||||
'type' => 'select',
|
||||
'title' => __('Template Selector Layout', 'wp-ultimo'),
|
||||
'placeholder' => __('Select your Layout', 'wp-ultimo'),
|
||||
'title' => __('Template Selector Layout', 'wp-multisite-waas'),
|
||||
'placeholder' => __('Select your Layout', 'wp-multisite-waas'),
|
||||
'default' => 'clean',
|
||||
'options' => [$this, 'get_template_selection_templates'],
|
||||
'wrapper_classes' => 'wu-flex-grow',
|
||||
@ -170,7 +170,7 @@ class Template_Switching_Element extends Base_Element {
|
||||
'order' => 99,
|
||||
'wrapper_classes' => 'sm:wu-p-0 sm:wu-block',
|
||||
'classes' => '',
|
||||
'desc' => sprintf('<div class="wu-p-4 wu-bg-blue-100 wu-text-grey-600">%s</div>', __('Want to add customized template selection templates?<br><a target="_blank" class="wu-no-underline" href="https://help.wpultimo.com/article/343-customize-your-checkout-flow-using-field-templates">See how you can do that here</a>.', 'wp-ultimo')),
|
||||
'desc' => sprintf('<div class="wu-p-4 wu-bg-blue-100 wu-text-grey-600">%s</div>', __('Want to add customized template selection templates?<br><a target="_blank" class="wu-no-underline" href="https://help.wpultimo.com/article/343-customize-your-checkout-flow-using-field-templates">See how you can do that here</a>.', 'wp-multisite-waas')),
|
||||
];
|
||||
|
||||
return $fields;
|
||||
@ -275,7 +275,7 @@ class Template_Switching_Element extends Base_Element {
|
||||
$template_id = wu_request('template_id', '');
|
||||
|
||||
if ( ! $template_id) {
|
||||
return new \WP_Error('template_id_required', __('You need to provide a valid template to duplicate.', 'wp-ultimo'));
|
||||
return new \WP_Error('template_id_required', __('You need to provide a valid template to duplicate.', 'wp-multisite-waas'));
|
||||
}
|
||||
|
||||
$switch = \WP_Ultimo\Helpers\Site_Duplicator::override_site($template_id, $this->site->get_id());
|
||||
@ -349,12 +349,12 @@ class Template_Switching_Element extends Base_Element {
|
||||
|
||||
$template_class = Field_Templates_Manager::get_instance()->get_template_class('template_selection', $atts['template_selection_template']);
|
||||
|
||||
$content = $template_class ? $template_class->render_container($template_attributes, $reducer_class) : __('Template does not exist.', 'wp-ultimo');
|
||||
$content = $template_class ? $template_class->render_container($template_attributes, $reducer_class) : __('Template does not exist.', 'wp-multisite-waas');
|
||||
|
||||
$checkout_fields['back_to_template_selection'] = [
|
||||
'type' => 'note',
|
||||
'order' => 0,
|
||||
'desc' => sprintf('<a href="#" class="wu-no-underline wu-mt-1 wu-uppercase wu-text-2xs wu-font-semibold wu-text-gray-600" v-on:click.prevent="template_id = original_template_id; confirm_switch = false">%s</a>', __('← Back to Template Selection', 'wp-ultimo')),
|
||||
'desc' => sprintf('<a href="#" class="wu-no-underline wu-mt-1 wu-uppercase wu-text-2xs wu-font-semibold wu-text-gray-600" v-on:click.prevent="template_id = original_template_id; confirm_switch = false">%s</a>', __('← Back to Template Selection', 'wp-multisite-waas')),
|
||||
'wrapper_html_attr' => [
|
||||
'v-init:original_template_id' => $this->site->get_template_id(),
|
||||
'v-show' => 'template_id != original_template_id',
|
||||
@ -375,8 +375,8 @@ class Template_Switching_Element extends Base_Element {
|
||||
|
||||
$checkout_fields['confirm_switch'] = [
|
||||
'type' => 'toggle',
|
||||
'title' => __('Confirm template switch?', 'wp-ultimo'),
|
||||
'desc' => __('Switching your current template completely overwrites the content of your site with the contents of the newly chosen template. All customizations will be lost. This action cannot be undone.', 'wp-ultimo'),
|
||||
'title' => __('Confirm template switch?', 'wp-multisite-waas'),
|
||||
'desc' => __('Switching your current template completely overwrites the content of your site with the contents of the newly chosen template. All customizations will be lost. This action cannot be undone.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'wrapper_classes' => '',
|
||||
'value' => 0,
|
||||
@ -391,7 +391,7 @@ class Template_Switching_Element extends Base_Element {
|
||||
|
||||
$checkout_fields['submit_switch'] = [
|
||||
'type' => 'link',
|
||||
'display_value' => __('Process Switch', 'wp-ultimo'),
|
||||
'display_value' => __('Process Switch', 'wp-multisite-waas'),
|
||||
'wrapper_classes' => 'wu-text-right wu-bg-gray-100',
|
||||
'classes' => 'button button-primary',
|
||||
'wrapper_html_attr' => [
|
||||
|
@ -148,8 +148,8 @@ class Thank_You_Element extends Base_Element {
|
||||
'resend_verification_email_nonce' => wp_create_nonce('wu_resend_verification_email_nonce'),
|
||||
'membership_hash' => $this->membership ? $this->membership->get_hash() : false,
|
||||
'i18n' => [
|
||||
'resending_verification_email' => __('Resending verification email...', 'wp-ultimo'),
|
||||
'email_sent' => __('Verification email sent!', 'wp-ultimo'),
|
||||
'resending_verification_email' => __('Resending verification email...', 'wp-multisite-waas'),
|
||||
'email_sent' => __('Verification email sent!', 'wp-multisite-waas'),
|
||||
],
|
||||
]
|
||||
);
|
||||
@ -162,14 +162,14 @@ class Thank_You_Element extends Base_Element {
|
||||
*
|
||||
* This is used on the Blocks list of Gutenberg.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('My Element', 'wp-ultimo').
|
||||
* e.g. return __('My Element', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return __('Thank You', 'wp-ultimo');
|
||||
return __('Thank You', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -178,14 +178,14 @@ class Thank_You_Element extends Base_Element {
|
||||
* This is also used on the Gutenberg block list
|
||||
* to explain what this block is about.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-ultimo').
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
|
||||
return __('Adds a checkout form block to the page.', 'wp-ultimo');
|
||||
return __('Adds a checkout form block to the page.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -210,24 +210,24 @@ class Thank_You_Element extends Base_Element {
|
||||
$fields = [];
|
||||
|
||||
$fields['header'] = [
|
||||
'title' => __('General', 'wp-ultimo'),
|
||||
'desc' => __('General', 'wp-ultimo'),
|
||||
'title' => __('General', 'wp-multisite-waas'),
|
||||
'desc' => __('General', 'wp-multisite-waas'),
|
||||
'type' => 'header',
|
||||
];
|
||||
|
||||
$fields['title'] = [
|
||||
'type' => 'text',
|
||||
'title' => __('Title', 'wp-ultimo'),
|
||||
'value' => __('Thank You', 'wp-ultimo'),
|
||||
'desc' => __('Leave blank to hide the title completely.', 'wp-ultimo'),
|
||||
'title' => __('Title', 'wp-multisite-waas'),
|
||||
'value' => __('Thank You', 'wp-multisite-waas'),
|
||||
'desc' => __('Leave blank to hide the title completely.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
];
|
||||
|
||||
$fields['thank_you_message'] = [
|
||||
'type' => 'textarea',
|
||||
'title' => __('Thank You Message', 'wp-ultimo'),
|
||||
'desc' => __('Shortcodes are supported.', 'wp-ultimo'),
|
||||
'value' => __('Thank you for your payment! Your transaction has been completed and a receipt for your purchase has been emailed to you.', 'wp-ultimo'),
|
||||
'title' => __('Thank You Message', 'wp-multisite-waas'),
|
||||
'desc' => __('Shortcodes are supported.', 'wp-multisite-waas'),
|
||||
'value' => __('Thank you for your payment! Your transaction has been completed and a receipt for your purchase has been emailed to you.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'html_attr' => [
|
||||
'rows' => 4,
|
||||
@ -236,17 +236,17 @@ class Thank_You_Element extends Base_Element {
|
||||
|
||||
$fields['title_pending'] = [
|
||||
'type' => 'text',
|
||||
'title' => __('Title (Pending)', 'wp-ultimo'),
|
||||
'value' => __('Thank You', 'wp-ultimo'),
|
||||
'desc' => __('Leave blank to hide the title completely. This title is used when the payment was not yet confirmed.', 'wp-ultimo'),
|
||||
'title' => __('Title (Pending)', 'wp-multisite-waas'),
|
||||
'value' => __('Thank You', 'wp-multisite-waas'),
|
||||
'desc' => __('Leave blank to hide the title completely. This title is used when the payment was not yet confirmed.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
];
|
||||
|
||||
$fields['thank_you_message_pending'] = [
|
||||
'type' => 'textarea',
|
||||
'title' => __('Thank You Message (Pending)', 'wp-ultimo'),
|
||||
'desc' => __('This content is used when the payment was not yet confirmed. Shortcodes are supported.', 'wp-ultimo'),
|
||||
'value' => __('Thank you for your order! We are waiting on the payment processor to confirm your payment, which can take up to 5 minutes. We will notify you via email when your site is ready.', 'wp-ultimo'),
|
||||
'title' => __('Thank You Message (Pending)', 'wp-multisite-waas'),
|
||||
'desc' => __('This content is used when the payment was not yet confirmed. Shortcodes are supported.', 'wp-multisite-waas'),
|
||||
'value' => __('Thank you for your order! We are waiting on the payment processor to confirm your payment, which can take up to 5 minutes. We will notify you via email when your site is ready.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'html_attr' => [
|
||||
'rows' => 4,
|
||||
@ -255,9 +255,9 @@ class Thank_You_Element extends Base_Element {
|
||||
|
||||
$fields['no_sites_message'] = [
|
||||
'type' => 'textarea',
|
||||
'title' => __('No Sites Message', 'wp-ultimo'),
|
||||
'desc' => __('A message to show if membership has no sites. Shortcodes are supported.', 'wp-ultimo'),
|
||||
'value' => __('No sites found', 'wp-ultimo'),
|
||||
'title' => __('No Sites Message', 'wp-multisite-waas'),
|
||||
'desc' => __('A message to show if membership has no sites. Shortcodes are supported.', 'wp-multisite-waas'),
|
||||
'value' => __('No sites found', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'html_attr' => [
|
||||
'rows' => 4,
|
||||
@ -312,11 +312,11 @@ class Thank_You_Element extends Base_Element {
|
||||
public function defaults() {
|
||||
|
||||
return [
|
||||
'title' => __('Thank You', 'wp-ultimo'),
|
||||
'thank_you_message' => __('Thank you for your payment! Your transaction has been completed and a receipt for your purchase has been emailed to you.', 'wp-ultimo'),
|
||||
'title_pending' => __('Thank You', 'wp-ultimo'),
|
||||
'thank_you_message_pending' => __('Thank you for your order! We are waiting on the payment processor to confirm your payment, which can take up to 5 minutes. We will notify you via email when your site is ready.', 'wp-ultimo'),
|
||||
'no_sites_message' => __('No sites found', 'wp-ultimo'),
|
||||
'title' => __('Thank You', 'wp-multisite-waas'),
|
||||
'thank_you_message' => __('Thank you for your payment! Your transaction has been completed and a receipt for your purchase has been emailed to you.', 'wp-multisite-waas'),
|
||||
'title_pending' => __('Thank You', 'wp-multisite-waas'),
|
||||
'thank_you_message_pending' => __('Thank you for your order! We are waiting on the payment processor to confirm your payment, which can take up to 5 minutes. We will notify you via email when your site is ready.', 'wp-multisite-waas'),
|
||||
'no_sites_message' => __('No sites found', 'wp-multisite-waas'),
|
||||
];
|
||||
}
|
||||
|
||||
@ -392,7 +392,7 @@ class Thank_You_Element extends Base_Element {
|
||||
/*
|
||||
* Deal with conversion tracking
|
||||
*/
|
||||
$conversion_snippets = $atts['checkout_form']->get_conversion_snippets();
|
||||
$conversion_snippets = $atts['checkout_form'] ? $atts['checkout_form']->get_conversion_snippets() : false;
|
||||
|
||||
if ( ! empty($conversion_snippets)) {
|
||||
$product_ids = [];
|
||||
@ -419,7 +419,7 @@ class Thank_You_Element extends Base_Element {
|
||||
);
|
||||
|
||||
foreach ($conversion_placeholders as $placeholder => $value) {
|
||||
$conversion_snippets = preg_replace('/\%\%\s?' . $placeholder . '\s?\%\%/', json_encode($value), (string) $conversion_snippets);
|
||||
$conversion_snippets = preg_replace('/\%\%\s?' . $placeholder . '\s?\%\%/', wp_json_encode($value), (string) $conversion_snippets);
|
||||
}
|
||||
|
||||
add_action(
|
||||
|
@ -95,8 +95,8 @@ class Tours {
|
||||
'ajaxurl' => wu_ajax_url(),
|
||||
'nonce' => wp_create_nonce('wu_tour_finished'),
|
||||
'i18n' => [
|
||||
'next' => __('Next', 'wp-ultimo'),
|
||||
'finish' => __('Close', 'wp-ultimo'),
|
||||
'next' => __('Next', 'wp-multisite-waas'),
|
||||
'finish' => __('Close', 'wp-multisite-waas'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
Reference in New Issue
Block a user