From 5834a3f99880d1e6ba6b1ae62e53ec0619134a73 Mon Sep 17 00:00:00 2001 From: Paul Bertrand Date: Thu, 18 Jun 2026 14:14:05 +0200 Subject: [PATCH 1/2] Improve General tab guidance and move custom domain to Advanced. This reduces setup confusion by keeping custom domain under Advanced, adds clearer onboarding copy and dashboard links in General, hides Save Changes on that informational tab, and updates browser tests for the revised tab behavior. --- simple-analytics.php | 9 ++-- src/UI/PageLayoutComponent.php | 71 ++++++++++++++++++++++++---- tests/Browser/pluginSettings.spec.ts | 26 ++++++++-- 3 files changed, 89 insertions(+), 17 deletions(-) diff --git a/simple-analytics.php b/simple-analytics.php index 2e2660b..5a22b62 100644 --- a/simple-analytics.php +++ b/simple-analytics.php @@ -77,10 +77,6 @@ $adminPage = SimpleAnalytics\Settings\AdminPage::title('Simple Analytics') ->slug('simpleanalytics') ->tab('General', function (Tab $tab) { - $tab->input(SettingName::CUSTOM_DOMAIN, 'Custom Domain') - ->placeholder('Enter your custom domain or leave it empty.') - ->description('E.g. api.example.com. Leave empty to use the default domain (most users).') - ->docs('https://docs.simpleanalytics.com/bypass-ad-blockers'); }) ->tab('Ignore Rules', function (Tab $tab) { $tab->icon(get_icon('eye-slash')); @@ -105,6 +101,11 @@ ->tab('Advanced', function (Tab $tab) { $tab->icon(get_icon('cog')); + $tab->input(SettingName::CUSTOM_DOMAIN, 'Custom Domain') + ->placeholder('Enter your custom domain or leave it empty.') + ->description('E.g. api.example.com. Leave empty to use the default domain (most users).') + ->docs('https://docs.simpleanalytics.com/bypass-ad-blockers'); + $tab->checkbox(SettingName::COLLECT_DNT, 'Collect Do Not Track') ->description('If you want to collect visitors with Do Not Track enabled, turn this on.') ->docs('https://docs.simpleanalytics.com/dnt'); diff --git a/src/UI/PageLayoutComponent.php b/src/UI/PageLayoutComponent.php index 0a8d81c..7fe3aa5 100644 --- a/src/UI/PageLayoutComponent.php +++ b/src/UI/PageLayoutComponent.php @@ -8,6 +8,9 @@ class PageLayoutComponent { + private const DASHBOARD_URL = 'https://dashboard.simpleanalytics.com/?utm_source=wordpress&utm_medium=plugin&utm_content=go_to_dashboard_button'; + private const SIGNUP_URL = 'https://www.simpleanalytics.com/signup?utm_source=wordpress&utm_medium=plugin&utm_content=signup_link'; + /** * @readonly * @var \SimpleAnalytics\Settings\AdminPage @@ -44,7 +47,7 @@ public function __invoke(): void
@@ -56,7 +59,7 @@ class="mr-2 inline-block h-10 w-auto text-primary" @@ -75,17 +78,22 @@ class="inline-flex items-center rounded bg-white px-2 py-1 text-xs font-semibold
+ getSlug() === 'general'): ?> + renderGeneralTabIntro(); ?> + render(); ?>
-
- -
+ getSlug() !== 'general'): ?> +
+ +
+