Skip to content

Commit 3ea5d17

Browse files
committed
Version 2.9.7
2 parents bf5ba40 + 06f552a commit 3ea5d17

20 files changed

+2942
-401
lines changed

composer.lock

Lines changed: 54 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

laterpay/README.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Tags: contribution, micropayment, paywall, sell content, subscription, conversio
66
Requires at least: 4.6
77
Tested up to: 5.5
88
Requires PHP: 5.6
9-
Stable tag: 2.9.6
9+
Stable tag: 2.9.7
1010
Author URI: https://laterpay.net
1111
Plugin URI: https://github.com/laterpay/laterpay-wordpress-plugin
1212
License: MIT
@@ -90,6 +90,10 @@ Yes!
9090
7. The plugin provides a variety of advanced settings to customize the Laterpay plugin and adjust it to your needs.
9191

9292
== Changelog ==
93+
= 2.9.7 ( October 7, 2020 ) =
94+
* Fixed alignment and size of Laterpay logo in various buttons.
95+
* Removed Google Analytics integration to comply with latest EU laws.
96+
9397
= 2.9.6 ( August 25, 2020 ) =
9498
* Updated Laterpay logo.
9599
* Updated 'Tested up to' tag to WordPress 5.5.
@@ -720,6 +724,9 @@ KNOWN BUGS:
720724

721725
== Upgrade notice ==
722726

727+
= 2.9.7 =
728+
Fixed Laterpay logo appearance, removed GA integration.
729+
723730
= 2.9.6 =
724731
Updated Laterpay logo and compatibility with WordPress 5.5.
725732

laterpay/application/Controller/Admin/Settings.php

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ public function init_laterpay_advanced_settings() {
125125
// add sections with fields
126126
$this->add_access_settings();
127127
$this->add_unlimited_access_settings();
128-
$this->add_analytics_settings();
129128
$this->add_appearance_settings();
130129
$this->add_technical_settings();
131130
$this->add_contact_section();
@@ -239,42 +238,7 @@ public function add_analytics_settings() {
239238
)
240239
);
241240

242-
// Add LaterPay GA Section.
243-
add_settings_field(
244-
'laterpay_tracking_data',
245-
__( 'Laterpay Google Analytics:', 'laterpay' ),
246-
array( $this, 'get_ga_field_markup' ),
247-
'laterpay',
248-
'laterpay_analytics',
249-
array(
250-
array(
251-
'name' => 'laterpay_ga_enabled_status',
252-
'value' => 1,
253-
'type' => 'checkbox',
254-
'parent_name' => 'laterpay_tracking_data',
255-
'modal' => array(
256-
'id' => 'lp_ga_modal_id',
257-
'message' => sprintf( '%1$s <br/><br/> %2$s',
258-
esc_html__( 'Laterpay collects this information to improve our products and
259-
services and also so that you can determine the effectiveness of your pricing
260-
strategy using our Merchant Analytics dashboard.', 'laterpay' ),
261-
esc_html__( 'Are you sure you would like to disable this feature?', 'laterpay' ) ),
262-
'saveText' => esc_html__( 'Yes, Disable Tracking', 'laterpay' ),
263-
'cancelText' => esc_html__( 'Cancel', 'laterpay' ),
264-
),
265-
),
266-
array(
267-
'name' => 'laterpay_ga_ua_id',
268-
'type' => 'text',
269-
'classes' => [ 'lp_ga-input' ],
270-
'readonly' => true,
271-
'parent_name' => 'laterpay_tracking_data',
272-
)
273-
)
274-
);
275-
276241
register_setting( 'laterpay', 'laterpay_user_tracking_data' );
277-
register_setting( 'laterpay', 'laterpay_tracking_data' );
278242

279243
}
280244

laterpay/application/Helper/Appearance.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -132,24 +132,6 @@ public static function add_overlay_styles( $handle ) {
132132
*/
133133
public static function is_any_ga_tracking_enabled() {
134134

135-
// Get current status of Google Analytics Settings.
136-
$lp_tracking_data = get_option( 'laterpay_tracking_data' );
137-
$lp_user_tracking_data = get_option( 'laterpay_user_tracking_data' );
138-
139-
// Check if LaterPay Tracking Setting is Enabled.
140-
$is_enabled_lp_tracking = ( ! empty( $lp_tracking_data['laterpay_ga_enabled_status'] ) &&
141-
1 === intval( $lp_tracking_data['laterpay_ga_enabled_status'] ) );
142-
143-
// Check if Personal Tracking Setting is Enabled.
144-
$is_enabled_lp_user_tracking = ( ! empty( $lp_user_tracking_data['laterpay_ga_personal_enabled_status'] ) &&
145-
1 === intval( $lp_user_tracking_data['laterpay_ga_personal_enabled_status'] ) );
146-
147-
$is_any_tracking_enabled = ( $is_enabled_lp_tracking || $is_enabled_lp_user_tracking );
148-
149-
if ( $is_any_tracking_enabled ) {
150-
return true;
151-
}
152-
153135
return false;
154136

155137
}

laterpay/asset_sources/js/laterpay-common.js

Lines changed: 12 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -68,53 +68,13 @@
6868
return matches ? decodeURIComponent(matches[1]) : undefined;
6969
},
7070

71-
// Injects Google Analytics Script.
71+
/**
72+
* Injects Google Analytics Script.
73+
*
74+
* Removed in 2.9.7. Always returns false.
75+
*/
7276
injectGAScript = function ( injectNow ) {
73-
if ( true === injectNow ) {
74-
// This injector script is for GA have made minor modifications to fix linting issue.
75-
(function(i, s, o, g, r, a, m) {
76-
i.GoogleAnalyticsObject = r;
77-
i[r] = i[r] || function() {
78-
(i[r].q = i[r].q || []).push(arguments);
79-
}; i[r].l = 1 * new Date();
80-
a = s.createElement(o);
81-
m = s.getElementsByTagName(o)[0];
82-
a.async = 1;
83-
a.src = g;
84-
m.parentNode.insertBefore(a, m);
85-
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'lpga');
86-
return window[window.GoogleAnalyticsObject || 'lpga'];
87-
}
88-
},
89-
90-
// Send event to LaterPay GA.
91-
sendParentEvent = function( injectNow, eventlabel, eventAction, eventCategory, eventValue, eventInteraction ) {
92-
var lpga = injectGAScript( injectNow );
93-
if (typeof lpga === 'function') {
94-
lpga( 'create', lpCommonVar.lp_tracking_id, 'auto', 'lpParentTracker' );
95-
lpga('lpParentTracker.send', 'event', {
96-
eventCategory : eventCategory,
97-
eventAction : eventAction,
98-
eventLabel : eventlabel,
99-
eventValue : eventValue,
100-
nonInteraction : eventInteraction,
101-
});
102-
}
103-
},
104-
105-
// Send event to User GA.
106-
sendUserEvent = function( injectNow, eventlabel, eventAction, eventCategory, eventValue, eventInteraction ) {
107-
var lpga = injectGAScript( injectNow );
108-
if (typeof lpga === 'function') {
109-
lpga( 'create', lpCommonVar.lp_user_tracking_id, 'auto', 'lpUserTracker' );
110-
lpga( 'lpUserTracker.send', 'event', {
111-
eventCategory : eventCategory,
112-
eventAction : eventAction,
113-
eventLabel : eventlabel,
114-
eventValue : eventValue,
115-
nonInteraction : eventInteraction,
116-
});
117-
}
77+
return false;
11878
},
11979

12080
// Read Post Purchased Cookie.
@@ -127,26 +87,6 @@
12787
}
12888
},
12989

130-
// Detect if GA is Enabled by MonsterInsights Plugin.
131-
detectMonsterInsightsGA = function () {
132-
if ( typeof window.mi_track_user === 'boolean' && true === window.mi_trac_user ) {
133-
return window[window.GoogleAnalyticsObject || '__gaTracker'];
134-
}
135-
},
136-
137-
// Create a tracker and send event to GA.
138-
createTrackerAndSendEvent = function ( gaTracker, trackingId, trackerName, eventAction, eventLabel,
139-
eventCategory, eventValue, eventInteraction ) {
140-
gaTracker( 'create', trackingId, 'auto', trackerName );
141-
gaTracker( trackerName + '.send', 'event', {
142-
eventCategory : eventCategory,
143-
eventAction : eventAction,
144-
eventLabel : eventLabel,
145-
eventValue : eventValue,
146-
nonInteraction : eventInteraction,
147-
});
148-
},
149-
15090
daysPassedSinceEvent = function( date1, date2 ) {
15191

15292
//Get 1 day in milliseconds
@@ -361,81 +301,13 @@
361301

362302
window.lpGlobal = {
363303

364-
// Send GA Event conditionally.
304+
/**
305+
* Send GA Event conditionally.
306+
*
307+
* Removed in 2.9.7, always returns false.
308+
*/
365309
sendLPGAEvent: function ( eventAction, eventCategory, eventLabel, eventValue, eventInteraction ) {
366-
367-
if ( 'undefined' === typeof eventInteraction ) {
368-
eventInteraction = false;
369-
}
370-
371-
var sentUserEvent = false;
372-
var __gaTracker = detectMonsterInsightsGA();
373-
var trackers = '';
374-
var userUAID = lpCommonVar.lp_user_tracking_id;
375-
var lpUAID = lpCommonVar.lp_tracking_id;
376-
377-
if( userUAID.length > 0 && lpUAID.length > 0 ) {
378-
379-
if (typeof __gaTracker === 'function' ) {
380-
trackers = __gaTracker.getAll();
381-
trackers.forEach(function(tracker) {
382-
if ( userUAID === tracker.get('trackingId') ) {
383-
sentUserEvent = true;
384-
var trackerName = tracker.get('name');
385-
__gaTracker( trackerName + '.send', 'event', {
386-
eventCategory : eventCategory,
387-
eventAction : eventAction,
388-
eventLabel : eventLabel,
389-
eventValue : eventValue,
390-
nonInteraction : eventInteraction,
391-
});
392-
}
393-
});
394-
395-
if ( true === sentUserEvent ) {
396-
createTrackerAndSendEvent( lpUAID, 'lpParentTracker', eventAction, eventLabel,
397-
eventCategory, eventValue, eventInteraction );
398-
} else {
399-
createTrackerAndSendEvent( __gaTracker, lpUAID, 'lpParentTracker', eventAction,
400-
eventLabel, eventCategory, eventValue, eventInteraction );
401-
createTrackerAndSendEvent( __gaTracker, userUAID, 'lpUserTracker', eventAction,
402-
eventLabel, eventCategory, eventValue, eventInteraction );
403-
}
404-
} else {
405-
sendParentEvent( true, eventLabel, eventAction, eventCategory, eventValue, eventInteraction );
406-
sendUserEvent( true, eventLabel, eventAction, eventCategory, eventValue, eventInteraction );
407-
}
408-
} else if( userUAID.length > 0 && lpUAID.length === 0 ) {
409-
if (typeof __gaTracker === 'function') {
410-
trackers = __gaTracker.getAll();
411-
trackers.forEach(function (tracker) {
412-
if (userUAID === tracker.get('trackingId')) {
413-
sentUserEvent = true;
414-
var trackerName = tracker.get('name');
415-
__gaTracker(trackerName + '.send', 'event', {
416-
eventCategory : eventCategory,
417-
eventAction : eventAction,
418-
eventLabel : eventLabel,
419-
eventValue : eventValue,
420-
nonInteraction : eventInteraction,
421-
});
422-
}
423-
});
424-
425-
if (true !== sentUserEvent) {
426-
sendUserEvent(true, eventLabel, eventAction, eventCategory, eventValue,eventInteraction);
427-
}
428-
} else {
429-
sendUserEvent(true, eventLabel, eventAction, eventCategory, eventValue,eventInteraction);
430-
}
431-
} else if( userUAID.length === 0 && lpUAID.length > 0 ) {
432-
if (typeof __gaTracker === 'function' ) {
433-
createTrackerAndSendEvent( __gaTracker, lpUAID, 'lpParentTracker', eventAction, eventLabel,
434-
eventCategory, eventValue, eventInteraction );
435-
} else{
436-
sendParentEvent( true, eventLabel, eventAction, eventCategory, eventValue, eventInteraction );
437-
}
438-
}
310+
return false;
439311
}
440312
};
441313

laterpay/asset_sources/scss/blocks/premium-download-box.scss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919
padding: 4px 7px 4px 7px!important;
2020

2121
&:before {
22-
font-size: round($fs * 2.5) !important;
23-
left: -2px !important;
24-
top: 10px !important;
22+
position: relative !important;
23+
top: 4px !important;
24+
left: 0 !important;
25+
margin-right: 0 !important;
26+
font-size: round($fs--2) !important;
2527
}
2628
}
2729
.lp_purchase-button-wrapper {

0 commit comments

Comments
 (0)