Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data updates #3

Merged
merged 1 commit into from
Sep 26, 2023
Merged
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
93 changes: 91 additions & 2 deletions includes/Brands.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,18 @@ public static function get_brands() {
'utm_medium' => 'brand-plugin',
),
),
'migrationInfo' => array(
'defaultLink' => Config::is_jarvis() ?
'https://www.bluehost.com/my-account/hosting/details/sites/add/transfer'
: 'https://my.bluehost.com/cgi/services/migration',
),
'config' => array(
'enabled_flows' => array(
'ecommerce' => true,
'wp-setup' => true,
),
'wonder_blocks' => true,
'prioritization' => false,
),
),
'bluehost-india' => array(
Expand Down Expand Up @@ -154,12 +160,14 @@ public static function get_brands() {
'utm_medium' => 'brand-plugin',
),
),
'migrationInfo' => array(),
'config' => array(
'enabled_flows' => array(
'ecommerce' => true,
'wp-setup' => false,
),
'wonder_blocks' => true,
'prioritization' => false,
),
),
'webcom' => array(
Expand Down Expand Up @@ -212,12 +220,14 @@ public static function get_brands() {
'utm_medium' => '',
),
),
'migrationInfo' => array(),
'config' => array(
'enabled_flows' => array(
'ecommerce' => false,
'wp-setup' => false,
),
'wonder_blocks' => true,
'prioritization' => false,
),
),
'crazy-domains' => array(
Expand Down Expand Up @@ -270,12 +280,81 @@ public static function get_brands() {
'utm_medium' => 'brand-plugin',
),
),
'migrationInfo' => array(),
'config' => array(
'enabled_flows' => array(
'ecommerce' => true,
'wp-setup' => true,
),
'wonder_blocks' => true,
'prioritization' => false,
'views' => array(
'sidebar' => array(
'illustration' => array(
'shown' => false,
),
),
),
),
),
'hostgator-br' => array(
'brand' => 'hostgator-br',
'name' => 'HostGator',
'url' => 'https://www.hostgator.com.br',
'knowledgeBaseUrl' => 'https://suporte.hostgator.com.br/hc/pt-br',
'helpUrl' => 'https://cliente.hostgator.com.br/suporte',
'blogUrl' => 'https://www.hostgator.com.br/blog/',
'facebookUrl' => 'https://www.facebook.com/HostgatorBrasil/',
'twitterName' => '@hostgatorbrasil',
'twitterUrl' => 'https://twitter.com/hostgatorbrasil',
'youtubeUrl' => 'https://www.youtube.com/c/HostGatorBrasil',
'linkedinUrl' => 'https://www.linkedin.com/company/hostgator-latam/',
'accountUrl' => 'https://financeiro.hostgator.com.br/',
'domainsUrl' => 'https://cliente.hostgator.com.br/dominios',
'emailUrl' => 'https://cliente.hostgator.com.br/emails-list',
'pluginDashboardPage' => \admin_url( 'admin.php?page=hostgator' ),
'phoneNumbers' => array(
'support' => '',
),
'hireExpertsInfo' => array(
'defaultLink' => 'https://suporte.hostgator.com.br/hc/pt-br',
'fragment' => '',
'queryParameters' => array(
'utm_source' => 'wp-onboarding',
'utm_medium' => 'brand-plugin',
'utm_campaign' => 'wp-setup',
),
),
'expertsInfo' => array(
'defaultLink' => 'https://suporte.hostgator.com.br/hc/pt-br',
'queryParams' => array(
'utm_source' => 'wp-onboarding',
'utm_medium' => 'brand-plugin',
),
),
'fullServiceCreativeTeamInfo' => array(
'defaultLink' => 'https://suporte.hostgator.com.br/hc/pt-br',
'fragment' => '',
'queryParams' => array(
'utm_source' => 'wp-onboarding',
'utm_medium' => 'brand-plugin',
),
),
'techSupportInfo' => array(
'defaultLink' => 'https://suporte.hostgator.com.br/hc/pt-br',
'queryParams' => array(
'utm_source' => 'wp-onboarding',
'utm_medium' => 'brand-plugin',
),
),
'migrationInfo' => array(),
'config' => array(
'enabled_flows' => array(
'ecommerce' => true,
'wp-setup' => true,
),
'wonder_blocks' => true,
'prioritization' => false,
'views' => array(
'sidebar' => array(
'illustration' => array(
Expand All @@ -292,15 +371,25 @@ public static function get_brands() {
* Sets the hosting brand for which Onboarding is active.
*
* @param object $container The brand plugin container.
* @return void
* @return string
*/
public static function set_current_brand( $container ) {
if ( ! defined( 'NFD_ONBOARDING_PLUGIN_BRAND' ) ) {
$brand = $container->plugin()->brand;
if ( empty( $brand ) ) {
$brand = 'wordpress';
}
define( 'NFD_ONBOARDING_PLUGIN_BRAND', sanitize_title_with_dashes( str_replace( '_', '-', $brand ) ) );

if ( false !== strpos( $brand, 'hostgator' ) ) {
$region = strtolower( $container->plugin()->region );
$brand = "hostgator-{$region}";
}

$brand = sanitize_title_with_dashes( str_replace( '_', '-', $brand ) );

define( 'NFD_ONBOARDING_PLUGIN_BRAND', $brand );

return $brand;
}
}
}
22 changes: 22 additions & 0 deletions includes/Config.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php
namespace NewfoldLabs\WP\Module\Onboarding\Data;

use NewfoldLabs\WP\Module\Data\SiteCapabilities;

/**
* WordPress and Onboarding configuration data.
*/
Expand All @@ -26,4 +28,24 @@ final class Config {
public static function get_wp_config_initialization_constants() {
return self::$wp_config_initialization_constants;
}

/**
* Get a specific site capability.
*
* @param string $capability Name/slug of the capability.
* @return boolean
*/
public static function get_site_capability( $capability ) {
$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' );
}
}