From b4e15a93e964347aa6396c3c2215c8397afe9d95 Mon Sep 17 00:00:00 2001 From: Daan van den Bergh <18595395+Dan0sz@users.noreply.github.com> Date: Fri, 6 Feb 2026 12:01:18 +0100 Subject: [PATCH] Fixed: don't assume API token is valid when getting the tracker configuration. --- src/Client.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Client.php b/src/Client.php index 7c34a601..0a0c2226 100644 --- a/src/Client.php +++ b/src/Client.php @@ -184,7 +184,12 @@ public function get_tracker_id() { if ( ! $id ) { $tracker_configuration = $this->get_configuration(); - $id = $tracker_configuration->getId(); + + if ( ! $tracker_configuration instanceof Client\Model\TrackerScriptConfigurationTrackerScriptConfiguration ) { + return ''; + } + + $id = $tracker_configuration->getId(); update_option( 'plausible_analytics_tracker_id', $id ); }