Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…oarding into enhance/enable-general-onboarding
  • Loading branch information
arunshenoy99 committed Apr 17, 2023
2 parents 4954190 + 0f3cd30 commit da59961
Show file tree
Hide file tree
Showing 67 changed files with 5,487 additions and 4,511 deletions.
67 changes: 67 additions & 0 deletions includes/Data/Brands.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public static function get_brands() {
'accountUrl' => 'https://my.bluehost.com',
'domainsUrl' => 'https://my.bluehost.com/hosting/app?lil=1#/domains',
'emailUrl' => 'https://my.bluehost.com/hosting/app?lil=1#/email-office',
'pluginDashboardPage' => \admin_url( 'admin.php?page=bluehost' ),
'phoneNumbers' => array(
'sales' => '844-303-1730',
'support' => '888-401-4678',
Expand Down Expand Up @@ -89,6 +90,7 @@ public static function get_brands() {
'accountUrl' => 'https://my.bluehost.in',
'domainsUrl' => 'https://my.bluehost.in/hosting/app?lil=1#/domains',
'emailUrl' => 'https://my.bluehost.in/hosting/app?lil=1#/email-office',
'pluginDashboardPage' => \admin_url( 'admin.php?page=bluehost' ),
'phoneNumbers' => array(
'support' => '1800-419-4426',
),
Expand Down Expand Up @@ -188,6 +190,71 @@ public static function get_brands() {
),
),
),
'crazy-domains' => array(
'brand' => 'crazy-domains',
'name' => 'Crazy Domains',
'url' => 'https://www.crazydomains.com',
'knowledgeBaseUrl' => 'https://www.crazydomains.com/learn/online-academy/',
'helpUrl' => 'https://www.crazydomains.com/help',
'blogUrl' => 'https://www.crazydomains.com/learn/',
'facebookUrl' => 'https://www.facebook.com/crazydomains/',
'twitterName' => '@crazydomains',
'twitterUrl' => 'https://twitter.com/crazydomains',
'youtubeUrl' => 'https://www.youtube.com/user/CrazyDomains',
'linkedinUrl' => '',
'accountUrl' => 'https://www.crazydomains.com/my-account/home/',
'domainsUrl' => '',
'emailUrl' => 'https://www.crazydomains.com/contact/',
'pluginDashboardPage' => \admin_url( 'admin.php?page=crazy-domains' ),
'phoneNumbers' => array(
'support' => '2135592459',
),
'hireExpertsInfo' => array(
'defaultLink' => 'https://www.crazydomains.com/help/',
'fragment' => '',
'queryParameters' => array(
'utm_source' => 'wp-onboarding',
'utm_medium' => 'brand-plugin',
'utm_campaign' => 'wp-setup',
),
),
'expertsInfo' => array(
'defaultLink' => 'https://www.crazydomains.com/help/',
'queryParams' => array(
'utm_source' => 'wp-onboarding',
'utm_medium' => 'brand-plugin',
),
),
'fullServiceCreativeTeamInfo' => array(
'defaultLink' => 'https://www.crazydomains.com/help/',
'fragment' => '',
'queryParams' => array(
'utm_source' => 'wp-onboarding',
'utm_medium' => 'brand-plugin',
),
),
'techSupportInfo' => array(
'defaultLink' => 'https://www.crazydomains.com/contact/',
'queryParams' => array(
'utm_source' => 'wp-onboarding',
'utm_medium' => 'brand-plugin',
),
),
'config' => array(
'net_new_signup_date_threshold' => '2022-08-18T15:30:00.000Z',
'enabled_flows' => array(
'ecommerce' => false,
'wp-setup' => false,
),
'views' => array(
'sidebar' => array(
'illustration' => array(
'shown' => false,
),
),
),
),
),
);
}

Expand Down
30 changes: 11 additions & 19 deletions includes/Data/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,14 @@ public static function runtime() {
/**
* Establish brand to apply to Onboarding experience.
*
* [TODO]: Pull brand from container.
*
* @return array
*/
public static function current_brand() {

$brand = \get_option( Options::get_option_name( 'brand', false ), 'newfold' );
// This case arises when the option mm_brand exists but has an empty string as it's value.
if ( empty( $brand ) ) {
$brand = 'newfold';
}
$brand = \apply_filters( 'nfd_module_onboarding_brand', sanitize_title_with_dashes( str_replace( '_', '-', $brand ) ) );

$brands = Brands::get_brands();

return array_key_exists( $brand, $brands ) ? $brands[ $brand ] : array( 'brand' => $brand );
return array_key_exists( NFD_ONBOARDING_PLUGIN_BRAND, $brands ) ?
$brands[ NFD_ONBOARDING_PLUGIN_BRAND ] :
array( 'brand' => NFD_ONBOARDING_PLUGIN_BRAND );
}


Expand All @@ -60,11 +52,11 @@ public static function current_plan() {

$current_flow = Flows::get_flow_from_customer_data( $customer_data );
if ( false !== $current_flow ) {
return array(
'flow' => $current_flow,
'subtype' => $customer_data['plan_subtype'],
'type' => $customer_data['plan_type'],
);
return array(
'flow' => $current_flow,
'subtype' => $customer_data['plan_subtype'],
'type' => $customer_data['plan_type'],
);
}

$current_flow = Flows::get_flow_from_params();
Expand Down Expand Up @@ -128,9 +120,9 @@ public static function current_flow() {
*/
public static function customer_data() {
if ( class_exists( 'NewfoldLabs\WP\Module\CustomerBluehost\CustomerBluehost' ) ) {
return CustomerBluehost::collect();
return CustomerBluehost::collect();
}
return array();
return array();
}

} // END \NewfoldLabs\WP\Module\Onboarding\Data()
}
14 changes: 14 additions & 0 deletions includes/Data/Plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,20 @@ final class Plugins {
),
'wc_priority' => array(),
),
'crazy-domains' => array(
'wc_priority' => array(
array(
'slug' => 'nfd_slug_yith_shippo_shippings_for_woocommerce',
'activate' => true,
'priority' => 259,
),
array(
'slug' => 'nfd_slug_yith_paypal_payments_for_woocommerce',
'activate' => true,
'priority' => 258,
),
),
),
),
);

Expand Down
Loading

0 comments on commit da59961

Please sign in to comment.