From 12ee7037620c1a280495445ad1e333ad54c8177b Mon Sep 17 00:00:00 2001 From: Dan0sz <18595395+Dan0sz@users.noreply.github.com> Date: Thu, 8 May 2025 19:40:31 +0200 Subject: [PATCH 1/3] Typo. --- src/Admin/Settings/API.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Admin/Settings/API.php b/src/Admin/Settings/API.php index 6c0dd82..128a6c7 100644 --- a/src/Admin/Settings/API.php +++ b/src/Admin/Settings/API.php @@ -89,7 +89,7 @@ public function settings_page() { 'Would you like to view your site\'s stats in your WordPress dashboard?', 'plausible-analytics' ), - 'enhanced_measurements' => __( 'Enable enhanced measurements', 'plausible-analytics' ), + 'enhanced_measurements' => __( 'Enable enhanced measurements.', 'plausible-analytics' ), 'proxy_enabled' => __( 'Run our script as a first party connection from your domain name to count visitors who use ad blockers', 'plausible-analytics' From 03c8c4396d852473ceb95f047ecf0425f3bb68f9 Mon Sep 17 00:00:00 2001 From: Dan0sz <18595395+Dan0sz@users.noreply.github.com> Date: Thu, 8 May 2025 19:41:02 +0200 Subject: [PATCH 2/3] Removed old db migration scripts. --- src/Admin/Upgrades.php | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/src/Admin/Upgrades.php b/src/Admin/Upgrades.php index 6df274f..c882211 100644 --- a/src/Admin/Upgrades.php +++ b/src/Admin/Upgrades.php @@ -60,10 +60,6 @@ public function run() { $this->upgrade_to_126(); } - if ( version_compare( $plausible_analytics_version, '1.3.1', '<' ) ) { - $this->upgrade_to_131(); - } - if ( version_compare( $plausible_analytics_version, '1.3.2', '<' ) ) { $this->upgrade_to_132(); } @@ -116,9 +112,6 @@ public function upgrade_to_125() { unset( $new_settings[ 'is_custom_domain' ] ); } - // Enable Outbound links by default. - $new_settings[ 'enhanced_measurements' ] = [ 'outbound-links' ]; - if ( ! empty( $old_settings[ 'track_administrator' ] ) && $old_settings[ 'track_administrator' ] === 'true' ) { $new_settings[ 'tracked_user_roles' ] = [ 'administrator' ]; } @@ -148,25 +141,6 @@ public function upgrade_to_126() { update_option( 'plausible_analytics_version', '1.2.6' ); } - /** - * Upgrade to 1.3.1 - * - Enables 404 pages tracking by default. - * - * @return void - * @codeCoverageIgnore - */ - public function upgrade_to_131() { - $settings = Helpers::get_settings(); - - if ( ! in_array( '404', $settings[ 'enhanced_measurements' ], true ) ) { - array_unshift( $settings[ 'enhanced_measurements' ], '404' ); - } - - update_option( 'plausible_analytics_settings', $settings ); - - update_option( 'plausible_analytics_version', '1.3.1' ); - } - /** * Upgrade to 1.3.2 * - Updates the Proxy Resource, Cache URL to be protocol relative. From 102b54c4c14531495b8c1994c78b834455df18e9 Mon Sep 17 00:00:00 2001 From: Dan0sz <18595395+Dan0sz@users.noreply.github.com> Date: Thu, 8 May 2025 19:41:11 +0200 Subject: [PATCH 3/3] Set default enhanced measurements. --- src/Helpers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Helpers.php b/src/Helpers.php index 39c176a..e1f07e7 100644 --- a/src/Helpers.php +++ b/src/Helpers.php @@ -94,7 +94,7 @@ public static function get_settings() { $defaults = [ 'domain_name' => '', 'api_token' => '', - 'enhanced_measurements' => [], + 'enhanced_measurements' => [ '404', 'file-downloads', 'form-completions', 'search', 'outbound-links' ], 'proxy_enabled' => '', 'enable_analytics_dashboard' => '', 'shared_link' => '',