diff --git a/page-dashboard.php b/page-dashboard.php index 365b761..4317e2a 100644 --- a/page-dashboard.php +++ b/page-dashboard.php @@ -12,6 +12,7 @@ if ( ! defined( 'ABSPATH' ) ) { $current_user_id = get_current_user_id(); $cloudflare_email = get_user_meta($current_user_id, 'cloudflare_api_email', true); $cloudflare_key = get_user_meta($current_user_id, 'cloudflare_api_key', true); +$onboard_steps = [ false, false, false, false ]; if (! ($cloudflare_email || $cloudflare_key) ) { $message = 'It looks like you haven\'t set up your CloudFlare API info yet. Click here to save that in your profile and get started!'; @@ -35,6 +36,22 @@ $email_count = count(get_posts([ 'meta_query' => [['key' => 'owner_id', 'value' => $current_user_id]] ])); +if ( ($cloudflare_email || $cloudflare_key) ) { + $onboard_steps[0] = true; +} + +if ($domain_count > 0) { + $onboard_steps[1] = true; +} + +if ($email_count > 0) { + $onboard_steps[2] = true; +} + +if ($campaign_count > 0) { + $onboard_steps[3] = true; +} + get_header(); ?>
> @@ -89,14 +106,14 @@ get_header(); ?>
- - - + + + - - - + + +
Total DomainsTotal CampaignsTotal Email AccountsTotal DomainsTotal CampaignsTotal Email Accounts
@@ -150,15 +167,18 @@ get_header(); ?> 'after' => '
', ) ); + if ( ($onboard_steps[0] || $onboard_steps[1] || $onboard_steps[2] || $onboard_steps[3]) ) : ?> - -

Get Started:

-
    -
  1. Save your CloudFlare API Credentials
  2. -
  3. Add a Domain and verify DNS records
  4. -
  5. Add one or more Email Accounts
  6. -
  7. Create a Campaign
  8. -
+
+

Get Started:

+
    +
  1. Save your CloudFlare API Credentials
  2. +
  3. Add a Domain and verify DNS records
  4. +
  5. Add one or more Email Accounts
  6. +
  7. Create a Campaign
  8. +
+
+