Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tkgdpr 54 fix vip error #278

Open
wants to merge 35 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
622ae7d
Verify nonce in user_registration hook
moutushi82 Jul 15, 2020
6ec6a2c
Fixed error "Overriding WordPress globals is prohibited".
moutushi82 Jul 16, 2020
3d27165
Changed $type to $consent_type
moutushi82 Jul 16, 2020
9822cc5
Escaped output
moutushi82 Jul 16, 2020
1b134b3
Removed set cookie from register & update user hook
moutushi82 Aug 5, 2020
e4fe141
Added JS version for save_consent & remove_consent
moutushi82 Aug 6, 2020
b3e5d3a
Set cookie inside JS for update_privacy_preferences()
moutushi82 Aug 6, 2020
aa5a64a
Set & remove cookie on ajax success
moutushi82 Aug 6, 2020
6e1fbe9
Set script tag to 'text/javascript'
moutushi82 Aug 11, 2020
a24d427
JS version of set_plugin_cookies() function
moutushi82 Aug 11, 2020
45468d6
Fixed ajax call for save_consent() & remove_consent() functions
moutushi82 Aug 12, 2020
acd0129
Removed setcookie() & update cookie name gdpr[privacy_bar] to gdpr_pr…
moutushi82 Aug 12, 2020
6d7018c
Removed set_plugin_cookies() function
moutushi82 Aug 12, 2020
47500c4
Removed $_COOKIE & setcookie from privacy_preferences_modal
moutushi82 Aug 13, 2020
856c680
Added deprecated function warning
moutushi82 Aug 13, 2020
81ebb44
Added data-gdpr checking for script with 'text/plain'
moutushi82 Aug 13, 2020
450d383
Removing save_consent and remove_consent from JS
fclaussen Aug 13, 2020
f2fbe93
Merge remote-tracking branch 'origin/TKGDPR-54-FIX-VIP-Error' into TK…
fclaussen Aug 13, 2020
ec28d8a
Fixed JS for cookie category check
moutushi82 Aug 13, 2020
7ed20d8
Merge remote-tracking branch 'origin/TKGDPR-54-FIX-VIP-Error' into TK…
fclaussen Aug 13, 2020
f19bf7f
cleanup
fclaussen Aug 13, 2020
34d02d2
remove wrong audit log entry
fclaussen Aug 13, 2020
0adcf3a
Fix Typo
fclaussen Aug 13, 2020
6d84cc7
Fixed preferences saving issue
moutushi82 Aug 14, 2020
bbd956a
Fixed refresh issue & preferences on/off issue
moutushi82 Aug 14, 2020
f2d85c2
Fixed on/off checkboxes for cookies
moutushi82 Aug 14, 2020
fce6590
Removed console log
moutushi82 Aug 14, 2020
225222f
Fixed checkbox on/off issue
moutushi82 Aug 14, 2020
ae44c5b
Added cookie status for on/off cookie checkbox
moutushi82 Aug 14, 2020
145c2b9
Fixed privacy bar showing part
moutushi82 Aug 14, 2020
89c52eb
Soft opt in cookies part fixed
moutushi82 Aug 14, 2020
36e9f22
Fix for running JS
fclaussen Aug 14, 2020
32097f1
Update dependencies
fclaussen Aug 17, 2020
ce66c02
Additional changes
fclaussen Aug 25, 2020
6ab628e
More fixes
fclaussen Aug 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Set cookie inside JS for update_privacy_preferences()
moutushi82 committed Aug 6, 2020
commit b3e5d3a7bb589fd4f2553e5a285f144a36ad520f
7 changes: 6 additions & 1 deletion public/class-gdpr-public.php
Original file line number Diff line number Diff line change
@@ -291,7 +291,12 @@ public function update_privacy_preferences() {
}
}

wp_send_json_success();
$success_data = array(
'cookies' => $approved_cookies,
'consent' => $consent
);

wp_send_json_success( $success_data );
}

/**
15 changes: 10 additions & 5 deletions src/js/public.js
Original file line number Diff line number Diff line change
@@ -22,13 +22,16 @@ window.has_consent = function( consent ) {
};

window.is_allowed_cookie = function ( cookie ) {
if ( Cookies.get( 'gdpr[allowed_cookies]' ) ) {
const cookiesArray = JSON.parse( Cookies.get( 'gdpr[allowed_cookies]' ) );
if ( -1 < cookiesArray.indexOf( cookie ) ) {
return true;
}
let cookiesArray = [];
if ( Cookies.get( 'gdpr_allowed_cookies' ) ) {
cookiesArray = JSON.parse( Cookies.get( 'gdpr_allowed_cookies' ) );
} else if ( Cookies.get( 'gdpr[allowed_cookies]' ) ) {
cookiesArray = JSON.parse( Cookies.get( 'gdpr[allowed_cookies]' ) );
}

if ( -1 < cookiesArray.indexOf( cookie ) ) {
return true;
}
return false;
};

@@ -94,6 +97,8 @@ $( function() {
function( response ) {
if ( response.success ) {
Cookies.set( 'gdpr[privacy_bar]', 1, { expires: 365 } );
Cookies.set( 'gdpr_allowed_cookies', JSON.stringify( response.data.cookies ), { expires: 365 } );
Cookies.set( 'gdpr_consent_types', JSON.stringify( response.data.consent ), { expires: 365 } );
if ( GDPR.refresh ) {
window.location.reload();
} else {