From b994a75db35895adb34b4739748bf14cab427467 Mon Sep 17 00:00:00 2001
From: David Stone <david@nnucomputerwhiz.com>
Date: Sat, 28 Dec 2024 23:26:14 -0700
Subject: [PATCH] Fix class not found errors

---
 inc/checkout/class-checkout.php             | 2 +-
 inc/class-api.php                           | 4 ++--
 inc/duplication/duplicate.php               | 2 +-
 inc/gateways/class-base-stripe-gateway.php  | 8 ++++----
 inc/helpers/class-site-duplicator.php       | 4 ++--
 inc/helpers/class-validator.php             | 2 +-
 inc/managers/class-email-manager.php        | 2 +-
 inc/models/class-domain.php                 | 2 +-
 inc/ui/class-site-actions-element.php       | 2 +-
 inc/ui/class-template-switching-element.php | 2 +-
 10 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/inc/checkout/class-checkout.php b/inc/checkout/class-checkout.php
index 650cbe8..0b582ab 100644
--- a/inc/checkout/class-checkout.php
+++ b/inc/checkout/class-checkout.php
@@ -954,7 +954,7 @@ class Checkout {
 
 			wu_maybe_log_error($e);
 
-			return new WP_Error('exception', $e->getMessage(), $e->getTrace());
+			return new \WP_Error('exception', $e->getMessage(), $e->getTrace());
 
 		} // end try;
 
diff --git a/inc/class-api.php b/inc/class-api.php
index 9ef222e..ad04e27 100644
--- a/inc/class-api.php
+++ b/inc/class-api.php
@@ -87,8 +87,8 @@ class API {
 	 *
 	 * @since 2.1.2
 	 *
-	 * @param WP_Error|null|bool $result Error from another authentication handler, null if we should handle it, or another value if not.
-	 * @return WP_Error|null|bool The current filter value or true if we should handle it.
+	 * @param \WP_Error|null|bool $result Error from another authentication handler, null if we should handle it, or another value if not.
+	 * @return \WP_Error|null|bool The current filter value or true if we should handle it.
 	 */
 	public function maybe_bypass_wp_auth($result) {
 
diff --git a/inc/duplication/duplicate.php b/inc/duplication/duplicate.php
index 9df1b7e..7edff19 100644
--- a/inc/duplication/duplicate.php
+++ b/inc/duplication/duplicate.php
@@ -122,7 +122,7 @@ if( !class_exists( 'MUCD_Duplicate' ) ) {
                 $password = wp_generate_password( 12, false );
                 $user_id = wpmu_create_user( $domain, $password, $email );
                 if ( false == $user_id ) {
-                    return new WP_Error( 'file_copy', MUCD_NETWORK_PAGE_DUPLICATE_ADMIN_ERROR_CREATE_USER);
+                    return new \WP_Error( 'file_copy', MUCD_NETWORK_PAGE_DUPLICATE_ADMIN_ERROR_CREATE_USER);
                 }
                 else {
                     wp_new_user_notification( $user_id, $password );
diff --git a/inc/gateways/class-base-stripe-gateway.php b/inc/gateways/class-base-stripe-gateway.php
index e0fe688..46befdd 100644
--- a/inc/gateways/class-base-stripe-gateway.php
+++ b/inc/gateways/class-base-stripe-gateway.php
@@ -2094,7 +2094,7 @@ class Base_Stripe_Gateway extends Base_Gateway {
 	 * @param Error\Base $e The stripe error object.
 	 *
 	 * @since 2.0.0
-	 * @return WP_Error
+	 * @return \WP_Error
 	 */
 	protected function get_stripe_error($e) {
 
@@ -2937,7 +2937,7 @@ class Base_Stripe_Gateway extends Base_Gateway {
 	 *                    }
 	 *
 	 * @since 2.0.0
-	 * @return string|WP_Error Plan ID on success or WP_Error on failure.
+	 * @return string|\WP_Error Plan ID on success or WP_Error on failure.
 	 */
 	public function maybe_create_plan($args) {
 
@@ -3066,7 +3066,7 @@ class Base_Stripe_Gateway extends Base_Gateway {
 	 *
 	 * @param string $name Product name.
 	 * @param string $id   Optional. Product ID. Automatically generated based on arguments.
-	 * @return string|WP_Error Product ID on success or WP_Error on failure.
+	 * @return string|\WP_Error Product ID on success or WP_Error on failure.
 	 */
 	private function maybe_create_product($name, $id = '') {
 
@@ -3166,7 +3166,7 @@ class Base_Stripe_Gateway extends Base_Gateway {
 	 * @param int    $duration      Duration.
 	 * @param string $duration_unit Duration unit.
 	 * @param string $tax_behavior  Tax behavior.
-	 * @return string|WP_Error Price ID on success or WP_Error on failure.
+	 * @return string|\WP_Error Price ID on success or WP_Error on failure.
 	 */
 	function maybe_create_price($title, $amount, $currency, $quantity = 1, $duration = false, $duration_unit = false, $tax_behavior = '') {
 
diff --git a/inc/helpers/class-site-duplicator.php b/inc/helpers/class-site-duplicator.php
index 03b05e3..25ef1e2 100644
--- a/inc/helpers/class-site-duplicator.php
+++ b/inc/helpers/class-site-duplicator.php
@@ -109,7 +109,7 @@ class Site_Duplicator {
 		if (is_wp_error($duplicate_site_id)) {
 
 			// translators: %s id the template site id and %s is the error message returned.
-			$message = sprintf(__('Attempt to override site %1$d with data from site %2$d failed: %3$s', 'wp-ultimo'), $from_site_id, $to_site_id, $duplicate_site->get_error_message());
+			$message = sprintf(__('Attempt to override site %1$d with data from site %2$d failed: %3$s', 'wp-ultimo'), $from_site_id, $to_site_id, $duplicate_site_id->get_error_message());
 
 			wu_log_add('site-duplication', $message, LogLevel::ERROR);
 
@@ -160,7 +160,7 @@ class Site_Duplicator {
 	 *                    - public       If the (new or not) site should be public. Defaults to true.
 	 *                    - domain       The domain of the new site.
 	 *                    - network_id   The network ID to allow for multi-network support.
-	 * @return int|WP_Error The Site ID.
+	 * @return int|\WP_Error The Site ID.
 	 */
 	protected static function process_duplication($args) {
 
diff --git a/inc/helpers/class-validator.php b/inc/helpers/class-validator.php
index 2a16859..94073c2 100644
--- a/inc/helpers/class-validator.php
+++ b/inc/helpers/class-validator.php
@@ -146,7 +146,7 @@ class Validator {
 	 * Returns a WP_Error object containing all validation errors.
 	 *
 	 * @since 2.0.0
-	 * @return WP_Error
+	 * @return \WP_Error
 	 */
 	public function get_errors() {
 
diff --git a/inc/managers/class-email-manager.php b/inc/managers/class-email-manager.php
index 10d3789..b78859b 100644
--- a/inc/managers/class-email-manager.php
+++ b/inc/managers/class-email-manager.php
@@ -553,7 +553,7 @@ class Email_Manager extends Base_Manager {
 	 *
 	 * @since 2.0.0
 	 *
-	 * @param WP_Error $error The error with the mailer.
+	 * @param \WP_Error $error The error with the mailer.
 	 * @return void.
 	 */
 	public function log_mailer_failure($error) {
diff --git a/inc/models/class-domain.php b/inc/models/class-domain.php
index 9515d03..f601d4f 100644
--- a/inc/models/class-domain.php
+++ b/inc/models/class-domain.php
@@ -586,7 +586,7 @@ class Domain extends Base_Model {
 	 * @since 2.0.0
 	 *
 	 * @param int|stdClass $site Site ID, or site object from {@see get_blog_details}.
-	 * @return Domain|Domain[]|WP_Error|false Mapping on success, WP_Error if error occurred, or false if no mapping found.
+	 * @return Domain|Domain[]|\WP_Error|false Mapping on success, WP_Error if error occurred, or false if no mapping found.
 	 */
 	public static function get_by_site($site) {
 
diff --git a/inc/ui/class-site-actions-element.php b/inc/ui/class-site-actions-element.php
index 939ff34..f5fa487 100644
--- a/inc/ui/class-site-actions-element.php
+++ b/inc/ui/class-site-actions-element.php
@@ -570,7 +570,7 @@ class Site_Actions_Element extends Base_Element {
 	 *
 	 * @since 2.0.21
 	 *
-	 * @return void|WP_Error Void or WP_Error.
+	 * @return void|\WP_Error Void or WP_Error.
 	 */
 	public function handle_delete_site() {
 
diff --git a/inc/ui/class-template-switching-element.php b/inc/ui/class-template-switching-element.php
index 10734c2..b9d3ed8 100644
--- a/inc/ui/class-template-switching-element.php
+++ b/inc/ui/class-template-switching-element.php
@@ -278,7 +278,7 @@ class Template_Switching_Element extends Base_Element {
 	 *
 	 * @since 2.0.4
 	 *
-	 * @return json|WP_Error Switch template response.
+	 * @return json|\WP_Error Switch template response.
 	 */
 	public function switch_template() {