diff --git a/README.md b/README.md
index a7f9cef..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: 5.8.2
+* Tested up to: 6.5.2
* Requires PHP: 7.2
diff --git a/readme.txt b/readme.txt
index 262f12e..00c34b3 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.5.2
Requires PHP: 7.2
-Stable tag: 1.0.4
+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.
@@ -60,3 +60,22 @@ 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
+- Drop un-used ePrivacy flag
+
+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.
+
+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..d797dc8 100644
--- a/types/WideAngleAttributes.php
+++ b/types/WideAngleAttributes.php
@@ -2,17 +2,22 @@
class WideAngleAttributes {
public $siteId;
public $ignoreHash;
+ public $fingerprint;
public $trackerDomain;
public $exclusionString;
public $includeParamsString;
+ public $suppressDnt;
private $helpers;
- public function __construct($siteId, $trackerDomain, $ignoreHash, $exclusionString, $includeParamsString) {
+ public function __construct($siteId, $trackerDomain, $ignoreHash, $exclusionString, $includeParamsString, $fingerprint, $suppressDnt) {
$this->siteId = $siteId;
$this->trackerDomain = $trackerDomain;
$this->ignoreHash = $ignoreHash;
$this->exclusionString = $exclusionString;
$this->includeParamsString = $includeParamsString;
+ $this->fingerprint = $fingerprint;
+ $this->ePrivacyMode = $ePrivacyMode;
+ $this->suppressDnt = $suppressDnt;
$this->helpers = new WideAngleHelpers();
}
@@ -21,6 +26,8 @@ class WideAngleAttributes {
'site_id' => $this->siteId,
'tracker_domain' => $this->trackerDomain,
'ignore_hash' => $this->ignoreHash,
+ 'fingerprint' => $this->fingerprint,
+ 'suppress_dnt' => $this->suppressDnt,
'exclusion_paths' => $this->generateExclusionsAttribute(),
'include_params' => $this->generateIncludeParamsAttribute()
);
diff --git a/types/WideAngleGenerator.php b/types/WideAngleGenerator.php
index a0a49af..fc8ea87 100644
--- a/types/WideAngleGenerator.php
+++ b/types/WideAngleGenerator.php
@@ -6,33 +6,40 @@ class WideAngleGenerator {
public $trackerDomain;
public $exclusionPaths;
public $includeParams;
+ public $ePrivacyMode;
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'];
+ $this->suppressDnt = $attributes['suppress_dnt'];
}
function generateHeaderScript() {
$href = esc_attr("https://{$this->trackerDomain}/script/{$this->siteId}.js");
$script = <<
+
EOD;
return $script;
}
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"';
+ $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) . "\"": '';
+ $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 8f9289f..362f5c6 100644
--- a/types/WideAngleHelpers.php
+++ b/types/WideAngleHelpers.php
@@ -29,6 +29,22 @@ class WideAngleHelpers {
}
}
+ function validateSuppressDntFlag($name, $suppressDnt) {
+ if(filter_var($suppressDnt, FILTER_VALIDATE_BOOLEAN)) {
+ return WideAngleValidated::createValid($name, $suppressDnt, "true");
+ } else {
+ return WideAngleValidated::createValid($name, $suppressDnt, "false");
+ }
+ }
+
+ 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)));
@@ -70,8 +86,9 @@ class WideAngleHelpers {
$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;
+ $asRegExp = "/" . wp_unslash($sanitizedValue) . "/";
+ if(@preg_match($asRegExp, null) === 0) {
+ $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 3ebb588..891df3e 100644
--- a/views/admin_settings.php
+++ b/views/admin_settings.php
@@ -2,6 +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);
+$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]));
$generator = new WideAngleGenerator($this->settings[self::WAA_CONF_ATTRIBUTES]);
@@ -122,7 +124,31 @@ $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.
+
+
+
+
+
+
+
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.
+
+
+
+
+
+
+
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.