From 90ccbac47393e9d9d4693d3e5ac7338331cd6468 Mon Sep 17 00:00:00 2001 From: Jonathan Nessier Date: Fri, 1 Jul 2022 08:42:55 +0200 Subject: [PATCH] Added support for visitor IP exclusion #3 --- README.md | 9 ++++++++- index.php | 46 ++++++++++++++++++++++++++-------------------- options.php | 13 ++++++++++--- 3 files changed, 44 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 85a1a6c..34cc593 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Written in PHP for Shared-Hosting on Apache. // If your proxy runs under https://example.com/stats, then set /stats as relative URI and otherwise just leave the string blank. $relativeUri = '/stats'; -// Set all allowed URI which should be accessible trough the proxy +// Set all allowed URI which should be accessible through the proxy $whitelist = [ '/js/script.js', '/js/plausible.outbound-links.js', @@ -43,6 +43,13 @@ $mapping = [ '/foo/bar.js' => '/js/plausible.outbound-links.js' ]; +// Set visitor IP addresses as exclusion (e.g. for yourself or developers) +// If not needed then leave the array empty. +$excluded = [ + '127.0.0.1', + '::1', +]; + // Set URL of Plausible Analytics $backendUrl = "https://plausible.io"; ``` diff --git a/index.php b/index.php index aa0609e..59fc1ba 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,6 @@ '/js/plausible.outbound-links.js' + '/foo/bar.js' => '/js/script.outbound-links.js' +]; + +// Set visitor IP addresses as exclusion (e.g. for yourself or developers) +// If not needed then leave the array empty. +$excluded = [ + '127.0.0.1', + '::1', ]; // Set URL of Plausible Analytics