diff --git a/.env.example b/.env.example index ef1d6ac..dd7f87b 100644 --- a/.env.example +++ b/.env.example @@ -23,9 +23,6 @@ RECAPTCHA_SITE_KEY= RECAPTCHA_PROJECT_ID= RECAPTCHA_API_KEY= -# Google Analytics tracking ID. Leave it empty to turn analytics off. -GOOGLE_ANALYTICS_ID= - # Directory for uploaded images waiting to be saved. Keep it outside the # web root. The default is xxx-uploads in the system temporary directory. UPLOAD_DIR= diff --git a/bottombar.inc.php b/bottombar.inc.php index ab945da..459f10b 100644 --- a/bottombar.inc.php +++ b/bottombar.inc.php @@ -2,4 +2,3 @@ All stories and submissions © 2003– their respective authors.

- diff --git a/google.inc.php b/google.inc.php deleted file mode 100644 index 2371f4a..0000000 --- a/google.inc.php +++ /dev/null @@ -1,13 +0,0 @@ - - - diff --git a/tests/php/Pages/NoAnalyticsTest.php b/tests/php/Pages/NoAnalyticsTest.php new file mode 100644 index 0000000..98777b8 --- /dev/null +++ b/tests/php/Pages/NoAnalyticsTest.php @@ -0,0 +1,19 @@ + 'UA-12345-1'); + } + + public function testNoPageLoadsAnalytics(): void { + foreach (array('/', '/article', '/about', '/publish', '/publish/login') as $path) { + $body = $this->get($path)['body']; + $this->assertStringNotContainsString('UA-12345-1', $body, $path); + $this->assertStringNotContainsString('google-analytics', $body, $path); + } + } +} diff --git a/tests/php/fixtures/test.env b/tests/php/fixtures/test.env index 5c387ef..4b77a84 100644 --- a/tests/php/fixtures/test.env +++ b/tests/php/fixtures/test.env @@ -7,7 +7,6 @@ SITE_URL=https://site.test RECAPTCHA_SITE_KEY=test-site-key RECAPTCHA_PROJECT_ID=test-project RECAPTCHA_API_KEY=test-api-key -GOOGLE_ANALYTICS_ID= UPLOAD_DIR= UPLOAD_DIR_LIMIT_MB=1 DISPLAY_ERRORS=