diff --git a/includes/Brands.php b/includes/Brands.php index 31f4995..aa1d952 100644 --- a/includes/Brands.php +++ b/includes/Brands.php @@ -31,13 +31,13 @@ public static function get_default_brand() { } /** - * Brand specific data - Bluehost, Bluehost India, Webcom + * Retrieve brand-specific data for various brands such as Bluehost, Bluehost India, Web.com, etc. * - * @return array + * @return array Associative array containing configuration details for each brand, including links, + * contact information, and enabled features. */ - public static function get_brands() { - - // Checks if customer has acess to AI Sitegen. + public static function get_brands(): array { + // Checks if customer has access to AI Sitegen. $has_ai_sitegen = Config::has_ai_sitegen(); $can_migrate_site = Config::can_migrate_site(); @@ -99,9 +99,7 @@ public static function get_brands() { ), ), 'migrationInfo' => array( - 'defaultLink' => Config::is_jarvis() ? - 'https://www.bluehost.com/my-account/hosting/details/sites/add/transfer' - : 'https://my.bluehost.com/cgi/services/migration', + 'defaultLink' => 'https://www.bluehost.com/my-account/hosting/details/sites/add/transfer', ), 'config' => array( 'enabled_flows' => array( @@ -401,15 +399,9 @@ public static function get_brands() { 'twitterUrl' => 'https://twitter.com/hostgator', 'youtubeUrl' => 'https://www.youtube.com/user/hostgator', 'linkedinUrl' => 'https://www.linkedin.com/company/hostgator-com/', - 'accountUrl' => Config::is_jarvis() ? - 'https://www.hostgator.com/my-account/login' - : 'https://portal.hostgator.com/', - 'domainsUrl' => Config::is_jarvis() ? - 'https://www.hostgator.com/my-account/domain-center/domain-list' - : 'https://portal.hostgator.com/domain/manage', - 'emailUrl' => Config::is_jarvis() ? - 'https://www.hostgator.com/my-account/hosting/details/email' - : 'https://portal.hostgator.com/email', + 'accountUrl' => 'https://www.hostgator.com/my-account/login', + 'domainsUrl' => 'https://www.hostgator.com/my-account/domain-center/domain-list', + 'emailUrl' => 'https://www.hostgator.com/my-account/hosting/details/email', 'pluginDashboardPage' => \admin_url( 'admin.php?page=hostgator' ), 'phoneNumbers' => array( 'support' => '866-964-2867', diff --git a/includes/Config.php b/includes/Config.php index 4b988f3..554dade 100644 --- a/includes/Config.php +++ b/includes/Config.php @@ -36,19 +36,14 @@ public static function get_wp_config_initialization_constants() { * @return boolean */ public static function get_site_capability( $capability ) { + // Only fetch capabilities in the admin when a user is logged in + if ( ! is_admin() || ! is_user_logged_in() ) { + return false; + } $site_capabilities = new SiteCapabilities(); return $site_capabilities->get( $capability ); } - /** - * Checks if the site is on Jarvis hosting. - * - * @return boolean - */ - public static function is_jarvis() { - return self::get_site_capability( 'isJarvis' ); - } - /** * Gets the current customer capability if he has access to AI Sitegen. * diff --git a/includes/Data.php b/includes/Data.php index 04f5713..2e91f32 100644 --- a/includes/Data.php +++ b/includes/Data.php @@ -35,9 +35,10 @@ public static function runtime() { } /** - * Establish brand to apply to Onboarding experience. + * Establish the brand to apply to the Onboarding experience. * - * @return array + * @return array The configuration array of the current brand. If the specified brand is not found, + * returns the default brand configuration. */ public static function current_brand() { $brands = Brands::get_brands(); diff --git a/includes/Flows/Flows.php b/includes/Flows/Flows.php index a3fc6fd..c805567 100644 --- a/includes/Flows/Flows.php +++ b/includes/Flows/Flows.php @@ -176,7 +176,7 @@ final class Flows { ), 'continueWithoutAi' => false, - 'sitegenThemeMode' => '', + 'sitegenThemeMode' => '', ); /** @@ -220,8 +220,10 @@ public static function get_default_flow() { /** * Retrieve all the known onboarding flows. * - * @return array A value of true for each key indicates that the flow has been approved - * and a value of null indicates the flow has not been approved (or) has been temporarily disabled. + * @return array Associative array of onboarding flows. A value of true for each key indicates that the + * flow has been approved. A value of null indicates the flow has not been approved or has + * been temporarily disabled. If no enabled flows are found, default flows are provided with + * a value of false. */ public static function get_flows() { $current_brand = Data::current_brand();