Skip to content

Commit 9a4f7da

Browse files
don't test endpoint if already not using it
1 parent ea1d0f6 commit 9a4f7da

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/class-endpoint-installer.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public static function install()
8282
// attempt to overwrite file with latest contents to ensure it's up-to-date
8383
file_put_contents(self::get_file_name(), self::get_file_contents());
8484

85-
return self::test();
85+
return self::test(true);
8686
}
8787

8888
public static function uninstall(): void
@@ -98,8 +98,13 @@ public static function uninstall(): void
9898
/**
9999
* @return string|bool
100100
*/
101-
public static function test()
101+
public static function test($force_test = false)
102102
{
103+
// No need to test if not using it
104+
if (!$force_test && ! get_option('koko_analytics_use_custom_endpoint')) {
105+
return;
106+
}
107+
103108
// Check if file exists
104109
// Note that we're not checking whether we were able to write to the file
105110
// To allow for users manually creating the file with the correct contents

0 commit comments

Comments
 (0)