From 203d63a5d0fec19914e30582f32f00a4e72d4693 Mon Sep 17 00:00:00 2001 From: Jaroslaw Rozanski Date: Tue, 18 Jan 2022 23:18:06 +0100 Subject: [PATCH 1/7] Support enabling finger print; fix prefetch --- readme.txt | 7 ++++++- types/WideAngleAttributes.php | 5 ++++- types/WideAngleGenerator.php | 15 +++++++++------ types/WideAngleHelpers.php | 8 ++++++++ views/admin_settings.php | 13 +++++++++++++ wide-angle-analytics.php | 16 ++++++++++++++-- 6 files changed, 54 insertions(+), 10 deletions(-) diff --git a/readme.txt b/readme.txt index 262f12e..1355cb2 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: web analytics, tracking, web traffic, analytics, statistics, stats Requires at least: 5.2 Tested up to: 5.8.2 Requires PHP: 7.2 -Stable tag: 1.0.4 +Stable tag: 1.0.5 License: GPLv2 Easily add Wide Angle Analytics tracker script to your WordPress site. You can quickly configure your web analytics tracker script. @@ -60,3 +60,8 @@ We run a business around serving the needs of our customer. That's you. You will find most of your answers in the [Knowledge Base](https://wideangle.co/documentation). Should you require further assistance, please [get in touch](https://wideangle.co/support) with our team. +== Changelog == +V1.0.5 +- Support for `data-waa-fingerprint` toggle enabling optional browser fingerprinting. +- Fix the header generate to use valid `prefetch` attribute + diff --git a/types/WideAngleAttributes.php b/types/WideAngleAttributes.php index 9be391b..73e3699 100644 --- a/types/WideAngleAttributes.php +++ b/types/WideAngleAttributes.php @@ -2,17 +2,19 @@ class WideAngleAttributes { public $siteId; public $ignoreHash; + public $fingerprint; public $trackerDomain; public $exclusionString; public $includeParamsString; private $helpers; - public function __construct($siteId, $trackerDomain, $ignoreHash, $exclusionString, $includeParamsString) { + public function __construct($siteId, $trackerDomain, $ignoreHash, $exclusionString, $includeParamsString, $fingerprint) { $this->siteId = $siteId; $this->trackerDomain = $trackerDomain; $this->ignoreHash = $ignoreHash; $this->exclusionString = $exclusionString; $this->includeParamsString = $includeParamsString; + $this->fingerprint = $fingerprint; $this->helpers = new WideAngleHelpers(); } @@ -21,6 +23,7 @@ class WideAngleAttributes { 'site_id' => $this->siteId, 'tracker_domain' => $this->trackerDomain, 'ignore_hash' => $this->ignoreHash, + 'fingerprint' => $this->fingerprint, 'exclusion_paths' => $this->generateExclusionsAttribute(), 'include_params' => $this->generateIncludeParamsAttribute() ); diff --git a/types/WideAngleGenerator.php b/types/WideAngleGenerator.php index a0a49af..b5131e9 100644 --- a/types/WideAngleGenerator.php +++ b/types/WideAngleGenerator.php @@ -8,18 +8,19 @@ class WideAngleGenerator { public $includeParams; public function __construct($attributes) { - $this->siteId = $attributes['site_id']; - $this->trackerDomain = $attributes['tracker_domain']; - $this->ignoreHash = $attributes['ignore_hash']; - $this->exclusionPaths = $attributes['exclusion_paths']; - $this->includeParams = $attributes['include_params']; + $this->siteId = $attributes['site_id']; + $this->trackerDomain = $attributes['tracker_domain']; + $this->ignoreHash = $attributes['ignore_hash']; + $this->exclusionPaths = $attributes['exclusion_paths']; + $this->includeParams = $attributes['include_params']; + $this->fingerprint = $attributes['fingerprint']; } function generateHeaderScript() { $href = esc_attr("https://{$this->trackerDomain}/script/{$this->siteId}.js"); $script = << + EOD; return $script; } @@ -29,9 +30,11 @@ EOD; $pathExlusionsAttribute = $this->exclusionPaths != '' ? "data-waa-exc-paths=\"" . esc_attr($this->exclusionPaths) . "\"": ''; $includeParamsAttribute = $this->includeParams != '' ? "data-waa-inc-params=\"" . esc_attr($this->includeParams) . "\"": ''; $ignoreHashAttribute = $this->ignoreHash != '' ? "data-waa-ignore-hash=\"" . esc_attr($this->ignoreHash) . "\"": 'data-waa-ignore-hash="false"'; + $fingerprintAttribute = $this->fingerprint != '' ? "data-waa-fingerprint=\"" . esc_attr($this->fingerprint) . "\"": ''; $script = << diff --git a/types/WideAngleHelpers.php b/types/WideAngleHelpers.php index 8f9289f..e611eb6 100644 --- a/types/WideAngleHelpers.php +++ b/types/WideAngleHelpers.php @@ -29,6 +29,14 @@ class WideAngleHelpers { } } + function validateFingerprint($name, $fingerprint) { + if(filter_var($fingerprint, FILTER_VALIDATE_BOOLEAN)) { + return WideAngleValidated::createValid($name, $fingerprint, "true"); + } else { + return WideAngleValidated::createValid($name, $fingerprint, "false"); + } + } + function validateSiteId($name, $siteId) { if(preg_match("/^[a-zA-Z0-9]{10,24}$/", $siteId)) { return WideAngleValidated::createValid($name, $siteId, strtoupper(trim($siteId))); diff --git a/views/admin_settings.php b/views/admin_settings.php index 3ebb588..85fa48d 100644 --- a/views/admin_settings.php +++ b/views/admin_settings.php @@ -2,6 +2,7 @@ $siteId = wp_unslash($this->settings[self::WAA_CONF_SITE_ID]); $trackerDomain = wp_unslash($this->settings[self::WAA_CONF_TRACKER_DOMAIN]); $ignoreHash = filter_var($this->settings[self::WAA_CONF_IGNORE_HASH], FILTER_VALIDATE_BOOLEAN); +$fingerprint = filter_var($this->settings[self::WAA_CONF_FINGERPRINT], FILTER_VALIDATE_BOOLEAN); $parsedExclusions = $this->plugin->helpers->parseExclusionSetting(wp_unslash($this->settings[self::WAA_CONF_EXC_PATHS])); $parsedIncludeParams = $this->plugin->helpers->parseIncludeParamsSetting(wp_unslash($this->settings[self::WAA_CONF_INC_PARAMS])); $generator = new WideAngleGenerator($this->settings[self::WAA_CONF_ATTRIBUTES]); @@ -125,6 +126,18 @@ $generator = new WideAngleGenerator($this->settings[self::WAA_CONF_AT

By default, w URL Fragment/hash is trasmitted as part of the tracking event. You can disable this behaviour. The fragment will be stripped before sending an event.

+ + + +
+ Browser Fingerprinting + +
+

The tracker script will not attempt to fingerprint the browser by default. You can improve tracking qaulity by enabling more reliable browser fingerprinting. Enabling this feature might require collecting consent.

+ + plugin->name, $this->plugin->name . '_nonce' ); ?> diff --git a/wide-angle-analytics.php b/wide-angle-analytics.php index 25431ec..17bc167 100644 --- a/wide-angle-analytics.php +++ b/wide-angle-analytics.php @@ -5,7 +5,7 @@ Description: Easily enable and configure Wide Angle Analytics on your Wordpress site Author: Wide Angle Analytics by Input Objects GmbH Author URI: https://wideangle.co - Version: 1.0.4 + Version: 1.0.5 Requires at least: 5.2 Requires PHP: 7.2 License: GPL v2 @@ -17,6 +17,7 @@ class WideAngleAnalytics { const WAA_CONF_SITE_ID = "waa_site_id"; const WAA_CONF_TRACKER_DOMAIN = "waa_tracker_domain"; + const WAA_CONF_FINGERPRINT = "waa_fingerprint"; const WAA_CONF_EXC_PATHS = "waa_exc_path"; const WAA_CONF_INC_PARAMS = "waa_inc_params"; const WAA_CONF_IGNORE_HASH = "waa_ignore_hash"; @@ -115,6 +116,7 @@ class WideAngleAnalytics { $waaSiteId = $this->plugin->helpers->validateSiteId(self::WAA_CONF_SITE_ID, sanitize_text_field($_REQUEST['waa_site_id'])); $waaTrackerDomain = $this->plugin->helpers->validateTrackerDomain(self::WAA_CONF_TRACKER_DOMAIN, sanitize_text_field($_REQUEST['waa_tracker_domain'])); $waaIgnoreHash = $this->plugin->helpers->validateIgnoreHashFlag(self::WAA_CONF_IGNORE_HASH, sanitize_text_field($_REQUEST['waa_ignore_hash'])); + $waaFingerprint = $this->plugin->helpers->validateFingerprint(self::WAA_CONF_FINGERPRINT, sanitize_text_field($_REQUEST['waa_fingerprint'])); $waaIncParams = $this->plugin->helpers->validateIncludeParams(self::WAA_CONF_INC_PARAMS, $_REQUEST); $waaExclusionPaths = $this->plugin->helpers->validateExclusionPathsRequest(self::WAA_CONF_EXC_PATHS, $_REQUEST); @@ -128,12 +130,20 @@ class WideAngleAnalytics { } if(count($errors) === 0) { - $attributes = new WideAngleAttributes($waaSiteId->get_value(), $waaTrackerDomain->get_value(), $waaIgnoreHash->get_value(), $waaExclusionPaths->get_value(), $waaIncParams->get_value()); + $attributes = new WideAngleAttributes( + $waaSiteId->get_value(), + $waaTrackerDomain->get_value(), + $waaIgnoreHash->get_value(), + $waaExclusionPaths->get_value(), + $waaIncParams->get_value(), + $waaFingerprint->get_value() + ); update_option(self::WAA_CONF_SITE_ID, $waaSiteId->get_value()); update_option(self::WAA_CONF_TRACKER_DOMAIN, $waaTrackerDomain->get_value()); update_option(self::WAA_CONF_IGNORE_HASH, $waaIgnoreHash->get_value()); update_option(self::WAA_CONF_EXC_PATHS, $waaExclusionPaths->get_value()); update_option(self::WAA_CONF_INC_PARAMS, $waaIncParams->get_value()); + update_option(self::WAA_CONF_FINGERPRINT, $waaFingerprint->get_value()); update_option(self::WAA_CONF_ATTRIBUTES, $attributes->generateAttributes()); $this->message = __('Settings updated', $this->plugin->name); } else { @@ -147,6 +157,7 @@ class WideAngleAnalytics { self::WAA_CONF_INC_PARAMS => get_option(self::WAA_CONF_INC_PARAMS), self::WAA_CONF_TRACKER_DOMAIN => get_option(self::WAA_CONF_TRACKER_DOMAIN), self::WAA_CONF_IGNORE_HASH => get_option(self::WAA_CONF_IGNORE_HASH), + self::WAA_CONF_FINGERPRINT => get_option(self::WAA_CONF_FINGERPRINT), self::WAA_CONF_ATTRIBUTES => get_option(self::WAA_CONF_ATTRIBUTES) ); include_once( $this->plugin->folder . '/views/admin_settings.php' ); @@ -170,6 +181,7 @@ class WideAngleAnalytics { register_setting($this->plugin->name, self::WAA_CONF_INC_PARAMS); register_setting($this->plugin->name, self::WAA_CONF_TRACKER_DOMAIN, array('default' => 'stats.wideangle.co')); register_setting($this->plugin->name, self::WAA_CONF_IGNORE_HASH, array('default' => 'false')); + register_setting($this->plugin->name, self::WAA_CONF_FINGERPRINT, array('default' => 'false')); register_setting($this->plugin->name, self::WAA_CONF_ATTRIBUTES, array('type' => 'array')); } From 1a4faa079d2c2f4099cc594bda0ceaf9717b4d4d Mon Sep 17 00:00:00 2001 From: Jaroslaw Rozanski Date: Mon, 24 Jan 2022 00:09:38 +0100 Subject: [PATCH 2/7] Support configuring ePrivacy Mode --- readme.txt | 2 +- types/WideAngleAttributes.php | 5 ++++- types/WideAngleGenerator.php | 12 ++++++++---- types/WideAngleHelpers.php | 8 ++++++++ views/admin_settings.php | 21 +++++++++++++++++++++ wide-angle-analytics.php | 15 +++++++++++++-- 6 files changed, 55 insertions(+), 8 deletions(-) diff --git a/readme.txt b/readme.txt index 1355cb2..3eaa472 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: web analytics, tracking, web traffic, analytics, statistics, stats Requires at least: 5.2 Tested up to: 5.8.2 Requires PHP: 7.2 -Stable tag: 1.0.5 +Stable tag: 1.0.6 License: GPLv2 Easily add Wide Angle Analytics tracker script to your WordPress site. You can quickly configure your web analytics tracker script. diff --git a/types/WideAngleAttributes.php b/types/WideAngleAttributes.php index 73e3699..d3f32b0 100644 --- a/types/WideAngleAttributes.php +++ b/types/WideAngleAttributes.php @@ -3,18 +3,20 @@ class WideAngleAttributes { public $siteId; public $ignoreHash; public $fingerprint; + public $ePrivacyMode; public $trackerDomain; public $exclusionString; public $includeParamsString; private $helpers; - public function __construct($siteId, $trackerDomain, $ignoreHash, $exclusionString, $includeParamsString, $fingerprint) { + public function __construct($siteId, $trackerDomain, $ignoreHash, $exclusionString, $includeParamsString, $fingerprint, $ePrivacyMode) { $this->siteId = $siteId; $this->trackerDomain = $trackerDomain; $this->ignoreHash = $ignoreHash; $this->exclusionString = $exclusionString; $this->includeParamsString = $includeParamsString; $this->fingerprint = $fingerprint; + $this->ePrivacyMode = $ePrivacyMode; $this->helpers = new WideAngleHelpers(); } @@ -24,6 +26,7 @@ class WideAngleAttributes { 'tracker_domain' => $this->trackerDomain, 'ignore_hash' => $this->ignoreHash, 'fingerprint' => $this->fingerprint, + 'eprivacy_mode' => $this->ePrivacyMode, 'exclusion_paths' => $this->generateExclusionsAttribute(), 'include_params' => $this->generateIncludeParamsAttribute() ); diff --git a/types/WideAngleGenerator.php b/types/WideAngleGenerator.php index b5131e9..ff3499c 100644 --- a/types/WideAngleGenerator.php +++ b/types/WideAngleGenerator.php @@ -6,6 +6,7 @@ class WideAngleGenerator { public $trackerDomain; public $exclusionPaths; public $includeParams; + public $ePrivacyMode; public function __construct($attributes) { $this->siteId = $attributes['site_id']; @@ -14,6 +15,7 @@ class WideAngleGenerator { $this->exclusionPaths = $attributes['exclusion_paths']; $this->includeParams = $attributes['include_params']; $this->fingerprint = $attributes['fingerprint']; + $this->ePrivacyMode = $attributes['eprivacy_mode']; } @@ -27,14 +29,16 @@ EOD; function generateFooterScript() { $trackerUrlAttribute = esc_attr("https://{$this->trackerDomain}/script/{$this->siteId}.js"); - $pathExlusionsAttribute = $this->exclusionPaths != '' ? "data-waa-exc-paths=\"" . esc_attr($this->exclusionPaths) . "\"": ''; - $includeParamsAttribute = $this->includeParams != '' ? "data-waa-inc-params=\"" . esc_attr($this->includeParams) . "\"": ''; - $ignoreHashAttribute = $this->ignoreHash != '' ? "data-waa-ignore-hash=\"" . esc_attr($this->ignoreHash) . "\"": 'data-waa-ignore-hash="false"'; - $fingerprintAttribute = $this->fingerprint != '' ? "data-waa-fingerprint=\"" . esc_attr($this->fingerprint) . "\"": ''; + $pathExlusionsAttribute = $this->exclusionPaths != '' ? "data-waa-exc-paths=\"" . esc_attr($this->exclusionPaths) . "\"": ''; + $includeParamsAttribute = $this->includeParams != '' ? "data-waa-inc-params=\"" . esc_attr($this->includeParams) . "\"": ''; + $ignoreHashAttribute = $this->ignoreHash != '' ? "data-waa-ignore-hash=\"" . esc_attr($this->ignoreHash) . "\"": 'data-waa-ignore-hash="false"'; + $fingerprintAttribute = $this->fingerprint != '' ? "data-waa-fingerprint=\"" . esc_attr($this->fingerprint) . "\"": ''; + $ePrivacyModeAttribute = $this->ePrivacyMode == 'consent' ? "data-waa-eprivacy-mode=\"" . esc_attr($this->ePrivacyMode) . "\"": ''; $script = << diff --git a/types/WideAngleHelpers.php b/types/WideAngleHelpers.php index e611eb6..d9029d9 100644 --- a/types/WideAngleHelpers.php +++ b/types/WideAngleHelpers.php @@ -37,6 +37,14 @@ class WideAngleHelpers { } } + function validateEPrivacyMode($name, $ePrivacyMode) { + if($ePrivacyMode === 'consent') { + return WideAngleValidated::createValid($name, $ePrivacyMode, "consent"); + } else { + return WideAngleValidated::createValid($name, $ePrivacyMode, "disabled"); + } + } + function validateSiteId($name, $siteId) { if(preg_match("/^[a-zA-Z0-9]{10,24}$/", $siteId)) { return WideAngleValidated::createValid($name, $siteId, strtoupper(trim($siteId))); diff --git a/views/admin_settings.php b/views/admin_settings.php index 85fa48d..a85dbb7 100644 --- a/views/admin_settings.php +++ b/views/admin_settings.php @@ -3,6 +3,7 @@ $siteId = wp_unslash($this->settings[self::WAA_CONF_SITE_ID]); $trackerDomain = wp_unslash($this->settings[self::WAA_CONF_TRACKER_DOMAIN]); $ignoreHash = filter_var($this->settings[self::WAA_CONF_IGNORE_HASH], FILTER_VALIDATE_BOOLEAN); $fingerprint = filter_var($this->settings[self::WAA_CONF_FINGERPRINT], FILTER_VALIDATE_BOOLEAN); +$ePrivacyMode = wp_unslash($this->settings[self::WAA_CONF_EPRIVACY_MODE]); $parsedExclusions = $this->plugin->helpers->parseExclusionSetting(wp_unslash($this->settings[self::WAA_CONF_EXC_PATHS])); $parsedIncludeParams = $this->plugin->helpers->parseIncludeParamsSetting(wp_unslash($this->settings[self::WAA_CONF_INC_PARAMS])); $generator = new WideAngleGenerator($this->settings[self::WAA_CONF_ATTRIBUTES]); @@ -138,6 +139,26 @@ $generator = new WideAngleGenerator($this->settings[self::WAA_CONF_AT

The tracker script will not attempt to fingerprint the browser by default. You can improve tracking qaulity by enabling more reliable browser fingerprinting. Enabling this feature might require collecting consent.

+ + + +
+ Browser Fingerprinting + +
+

When you disable tracking, the script collects only bare-bone information. You can opt for more verbose tracking, but be aware that according to ePrivacy Regulations, this might require visitor's consent.

+ + plugin->name, $this->plugin->name . '_nonce' ); ?> diff --git a/wide-angle-analytics.php b/wide-angle-analytics.php index 17bc167..a80139a 100644 --- a/wide-angle-analytics.php +++ b/wide-angle-analytics.php @@ -5,7 +5,7 @@ Description: Easily enable and configure Wide Angle Analytics on your Wordpress site Author: Wide Angle Analytics by Input Objects GmbH Author URI: https://wideangle.co - Version: 1.0.5 + Version: 1.0.6 Requires at least: 5.2 Requires PHP: 7.2 License: GPL v2 @@ -18,6 +18,7 @@ class WideAngleAnalytics { const WAA_CONF_SITE_ID = "waa_site_id"; const WAA_CONF_TRACKER_DOMAIN = "waa_tracker_domain"; const WAA_CONF_FINGERPRINT = "waa_fingerprint"; + const WAA_CONF_EPRIVACY_MODE = "waa_eprivacy_mode"; const WAA_CONF_EXC_PATHS = "waa_exc_path"; const WAA_CONF_INC_PARAMS = "waa_inc_params"; const WAA_CONF_IGNORE_HASH = "waa_ignore_hash"; @@ -38,6 +39,11 @@ class WideAngleAnalytics { "regex" => "RegEx", ); + $this->plugin->ePrivacyModes = array( + "disabled" => "Disable Tracking", + "consent" => "Track assuming consent" + ); + add_action('admin_init', array( &$this, 'registerPluginSettings' ) ); add_action('admin_menu', array( &$this, 'registerAdminMenu' )); @@ -117,6 +123,7 @@ class WideAngleAnalytics { $waaTrackerDomain = $this->plugin->helpers->validateTrackerDomain(self::WAA_CONF_TRACKER_DOMAIN, sanitize_text_field($_REQUEST['waa_tracker_domain'])); $waaIgnoreHash = $this->plugin->helpers->validateIgnoreHashFlag(self::WAA_CONF_IGNORE_HASH, sanitize_text_field($_REQUEST['waa_ignore_hash'])); $waaFingerprint = $this->plugin->helpers->validateFingerprint(self::WAA_CONF_FINGERPRINT, sanitize_text_field($_REQUEST['waa_fingerprint'])); + $waaEPrivacyMode = $this->plugin->helpers->validateEPrivacyMode(self::WAA_CONF_EPRIVACY_MODE, sanitize_text_field($_REQUEST['waa_eprivacy_mode'])); $waaIncParams = $this->plugin->helpers->validateIncludeParams(self::WAA_CONF_INC_PARAMS, $_REQUEST); $waaExclusionPaths = $this->plugin->helpers->validateExclusionPathsRequest(self::WAA_CONF_EXC_PATHS, $_REQUEST); @@ -136,7 +143,8 @@ class WideAngleAnalytics { $waaIgnoreHash->get_value(), $waaExclusionPaths->get_value(), $waaIncParams->get_value(), - $waaFingerprint->get_value() + $waaFingerprint->get_value(), + $waaEPrivacyMode->get_value() ); update_option(self::WAA_CONF_SITE_ID, $waaSiteId->get_value()); update_option(self::WAA_CONF_TRACKER_DOMAIN, $waaTrackerDomain->get_value()); @@ -144,6 +152,7 @@ class WideAngleAnalytics { update_option(self::WAA_CONF_EXC_PATHS, $waaExclusionPaths->get_value()); update_option(self::WAA_CONF_INC_PARAMS, $waaIncParams->get_value()); update_option(self::WAA_CONF_FINGERPRINT, $waaFingerprint->get_value()); + update_option(self::WAA_CONF_EPRIVACY_MODE, $waaEPrivacyMode->get_value()); update_option(self::WAA_CONF_ATTRIBUTES, $attributes->generateAttributes()); $this->message = __('Settings updated', $this->plugin->name); } else { @@ -158,6 +167,7 @@ class WideAngleAnalytics { self::WAA_CONF_TRACKER_DOMAIN => get_option(self::WAA_CONF_TRACKER_DOMAIN), self::WAA_CONF_IGNORE_HASH => get_option(self::WAA_CONF_IGNORE_HASH), self::WAA_CONF_FINGERPRINT => get_option(self::WAA_CONF_FINGERPRINT), + self::WAA_CONF_EPRIVACY_MODE => get_option(self::WAA_CONF_EPRIVACY_MODE), self::WAA_CONF_ATTRIBUTES => get_option(self::WAA_CONF_ATTRIBUTES) ); include_once( $this->plugin->folder . '/views/admin_settings.php' ); @@ -182,6 +192,7 @@ class WideAngleAnalytics { register_setting($this->plugin->name, self::WAA_CONF_TRACKER_DOMAIN, array('default' => 'stats.wideangle.co')); register_setting($this->plugin->name, self::WAA_CONF_IGNORE_HASH, array('default' => 'false')); register_setting($this->plugin->name, self::WAA_CONF_FINGERPRINT, array('default' => 'false')); + register_setting($this->plugin->name, self::WAA_CONF_EPRIVACY_MODE, array('default' => 'disabled')); register_setting($this->plugin->name, self::WAA_CONF_ATTRIBUTES, array('type' => 'array')); } From aee70c947b93ede352169ae62aacb3d051a04a10 Mon Sep 17 00:00:00 2001 From: Jaroslaw Rozanski Date: Mon, 24 Jan 2022 00:10:32 +0100 Subject: [PATCH 3/7] V1.0.6 changelog --- readme.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/readme.txt b/readme.txt index 3eaa472..2550ca7 100644 --- a/readme.txt +++ b/readme.txt @@ -61,6 +61,9 @@ We run a business around serving the needs of our customer. That's you. You will find most of your answers in the [Knowledge Base](https://wideangle.co/documentation). Should you require further assistance, please [get in touch](https://wideangle.co/support) with our team. == Changelog == +V1.0.6 +- Support for ePrivacy Mode configuration. + V1.0.5 - Support for `data-waa-fingerprint` toggle enabling optional browser fingerprinting. - Fix the header generate to use valid `prefetch` attribute From 04b8a858b76c1c26783dfa801f4c7e73e89ef261 Mon Sep 17 00:00:00 2001 From: Jarek Rozanski Date: Sat, 17 Dec 2022 20:38:51 +0000 Subject: [PATCH 4/7] Version 1.0.7 --- README.md | 2 +- readme.txt | 8 ++++++-- types/WideAngleHelpers.php | 7 ++++--- wide-angle-analytics.php | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a7f9cef..84d4048 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Easily add [Wide Angle Analytics](https://wideangle.co) tracker script to your W * Requires at least: 5.2 -* Tested up to: 5.8.2 +* Tested up to: 6.1.1 * Requires PHP: 7.2 diff --git a/readme.txt b/readme.txt index 2550ca7..32f7ea7 100644 --- a/readme.txt +++ b/readme.txt @@ -2,9 +2,9 @@ Contributors: jrozanski,inputobjects Tags: web analytics, tracking, web traffic, analytics, statistics, stats Requires at least: 5.2 -Tested up to: 5.8.2 +Tested up to: 6.1.1 Requires PHP: 7.2 -Stable tag: 1.0.6 +Stable tag: 1.0.7 License: GPLv2 Easily add Wide Angle Analytics tracker script to your WordPress site. You can quickly configure your web analytics tracker script. @@ -61,6 +61,10 @@ We run a business around serving the needs of our customer. That's you. You will find most of your answers in the [Knowledge Base](https://wideangle.co/documentation). Should you require further assistance, please [get in touch](https://wideangle.co/support) with our team. == Changelog == +V1.0.7 +- Fix configuration of custom RegEx in the exclusion paths +- Test with WordPress 6.1.1 + V1.0.6 - Support for ePrivacy Mode configuration. diff --git a/types/WideAngleHelpers.php b/types/WideAngleHelpers.php index d9029d9..25ac3bd 100644 --- a/types/WideAngleHelpers.php +++ b/types/WideAngleHelpers.php @@ -85,9 +85,10 @@ class WideAngleHelpers { if(preg_match(self::excludePathRequestKeyPattern, $key, $idx)) { $valueKey = "waa_exc_path_".$idx[1]."_value"; $sanitizedValue = trim(sanitize_text_field($request[$valueKey])); - if($sanitizedValue != null) { - if(filter_var($sanitizedValue, FILTER_VALIDATE_REGEXP)) { - $typedExclusion = "[" . $exclusionType . "]" . $sanitizedValue; + if($sanitizedValue != null) { + $asRegExp = "/" . wp_unslash($sanitizedValue) . "/"; + if(@preg_match($asRegExp, null) === 0) { + $typedExclusion = "[" . $exclusionType . "]" . wp_unslash($sanitizedValue); array_push($exclusions, $typedExclusion); } else { $typedExclusion = "[" . $exclusionType . "]" . filter_var($sanitizedValue, FILTER_SANITIZE_SPECIAL_CHARS); diff --git a/wide-angle-analytics.php b/wide-angle-analytics.php index a80139a..a9d8325 100644 --- a/wide-angle-analytics.php +++ b/wide-angle-analytics.php @@ -5,7 +5,7 @@ Description: Easily enable and configure Wide Angle Analytics on your Wordpress site Author: Wide Angle Analytics by Input Objects GmbH Author URI: https://wideangle.co - Version: 1.0.6 + Version: 1.0.7 Requires at least: 5.2 Requires PHP: 7.2 License: GPL v2 From f9597f16aeb66faa42e8e2e13601c54d81f0be2e Mon Sep 17 00:00:00 2001 From: Jarek Rozanski Date: Sat, 17 Dec 2022 20:56:55 +0000 Subject: [PATCH 5/7] Sanitze in-admin view --- types/WideAngleHelpers.php | 2 +- views/admin_settings.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/WideAngleHelpers.php b/types/WideAngleHelpers.php index 25ac3bd..062215a 100644 --- a/types/WideAngleHelpers.php +++ b/types/WideAngleHelpers.php @@ -88,7 +88,7 @@ class WideAngleHelpers { if($sanitizedValue != null) { $asRegExp = "/" . wp_unslash($sanitizedValue) . "/"; if(@preg_match($asRegExp, null) === 0) { - $typedExclusion = "[" . $exclusionType . "]" . wp_unslash($sanitizedValue); + $typedExclusion = "[" . $exclusionType . "]" . filter_var($sanitizedValue, FILTER_SANITIZE_SPECIAL_CHARS); array_push($exclusions, $typedExclusion); } else { $typedExclusion = "[" . $exclusionType . "]" . filter_var($sanitizedValue, FILTER_SANITIZE_SPECIAL_CHARS); diff --git a/views/admin_settings.php b/views/admin_settings.php index a85dbb7..23d4494 100644 --- a/views/admin_settings.php +++ b/views/admin_settings.php @@ -175,7 +175,7 @@ $generator = new WideAngleGenerator($this->settings[self::WAA_CONF_AT </head> <!-- .. --> -generateFooterScript()); ?> +generateFooterScript())); ?> From 590ae448bc177ac274099301c313889168fd58fb Mon Sep 17 00:00:00 2001 From: Jarek Rozanski Date: Wed, 1 May 2024 22:11:05 +0000 Subject: [PATCH 6/7] WP Upgrade; DNT support --- README.md | 2 +- readme.txt | 12 ++++++++---- types/WideAngleAttributes.php | 7 ++++--- types/WideAngleGenerator.php | 6 +++--- types/WideAngleHelpers.php | 18 +++++++++--------- views/admin_settings.php | 36 ++++++++++++++--------------------- wide-angle-analytics.php | 17 +++++++++-------- 7 files changed, 48 insertions(+), 50 deletions(-) diff --git a/README.md b/README.md index 84d4048..a186347 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Easily add [Wide Angle Analytics](https://wideangle.co) tracker script to your W * Requires at least: 5.2 -* Tested up to: 6.1.1 +* Tested up to: 6.5.2 * Requires PHP: 7.2 diff --git a/readme.txt b/readme.txt index 32f7ea7..20a143e 100644 --- a/readme.txt +++ b/readme.txt @@ -2,9 +2,9 @@ Contributors: jrozanski,inputobjects Tags: web analytics, tracking, web traffic, analytics, statistics, stats Requires at least: 5.2 -Tested up to: 6.1.1 +Tested up to: 6.5.2 Requires PHP: 7.2 -Stable tag: 1.0.7 +Stable tag: 1.0.8 License: GPLv2 Easily add Wide Angle Analytics tracker script to your WordPress site. You can quickly configure your web analytics tracker script. @@ -61,7 +61,12 @@ We run a business around serving the needs of our customer. That's you. You will find most of your answers in the [Knowledge Base](https://wideangle.co/documentation). Should you require further assistance, please [get in touch](https://wideangle.co/support) with our team. == Changelog == -V1.0.7 +V1.0.8 +- Expose DNT Flag override +- Test with WordPress 6.5.2 +- Drop un-used ePrivacy flag + +V1.0.7 - Fix configuration of custom RegEx in the exclusion paths - Test with WordPress 6.1.1 @@ -71,4 +76,3 @@ V1.0.6 V1.0.5 - Support for `data-waa-fingerprint` toggle enabling optional browser fingerprinting. - Fix the header generate to use valid `prefetch` attribute - diff --git a/types/WideAngleAttributes.php b/types/WideAngleAttributes.php index d3f32b0..71413ef 100644 --- a/types/WideAngleAttributes.php +++ b/types/WideAngleAttributes.php @@ -3,13 +3,13 @@ class WideAngleAttributes { public $siteId; public $ignoreHash; public $fingerprint; - public $ePrivacyMode; public $trackerDomain; public $exclusionString; public $includeParamsString; + public $supressDnt; private $helpers; - public function __construct($siteId, $trackerDomain, $ignoreHash, $exclusionString, $includeParamsString, $fingerprint, $ePrivacyMode) { + public function __construct($siteId, $trackerDomain, $ignoreHash, $exclusionString, $includeParamsString, $fingerprint, $supressDnt) { $this->siteId = $siteId; $this->trackerDomain = $trackerDomain; $this->ignoreHash = $ignoreHash; @@ -17,6 +17,7 @@ class WideAngleAttributes { $this->includeParamsString = $includeParamsString; $this->fingerprint = $fingerprint; $this->ePrivacyMode = $ePrivacyMode; + $this->supressDnt = $supressDnt; $this->helpers = new WideAngleHelpers(); } @@ -26,7 +27,7 @@ class WideAngleAttributes { 'tracker_domain' => $this->trackerDomain, 'ignore_hash' => $this->ignoreHash, 'fingerprint' => $this->fingerprint, - 'eprivacy_mode' => $this->ePrivacyMode, + 'supress_dnt' => $this->supressDnt, 'exclusion_paths' => $this->generateExclusionsAttribute(), 'include_params' => $this->generateIncludeParamsAttribute() ); diff --git a/types/WideAngleGenerator.php b/types/WideAngleGenerator.php index ff3499c..effa479 100644 --- a/types/WideAngleGenerator.php +++ b/types/WideAngleGenerator.php @@ -15,7 +15,7 @@ class WideAngleGenerator { $this->exclusionPaths = $attributes['exclusion_paths']; $this->includeParams = $attributes['include_params']; $this->fingerprint = $attributes['fingerprint']; - $this->ePrivacyMode = $attributes['eprivacy_mode']; + $this->supressDnt = $attributes['supress_dnt']; } @@ -33,13 +33,13 @@ EOD; $includeParamsAttribute = $this->includeParams != '' ? "data-waa-inc-params=\"" . esc_attr($this->includeParams) . "\"": ''; $ignoreHashAttribute = $this->ignoreHash != '' ? "data-waa-ignore-hash=\"" . esc_attr($this->ignoreHash) . "\"": 'data-waa-ignore-hash="false"'; $fingerprintAttribute = $this->fingerprint != '' ? "data-waa-fingerprint=\"" . esc_attr($this->fingerprint) . "\"": ''; - $ePrivacyModeAttribute = $this->ePrivacyMode == 'consent' ? "data-waa-eprivacy-mode=\"" . esc_attr($this->ePrivacyMode) . "\"": ''; + $supressDntAttribute = $this->supressDnt != '' ? "data-waa-dnt-supress=\"" . esc_attr($this->supressDnt) . "\"": 'data-waa-dnt-supress="false"'; $script = << EOD; diff --git a/types/WideAngleHelpers.php b/types/WideAngleHelpers.php index 062215a..4cf4eef 100644 --- a/types/WideAngleHelpers.php +++ b/types/WideAngleHelpers.php @@ -29,6 +29,14 @@ class WideAngleHelpers { } } + function validateSupressDntFlag($name, $supressDnt) { + if(filter_var($supressDnt, FILTER_VALIDATE_BOOLEAN)) { + return WideAngleValidated::createValid($name, $supressDnt, "true"); + } else { + return WideAngleValidated::createValid($name, $supressDnt, "false"); + } + } + function validateFingerprint($name, $fingerprint) { if(filter_var($fingerprint, FILTER_VALIDATE_BOOLEAN)) { return WideAngleValidated::createValid($name, $fingerprint, "true"); @@ -37,14 +45,6 @@ class WideAngleHelpers { } } - function validateEPrivacyMode($name, $ePrivacyMode) { - if($ePrivacyMode === 'consent') { - return WideAngleValidated::createValid($name, $ePrivacyMode, "consent"); - } else { - return WideAngleValidated::createValid($name, $ePrivacyMode, "disabled"); - } - } - function validateSiteId($name, $siteId) { if(preg_match("/^[a-zA-Z0-9]{10,24}$/", $siteId)) { return WideAngleValidated::createValid($name, $siteId, strtoupper(trim($siteId))); @@ -85,7 +85,7 @@ class WideAngleHelpers { if(preg_match(self::excludePathRequestKeyPattern, $key, $idx)) { $valueKey = "waa_exc_path_".$idx[1]."_value"; $sanitizedValue = trim(sanitize_text_field($request[$valueKey])); - if($sanitizedValue != null) { + if($sanitizedValue != null) { $asRegExp = "/" . wp_unslash($sanitizedValue) . "/"; if(@preg_match($asRegExp, null) === 0) { $typedExclusion = "[" . $exclusionType . "]" . filter_var($sanitizedValue, FILTER_SANITIZE_SPECIAL_CHARS); diff --git a/views/admin_settings.php b/views/admin_settings.php index 23d4494..92a86c8 100644 --- a/views/admin_settings.php +++ b/views/admin_settings.php @@ -2,8 +2,8 @@ $siteId = wp_unslash($this->settings[self::WAA_CONF_SITE_ID]); $trackerDomain = wp_unslash($this->settings[self::WAA_CONF_TRACKER_DOMAIN]); $ignoreHash = filter_var($this->settings[self::WAA_CONF_IGNORE_HASH], FILTER_VALIDATE_BOOLEAN); +$supressDnt = filter_var($this->settings[self::WAA_CONF_SUPRESS_DNT], FILTER_VALIDATE_BOOLEAN); $fingerprint = filter_var($this->settings[self::WAA_CONF_FINGERPRINT], FILTER_VALIDATE_BOOLEAN); -$ePrivacyMode = wp_unslash($this->settings[self::WAA_CONF_EPRIVACY_MODE]); $parsedExclusions = $this->plugin->helpers->parseExclusionSetting(wp_unslash($this->settings[self::WAA_CONF_EXC_PATHS])); $parsedIncludeParams = $this->plugin->helpers->parseIncludeParamsSetting(wp_unslash($this->settings[self::WAA_CONF_INC_PARAMS])); $generator = new WideAngleGenerator($this->settings[self::WAA_CONF_ATTRIBUTES]); @@ -124,7 +124,19 @@ $generator = new WideAngleGenerator($this->settings[self::WAA_CONF_AT /> Ignore -

By default, w URL Fragment/hash is trasmitted as part of the tracking event. You can disable this behaviour. The fragment will be stripped before sending an event.

+

By default, URL Fragment/hash is trasmitted as part of the tracking event. You can disable this behaviour. The fragment will be stripped before sending an event.

+ + + + + +
+ Supress Do-Not-Track + +
+

Wide Angle Analytics respects Do-Not-Track (DNT) browser flag by default. You override this behaviour and always ignore this flag. Please consult relevant laws and regulation whether overriding DNT requires user consent.

@@ -139,26 +151,6 @@ $generator = new WideAngleGenerator($this->settings[self::WAA_CONF_AT

The tracker script will not attempt to fingerprint the browser by default. You can improve tracking qaulity by enabling more reliable browser fingerprinting. Enabling this feature might require collecting consent.

- - - -
- Browser Fingerprinting - -
-

When you disable tracking, the script collects only bare-bone information. You can opt for more verbose tracking, but be aware that according to ePrivacy Regulations, this might require visitor's consent.

- - plugin->name, $this->plugin->name . '_nonce' ); ?> diff --git a/wide-angle-analytics.php b/wide-angle-analytics.php index a9d8325..bda8e50 100644 --- a/wide-angle-analytics.php +++ b/wide-angle-analytics.php @@ -5,7 +5,7 @@ Description: Easily enable and configure Wide Angle Analytics on your Wordpress site Author: Wide Angle Analytics by Input Objects GmbH Author URI: https://wideangle.co - Version: 1.0.7 + Version: 1.0.8 Requires at least: 5.2 Requires PHP: 7.2 License: GPL v2 @@ -18,10 +18,10 @@ class WideAngleAnalytics { const WAA_CONF_SITE_ID = "waa_site_id"; const WAA_CONF_TRACKER_DOMAIN = "waa_tracker_domain"; const WAA_CONF_FINGERPRINT = "waa_fingerprint"; - const WAA_CONF_EPRIVACY_MODE = "waa_eprivacy_mode"; const WAA_CONF_EXC_PATHS = "waa_exc_path"; const WAA_CONF_INC_PARAMS = "waa_inc_params"; const WAA_CONF_IGNORE_HASH = "waa_ignore_hash"; + const WAA_CONF_SUPRESS_DNT = "waa_supress_dnt"; const WAA_CONF_ATTRIBUTES = "waa_attributes"; public function __construct() { @@ -123,12 +123,12 @@ class WideAngleAnalytics { $waaTrackerDomain = $this->plugin->helpers->validateTrackerDomain(self::WAA_CONF_TRACKER_DOMAIN, sanitize_text_field($_REQUEST['waa_tracker_domain'])); $waaIgnoreHash = $this->plugin->helpers->validateIgnoreHashFlag(self::WAA_CONF_IGNORE_HASH, sanitize_text_field($_REQUEST['waa_ignore_hash'])); $waaFingerprint = $this->plugin->helpers->validateFingerprint(self::WAA_CONF_FINGERPRINT, sanitize_text_field($_REQUEST['waa_fingerprint'])); - $waaEPrivacyMode = $this->plugin->helpers->validateEPrivacyMode(self::WAA_CONF_EPRIVACY_MODE, sanitize_text_field($_REQUEST['waa_eprivacy_mode'])); + $waaSupressDnt = $this->plugin->helpers->validateSupressDntFlag(self::WAA_CONF_SUPRESS_DNT, sanitize_text_field($_REQUEST['waa_supress_dnt'])); $waaIncParams = $this->plugin->helpers->validateIncludeParams(self::WAA_CONF_INC_PARAMS, $_REQUEST); $waaExclusionPaths = $this->plugin->helpers->validateExclusionPathsRequest(self::WAA_CONF_EXC_PATHS, $_REQUEST); include_once( $this->plugin->folder . '/types/WideAngleAttributes.php'); - $merged = array($waaSiteId, $waaTrackerDomain, $waaIgnoreHash, $waaIncParams, $waaExclusionPaths); + $merged = array($waaSiteId, $waaTrackerDomain, $waaIgnoreHash, $waaIncParams, $waaExclusionPaths, $waaSupressDnt); $errors = array(); foreach($merged as $validated) { if(!$validated->is_valid()) { @@ -144,7 +144,7 @@ class WideAngleAnalytics { $waaExclusionPaths->get_value(), $waaIncParams->get_value(), $waaFingerprint->get_value(), - $waaEPrivacyMode->get_value() + $waaSupressDnt->get_value() ); update_option(self::WAA_CONF_SITE_ID, $waaSiteId->get_value()); update_option(self::WAA_CONF_TRACKER_DOMAIN, $waaTrackerDomain->get_value()); @@ -152,7 +152,7 @@ class WideAngleAnalytics { update_option(self::WAA_CONF_EXC_PATHS, $waaExclusionPaths->get_value()); update_option(self::WAA_CONF_INC_PARAMS, $waaIncParams->get_value()); update_option(self::WAA_CONF_FINGERPRINT, $waaFingerprint->get_value()); - update_option(self::WAA_CONF_EPRIVACY_MODE, $waaEPrivacyMode->get_value()); + update_option(self::WAA_CONF_SUPRESS_DNT, $waaSupressDnt->get_value()); update_option(self::WAA_CONF_ATTRIBUTES, $attributes->generateAttributes()); $this->message = __('Settings updated', $this->plugin->name); } else { @@ -167,7 +167,7 @@ class WideAngleAnalytics { self::WAA_CONF_TRACKER_DOMAIN => get_option(self::WAA_CONF_TRACKER_DOMAIN), self::WAA_CONF_IGNORE_HASH => get_option(self::WAA_CONF_IGNORE_HASH), self::WAA_CONF_FINGERPRINT => get_option(self::WAA_CONF_FINGERPRINT), - self::WAA_CONF_EPRIVACY_MODE => get_option(self::WAA_CONF_EPRIVACY_MODE), + self::WAA_CONF_SUPRESS_DNT => get_option(self::WAA_CONF_SUPRESS_DNT), self::WAA_CONF_ATTRIBUTES => get_option(self::WAA_CONF_ATTRIBUTES) ); include_once( $this->plugin->folder . '/views/admin_settings.php' ); @@ -182,6 +182,7 @@ class WideAngleAnalytics { * - waa_exc_path * - waa_inc_params * - waa_ignore_hash + * - waa_supress_dnt * - waa_header_script * - waa_footer_script */ @@ -192,7 +193,7 @@ class WideAngleAnalytics { register_setting($this->plugin->name, self::WAA_CONF_TRACKER_DOMAIN, array('default' => 'stats.wideangle.co')); register_setting($this->plugin->name, self::WAA_CONF_IGNORE_HASH, array('default' => 'false')); register_setting($this->plugin->name, self::WAA_CONF_FINGERPRINT, array('default' => 'false')); - register_setting($this->plugin->name, self::WAA_CONF_EPRIVACY_MODE, array('default' => 'disabled')); + register_setting($this->plugin->name, self::WAA_CONF_SUPRESS_DNT, array('default' => 'false')); register_setting($this->plugin->name, self::WAA_CONF_ATTRIBUTES, array('type' => 'array')); } From 7b14f38a9d5a4fe90c2211afebf90df6e0552833 Mon Sep 17 00:00:00 2001 From: Jarek Rozanski Date: Thu, 30 Jan 2025 21:52:24 +0100 Subject: [PATCH 7/7] Address the typo in API --- readme.txt | 5 ++++- types/WideAngleAttributes.php | 8 ++++---- types/WideAngleGenerator.php | 6 +++--- types/WideAngleHelpers.php | 8 ++++---- views/admin_settings.php | 8 ++++---- wide-angle-analytics.php | 18 +++++++++--------- 6 files changed, 28 insertions(+), 25 deletions(-) diff --git a/readme.txt b/readme.txt index 20a143e..00c34b3 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: web analytics, tracking, web traffic, analytics, statistics, stats Requires at least: 5.2 Tested up to: 6.5.2 Requires PHP: 7.2 -Stable tag: 1.0.8 +Stable tag: 1.0.9 License: GPLv2 Easily add Wide Angle Analytics tracker script to your WordPress site. You can quickly configure your web analytics tracker script. @@ -61,6 +61,9 @@ We run a business around serving the needs of our customer. That's you. You will find most of your answers in the [Knowledge Base](https://wideangle.co/documentation). Should you require further assistance, please [get in touch](https://wideangle.co/support) with our team. == Changelog == +v1.0.9 +- Correct the API type from "supress" to "suppress" + V1.0.8 - Expose DNT Flag override - Test with WordPress 6.5.2 diff --git a/types/WideAngleAttributes.php b/types/WideAngleAttributes.php index 71413ef..d797dc8 100644 --- a/types/WideAngleAttributes.php +++ b/types/WideAngleAttributes.php @@ -6,10 +6,10 @@ class WideAngleAttributes { public $trackerDomain; public $exclusionString; public $includeParamsString; - public $supressDnt; + public $suppressDnt; private $helpers; - public function __construct($siteId, $trackerDomain, $ignoreHash, $exclusionString, $includeParamsString, $fingerprint, $supressDnt) { + public function __construct($siteId, $trackerDomain, $ignoreHash, $exclusionString, $includeParamsString, $fingerprint, $suppressDnt) { $this->siteId = $siteId; $this->trackerDomain = $trackerDomain; $this->ignoreHash = $ignoreHash; @@ -17,7 +17,7 @@ class WideAngleAttributes { $this->includeParamsString = $includeParamsString; $this->fingerprint = $fingerprint; $this->ePrivacyMode = $ePrivacyMode; - $this->supressDnt = $supressDnt; + $this->suppressDnt = $suppressDnt; $this->helpers = new WideAngleHelpers(); } @@ -27,7 +27,7 @@ class WideAngleAttributes { 'tracker_domain' => $this->trackerDomain, 'ignore_hash' => $this->ignoreHash, 'fingerprint' => $this->fingerprint, - 'supress_dnt' => $this->supressDnt, + 'suppress_dnt' => $this->suppressDnt, 'exclusion_paths' => $this->generateExclusionsAttribute(), 'include_params' => $this->generateIncludeParamsAttribute() ); diff --git a/types/WideAngleGenerator.php b/types/WideAngleGenerator.php index effa479..fc8ea87 100644 --- a/types/WideAngleGenerator.php +++ b/types/WideAngleGenerator.php @@ -15,7 +15,7 @@ class WideAngleGenerator { $this->exclusionPaths = $attributes['exclusion_paths']; $this->includeParams = $attributes['include_params']; $this->fingerprint = $attributes['fingerprint']; - $this->supressDnt = $attributes['supress_dnt']; + $this->suppressDnt = $attributes['suppress_dnt']; } @@ -33,13 +33,13 @@ EOD; $includeParamsAttribute = $this->includeParams != '' ? "data-waa-inc-params=\"" . esc_attr($this->includeParams) . "\"": ''; $ignoreHashAttribute = $this->ignoreHash != '' ? "data-waa-ignore-hash=\"" . esc_attr($this->ignoreHash) . "\"": 'data-waa-ignore-hash="false"'; $fingerprintAttribute = $this->fingerprint != '' ? "data-waa-fingerprint=\"" . esc_attr($this->fingerprint) . "\"": ''; - $supressDntAttribute = $this->supressDnt != '' ? "data-waa-dnt-supress=\"" . esc_attr($this->supressDnt) . "\"": 'data-waa-dnt-supress="false"'; + $suppressDntAttribute = $this->suppressDnt != '' ? "data-waa-dnt-suppress=\"" . esc_attr($this->suppressDnt) . "\"": 'data-waa-dnt-suppress="false"'; $script = << EOD; diff --git a/types/WideAngleHelpers.php b/types/WideAngleHelpers.php index 4cf4eef..362f5c6 100644 --- a/types/WideAngleHelpers.php +++ b/types/WideAngleHelpers.php @@ -29,11 +29,11 @@ class WideAngleHelpers { } } - function validateSupressDntFlag($name, $supressDnt) { - if(filter_var($supressDnt, FILTER_VALIDATE_BOOLEAN)) { - return WideAngleValidated::createValid($name, $supressDnt, "true"); + function validateSuppressDntFlag($name, $suppressDnt) { + if(filter_var($suppressDnt, FILTER_VALIDATE_BOOLEAN)) { + return WideAngleValidated::createValid($name, $suppressDnt, "true"); } else { - return WideAngleValidated::createValid($name, $supressDnt, "false"); + return WideAngleValidated::createValid($name, $suppressDnt, "false"); } } diff --git a/views/admin_settings.php b/views/admin_settings.php index 92a86c8..891df3e 100644 --- a/views/admin_settings.php +++ b/views/admin_settings.php @@ -2,7 +2,7 @@ $siteId = wp_unslash($this->settings[self::WAA_CONF_SITE_ID]); $trackerDomain = wp_unslash($this->settings[self::WAA_CONF_TRACKER_DOMAIN]); $ignoreHash = filter_var($this->settings[self::WAA_CONF_IGNORE_HASH], FILTER_VALIDATE_BOOLEAN); -$supressDnt = filter_var($this->settings[self::WAA_CONF_SUPRESS_DNT], FILTER_VALIDATE_BOOLEAN); +$suppressDnt = filter_var($this->settings[self::WAA_CONF_SUPPRESS_DNT], FILTER_VALIDATE_BOOLEAN); $fingerprint = filter_var($this->settings[self::WAA_CONF_FINGERPRINT], FILTER_VALIDATE_BOOLEAN); $parsedExclusions = $this->plugin->helpers->parseExclusionSetting(wp_unslash($this->settings[self::WAA_CONF_EXC_PATHS])); $parsedIncludeParams = $this->plugin->helpers->parseIncludeParamsSetting(wp_unslash($this->settings[self::WAA_CONF_INC_PARAMS])); @@ -128,12 +128,12 @@ $generator = new WideAngleGenerator($this->settings[self::WAA_CONF_AT - +
- Supress Do-Not-Track + Suppress Do-Not-Track

Wide Angle Analytics respects Do-Not-Track (DNT) browser flag by default. You override this behaviour and always ignore this flag. Please consult relevant laws and regulation whether overriding DNT requires user consent.

diff --git a/wide-angle-analytics.php b/wide-angle-analytics.php index bda8e50..d30e36b 100644 --- a/wide-angle-analytics.php +++ b/wide-angle-analytics.php @@ -5,7 +5,7 @@ Description: Easily enable and configure Wide Angle Analytics on your Wordpress site Author: Wide Angle Analytics by Input Objects GmbH Author URI: https://wideangle.co - Version: 1.0.8 + Version: 1.0.9 Requires at least: 5.2 Requires PHP: 7.2 License: GPL v2 @@ -21,7 +21,7 @@ class WideAngleAnalytics { const WAA_CONF_EXC_PATHS = "waa_exc_path"; const WAA_CONF_INC_PARAMS = "waa_inc_params"; const WAA_CONF_IGNORE_HASH = "waa_ignore_hash"; - const WAA_CONF_SUPRESS_DNT = "waa_supress_dnt"; + const WAA_CONF_SUPPRESS_DNT = "waa_suppress_dnt"; const WAA_CONF_ATTRIBUTES = "waa_attributes"; public function __construct() { @@ -123,12 +123,12 @@ class WideAngleAnalytics { $waaTrackerDomain = $this->plugin->helpers->validateTrackerDomain(self::WAA_CONF_TRACKER_DOMAIN, sanitize_text_field($_REQUEST['waa_tracker_domain'])); $waaIgnoreHash = $this->plugin->helpers->validateIgnoreHashFlag(self::WAA_CONF_IGNORE_HASH, sanitize_text_field($_REQUEST['waa_ignore_hash'])); $waaFingerprint = $this->plugin->helpers->validateFingerprint(self::WAA_CONF_FINGERPRINT, sanitize_text_field($_REQUEST['waa_fingerprint'])); - $waaSupressDnt = $this->plugin->helpers->validateSupressDntFlag(self::WAA_CONF_SUPRESS_DNT, sanitize_text_field($_REQUEST['waa_supress_dnt'])); + $waaSuppressDnt = $this->plugin->helpers->validateSuppressDntFlag(self::WAA_CONF_SUPPRESS_DNT, sanitize_text_field($_REQUEST['waa_suppress_dnt'])); $waaIncParams = $this->plugin->helpers->validateIncludeParams(self::WAA_CONF_INC_PARAMS, $_REQUEST); $waaExclusionPaths = $this->plugin->helpers->validateExclusionPathsRequest(self::WAA_CONF_EXC_PATHS, $_REQUEST); include_once( $this->plugin->folder . '/types/WideAngleAttributes.php'); - $merged = array($waaSiteId, $waaTrackerDomain, $waaIgnoreHash, $waaIncParams, $waaExclusionPaths, $waaSupressDnt); + $merged = array($waaSiteId, $waaTrackerDomain, $waaIgnoreHash, $waaIncParams, $waaExclusionPaths, $waaSuppressDnt); $errors = array(); foreach($merged as $validated) { if(!$validated->is_valid()) { @@ -144,7 +144,7 @@ class WideAngleAnalytics { $waaExclusionPaths->get_value(), $waaIncParams->get_value(), $waaFingerprint->get_value(), - $waaSupressDnt->get_value() + $waaSuppressDnt->get_value() ); update_option(self::WAA_CONF_SITE_ID, $waaSiteId->get_value()); update_option(self::WAA_CONF_TRACKER_DOMAIN, $waaTrackerDomain->get_value()); @@ -152,7 +152,7 @@ class WideAngleAnalytics { update_option(self::WAA_CONF_EXC_PATHS, $waaExclusionPaths->get_value()); update_option(self::WAA_CONF_INC_PARAMS, $waaIncParams->get_value()); update_option(self::WAA_CONF_FINGERPRINT, $waaFingerprint->get_value()); - update_option(self::WAA_CONF_SUPRESS_DNT, $waaSupressDnt->get_value()); + update_option(self::WAA_CONF_SUPPRESS_DNT, $waaSuppressDnt->get_value()); update_option(self::WAA_CONF_ATTRIBUTES, $attributes->generateAttributes()); $this->message = __('Settings updated', $this->plugin->name); } else { @@ -167,7 +167,7 @@ class WideAngleAnalytics { self::WAA_CONF_TRACKER_DOMAIN => get_option(self::WAA_CONF_TRACKER_DOMAIN), self::WAA_CONF_IGNORE_HASH => get_option(self::WAA_CONF_IGNORE_HASH), self::WAA_CONF_FINGERPRINT => get_option(self::WAA_CONF_FINGERPRINT), - self::WAA_CONF_SUPRESS_DNT => get_option(self::WAA_CONF_SUPRESS_DNT), + self::WAA_CONF_SUPPRESS_DNT => get_option(self::WAA_CONF_SUPPRESS_DNT), self::WAA_CONF_ATTRIBUTES => get_option(self::WAA_CONF_ATTRIBUTES) ); include_once( $this->plugin->folder . '/views/admin_settings.php' ); @@ -182,7 +182,7 @@ class WideAngleAnalytics { * - waa_exc_path * - waa_inc_params * - waa_ignore_hash - * - waa_supress_dnt + * - waa_suppress_dnt * - waa_header_script * - waa_footer_script */ @@ -193,7 +193,7 @@ class WideAngleAnalytics { register_setting($this->plugin->name, self::WAA_CONF_TRACKER_DOMAIN, array('default' => 'stats.wideangle.co')); register_setting($this->plugin->name, self::WAA_CONF_IGNORE_HASH, array('default' => 'false')); register_setting($this->plugin->name, self::WAA_CONF_FINGERPRINT, array('default' => 'false')); - register_setting($this->plugin->name, self::WAA_CONF_SUPRESS_DNT, array('default' => 'false')); + register_setting($this->plugin->name, self::WAA_CONF_SUPPRESS_DNT, array('default' => 'false')); register_setting($this->plugin->name, self::WAA_CONF_ATTRIBUTES, array('type' => 'array')); }