| @@ -1,23 +1,20 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace SimpleAnalytics\UI; |
| 4 | 4 | |
| 5 | -use SimpleAnalytics\Settings\{AdminPage, Tab}; | |
| 5 | +use SimpleAnalytics\Settings\{Page, Tab}; | |
| 6 | 6 | use function SimpleAnalytics\get_icon; |
| 7 | 7 | use const SimpleAnalytics\PLUGIN_URL; |
| 8 | 8 | |
| 9 | 9 | class PageLayoutComponent |
| 10 | 10 | { |
| 11 | - private const DASHBOARD_URL = 'https://dashboard.simpleanalytics.com/?utm_source=wordpress&utm_medium=plugin&utm_content=go_to_dashboard_button'; | |
| 12 | - private const SIGNUP_URL = 'https://www.simpleanalytics.com/signup?utm_source=wordpress&utm_medium=plugin&utm_content=signup_link'; | |
| 13 | - | |
| 14 | 11 | /** |
| 15 | 12 | * @readonly |
| 16 | - * @var \SimpleAnalytics\Settings\AdminPage | |
| 13 | + * @var \SimpleAnalytics\Settings\Page | |
| 17 | 14 | */ |
| 18 | 15 | private $page; |
| 19 | - public function __construct(AdminPage $page) | |
| 16 | + public function __construct(Page $page) | |
| 20 | 17 | { |
| 21 | 18 | $this->page = $page; |
| 22 | 19 | } |
| 23 | 20 | |
| @@ -46,9 +43,9 @@ | ||
| 46 | 43 | <div class="mx-auto max-w-3xl flex-col justify-between gap-5 sm:flex sm:items-baseline"> |
| 47 | 44 | <div class="flex items-center"> |
| 48 | 45 | <!-- Logo --> |
| 49 | 46 | <a |
| 50 | - href="<?php echo esc_url(self::DASHBOARD_URL); ?>" | |
| 47 | + href="https://dashboard.simpleanalytics.com/websites" | |
| 51 | 48 | target="_blank" |
| 52 | 49 | class="text-base font-semibold leading-6 text-gray-900" |
| 53 | 50 | > |
| 54 | 51 | <img |
| @@ -58,9 +55,9 @@ | ||
| 58 | 55 | > |
| 59 | 56 | </a> |
| 60 | 57 | <!-- "Open Dashboard" link --> |
| 61 | 58 | <a |
| 62 | - href="<?php echo esc_url(self::DASHBOARD_URL); ?>" | |
| 59 | + href="https://dashboard.simpleanalytics.com/websites" | |
| 63 | 60 | target="_blank" |
| 64 | 61 | class="inline-flex items-center rounded bg-white px-2 py-1 text-xs font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50" |
| 65 | 62 | > |
| 66 | 63 | <?php echo get_icon('external')->class('w-3.5 h-3.5 mr-0.5'); ?> |
| @@ -77,24 +74,19 @@ | ||
| 77 | 74 | |
| 78 | 75 | <!-- Fields / Layout --> |
| 79 | 76 | <div class="mx-auto max-w-3xl bg-white px-4 py-6 sm:px-4 lg:px-0"> |
| 80 | 77 | <div class="border-b border-gray-900/10 pb-7"> |
| 81 | - <?php if ($currentTab->getSlug() === 'general'): ?> | |
| 82 | - <?php $this->renderGeneralTabIntro(); ?> | |
| 83 | - <?php endif; ?> | |
| 84 | 78 | <?php $currentTab->render(); ?> |
| 85 | 79 | </div> |
| 86 | 80 | |
| 87 | - <?php if ($currentTab->getSlug() !== 'general'): ?> | |
| 88 | - <div class="mt-6 flex items-center justify-start gap-x-6"> | |
| 89 | - <button | |
| 90 | - type="submit" | |
| 91 | - class="rounded-md px-3 py-2 text-sm font-semibold text-white shadow-sm bg-primary hover:bg-red-500 focus-visible:outline-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2" | |
| 92 | - > | |
| 93 | - Save Changes | |
| 94 | - </button> | |
| 95 | - </div> | |
| 96 | - <?php endif; ?> | |
| 81 | + <div class="mt-6 flex items-center justify-start gap-x-6"> | |
| 82 | + <button | |
| 83 | + type="submit" | |
| 84 | + class="rounded-md px-3 py-2 text-sm font-semibold text-white shadow-sm bg-primary hover:bg-red-500 focus-visible:outline-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2" | |
| 85 | + > | |
| 86 | + Save Changes | |
| 87 | + </button> | |
| 88 | + </div> | |
| 97 | 89 | </div> |
| 98 | 90 | </form> |
| 99 | 91 | <script> |
| 100 | 92 | /** |
| @@ -146,50 +138,6 @@ | ||
| 146 | 138 | if ($tab->getSlug() === $slug) return $tab; |
| 147 | 139 | } |
| 148 | 140 | |
| 149 | 141 | return null; |
| 150 | - } | |
| 151 | - | |
| 152 | - protected function renderGeneralTabIntro(): void | |
| 153 | - { | |
| 154 | - ?> | |
| 155 | - <div class="mb-7" style="max-width: 64ch;"> | |
| 156 | - <p class="text-sm text-gray-700"> | |
| 157 | - Simple Analytics is now added to your WordPress site. | |
| 158 | - </p> | |
| 159 | - <p class="mt-4 text-sm text-gray-700"> | |
| 160 | - The plugin collects pageviews in a privacy-first way, without cookies or personal data. | |
| 161 | - </p> | |
| 162 | - <p class="mt-4 text-sm text-gray-700"> | |
| 163 | - Your stats will appear in | |
| 164 | - <a class="text-primary hover:underline" target="_blank" href="<?php echo esc_url(self::DASHBOARD_URL); ?>"> | |
| 165 | - the Simple Analytics dashboard | |
| 166 | - </a> | |
| 167 | - within a few minutes. | |
| 168 | - </p> | |
| 169 | - <p class="mt-4 text-sm text-gray-700"> | |
| 170 | - To avoid tracking your own visits, go to the "Ignore Rules" tab and ignore visits from logged-in admins. | |
| 171 | - You can also add your own IP address there. | |
| 172 | - </p> | |
| 173 | - <p class="mt-4 text-sm text-gray-700"> | |
| 174 | - To automatically track downloads, outbound links, and email clicks, go to the "Events" tab and enable "Collect automated events". | |
| 175 | - </p> | |
| 176 | - <p class="mt-4 text-sm text-gray-700"> | |
| 177 | - No account yet? Create one at | |
| 178 | - <a class="text-primary hover:underline" target="_blank" href="<?php echo esc_url(self::SIGNUP_URL); ?>"> | |
| 179 | - simpleanalytics.com. | |
| 180 | - </a> | |
| 181 | - You can start with a free trial and choose a free or paid plan later. | |
| 182 | - </p> | |
| 183 | - <p class="mt-6"> | |
| 184 | - <a | |
| 185 | - href="<?php echo esc_url(self::DASHBOARD_URL); ?>" | |
| 186 | - target="_blank" | |
| 187 | - class="inline-flex items-center rounded bg-primary px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-red-500" | |
| 188 | - > | |
| 189 | - Open dashboard | |
| 190 | - </a> | |
| 191 | - </p> | |
| 192 | - </div> | |
| 193 | - <?php | |
| 194 | 142 | } |
| 195 | 143 | } |