From 5ee45a0fb7e2c1caefe6b80d6b11db31c4500f1e Mon Sep 17 00:00:00 2001 From: Tom Stark Date: Thu, 10 Sep 2020 13:38:28 +0200 Subject: [PATCH 01/10] Update packages --- package-lock.json | 22 +++++++++++----------- package.json | 6 +++--- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index d61d34bcd..579a9fcf1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9520,9 +9520,9 @@ } }, "gulp-load-plugins": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/gulp-load-plugins/-/gulp-load-plugins-2.0.3.tgz", - "integrity": "sha512-U/1Sml7UbyOu2kH6Fbpo+ka2xyp4DRH6+oDtHgC8oKsnlQRuiBQYQ/LS4k6HxBv1HJlucaNV/SdwZXtLBuvSqg==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/gulp-load-plugins/-/gulp-load-plugins-2.0.4.tgz", + "integrity": "sha512-pMvplJGBY0ej4q1yGTUUWY6CHd1cwOsf+0E+lsvR941CTASofYyrdJ3q8EgXY0wLHACWPrO0COsr1DFWJ7zzhg==", "dev": true, "requires": { "array-unique": "^0.3.2", @@ -9531,7 +9531,7 @@ "gulplog": "^1.0.0", "has-gulplog": "^0.1.0", "micromatch": "^4.0.2", - "resolve": "^1.15.1" + "resolve": "^1.17.0" }, "dependencies": { "braces": { @@ -13672,16 +13672,16 @@ "dev": true }, "jshint": { - "version": "2.11.1", - "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.11.1.tgz", - "integrity": "sha512-WXWePB8ssAH3DlD05IoqolsY6arhbll/1+i2JkRPpihQAuiNaR/gSt8VKIcxpV5m6XChP0hCwESQUqpuQMA8Tg==", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.12.0.tgz", + "integrity": "sha512-TwuuaUDmra0JMkuqvqy+WGo2xGHSNjv1BA1nTIgtH2K5z1jHuAEeAgp7laaR+hLRmajRjcrM71+vByBDanCyYA==", "dev": true, "requires": { "cli": "~1.0.0", "console-browserify": "1.1.x", "exit": "0.1.x", "htmlparser2": "3.8.x", - "lodash": "~4.17.11", + "lodash": "~4.17.19", "minimatch": "~3.0.2", "shelljs": "0.3.x", "strip-json-comments": "1.0.x" @@ -14162,9 +14162,9 @@ } }, "lodash": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true }, "lodash._basecopy": { diff --git a/package.json b/package.json index da079cbad..4901a2ed3 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "gulp-jsbeautifier": "3.0.1", "gulp-jshint": "^2.1.0", "gulp-lintspaces": "^1.0.1", - "gulp-load-plugins": "^2.0.3", + "gulp-load-plugins": "^2.0.4", "gulp-notify": "^3.2.0", "gulp-phpcs": "^3.1.0", "gulp-prettify": "^0.5.0", @@ -39,9 +39,9 @@ "gulp-wp-pot": "^2.4.3", "gulp-zip": "^5.0.2", "gulp4-run-sequence": "^1.0.1", - "jshint": "^2.11.1", + "jshint": "^2.12.0", "jshint-stylish": "^2.2.1", - "lodash": ">=4.17.19", + "lodash": "^4.17.20", "minimist": "^1.2.5", "prompt": "^1.0.0", "q": "^1.5.1" From 648d29362bd661a29afc4dad266049aea7e859ec Mon Sep 17 00:00:00 2001 From: Tom Stark Date: Fri, 11 Sep 2020 15:53:38 +0200 Subject: [PATCH 02/10] Address dependabot alerts. --- package-lock.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 579a9fcf1..f7ed0ffd0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15395,9 +15395,9 @@ "dev": true }, "node-fetch": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", - "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", "dev": true }, "node-gyp": { @@ -23016,7 +23016,7 @@ "string-width": "^3.0.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" + "yargs-parser": ">=13.1.2" }, "dependencies": { "ansi-regex": { @@ -23063,7 +23063,7 @@ } }, "yargs-parser": { - "version": "13.1.2", + "version": ">=13.1.2", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", "dev": true, From 165dee71613e0943dc44d2ffdac7df283b599e1f Mon Sep 17 00:00:00 2001 From: Tom Stark Date: Thu, 1 Oct 2020 10:41:43 +0200 Subject: [PATCH 03/10] Fix Laterpay logo in buttons --- .../asset_sources/scss/blocks/premium-download-box.scss | 8 +++++--- laterpay/asset_sources/scss/pages/_post_view.scss | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/laterpay/asset_sources/scss/blocks/premium-download-box.scss b/laterpay/asset_sources/scss/blocks/premium-download-box.scss index 076d31636..e4e2f79ab 100644 --- a/laterpay/asset_sources/scss/blocks/premium-download-box.scss +++ b/laterpay/asset_sources/scss/blocks/premium-download-box.scss @@ -19,9 +19,11 @@ padding: 4px 7px 4px 7px!important; &:before { - font-size: round($fs * 2.5) !important; - left: -2px !important; - top: 10px !important; + position: relative !important; + top: 4px !important; + left: 0 !important; + margin-right: 0 !important; + font-size: round($fs--2) !important; } } .lp_purchase-button-wrapper { diff --git a/laterpay/asset_sources/scss/pages/_post_view.scss b/laterpay/asset_sources/scss/pages/_post_view.scss index b72c11049..70de5649d 100644 --- a/laterpay/asset_sources/scss/pages/_post_view.scss +++ b/laterpay/asset_sources/scss/pages/_post_view.scss @@ -218,9 +218,11 @@ padding: 4px 7px 4px 7px!important; &:before { - font-size: round($fs * 2.5) !important; - left: -2px !important; - top: 10px !important; + position: relative !important; + top: 4px !important; + left: 0 !important; + margin-right: 0 !important; + font-size: round($fs--2) !important; } } .lp_purchase-button-wrapper { From 729a9807e81936ccf1198fc72ce8fade01e3e6d3 Mon Sep 17 00:00:00 2001 From: Tom Stark Date: Thu, 1 Oct 2020 11:06:23 +0200 Subject: [PATCH 04/10] Fix Laterpay logo size in Appearance screen and purchase dialog --- .../scss/components/_purchase_button.scss | 11 +++++------ .../asset_sources/scss/components/_time_pass.scss | 11 +++++------ laterpay/asset_sources/scss/laterpay-post-view.scss | 7 +------ laterpay/asset_sources/scss/pages/_appearance.scss | 6 +++--- 4 files changed, 14 insertions(+), 21 deletions(-) diff --git a/laterpay/asset_sources/scss/components/_purchase_button.scss b/laterpay/asset_sources/scss/components/_purchase_button.scss index b9343d5c5..14d228d9d 100644 --- a/laterpay/asset_sources/scss/components/_purchase_button.scss +++ b/laterpay/asset_sources/scss/components/_purchase_button.scss @@ -65,7 +65,7 @@ font-weight: normal !important; line-height: 1.3 !important; margin: 0 !important; - padding: $fs--025 $fs--075 $fs--025 $fs--35 !important; + padding: $fs--025 $fs--075 $fs--025 $fs !important; text-decoration: none !important; transition: background-color 0.2s ease-in; white-space: nowrap !important; @@ -78,13 +78,12 @@ * 2. Nullify line-height to avoid icon overlapping other elements */ &:before { - font-size: 30px !important; /* 1 */ + font-size: $fs--2 !important; /* 1 */ line-height: .5 !important; /* 2 */ - margin: 0 (-$fs--05) 0 0 !important; - position: absolute !important; + margin: 0 !important; + position: relative !important; width: (round($fs * 4.35)); - left: 13px; - top: 14px; + top: 3px; } &:hover, diff --git a/laterpay/asset_sources/scss/components/_time_pass.scss b/laterpay/asset_sources/scss/components/_time_pass.scss index 999ec52f9..21cefd616 100644 --- a/laterpay/asset_sources/scss/components/_time_pass.scss +++ b/laterpay/asset_sources/scss/components/_time_pass.scss @@ -96,8 +96,8 @@ * 1. Take up full available width, i.e. 100% - padding of .lp_timePass */ .lp_time-pass__actions { - bottom: 1em; - position: absolute; + display: flex; + position: relative; width: 80%; /* 1 - fallback for browsers that don't support calc */ width: calc(100% - 4em); /* 1 */ @@ -352,7 +352,7 @@ input.lp_voucher__code { } .lp_time-pass__actions { - bottom: 0.8em !important; + display: flex; width: 80% !important; /* 1 - fallback for browsers that don't support calc */ width: calc(100% - 2em) !important; /* 1 */ margin-left: 3px !important; @@ -361,9 +361,8 @@ input.lp_voucher__code { font-size: $fs--15 !important; &:before { - font-size: 36px !important; - left: -1px !important; - top: 10px !important; + font-size: 25px !important; + top: 4px !important; } } diff --git a/laterpay/asset_sources/scss/laterpay-post-view.scss b/laterpay/asset_sources/scss/laterpay-post-view.scss index a1e905e76..c0c9dc8b1 100644 --- a/laterpay/asset_sources/scss/laterpay-post-view.scss +++ b/laterpay/asset_sources/scss/laterpay-post-view.scss @@ -32,13 +32,8 @@ // fix for small card on front view -.lp_time-pass-widget .lp_time-pass__actions .lp_purchase-button:before { - left: 1px !important; - top: 9px!important; -} - .lp_time-pass-widget .lp_time-pass__actions .lp_purchase-button { - padding: 4px 11px 4px 36px!important; + padding: 4px 11px 4px 10px!important; } .lp_premium_link_anchor { diff --git a/laterpay/asset_sources/scss/pages/_appearance.scss b/laterpay/asset_sources/scss/pages/_appearance.scss index 497ea2d0b..f4374011f 100644 --- a/laterpay/asset_sources/scss/pages/_appearance.scss +++ b/laterpay/asset_sources/scss/pages/_appearance.scss @@ -179,10 +179,10 @@ display: inline-block !important; float: none !important; margin-bottom: 5px !important; - font-size: $fs !important; + font-size: $fs--2 !important; &:before { - font-size: 30px !important; - top: 6px; + font-size: 28px !important; + top: 3px; } } From d50ca010cd3f442eee556d859710f631f59993ce Mon Sep 17 00:00:00 2001 From: Tom Stark Date: Thu, 1 Oct 2020 12:09:15 +0200 Subject: [PATCH 05/10] Update composer.lock --- composer.lock | 59 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index d39772029..4836fbdd0 100644 --- a/composer.lock +++ b/composer.lock @@ -32,20 +32,21 @@ "packages-dev": [ { "name": "automattic/vipwpcs", - "version": "2.1.0", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/Automattic/VIP-Coding-Standards.git", - "reference": "03e75ddd0261b675dece60fb67fc2e9c6af4ad35" + "reference": "4d0612461232b313d06321f1501c3989bd6aecf9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/03e75ddd0261b675dece60fb67fc2e9c6af4ad35", - "reference": "03e75ddd0261b675dece60fb67fc2e9c6af4ad35", + "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/4d0612461232b313d06321f1501c3989bd6aecf9", + "reference": "4d0612461232b313d06321f1501c3989bd6aecf9", "shasum": "" }, "require": { "php": ">=5.4", + "sirbrillig/phpcs-variable-analysis": "^2.8.3", "squizlabs/php_codesniffer": "^3.5.5", "wp-coding-standards/wpcs": "^2.3" }, @@ -74,7 +75,7 @@ "standards", "wordpress" ], - "time": "2020-07-07T07:48:04+00:00" + "time": "2020-09-07T10:45:45+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -304,6 +305,54 @@ ], "time": "2019-08-28T14:22:28+00:00" }, + { + "name": "sirbrillig/phpcs-variable-analysis", + "version": "v2.8.3", + "source": { + "type": "git", + "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", + "reference": "00b4fa3130faa26762c929989e3d958086c627f1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/00b4fa3130faa26762c929989e3d958086c627f1", + "reference": "00b4fa3130faa26762c929989e3d958086c627f1", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "squizlabs/php_codesniffer": "^3.1" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4 || ^0.5 || ^0.6", + "limedeck/phpunit-detailed-printer": "^3.1 || ^4.0 || ^5.0", + "phpstan/phpstan": "^0.11.8", + "phpunit/phpunit": "^5.0 || ^6.5 || ^7.0 || ^8.0", + "sirbrillig/phpcs-import-detection": "^1.1" + }, + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "VariableAnalysis\\": "VariableAnalysis/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Sam Graham", + "email": "php-codesniffer-variableanalysis@illusori.co.uk" + }, + { + "name": "Payton Swick", + "email": "payton@foolord.com" + } + ], + "description": "A PHPCS sniff to detect problems with variables.", + "time": "2020-07-11T23:32:06+00:00" + }, { "name": "squizlabs/php_codesniffer", "version": "3.5.6", From 2d9bbe800b16f7528ee8b9a182984d97ee6ad968 Mon Sep 17 00:00:00 2001 From: Tom Stark Date: Fri, 2 Oct 2020 17:15:59 +0200 Subject: [PATCH 06/10] Fix Laterpay logo size in the button above article --- laterpay/asset_sources/scss/pages/_appearance.scss | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/laterpay/asset_sources/scss/pages/_appearance.scss b/laterpay/asset_sources/scss/pages/_appearance.scss index f4374011f..cccd4fb4c 100644 --- a/laterpay/asset_sources/scss/pages/_appearance.scss +++ b/laterpay/asset_sources/scss/pages/_appearance.scss @@ -84,9 +84,7 @@ font-size: 15px !important; &:before { - font-size: 30px !important; - left: 10px; - top: 6px; + font-size: 20px !important; } } From 060fd63651d863bfbfbc486a11b9ddf619c1ea34 Mon Sep 17 00:00:00 2001 From: Tom Stark Date: Tue, 6 Oct 2020 13:26:19 +0200 Subject: [PATCH 07/10] CLIENTS-785: Remove GA code from codebase. Ref: https://laterpay.atlassian.net/browse/CLIENTS-785 --- .../application/Controller/Admin/Settings.php | 36 ----- laterpay/application/Helper/Appearance.php | 18 --- laterpay/asset_sources/js/laterpay-common.js | 152 ++---------------- 3 files changed, 12 insertions(+), 194 deletions(-) diff --git a/laterpay/application/Controller/Admin/Settings.php b/laterpay/application/Controller/Admin/Settings.php index 180bc4f06..9ec512eee 100644 --- a/laterpay/application/Controller/Admin/Settings.php +++ b/laterpay/application/Controller/Admin/Settings.php @@ -125,7 +125,6 @@ public function init_laterpay_advanced_settings() { // add sections with fields $this->add_access_settings(); $this->add_unlimited_access_settings(); - $this->add_analytics_settings(); $this->add_appearance_settings(); $this->add_technical_settings(); $this->add_contact_section(); @@ -239,42 +238,7 @@ public function add_analytics_settings() { ) ); - // Add LaterPay GA Section. - add_settings_field( - 'laterpay_tracking_data', - __( 'Laterpay Google Analytics:', 'laterpay' ), - array( $this, 'get_ga_field_markup' ), - 'laterpay', - 'laterpay_analytics', - array( - array( - 'name' => 'laterpay_ga_enabled_status', - 'value' => 1, - 'type' => 'checkbox', - 'parent_name' => 'laterpay_tracking_data', - 'modal' => array( - 'id' => 'lp_ga_modal_id', - 'message' => sprintf( '%1$s

%2$s', - esc_html__( 'Laterpay collects this information to improve our products and - services and also so that you can determine the effectiveness of your pricing - strategy using our Merchant Analytics dashboard.', 'laterpay' ), - esc_html__( 'Are you sure you would like to disable this feature?', 'laterpay' ) ), - 'saveText' => esc_html__( 'Yes, Disable Tracking', 'laterpay' ), - 'cancelText' => esc_html__( 'Cancel', 'laterpay' ), - ), - ), - array( - 'name' => 'laterpay_ga_ua_id', - 'type' => 'text', - 'classes' => [ 'lp_ga-input' ], - 'readonly' => true, - 'parent_name' => 'laterpay_tracking_data', - ) - ) - ); - register_setting( 'laterpay', 'laterpay_user_tracking_data' ); - register_setting( 'laterpay', 'laterpay_tracking_data' ); } diff --git a/laterpay/application/Helper/Appearance.php b/laterpay/application/Helper/Appearance.php index 3783202ca..8757861a7 100644 --- a/laterpay/application/Helper/Appearance.php +++ b/laterpay/application/Helper/Appearance.php @@ -132,24 +132,6 @@ public static function add_overlay_styles( $handle ) { */ public static function is_any_ga_tracking_enabled() { - // Get current status of Google Analytics Settings. - $lp_tracking_data = get_option( 'laterpay_tracking_data' ); - $lp_user_tracking_data = get_option( 'laterpay_user_tracking_data' ); - - // Check if LaterPay Tracking Setting is Enabled. - $is_enabled_lp_tracking = ( ! empty( $lp_tracking_data['laterpay_ga_enabled_status'] ) && - 1 === intval( $lp_tracking_data['laterpay_ga_enabled_status'] ) ); - - // Check if Personal Tracking Setting is Enabled. - $is_enabled_lp_user_tracking = ( ! empty( $lp_user_tracking_data['laterpay_ga_personal_enabled_status'] ) && - 1 === intval( $lp_user_tracking_data['laterpay_ga_personal_enabled_status'] ) ); - - $is_any_tracking_enabled = ( $is_enabled_lp_tracking || $is_enabled_lp_user_tracking ); - - if ( $is_any_tracking_enabled ) { - return true; - } - return false; } diff --git a/laterpay/asset_sources/js/laterpay-common.js b/laterpay/asset_sources/js/laterpay-common.js index 6cf3f8a3d..797035d51 100644 --- a/laterpay/asset_sources/js/laterpay-common.js +++ b/laterpay/asset_sources/js/laterpay-common.js @@ -68,53 +68,13 @@ return matches ? decodeURIComponent(matches[1]) : undefined; }, - // Injects Google Analytics Script. + /** + * Injects Google Analytics Script. + * + * Removed in 2.9.7. Always returns false. + */ injectGAScript = function ( injectNow ) { - if ( true === injectNow ) { - // This injector script is for GA have made minor modifications to fix linting issue. - (function(i, s, o, g, r, a, m) { - i.GoogleAnalyticsObject = r; - i[r] = i[r] || function() { - (i[r].q = i[r].q || []).push(arguments); - }; i[r].l = 1 * new Date(); - a = s.createElement(o); - m = s.getElementsByTagName(o)[0]; - a.async = 1; - a.src = g; - m.parentNode.insertBefore(a, m); - })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'lpga'); - return window[window.GoogleAnalyticsObject || 'lpga']; - } - }, - - // Send event to LaterPay GA. - sendParentEvent = function( injectNow, eventlabel, eventAction, eventCategory, eventValue, eventInteraction ) { - var lpga = injectGAScript( injectNow ); - if (typeof lpga === 'function') { - lpga( 'create', lpCommonVar.lp_tracking_id, 'auto', 'lpParentTracker' ); - lpga('lpParentTracker.send', 'event', { - eventCategory : eventCategory, - eventAction : eventAction, - eventLabel : eventlabel, - eventValue : eventValue, - nonInteraction : eventInteraction, - }); - } - }, - - // Send event to User GA. - sendUserEvent = function( injectNow, eventlabel, eventAction, eventCategory, eventValue, eventInteraction ) { - var lpga = injectGAScript( injectNow ); - if (typeof lpga === 'function') { - lpga( 'create', lpCommonVar.lp_user_tracking_id, 'auto', 'lpUserTracker' ); - lpga( 'lpUserTracker.send', 'event', { - eventCategory : eventCategory, - eventAction : eventAction, - eventLabel : eventlabel, - eventValue : eventValue, - nonInteraction : eventInteraction, - }); - } + return false; }, // Read Post Purchased Cookie. @@ -127,26 +87,6 @@ } }, - // Detect if GA is Enabled by MonsterInsights Plugin. - detectMonsterInsightsGA = function () { - if ( typeof window.mi_track_user === 'boolean' && true === window.mi_trac_user ) { - return window[window.GoogleAnalyticsObject || '__gaTracker']; - } - }, - - // Create a tracker and send event to GA. - createTrackerAndSendEvent = function ( gaTracker, trackingId, trackerName, eventAction, eventLabel, - eventCategory, eventValue, eventInteraction ) { - gaTracker( 'create', trackingId, 'auto', trackerName ); - gaTracker( trackerName + '.send', 'event', { - eventCategory : eventCategory, - eventAction : eventAction, - eventLabel : eventLabel, - eventValue : eventValue, - nonInteraction : eventInteraction, - }); - }, - daysPassedSinceEvent = function( date1, date2 ) { //Get 1 day in milliseconds @@ -361,81 +301,13 @@ window.lpGlobal = { - // Send GA Event conditionally. + /** + * Send GA Event conditionally. + * + * Removed in 2.9.7, always returns false. + */ sendLPGAEvent: function ( eventAction, eventCategory, eventLabel, eventValue, eventInteraction ) { - - if ( 'undefined' === typeof eventInteraction ) { - eventInteraction = false; - } - - var sentUserEvent = false; - var __gaTracker = detectMonsterInsightsGA(); - var trackers = ''; - var userUAID = lpCommonVar.lp_user_tracking_id; - var lpUAID = lpCommonVar.lp_tracking_id; - - if( userUAID.length > 0 && lpUAID.length > 0 ) { - - if (typeof __gaTracker === 'function' ) { - trackers = __gaTracker.getAll(); - trackers.forEach(function(tracker) { - if ( userUAID === tracker.get('trackingId') ) { - sentUserEvent = true; - var trackerName = tracker.get('name'); - __gaTracker( trackerName + '.send', 'event', { - eventCategory : eventCategory, - eventAction : eventAction, - eventLabel : eventLabel, - eventValue : eventValue, - nonInteraction : eventInteraction, - }); - } - }); - - if ( true === sentUserEvent ) { - createTrackerAndSendEvent( lpUAID, 'lpParentTracker', eventAction, eventLabel, - eventCategory, eventValue, eventInteraction ); - } else { - createTrackerAndSendEvent( __gaTracker, lpUAID, 'lpParentTracker', eventAction, - eventLabel, eventCategory, eventValue, eventInteraction ); - createTrackerAndSendEvent( __gaTracker, userUAID, 'lpUserTracker', eventAction, - eventLabel, eventCategory, eventValue, eventInteraction ); - } - } else { - sendParentEvent( true, eventLabel, eventAction, eventCategory, eventValue, eventInteraction ); - sendUserEvent( true, eventLabel, eventAction, eventCategory, eventValue, eventInteraction ); - } - } else if( userUAID.length > 0 && lpUAID.length === 0 ) { - if (typeof __gaTracker === 'function') { - trackers = __gaTracker.getAll(); - trackers.forEach(function (tracker) { - if (userUAID === tracker.get('trackingId')) { - sentUserEvent = true; - var trackerName = tracker.get('name'); - __gaTracker(trackerName + '.send', 'event', { - eventCategory : eventCategory, - eventAction : eventAction, - eventLabel : eventLabel, - eventValue : eventValue, - nonInteraction : eventInteraction, - }); - } - }); - - if (true !== sentUserEvent) { - sendUserEvent(true, eventLabel, eventAction, eventCategory, eventValue,eventInteraction); - } - } else { - sendUserEvent(true, eventLabel, eventAction, eventCategory, eventValue,eventInteraction); - } - } else if( userUAID.length === 0 && lpUAID.length > 0 ) { - if (typeof __gaTracker === 'function' ) { - createTrackerAndSendEvent( __gaTracker, lpUAID, 'lpParentTracker', eventAction, eventLabel, - eventCategory, eventValue, eventInteraction ); - } else{ - sendParentEvent( true, eventLabel, eventAction, eventCategory, eventValue, eventInteraction ); - } - } + return false; } }; From 5e3686877e3aab4c01e46229cdc06dff000ad603 Mon Sep 17 00:00:00 2001 From: Tom Stark Date: Wed, 7 Oct 2020 08:23:40 +0200 Subject: [PATCH 08/10] CLIENTS-785: Remove Analytics & Usage data section from Advanced tab --- laterpay/views/backend/advanced.php | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/laterpay/views/backend/advanced.php b/laterpay/views/backend/advanced.php index d53cfe69f..7c837144f 100644 --- a/laterpay/views/backend/advanced.php +++ b/laterpay/views/backend/advanced.php @@ -204,30 +204,6 @@ class="lp_plugin-mode-indicator" -
- -
-
-

- -

-

- -

-
    -
  • - -
  • -
  • - -
  • -
-
-
-
-