Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab
indent_size = 4

[*.{json,yml,yaml}]
indent_style = space
indent_size = 2
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Ultimate Multisite

<p align="center">
<img src="https://raw.githubusercontent.com/superdav42/wp-multisite-waas/refs/heads/main/assets/img/logo.png" alt="Ultimate Multisite Logo" width="300">
<img src="https://github.com/Boofola/ultimate-multisite/blob/main/assets/img/logo-white.png" alt="Ultimate Multisite Logo" width="300">
</p>

<p align="center">
Expand Down
Binary file modified assets/img/checkout-forms/clean-template-selection.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/checkout-forms/minimal-template-selection.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/checkout-forms/url-preview.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/logo-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/logo-wide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/settings/settings-disable-hover-to-zoom.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/settings/settings-hide-ui-tours.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/sidebar/checkout-forms.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/sidebar/invoice-template.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/sidebar/invoices.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/sidebar/site-template.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/sidebar/system-emails.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/sidebar/template-placeholders.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/ultimate-multisite-screenshot.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/img/wp-ultimo-screenshot.webp
Binary file not shown.
2 changes: 1 addition & 1 deletion inc/admin-pages/class-setup-wizard-admin-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ public function alert_incomplete_installation(): void {

if (! defined('SUNRISE') || ! SUNRISE) {
// translators: %s code snippet.
$message = sprintf(__('The SUNRISE constant is missing. Domain mapping and plugin/theme limits will not function until `%s` is added to wp-config.php. Please complete the setup to attempt to do this automatically.', 'multisite-ultimate'), 'define( \'SUNRISE\', \'1\' );');
$message = sprintf(__('The SUNRISE constant is missing. Domain mapping and plugin/theme limits will not function until `%s` is added to wp-config.php. Please complete the setup to attempt to do this automatically.', 'ultimate-multisite'), 'define( \'SUNRISE\', \'1\' );');
} else {
$message = __('Ultimate Multisite installation is incomplete. The sunrise.php file is missing. Please complete the setup to ensure proper functionality.', 'ultimate-multisite');
}
Expand Down
14 changes: 7 additions & 7 deletions inc/apis/trait-mcp-abilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ public function register_ability_category(): void {
return;
}

if (wp_has_ability_category('multisite-ultimate')) {
if (wp_has_ability_category('ultimate-multisite')) {
return;
}
wp_register_ability_category(
'multisite-ultimate',
'ultimate-multisite',
[
'label' => __('Multisite Ultimate', 'ultimate-multisite'),
'description' => __('CRUD operations for Multisite Ultimate entities including customers, sites, products, memberships, and more.', 'ultimate-multisite'),
Expand Down Expand Up @@ -180,7 +180,7 @@ protected function register_get_item_ability(string $ability_prefix, string $dis
'label' => sprintf(__('Get %s by ID', 'ultimate-multisite'), $display_name),
// translators: %s: entity name (e.g., customer, site, product)
'description' => sprintf(__('Retrieve a single %s by its ID', 'ultimate-multisite'), strtolower($display_name)),
'category' => 'multisite-ultimate',
'category' => 'ultimate-multisite',
'execute_callback' => [$this, 'mcp_get_item'],
'permission_callback' => [$this, 'mcp_permission_callback'],
'input_schema' => [
Expand Down Expand Up @@ -231,7 +231,7 @@ protected function register_get_items_ability(string $ability_prefix, string $di
'label' => sprintf(__('List %s', 'ultimate-multisite'), $display_name),
// translators: %s: entity name (e.g., customer, site, product)
'description' => sprintf(__('Retrieve a list of %s with optional filters', 'ultimate-multisite'), strtolower($display_name)),
'category' => 'multisite-ultimate',
'category' => 'ultimate-multisite',
'execute_callback' => [$this, 'mcp_get_items'],
'permission_callback' => [$this, 'mcp_permission_callback'],
'input_schema' => [
Expand Down Expand Up @@ -289,7 +289,7 @@ protected function register_create_item_ability(string $ability_prefix, string $
'label' => sprintf(__('Create %s', 'ultimate-multisite'), $display_name),
// translators: %s: entity name (e.g., customer, site, product)
'description' => sprintf(__('Create a new %s', 'ultimate-multisite'), strtolower($display_name)),
'category' => 'multisite-ultimate',
'category' => 'ultimate-multisite',
'execute_callback' => [$this, 'mcp_create_item'],
'permission_callback' => [$this, 'mcp_permission_callback'],
'input_schema' => $input_schema,
Expand Down Expand Up @@ -339,7 +339,7 @@ protected function register_update_item_ability(string $ability_prefix, string $
'label' => sprintf(__('Update %s', 'ultimate-multisite'), $display_name),
// translators: %s: entity name (e.g., customer, site, product)
'description' => sprintf(__('Update an existing %s', 'ultimate-multisite'), strtolower($display_name)),
'category' => 'multisite-ultimate',
'category' => 'ultimate-multisite',
'execute_callback' => [$this, 'mcp_update_item'],
'permission_callback' => [$this, 'mcp_permission_callback'],
'input_schema' => $input_schema,
Expand Down Expand Up @@ -374,7 +374,7 @@ protected function register_delete_item_ability(string $ability_prefix, string $
'label' => sprintf(__('Delete %s', 'ultimate-multisite'), $display_name),
// translators: %s: entity name (e.g., customer, site, product)
'description' => sprintf(__('Delete a %s by its ID', 'ultimate-multisite'), strtolower($display_name)),
'category' => 'multisite-ultimate',
'category' => 'ultimate-multisite',
'execute_callback' => [$this, 'mcp_delete_item'],
'permission_callback' => [$this, 'mcp_permission_callback'],
'input_schema' => [
Expand Down
24 changes: 24 additions & 0 deletions inc/managers/class-customer-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ function () {

add_action('wu_transition_customer_email_verification', [$this, 'transition_customer_email_verification'], 10, 3);

add_action('wu_event_customer_created', [$this, 'customer_created_email_verification']);

add_action('init', [$this, 'maybe_verify_email_address']);

add_action('wu_maybe_create_customer', [$this, 'maybe_add_to_main_site'], 10, 2);
Expand Down Expand Up @@ -176,6 +178,28 @@ public function transition_customer_email_verification($old_status, $new_status,
}
}


/**
* Send customer email verification when new customer is created with pending.
*
* @since 2.4.8
*
* @param array $payload Event Payload.
* @return void
*/
public function customer_created_email_verification($payload): void {

if ('pending' !== $payload['customer_email_verification']) {
return;
}

$customer = wu_get_customer($payload['customer_id']);
Comment on lines +192 to +196
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add payload validation to prevent potential errors.

The method accesses $payload['customer_email_verification'] and $payload['customer_id'] without validating that these keys exist, which could trigger PHP warnings if the event payload is incomplete or malformed.

Apply this diff to add proper validation:

 public function customer_created_email_verification($payload): void {

+	if (!isset($payload['customer_email_verification'], $payload['customer_id'])) {
+		return;
+	}
+
 	if ('pending' !== $payload['customer_email_verification']) {
 		return;
 	}

 	$customer = wu_get_customer($payload['customer_id']);

 	if ($customer) {
 		$customer->send_verification_email();
 	}
 }
🤖 Prompt for AI Agents
In inc/managers/class-customer-manager.php around lines 192 to 196, the code
reads $payload['customer_email_verification'] and $payload['customer_id']
without verifying those keys exist; add explicit payload validation by checking
that 'customer_email_verification' and 'customer_id' are present (use isset or
array_key_exists) before accessing them, return early if either is missing or
not a string/expected type, and only then call
wu_get_customer($payload['customer_id']); this prevents PHP warnings from
malformed or incomplete event payloads.


if ($customer) {
$customer->send_verification_email();
}
}

/**
* Verifies a customer by checking the email key.
*
Expand Down
Loading