Compare commits

...

1 commit
v1.0.8 ... main

Author SHA1 Message Date
7b14f38a9d Address the typo in API 2025-01-30 21:52:24 +01:00
6 changed files with 28 additions and 25 deletions

View file

@ -4,7 +4,7 @@ Tags: web analytics, tracking, web traffic, analytics, statistics, stats
Requires at least: 5.2 Requires at least: 5.2
Tested up to: 6.5.2 Tested up to: 6.5.2
Requires PHP: 7.2 Requires PHP: 7.2
Stable tag: 1.0.8 Stable tag: 1.0.9
License: GPLv2 License: GPLv2
Easily add Wide Angle Analytics tracker script to your WordPress site. You can quickly configure your web analytics tracker script. 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. 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 == == Changelog ==
v1.0.9
- Correct the API type from "supress" to "suppress"
V1.0.8 V1.0.8
- Expose DNT Flag override - Expose DNT Flag override
- Test with WordPress 6.5.2 - Test with WordPress 6.5.2

View file

@ -6,10 +6,10 @@ class WideAngleAttributes {
public $trackerDomain; public $trackerDomain;
public $exclusionString; public $exclusionString;
public $includeParamsString; public $includeParamsString;
public $supressDnt; public $suppressDnt;
private $helpers; 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->siteId = $siteId;
$this->trackerDomain = $trackerDomain; $this->trackerDomain = $trackerDomain;
$this->ignoreHash = $ignoreHash; $this->ignoreHash = $ignoreHash;
@ -17,7 +17,7 @@ class WideAngleAttributes {
$this->includeParamsString = $includeParamsString; $this->includeParamsString = $includeParamsString;
$this->fingerprint = $fingerprint; $this->fingerprint = $fingerprint;
$this->ePrivacyMode = $ePrivacyMode; $this->ePrivacyMode = $ePrivacyMode;
$this->supressDnt = $supressDnt; $this->suppressDnt = $suppressDnt;
$this->helpers = new WideAngleHelpers(); $this->helpers = new WideAngleHelpers();
} }
@ -27,7 +27,7 @@ class WideAngleAttributes {
'tracker_domain' => $this->trackerDomain, 'tracker_domain' => $this->trackerDomain,
'ignore_hash' => $this->ignoreHash, 'ignore_hash' => $this->ignoreHash,
'fingerprint' => $this->fingerprint, 'fingerprint' => $this->fingerprint,
'supress_dnt' => $this->supressDnt, 'suppress_dnt' => $this->suppressDnt,
'exclusion_paths' => $this->generateExclusionsAttribute(), 'exclusion_paths' => $this->generateExclusionsAttribute(),
'include_params' => $this->generateIncludeParamsAttribute() 'include_params' => $this->generateIncludeParamsAttribute()
); );

View file

@ -15,7 +15,7 @@ class WideAngleGenerator {
$this->exclusionPaths = $attributes['exclusion_paths']; $this->exclusionPaths = $attributes['exclusion_paths'];
$this->includeParams = $attributes['include_params']; $this->includeParams = $attributes['include_params'];
$this->fingerprint = $attributes['fingerprint']; $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) . "\"": ''; $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"'; $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) . "\"": ''; $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 $script = <<<EOD
<script async defer <script async defer
src="{$trackerUrlAttribute}" src="{$trackerUrlAttribute}"
$fingerprintAttribute $fingerprintAttribute
$ignoreHashAttribute $ignoreHashAttribute
$supressDntAttribute $suppressDntAttribute
$includeParamsAttribute $includeParamsAttribute
$pathExlusionsAttribute></script> $pathExlusionsAttribute></script>
EOD; EOD;

View file

@ -29,11 +29,11 @@ class WideAngleHelpers {
} }
} }
function validateSupressDntFlag($name, $supressDnt) { function validateSuppressDntFlag($name, $suppressDnt) {
if(filter_var($supressDnt, FILTER_VALIDATE_BOOLEAN)) { if(filter_var($suppressDnt, FILTER_VALIDATE_BOOLEAN)) {
return WideAngleValidated::createValid($name, $supressDnt, "true"); return WideAngleValidated::createValid($name, $suppressDnt, "true");
} else { } else {
return WideAngleValidated::createValid($name, $supressDnt, "false"); return WideAngleValidated::createValid($name, $suppressDnt, "false");
} }
} }

View file

@ -2,7 +2,7 @@
$siteId = wp_unslash($this->settings[self::WAA_CONF_SITE_ID]); $siteId = wp_unslash($this->settings[self::WAA_CONF_SITE_ID]);
$trackerDomain = wp_unslash($this->settings[self::WAA_CONF_TRACKER_DOMAIN]); $trackerDomain = wp_unslash($this->settings[self::WAA_CONF_TRACKER_DOMAIN]);
$ignoreHash = filter_var($this->settings[self::WAA_CONF_IGNORE_HASH], FILTER_VALIDATE_BOOLEAN); $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); $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])); $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])); $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
</td> </td>
</tr> </tr>
<tr> <tr>
<th scope="row"><label>Supress Do-Not-Track</label></th> <th scope="row"><label>Suppress Do-Not-Track</label></th>
<td> <td>
<fieldset> <fieldset>
<legend class="screen-reader-text"><span>Supress Do-Not-Track</span></legend> <legend class="screen-reader-text"><span>Suppress Do-Not-Track</span></legend>
<label> <label>
<input id="waa_supress_dnt" type="checkbox" name="waa_supress_dnt" <?php if($supressDnt) { echo "checked"; } ?>/> Supress <input id="waa_suppress_dnt" type="checkbox" name="waa_suppress_dnt" <?php if($suppressDnt) { echo "checked"; } ?>/> Suppress
</label> </label>
</fieldset> </fieldset>
<p class="description" id="tagline-description">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.</p> <p class="description" id="tagline-description">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.</p>

View file

@ -5,7 +5,7 @@
Description: Easily enable and configure Wide Angle Analytics on your Wordpress site Description: Easily enable and configure Wide Angle Analytics on your Wordpress site
Author: Wide Angle Analytics by Input Objects GmbH Author: Wide Angle Analytics by Input Objects GmbH
Author URI: https://wideangle.co Author URI: https://wideangle.co
Version: 1.0.8 Version: 1.0.9
Requires at least: 5.2 Requires at least: 5.2
Requires PHP: 7.2 Requires PHP: 7.2
License: GPL v2 License: GPL v2
@ -21,7 +21,7 @@ class WideAngleAnalytics {
const WAA_CONF_EXC_PATHS = "waa_exc_path"; const WAA_CONF_EXC_PATHS = "waa_exc_path";
const WAA_CONF_INC_PARAMS = "waa_inc_params"; const WAA_CONF_INC_PARAMS = "waa_inc_params";
const WAA_CONF_IGNORE_HASH = "waa_ignore_hash"; 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"; const WAA_CONF_ATTRIBUTES = "waa_attributes";
public function __construct() { 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'])); $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'])); $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'])); $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); $waaIncParams = $this->plugin->helpers->validateIncludeParams(self::WAA_CONF_INC_PARAMS, $_REQUEST);
$waaExclusionPaths = $this->plugin->helpers->validateExclusionPathsRequest(self::WAA_CONF_EXC_PATHS, $_REQUEST); $waaExclusionPaths = $this->plugin->helpers->validateExclusionPathsRequest(self::WAA_CONF_EXC_PATHS, $_REQUEST);
include_once( $this->plugin->folder . '/types/WideAngleAttributes.php'); 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(); $errors = array();
foreach($merged as $validated) { foreach($merged as $validated) {
if(!$validated->is_valid()) { if(!$validated->is_valid()) {
@ -144,7 +144,7 @@ class WideAngleAnalytics {
$waaExclusionPaths->get_value(), $waaExclusionPaths->get_value(),
$waaIncParams->get_value(), $waaIncParams->get_value(),
$waaFingerprint->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_SITE_ID, $waaSiteId->get_value());
update_option(self::WAA_CONF_TRACKER_DOMAIN, $waaTrackerDomain->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_EXC_PATHS, $waaExclusionPaths->get_value());
update_option(self::WAA_CONF_INC_PARAMS, $waaIncParams->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_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()); update_option(self::WAA_CONF_ATTRIBUTES, $attributes->generateAttributes());
$this->message = __('Settings updated', $this->plugin->name); $this->message = __('Settings updated', $this->plugin->name);
} else { } else {
@ -167,7 +167,7 @@ class WideAngleAnalytics {
self::WAA_CONF_TRACKER_DOMAIN => get_option(self::WAA_CONF_TRACKER_DOMAIN), 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_IGNORE_HASH => get_option(self::WAA_CONF_IGNORE_HASH),
self::WAA_CONF_FINGERPRINT => get_option(self::WAA_CONF_FINGERPRINT), 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) self::WAA_CONF_ATTRIBUTES => get_option(self::WAA_CONF_ATTRIBUTES)
); );
include_once( $this->plugin->folder . '/views/admin_settings.php' ); include_once( $this->plugin->folder . '/views/admin_settings.php' );
@ -182,7 +182,7 @@ class WideAngleAnalytics {
* - waa_exc_path * - waa_exc_path
* - waa_inc_params * - waa_inc_params
* - waa_ignore_hash * - waa_ignore_hash
* - waa_supress_dnt * - waa_suppress_dnt
* - waa_header_script * - waa_header_script
* - waa_footer_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_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_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_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')); register_setting($this->plugin->name, self::WAA_CONF_ATTRIBUTES, array('type' => 'array'));
} }