Version Description
- GDPR consent management module added
- Updated Privacy policy
Download this release
Release Info
Developer | quickadsense |
Plugin | Quick Adsense |
Version | 2.4 |
Comparing to | |
See all releases |
Code changes from version 2.3.2 to 2.4
- includes/api/vi.php +133 -66
- includes/css/gdpr.css +131 -0
- includes/images/privacy.png +0 -0
- includes/js/admin.js +2 -0
- includes/js/gdpr.js +198 -0
- includes/vi-gdpr.php +147 -0
- includes/vi.php +13 -0
- quick-adsense.php +4 -2
- readme.txt +28 -4
includes/api/vi.php
CHANGED
@@ -6,6 +6,7 @@ function quick_adsense_vi_api_get_settings() {
|
|
6 |
$response = wp_remote_get('https://dashboard-api.vidint.net/v1/api/widget/settings', array('timeout' => 15));
|
7 |
if(!is_wp_error($response) && (200 == wp_remote_retrieve_response_code($response))) {
|
8 |
$responseBody = json_decode($response['body']);
|
|
|
9 |
if((json_last_error() == JSON_ERROR_NONE) && ($responseBody->status == 'ok')) {
|
10 |
$viSettings = array(
|
11 |
'signupURL' => $responseBody->data->signupURL,
|
@@ -17,7 +18,11 @@ function quick_adsense_vi_api_get_settings() {
|
|
17 |
'revenueAPI' => $responseBody->data->revenueAPI,
|
18 |
'adsTxtAPI' => $responseBody->data->adsTxtAPI,
|
19 |
'languages' => $responseBody->data->languages,
|
20 |
-
'jsTagAPI' => $responseBody->data->jsTagAPI,
|
|
|
|
|
|
|
|
|
21 |
);
|
22 |
delete_transient('quick_adsense_vi_api_settings');
|
23 |
set_transient('quick_adsense_vi_api_settings', $viSettings, WEEK_IN_SECONDS);
|
@@ -32,6 +37,10 @@ function quick_adsense_vi_api_get_settings() {
|
|
32 |
return $viSettings;
|
33 |
}
|
34 |
|
|
|
|
|
|
|
|
|
35 |
function quick_adsense_vi_api_get_signupurl() {
|
36 |
$viSettings = quick_adsense_vi_api_get_settings();
|
37 |
if(($viSettings != false) && is_array($viSettings)) {
|
@@ -74,6 +83,22 @@ function quick_adsense_vi_api_get_languages() {
|
|
74 |
return false;
|
75 |
}
|
76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
function quick_adsense_vi_api_get_adstxt_content() {
|
78 |
$viSettings = quick_adsense_vi_api_get_settings();
|
79 |
if(($viSettings != false) && is_array($viSettings)) {
|
@@ -316,82 +341,74 @@ function quick_adsense_vi_api_set_vi_code($args = null) {
|
|
316 |
}
|
317 |
}
|
318 |
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
$
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
'
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
if(
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
return $responseBody->data;
|
359 |
-
} else {
|
360 |
-
return array(
|
361 |
-
'status' => 'error',
|
362 |
-
'errorCode' => 'WIVI106',
|
363 |
-
'message' => 'Response JSON error!',
|
364 |
-
);
|
365 |
-
}
|
366 |
} else {
|
367 |
return array(
|
368 |
'status' => 'error',
|
369 |
-
'errorCode' => '
|
370 |
-
'message' => '
|
371 |
);
|
372 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
373 |
}
|
374 |
-
} catch(Exception $ex) {
|
375 |
-
return array(
|
376 |
-
'status' => 'error',
|
377 |
-
'errorCode' => 'WIVI103',
|
378 |
-
'message' => 'Exception during API communication',
|
379 |
-
);
|
380 |
}
|
381 |
-
}
|
382 |
return array(
|
383 |
'status' => 'error',
|
384 |
-
'errorCode' => '
|
385 |
-
'message' => '
|
386 |
);
|
387 |
}
|
388 |
-
|
389 |
-
|
390 |
'status' => 'error',
|
391 |
-
'errorCode' => '
|
392 |
-
'message' => '
|
393 |
-
)
|
394 |
-
|
395 |
} else {
|
396 |
return array(
|
397 |
'status' => 'error',
|
@@ -402,7 +419,6 @@ function quick_adsense_vi_api_set_vi_code($args = null) {
|
|
402 |
}
|
403 |
|
404 |
function quick_adsense_vi_api_get_vi_code($settingsKey = '') {
|
405 |
-
//delete_transient('quick_adsense_vi_api_jstag');
|
406 |
$jsTag = get_transient('quick_adsense_vi_api_jstag');
|
407 |
if(($jsTag === false) || ($jsTag == '') || is_array($jsTag)) {
|
408 |
if($settingsKey != '') {
|
@@ -417,4 +433,55 @@ function quick_adsense_vi_api_get_vi_code($settingsKey = '') {
|
|
417 |
}
|
418 |
return '<script type="text/javascript">'.$jsTag.'</script>';
|
419 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
420 |
?>
|
6 |
$response = wp_remote_get('https://dashboard-api.vidint.net/v1/api/widget/settings', array('timeout' => 15));
|
7 |
if(!is_wp_error($response) && (200 == wp_remote_retrieve_response_code($response))) {
|
8 |
$responseBody = json_decode($response['body']);
|
9 |
+
//echo '<pre>'; print_r($responseBody->data); echo '</pre>';
|
10 |
if((json_last_error() == JSON_ERROR_NONE) && ($responseBody->status == 'ok')) {
|
11 |
$viSettings = array(
|
12 |
'signupURL' => $responseBody->data->signupURL,
|
18 |
'revenueAPI' => $responseBody->data->revenueAPI,
|
19 |
'adsTxtAPI' => $responseBody->data->adsTxtAPI,
|
20 |
'languages' => $responseBody->data->languages,
|
21 |
+
'jsTagAPI' => $responseBody->data->jsTagAPI,
|
22 |
+
'vendorListURL' => $responseBody->data->vendorListURL,
|
23 |
+
'vendorListVersion' => $responseBody->data->vendorListVersion,
|
24 |
+
'consentPopupContent' => $responseBody->data->consentPopupContent,
|
25 |
+
'purposes' => $responseBody->data->purposes,
|
26 |
);
|
27 |
delete_transient('quick_adsense_vi_api_settings');
|
28 |
set_transient('quick_adsense_vi_api_settings', $viSettings, WEEK_IN_SECONDS);
|
37 |
return $viSettings;
|
38 |
}
|
39 |
|
40 |
+
function quick_adsense_vi_api_reset_settings() {
|
41 |
+
delete_transient('quick_adsense_vi_api_settings');
|
42 |
+
}
|
43 |
+
|
44 |
function quick_adsense_vi_api_get_signupurl() {
|
45 |
$viSettings = quick_adsense_vi_api_get_settings();
|
46 |
if(($viSettings != false) && is_array($viSettings)) {
|
83 |
return false;
|
84 |
}
|
85 |
|
86 |
+
function quick_adsense_vi_api_get_consent_popup_content() {
|
87 |
+
$viSettings = quick_adsense_vi_api_get_settings();
|
88 |
+
if(($viSettings != false) && is_array($viSettings)) {
|
89 |
+
return $viSettings['consentPopupContent'];
|
90 |
+
}
|
91 |
+
return false;
|
92 |
+
}
|
93 |
+
|
94 |
+
function quick_adsense_vi_api_get_consent_purposes() {
|
95 |
+
$viSettings = quick_adsense_vi_api_get_settings();
|
96 |
+
if(($viSettings != false) && is_array($viSettings)) {
|
97 |
+
return $viSettings['purposes'];
|
98 |
+
}
|
99 |
+
return false;
|
100 |
+
}
|
101 |
+
|
102 |
function quick_adsense_vi_api_get_adstxt_content() {
|
103 |
$viSettings = quick_adsense_vi_api_get_settings();
|
104 |
if(($viSettings != false) && is_array($viSettings)) {
|
341 |
}
|
342 |
}
|
343 |
|
344 |
+
$viSettings = quick_adsense_vi_api_get_settings();
|
345 |
+
if(($viSettings != false) && is_array($viSettings)) {
|
346 |
+
$viToken = quick_adsense_vi_api_get_publisher_token();
|
347 |
+
if($viToken !== false) {
|
348 |
+
try{
|
349 |
+
$response = wp_remote_request(
|
350 |
+
$viSettings['jsTagAPI'],
|
351 |
+
array(
|
352 |
+
'method' => 'POST',
|
353 |
+
'timeout' => 15,
|
354 |
+
'headers' => array(
|
355 |
+
'Content-Type' => 'application/json',
|
356 |
+
'Authorization' => $viToken
|
357 |
+
),
|
358 |
+
'body' => json_encode($selectedArgs)
|
359 |
+
)
|
360 |
+
);
|
361 |
+
if(!is_wp_error($response)) {
|
362 |
+
if(400 == wp_remote_retrieve_response_code($response)) {
|
363 |
+
$responseBody = json_decode($response['body']);
|
364 |
+
if((json_last_error() == JSON_ERROR_NONE) && ($responseBody->status == 'error')) {
|
365 |
+
return array(
|
366 |
+
'status' => 'error',
|
367 |
+
'errorCode' => 'WIVI108',
|
368 |
+
'message' => $responseBody->error->description,
|
369 |
+
);
|
370 |
+
} else {
|
371 |
+
return array(
|
372 |
+
'status' => 'error',
|
373 |
+
'errorCode' => 'WIVI107',
|
374 |
+
'message' => 'Response JSON error, Please try again later!',
|
375 |
+
);
|
376 |
+
}
|
377 |
+
} else if(201 == wp_remote_retrieve_response_code($response)) {
|
378 |
+
$responseBody = json_decode($response['body']);
|
379 |
+
if((json_last_error() == JSON_ERROR_NONE) && ($responseBody->status == 'ok')) {
|
380 |
+
delete_transient('quick_adsense_vi_api_jstag');
|
381 |
+
set_transient('quick_adsense_vi_api_jstag', $responseBody->data, YEAR_IN_SECONDS);
|
382 |
+
return $responseBody->data;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
383 |
} else {
|
384 |
return array(
|
385 |
'status' => 'error',
|
386 |
+
'errorCode' => 'WIVI106',
|
387 |
+
'message' => 'Response JSON error!',
|
388 |
);
|
389 |
}
|
390 |
+
} else {
|
391 |
+
return array(
|
392 |
+
'status' => 'error',
|
393 |
+
'errorCode' => 'WIVI105',
|
394 |
+
'message' => 'Unknown response code',
|
395 |
+
);
|
396 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
397 |
}
|
398 |
+
} catch(Exception $ex) {
|
399 |
return array(
|
400 |
'status' => 'error',
|
401 |
+
'errorCode' => 'WIVI103',
|
402 |
+
'message' => 'Exception during API communication',
|
403 |
);
|
404 |
}
|
405 |
+
} else {
|
406 |
+
return array(
|
407 |
'status' => 'error',
|
408 |
+
'errorCode' => 'WIVI102',
|
409 |
+
'message' => 'Authorization Token is Missing',
|
410 |
+
);
|
411 |
+
}
|
412 |
} else {
|
413 |
return array(
|
414 |
'status' => 'error',
|
419 |
}
|
420 |
|
421 |
function quick_adsense_vi_api_get_vi_code($settingsKey = '') {
|
|
|
422 |
$jsTag = get_transient('quick_adsense_vi_api_jstag');
|
423 |
if(($jsTag === false) || ($jsTag == '') || is_array($jsTag)) {
|
424 |
if($settingsKey != '') {
|
433 |
}
|
434 |
return '<script type="text/javascript">'.$jsTag.'</script>';
|
435 |
}
|
436 |
+
|
437 |
+
function quick_adsense_vi_api_is_eu() {
|
438 |
+
$userIp = $_SERVER["REMOTE_ADDR"];
|
439 |
+
//$userIp = '185.216.33.82';
|
440 |
+
$isEU = get_transient('quick_adsense_vi_api_is_eu_'.$userIp);
|
441 |
+
if($isEU === false) {
|
442 |
+
try{
|
443 |
+
$response = wp_remote_get(
|
444 |
+
'http://gdpr-check.net/gdpr/is-eu?ip='.$userIp,
|
445 |
+
array('timeout' => 15)
|
446 |
+
);
|
447 |
+
if(!is_wp_error($response)) {
|
448 |
+
if(200 == wp_remote_retrieve_response_code($response)) {
|
449 |
+
$responseBody = json_decode($response['body']);
|
450 |
+
if((json_last_error() == JSON_ERROR_NONE)) {
|
451 |
+
if((isset($responseBody->is_eu)) && ($responseBody->is_eu == '1')) {
|
452 |
+
delete_transient('quick_adsense_vi_api_is_eu_'.$userIp);
|
453 |
+
set_transient('quick_adsense_vi_api_is_eu_'.$userIp, '1', WEEK_IN_SECONDS);
|
454 |
+
return true;
|
455 |
+
} else {
|
456 |
+
delete_transient('quick_adsense_vi_api_is_eu_'.$userIp);
|
457 |
+
set_transient('quick_adsense_vi_api_is_eu_'.$userIp, '0', WEEK_IN_SECONDS);
|
458 |
+
return false;
|
459 |
+
}
|
460 |
+
} else {
|
461 |
+
return false;
|
462 |
+
}
|
463 |
+
} else {
|
464 |
+
return false;
|
465 |
+
}
|
466 |
+
}
|
467 |
+
} catch(Exception $ex) {
|
468 |
+
return false;
|
469 |
+
}
|
470 |
+
} else {
|
471 |
+
if($isEU == '1') {
|
472 |
+
return true;
|
473 |
+
} else {
|
474 |
+
return false;
|
475 |
+
}
|
476 |
+
|
477 |
+
}
|
478 |
+
}
|
479 |
+
|
480 |
+
function quick_adsense_vi_api_get_vendor_list_version() {
|
481 |
+
$viSettings = quick_adsense_vi_api_get_settings();
|
482 |
+
if(($viSettings != false) && is_array($viSettings)) {
|
483 |
+
return $viSettings['vendorListVersion'];
|
484 |
+
}
|
485 |
+
return false;
|
486 |
+
}
|
487 |
?>
|
includes/css/gdpr.css
ADDED
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#quick_adsense_vi_consent_popup_overlay {
|
2 |
+
position: fixed;
|
3 |
+
left: 0;
|
4 |
+
right: 0;
|
5 |
+
top: 0;
|
6 |
+
bottom: 0;
|
7 |
+
background: rgba(0,0,0,0.5);
|
8 |
+
z-index: 10000;
|
9 |
+
}
|
10 |
+
|
11 |
+
#quick_adsense_vi_consent_popup_wrapper {
|
12 |
+
max-width: 480px;
|
13 |
+
background: rgba(255,255,255,0.9);
|
14 |
+
padding: 30px 30px 30px;
|
15 |
+
position: fixed;
|
16 |
+
right: 0;
|
17 |
+
bottom: 0;
|
18 |
+
color: #000;
|
19 |
+
z-index: 10001;
|
20 |
+
}
|
21 |
+
|
22 |
+
#quick_adsense_vi_consent_popup_wrapper h1 {
|
23 |
+
line-height: 42px;
|
24 |
+
font-weight: 400;
|
25 |
+
font-family: sans-serif,Helvetica,Arial;
|
26 |
+
font-size: 36px;
|
27 |
+
text-align: center;
|
28 |
+
margin: 0;
|
29 |
+
padding: 0;
|
30 |
+
border: none;
|
31 |
+
background: none;
|
32 |
+
color: #000;
|
33 |
+
}
|
34 |
+
|
35 |
+
#quick_adsense_vi_consent_popup_wrapper p {
|
36 |
+
font-size: 14px;
|
37 |
+
font-family: sans-serif,Helvetica,Arial;
|
38 |
+
line-height: 20px;
|
39 |
+
margin: 10px 0 30px;
|
40 |
+
padding: 0;
|
41 |
+
border: none;
|
42 |
+
background: none;
|
43 |
+
color: #000;
|
44 |
+
text-align: justify;
|
45 |
+
font-weight: 400;
|
46 |
+
}
|
47 |
+
|
48 |
+
#quick_adsense_vi_consent_popup_wrapper p a,
|
49 |
+
#quick_adsense_vi_consent_popup_wrapper p a:hover {
|
50 |
+
font-size: 14px;
|
51 |
+
font-family: sans-serif,Helvetica,Arial;
|
52 |
+
line-height: 20px;
|
53 |
+
margin: 0;
|
54 |
+
padding: 0;
|
55 |
+
border: none;
|
56 |
+
background: none;
|
57 |
+
color: #000;
|
58 |
+
text-decoration: underline;
|
59 |
+
}
|
60 |
+
|
61 |
+
#quick_adsense_vi_consent_popup_wrapper #quick_adsense_vi_consent_popup_actions_wrapper {
|
62 |
+
text-align: center;
|
63 |
+
margin: 0 0 30px;
|
64 |
+
}
|
65 |
+
|
66 |
+
#quick_adsense_vi_consent_popup_wrapper #quick_adsense_vi_consent_popup_actions_wrapper #quick_adsense_vi_consent_popup_disagree_btn,
|
67 |
+
#quick_adsense_vi_consent_popup_wrapper #quick_adsense_vi_consent_popup_actions_wrapper #quick_adsense_vi_consent_popup_disagree_btn:hover {
|
68 |
+
cursor: pointer;
|
69 |
+
color: #000;
|
70 |
+
background: none;
|
71 |
+
border: none;
|
72 |
+
padding: 10px 30px;
|
73 |
+
text-align: center;
|
74 |
+
font-weight: 600;
|
75 |
+
font-size: 15px;
|
76 |
+
font-family: sans-serif,Helvetica,Arial;
|
77 |
+
margin: 0;
|
78 |
+
}
|
79 |
+
|
80 |
+
#quick_adsense_vi_consent_popup_wrapper #quick_adsense_vi_consent_popup_actions_wrapper #quick_adsense_vi_consent_popup_agree_btn,
|
81 |
+
#quick_adsense_vi_consent_popup_wrapper #quick_adsense_vi_consent_popup_actions_wrapper #quick_adsense_vi_consent_popup_agree_btn:hover {
|
82 |
+
cursor: pointer;
|
83 |
+
color: #000;
|
84 |
+
background: rgba(255, 242, 0, 1);
|
85 |
+
border: 2px solid rgba(255, 242, 0, 1);
|
86 |
+
padding: 10px 60px;
|
87 |
+
text-align: center;
|
88 |
+
font-weight: 600;
|
89 |
+
font-size: 15px;
|
90 |
+
font-family: sans-serif,Helvetica,Arial;
|
91 |
+
border-radius: 18px;
|
92 |
+
margin: 0;
|
93 |
+
}
|
94 |
+
|
95 |
+
#quick_adsense_vi_consent_popup_wrapper #quick_adsense_vi_consent_popup_links_wrapper {
|
96 |
+
text-align: center;
|
97 |
+
}
|
98 |
+
|
99 |
+
#quick_adsense_vi_consent_popup_wrapper #quick_adsense_vi_consent_popup_links_wrapper a,
|
100 |
+
#quick_adsense_vi_consent_popup_wrapper #quick_adsense_vi_consent_popup_links_wrapper a:hover {
|
101 |
+
color: #000;
|
102 |
+
background: none;
|
103 |
+
border: none;
|
104 |
+
padding: 10px;
|
105 |
+
text-align: center;
|
106 |
+
font-weight: 400;
|
107 |
+
font-size: 12px;
|
108 |
+
font-family: sans-serif,Helvetica,Arial;
|
109 |
+
margin: 0;
|
110 |
+
text-decoration: underline;
|
111 |
+
line-height: 24px;
|
112 |
+
}
|
113 |
+
|
114 |
+
#quick_adsense_vi_consent_popup_settings_button {
|
115 |
+
font-size: 13px;
|
116 |
+
color: rgba(146, 135, 131, 1);
|
117 |
+
background: url(../images/privacy.png) no-repeat left center;
|
118 |
+
padding: 0 0 0 32px;
|
119 |
+
position: fixed;
|
120 |
+
bottom: 10px;
|
121 |
+
right: 10px;
|
122 |
+
cursor: pointer;
|
123 |
+
z-index: 10002;
|
124 |
+
font-family: sans-serif,Helvetica,Arial;
|
125 |
+
-webkit-touch-callout: none; /* iOS Safari */
|
126 |
+
-webkit-user-select: none; /* Safari */
|
127 |
+
-khtml-user-select: none; /* Konqueror HTML */
|
128 |
+
-moz-user-select: none; /* Firefox */
|
129 |
+
-ms-user-select: none; /* Internet Explorer/Edge */
|
130 |
+
user-select: none; /* Non-prefixed version, currently supported by Chrome and Opera */
|
131 |
+
}
|
includes/images/privacy.png
ADDED
Binary file
|
includes/js/admin.js
CHANGED
@@ -749,6 +749,7 @@ function quick_adsense_vi_customize_adcode() {
|
|
749 |
var quick_adsense_vi_code_settings_native_text_color = jQuery('#quick_adsense_vi_code_settings_native_text_color').val();
|
750 |
var quick_adsense_vi_code_settings_font_family = jQuery('#quick_adsense_vi_code_settings_font_family').val();
|
751 |
var quick_adsense_vi_code_settings_font_size = jQuery('#quick_adsense_vi_code_settings_font_size').val();
|
|
|
752 |
jQuery('.ui-dialog-content').html('<div class="quick_adsense_ajaxloader"></div>');
|
753 |
jQuery('.quick_adsense_ajaxloader').show();
|
754 |
jQuery.post(
|
@@ -764,6 +765,7 @@ function quick_adsense_vi_customize_adcode() {
|
|
764 |
'quick_adsense_vi_code_settings_native_text_color': quick_adsense_vi_code_settings_native_text_color,
|
765 |
'quick_adsense_vi_code_settings_font_family': quick_adsense_vi_code_settings_font_family,
|
766 |
'quick_adsense_vi_code_settings_font_size': quick_adsense_vi_code_settings_font_size,
|
|
|
767 |
}, function(response) {
|
768 |
if(response.indexOf('###SUCCESS###') !== -1) {
|
769 |
jQuery('#quick_adsense_vi_embedcode_status').val('Configured');
|
749 |
var quick_adsense_vi_code_settings_native_text_color = jQuery('#quick_adsense_vi_code_settings_native_text_color').val();
|
750 |
var quick_adsense_vi_code_settings_font_family = jQuery('#quick_adsense_vi_code_settings_font_family').val();
|
751 |
var quick_adsense_vi_code_settings_font_size = jQuery('#quick_adsense_vi_code_settings_font_size').val();
|
752 |
+
var quick_adsense_vi_code_settings_show_gdpr_authorization = jQuery('#quick_adsense_vi_code_settings_show_gdpr_authorization').val();
|
753 |
jQuery('.ui-dialog-content').html('<div class="quick_adsense_ajaxloader"></div>');
|
754 |
jQuery('.quick_adsense_ajaxloader').show();
|
755 |
jQuery.post(
|
765 |
'quick_adsense_vi_code_settings_native_text_color': quick_adsense_vi_code_settings_native_text_color,
|
766 |
'quick_adsense_vi_code_settings_font_family': quick_adsense_vi_code_settings_font_family,
|
767 |
'quick_adsense_vi_code_settings_font_size': quick_adsense_vi_code_settings_font_size,
|
768 |
+
'quick_adsense_vi_code_settings_show_gdpr_authorization': quick_adsense_vi_code_settings_show_gdpr_authorization,
|
769 |
}, function(response) {
|
770 |
if(response.indexOf('###SUCCESS###') !== -1) {
|
771 |
jQuery('#quick_adsense_vi_embedcode_status').val('Configured');
|
includes/js/gdpr.js
ADDED
@@ -0,0 +1,198 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Begin IAB API V 1.1 Implementation */
|
2 |
+
var __vicmp = (function () {
|
3 |
+
return typeof (__vicmp) == "function" ? __vicmp : function (c) {
|
4 |
+
var b = arguments;
|
5 |
+
if (!b.length) {
|
6 |
+
return __vicmp.a;
|
7 |
+
}
|
8 |
+
else if (c == '__vicmp') {
|
9 |
+
return false;
|
10 |
+
} else {
|
11 |
+
if (typeof __vicmp.a === 'undefined') {
|
12 |
+
__vicmp.a = [];
|
13 |
+
}
|
14 |
+
__vicmp.a.push([].slice.apply(b));
|
15 |
+
if(typeof __vicmp.execute != 'undefined') {
|
16 |
+
__vicmp.execute(b);
|
17 |
+
}
|
18 |
+
}
|
19 |
+
}
|
20 |
+
})();
|
21 |
+
|
22 |
+
function quick_adsense_vi_consent_onload_cmp() {
|
23 |
+
if(typeof __vicmp.execute === 'undefined') {
|
24 |
+
__vicmp.execute = function(b) {
|
25 |
+
var data = {};
|
26 |
+
if(typeof b != 'undefined') {
|
27 |
+
if(b[0] == 'getUserConsentStatus') {
|
28 |
+
var ViconsentCookie = quick_adsense_vi_consent_popup_get_cookie('Viconsent');
|
29 |
+
var gdprStatus = false;
|
30 |
+
if(document.getElementById('quick_adsense_vi_consent_popup_is_eu').value == '1') {
|
31 |
+
gdprStatus = true;
|
32 |
+
}
|
33 |
+
if(ViconsentCookie != '') {
|
34 |
+
var ViconsentCookieData = quick_adsense_vi_consent_popup_decode_cookie_content(ViconsentCookie);
|
35 |
+
data = {
|
36 |
+
gdprApplies: gdprStatus,
|
37 |
+
hasGlobalScope: false,
|
38 |
+
consent: ViconsentCookieData['PurposeAllowed'][1],
|
39 |
+
}
|
40 |
+
} else { // Cookie Missing / Corrupted
|
41 |
+
data = {
|
42 |
+
gdprApplies: gdprStatus,
|
43 |
+
hasGlobalScope: false,
|
44 |
+
consent: false,
|
45 |
+
}
|
46 |
+
}
|
47 |
+
}
|
48 |
+
b[2](data, true);
|
49 |
+
}
|
50 |
+
};
|
51 |
+
|
52 |
+
if(__vicmp.a && typeof func === 'undefined') {
|
53 |
+
for(var i=0; i<__vicmp.a.length;i++) {
|
54 |
+
__vicmp.execute(__vicmp.a[i]);
|
55 |
+
}
|
56 |
+
}
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
//setTimeout(quick_adsense_vi_consent_onload_cmp, 500);
|
61 |
+
quick_adsense_vi_consent_onload_cmp();
|
62 |
+
/* End IAB API V 1.1 Implementation */
|
63 |
+
|
64 |
+
/* Begin Consent Cookie Implementation */
|
65 |
+
function quick_adsense_vi_consent_popup_disagree() {
|
66 |
+
var cookieData = quick_adsense_vi_consent_popup_create_cookie_content('000000000000000000000000');
|
67 |
+
quick_adsense_vi_consent_popup_set_cookie('Viconsent', cookieData);
|
68 |
+
|
69 |
+
var ajaxFrame = document.createElement('iframe');
|
70 |
+
ajaxFrame.src = document.getElementById('quick_adsense_vi_consent_popup_url').value + '?quick_adsense_vi_consent=' + document.getElementById('quick_adsense_vi_consent_popup_auth').value;
|
71 |
+
ajaxFrame.style.display = 'none';
|
72 |
+
document.getElementById('quick_adsense_vi_consent_popup_wrapper').appendChild(ajaxFrame);
|
73 |
+
document.getElementById('quick_adsense_vi_consent_popup_wrapper').style.display = 'none';
|
74 |
+
document.getElementById('quick_adsense_vi_consent_popup_overlay').style.display = 'none';
|
75 |
+
document.getElementById('quick_adsense_vi_consent_popup_settings_button').style.display = 'block';
|
76 |
+
}
|
77 |
+
|
78 |
+
function quick_adsense_vi_consent_popup_agree() {
|
79 |
+
var quick_adsense_vi_consent_popup_vendor_list_purposes = document.getElementById('quick_adsense_vi_consent_popup_vendor_list_purposes').value;
|
80 |
+
var cookieData = quick_adsense_vi_consent_popup_create_cookie_content(quick_adsense_vi_consent_popup_vendor_list_purposes);
|
81 |
+
quick_adsense_vi_consent_popup_set_cookie('Viconsent', cookieData);
|
82 |
+
|
83 |
+
var ajaxFrame = document.createElement('iframe');
|
84 |
+
ajaxFrame.src = document.getElementById('quick_adsense_vi_consent_popup_url').value + '?quick_adsense_vi_consent=' + document.getElementById('quick_adsense_vi_consent_popup_auth').value;
|
85 |
+
ajaxFrame.style.display = 'none';
|
86 |
+
document.getElementById('quick_adsense_vi_consent_popup_wrapper').appendChild(ajaxFrame);
|
87 |
+
document.getElementById('quick_adsense_vi_consent_popup_wrapper').style.display = 'none';
|
88 |
+
document.getElementById('quick_adsense_vi_consent_popup_overlay').style.display = 'none';
|
89 |
+
document.getElementById('quick_adsense_vi_consent_popup_settings_button').style.display = 'block';
|
90 |
+
}
|
91 |
+
|
92 |
+
function quick_adsense_vi_consent_popup_create_cookie_content(purposeAllowed) {
|
93 |
+
cookieConsentTimeStamp = Math.round((new Date()).getTime()/100);
|
94 |
+
var cookieConsent = new Object();
|
95 |
+
cookieConsent['Version'] = quick_adsense_vi_consent_popup_create_binary_string(1, 6);
|
96 |
+
cookieConsent['Created'] = quick_adsense_vi_consent_popup_create_binary_string(cookieConsentTimeStamp, 36);
|
97 |
+
cookieConsent['LastUpdated'] = quick_adsense_vi_consent_popup_create_binary_string(cookieConsentTimeStamp, 36);
|
98 |
+
cookieConsent['CMPId'] = quick_adsense_vi_consent_popup_create_binary_string(999, 12);
|
99 |
+
cookieConsent['CMPVersion'] = quick_adsense_vi_consent_popup_create_binary_string(0, 6);
|
100 |
+
cookieConsent['ConsentScreen'] = quick_adsense_vi_consent_popup_create_binary_string(0, 6);
|
101 |
+
cookieConsent['ConsentLanguage'] = quick_adsense_vi_consent_popup_create_binary_string(4, 6)+quick_adsense_vi_consent_popup_create_binary_string(13, 6);
|
102 |
+
var quick_adsense_vi_consent_popup_vendor_list_version = parseInt(document.getElementById('quick_adsense_vi_consent_popup_vendor_list_version').value);
|
103 |
+
cookieConsent['VendorListVersion'] = quick_adsense_vi_consent_popup_create_binary_string(quick_adsense_vi_consent_popup_vendor_list_version, 12);
|
104 |
+
cookieConsent['PurposeAllowed'] = purposeAllowed;
|
105 |
+
|
106 |
+
return window.btoa(cookieConsent['Version'] + cookieConsent['Created'] + cookieConsent['LastUpdated'] + cookieConsent['CMPId'] + cookieConsent['CMPVersion'] + cookieConsent['ConsentScreen'] + cookieConsent['ConsentLanguage'] + cookieConsent['VendorListVersion'] + cookieConsent['PurposeAllowed']);
|
107 |
+
}
|
108 |
+
|
109 |
+
function quick_adsense_vi_consent_popup_decode_cookie_content(cookieData) {
|
110 |
+
if(cookieData != '') {
|
111 |
+
var binaryCookieData = atob(cookieData);
|
112 |
+
var cookieConsent = new Object();
|
113 |
+
cookieConsent['Version'] = parseInt(binaryCookieData.substring(0, 6), 2);
|
114 |
+
cookieConsent['Created'] = parseInt(binaryCookieData.substring(6, 42), 2);
|
115 |
+
cookieConsent['LastUpdated'] = parseInt(binaryCookieData.substring(42, 78), 2);
|
116 |
+
cookieConsent['CMPId'] = parseInt(binaryCookieData.substring(78, 90), 2);
|
117 |
+
cookieConsent['CMPVersion'] = parseInt(binaryCookieData.substring(90, 96), 2);
|
118 |
+
cookieConsent['ConsentScreen'] = parseInt(binaryCookieData.substring(96, 102), 2);
|
119 |
+
cookieConsent['ConsentLanguage'] = parseInt(binaryCookieData.substring(102, 108), 2)+''+parseInt(binaryCookieData.substring(106, 114), 2);
|
120 |
+
cookieConsent['VendorListVersion'] = parseInt(binaryCookieData.substring(114,126), 2);
|
121 |
+
cookieConsent['PurposeAllowed'] = binaryCookieData.substring(126, 150);
|
122 |
+
|
123 |
+
var purposeConsents = new Object();
|
124 |
+
for(var i = 24; i > 0; i--) {
|
125 |
+
if(cookieConsent['PurposeAllowed'].substring(i - 1, i) == '1') {
|
126 |
+
purposeConsents[(24 - i) + 1] = true;
|
127 |
+
} else {
|
128 |
+
purposeConsents[(24 - i) + 1] = false;
|
129 |
+
}
|
130 |
+
}
|
131 |
+
cookieConsent['PurposeAllowed'] = purposeConsents;
|
132 |
+
return cookieConsent;
|
133 |
+
}
|
134 |
+
return false;
|
135 |
+
}
|
136 |
+
|
137 |
+
function quick_adsense_vi_consent_popup_create_binary_string(dMask, dBitSize) {
|
138 |
+
var bMask = "";
|
139 |
+
if(dBitSize <= 32) {
|
140 |
+
while(dBitSize--) {
|
141 |
+
bMask += (dMask >> dBitSize) & 1;
|
142 |
+
}
|
143 |
+
} else {
|
144 |
+
bMask = dMask.toString(2);
|
145 |
+
while (bMask.length < dBitSize) {
|
146 |
+
bMask = "0" + bMask;
|
147 |
+
}
|
148 |
+
}
|
149 |
+
return bMask;
|
150 |
+
}
|
151 |
+
|
152 |
+
function quick_adsense_vi_consent_popup_set_cookie(name, value) {
|
153 |
+
var date = new Date();
|
154 |
+
date.setTime(date.getTime() + (365*24*60*60*1000));
|
155 |
+
document.cookie = name + "=" + value + ";" + "expires=" + date.toUTCString() + ";path=/";
|
156 |
+
}
|
157 |
+
|
158 |
+
function quick_adsense_vi_consent_popup_get_cookie(cookieName) {
|
159 |
+
var name = cookieName + "=";
|
160 |
+
var decodedCookie = decodeURIComponent(document.cookie);
|
161 |
+
var ca = decodedCookie.split(';');
|
162 |
+
for(var i = 0; i <ca.length; i++) {
|
163 |
+
var c = ca[i];
|
164 |
+
while (c.charAt(0) == ' ') {
|
165 |
+
c = c.substring(1);
|
166 |
+
}
|
167 |
+
if (c.indexOf(name) == 0) {
|
168 |
+
return c.substring(name.length, c.length);
|
169 |
+
}
|
170 |
+
}
|
171 |
+
return "";
|
172 |
+
}
|
173 |
+
|
174 |
+
function quick_adsense_vi_consent_popup_settings() {
|
175 |
+
document.getElementById('quick_adsense_vi_consent_popup_wrapper').style.display = 'block';
|
176 |
+
document.getElementById('quick_adsense_vi_consent_popup_overlay').style.display = 'block';
|
177 |
+
document.getElementById('quick_adsense_vi_consent_popup_settings_button').style.display = 'none';
|
178 |
+
}
|
179 |
+
|
180 |
+
function quick_adsense_vi_consent_popup_load() {
|
181 |
+
if(document.getElementById('quick_adsense_vi_consent_popup_is_eu').value == true) {
|
182 |
+
if(quick_adsense_vi_consent_popup_get_cookie('Viconsent') == false) {
|
183 |
+
document.getElementById('quick_adsense_vi_consent_popup_wrapper').style.display = 'block';
|
184 |
+
document.getElementById('quick_adsense_vi_consent_popup_overlay').style.display = 'block';
|
185 |
+
document.getElementById('quick_adsense_vi_consent_popup_settings_button').style.display = 'none';
|
186 |
+
} else {
|
187 |
+
document.getElementById('quick_adsense_vi_consent_popup_wrapper').style.display = 'none';
|
188 |
+
document.getElementById('quick_adsense_vi_consent_popup_overlay').style.display = 'none';
|
189 |
+
document.getElementById('quick_adsense_vi_consent_popup_settings_button').style.display = 'block';
|
190 |
+
}
|
191 |
+
} else {
|
192 |
+
document.getElementById('quick_adsense_vi_consent_popup_wrapper').style.display = 'none';
|
193 |
+
document.getElementById('quick_adsense_vi_consent_popup_overlay').style.display = 'none';
|
194 |
+
document.getElementById('quick_adsense_vi_consent_popup_settings_button').style.display = 'none';
|
195 |
+
}
|
196 |
+
}
|
197 |
+
setTimeout(quick_adsense_vi_consent_popup_load, 500);
|
198 |
+
/* End Consent Cookie Implementation */
|
includes/vi-gdpr.php
ADDED
@@ -0,0 +1,147 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* Begin Consent Popup */
|
3 |
+
add_action('init', 'quick_adsense_vi_gdpr_popup_init');
|
4 |
+
function quick_adsense_vi_gdpr_popup_init() {
|
5 |
+
$vicodeSettings = get_option('quick_adsense_vi_code_settings');
|
6 |
+
if(isset($vicodeSettings['show_gdpr_authorization']) && ($vicodeSettings['show_gdpr_authorization'] == 'true')) {
|
7 |
+
add_action('wp_enqueue_scripts', 'quick_adsense_vi_gdpr_popup_wp_enqueue_style');
|
8 |
+
add_action('wp_enqueue_scripts', 'quick_adsense_vi_gdpr_popup_wp_enqueue_scripts');
|
9 |
+
add_action('wp_footer', 'quick_adsense_vi_gdpr_popup_wp_footer');
|
10 |
+
}
|
11 |
+
}
|
12 |
+
|
13 |
+
function quick_adsense_vi_gdpr_popup_wp_enqueue_style() {
|
14 |
+
wp_enqueue_style('quick_adsense_vi_gdpr', plugins_url('/css/gdpr.css', __FILE__), array(), 2.4 , 'all');
|
15 |
+
}
|
16 |
+
|
17 |
+
|
18 |
+
function quick_adsense_vi_gdpr_popup_wp_enqueue_scripts() {
|
19 |
+
wp_enqueue_script('quick_adsense_vi_gdpr', plugins_url('/js/gdpr.js', __FILE__), array(), 2.4 , true);
|
20 |
+
}
|
21 |
+
|
22 |
+
function quick_adsense_vi_gdpr_popup_wp_footer() {
|
23 |
+
$showViConsent = true;
|
24 |
+
$isEU = quick_adsense_vi_api_is_eu();
|
25 |
+
if(isset($_COOKIE['Viconsent'])) {
|
26 |
+
$showViConsent = false;
|
27 |
+
}
|
28 |
+
$vicodeSettings = get_option('quick_adsense_vi_code_settings');
|
29 |
+
$labels = array();
|
30 |
+
$viConsentPopupContent = quick_adsense_vi_api_get_consent_popup_content();
|
31 |
+
if($viConsentPopupContent != false) {
|
32 |
+
switch($vicodeSettings['language']) {
|
33 |
+
case 'de-de':
|
34 |
+
$labels['popupContent'] = $viConsentPopupContent->es;
|
35 |
+
$labels['accept'] = 'acepto';
|
36 |
+
$labels['donotaccept'] = 'no acepto';
|
37 |
+
$labels['showPurposes'] = 'Mostrar propósitos';
|
38 |
+
$labels['showVendors'] = 'Mostrar vendedores';
|
39 |
+
|
40 |
+
break;
|
41 |
+
case 'fr-fr':
|
42 |
+
$labels['popupContent'] = $viConsentPopupContent->fr;
|
43 |
+
$labels['accept'] = 'J’accepte';
|
44 |
+
$labels['donotaccept'] = 'Je n’accepte pas';
|
45 |
+
$labels['showPurposes'] = 'Plus de details';
|
46 |
+
$labels['showVendors'] = 'Montrez les vendeurs';
|
47 |
+
break;
|
48 |
+
case 'en-us':
|
49 |
+
default:
|
50 |
+
$labels['popupContent'] = $viConsentPopupContent->en;
|
51 |
+
$labels['accept'] = 'I accept';
|
52 |
+
$labels['donotaccept'] = 'I do not accept';
|
53 |
+
$labels['showPurposes'] = 'Show purposes';
|
54 |
+
$labels['showVendors'] = 'Show vendors';
|
55 |
+
break;
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
echo '<div id="quick_adsense_vi_consent_popup_wrapper" style="display: none;">';
|
60 |
+
echo $labels['popupContent'];
|
61 |
+
echo '<div id="quick_adsense_vi_consent_popup_actions_wrapper">';
|
62 |
+
echo '<input id="quick_adsense_vi_consent_popup_disagree_btn" type="button" value="'.$labels['donotaccept'].'" onclick="quick_adsense_vi_consent_popup_disagree()" />';
|
63 |
+
echo '<input id="quick_adsense_vi_consent_popup_agree_btn" type="button" value="'.$labels['accept'].'" onclick="quick_adsense_vi_consent_popup_agree()" />';
|
64 |
+
echo '</div>';
|
65 |
+
echo '<div id="quick_adsense_vi_consent_popup_links_wrapper">';
|
66 |
+
echo '<a href="https://www.vi.ai/purposes" target="_blank">'.$labels['showPurposes'].'</a>';
|
67 |
+
echo '<a href="https://www.vi.ai/vendors" target="_blank">'.$labels['showVendors'].'</a>';
|
68 |
+
echo '</div>';
|
69 |
+
echo '<input id="quick_adsense_vi_consent_popup_is_eu" type="hidden" value="'.$isEU.'" />';
|
70 |
+
echo '<input id="quick_adsense_vi_consent_popup_url" type="hidden" value="'.get_bloginfo('url').'" />';
|
71 |
+
echo '<input id="quick_adsense_vi_consent_popup_auth" type="hidden" value="'.wp_create_nonce('quick_adsense_vi_consent').'" />';
|
72 |
+
echo '<input id="quick_adsense_vi_consent_popup_vendor_list_version" type="hidden" value="'.quick_adsense_vi_api_get_vendor_list_version().'" />';
|
73 |
+
$purposesBinary = '000000000000000000000000';
|
74 |
+
$purposes = quick_adsense_vi_api_get_consent_purposes();
|
75 |
+
if(isset($purposes) && (count($purposes) > 0)) {
|
76 |
+
foreach($purposes as $purpose) {
|
77 |
+
$purposesBinary = substr_replace($purposesBinary, '1', ((24 - (int)$purpose->id) + 1), 1);
|
78 |
+
}
|
79 |
+
}
|
80 |
+
echo '<input id="quick_adsense_vi_consent_popup_vendor_list_purposes" type="hidden" value="'.$purposesBinary.'" />';
|
81 |
+
echo '<input id="quick_adsense_vi_consent_popup_vendor_list_vendors" type="hidden" value="999" />';
|
82 |
+
echo '</div>';
|
83 |
+
echo '<div id="quick_adsense_vi_consent_popup_overlay" style="display: none;"></div>';
|
84 |
+
echo '<span id="quick_adsense_vi_consent_popup_settings_button" onclick="quick_adsense_vi_consent_popup_settings()" unselectable="on" style="display: none;">Privacy settings</span>';
|
85 |
+
}
|
86 |
+
/* End Consent Popup */
|
87 |
+
|
88 |
+
/* Begin Data Storage */
|
89 |
+
add_action('init', 'quick_adsense_vi_gdpr_data_init');
|
90 |
+
function quick_adsense_vi_gdpr_data_init() {
|
91 |
+
if(isset($_GET['quick_adsense_vi_consent']) && ($_GET['quick_adsense_vi_consent'] != '')) {
|
92 |
+
check_ajax_referer('quick_adsense_vi_consent', 'quick_adsense_vi_consent');
|
93 |
+
wp_insert_post(array(
|
94 |
+
'post_title' => date('c'),
|
95 |
+
'post_content' => ((isset($_COOKIE['Viconsent']))?$_COOKIE['Viconsent']:''),
|
96 |
+
'post_status' => 'publish',
|
97 |
+
'post_type' => 'viconsent',
|
98 |
+
));
|
99 |
+
die();
|
100 |
+
}
|
101 |
+
|
102 |
+
|
103 |
+
$labels = array(
|
104 |
+
'name' => 'VI Consent',
|
105 |
+
'singular_name' => 'VI Consent',
|
106 |
+
'add_new' => 'Add New',
|
107 |
+
'add_new_item' => 'Add New VI Consent',
|
108 |
+
'edit_item' => 'Edit VI Consent',
|
109 |
+
'new_item' => 'New VI Consent',
|
110 |
+
'view_item' => 'View VI Consent',
|
111 |
+
'search_items' => 'Search VI Consent',
|
112 |
+
'not_found' => 'No VI Consent found',
|
113 |
+
'not_found_in_trash' => 'No VI Consent found in Trash',
|
114 |
+
'parent_item_colon' => 'Parent VI Consent:',
|
115 |
+
'menu_name' => 'VI Consent',
|
116 |
+
);
|
117 |
+
|
118 |
+
$args = array(
|
119 |
+
'labels' => $labels,
|
120 |
+
'hierarchical' => false,
|
121 |
+
'description' => 'VI Consent',
|
122 |
+
'supports' => array('title', 'editor'),
|
123 |
+
'public' => false,
|
124 |
+
'show_ui' => true,
|
125 |
+
'show_in_menu' => false,
|
126 |
+
'show_in_nav_menus' => false,
|
127 |
+
'publicly_queryable' => false,
|
128 |
+
'exclude_from_search' => true,
|
129 |
+
'has_archive' => false,
|
130 |
+
'query_var' => false,
|
131 |
+
'can_export' => true,
|
132 |
+
'rewrite' => false,
|
133 |
+
'capability_type' => 'post'
|
134 |
+
);
|
135 |
+
|
136 |
+
register_post_type('viconsent', $args);
|
137 |
+
}
|
138 |
+
|
139 |
+
add_filter('user_can_richedit', 'quick_adsense_vi_gdpr_data_user_can_richedit');
|
140 |
+
function quick_adsense_vi_gdpr_data_user_can_richedit($default) {
|
141 |
+
if(get_post_type() === 'viconsent') {
|
142 |
+
return false;
|
143 |
+
}
|
144 |
+
return $default;
|
145 |
+
}
|
146 |
+
/* End Data Storage */
|
147 |
+
?>
|
includes/vi.php
CHANGED
@@ -321,6 +321,17 @@ function quick_adsense_vi_customize_adcode_form_get_content() {
|
|
321 |
echo '</div>';
|
322 |
echo '</div>';
|
323 |
echo '</div>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
echo '<script type="text/javascript">';
|
325 |
echo 'jQuery(".ui-dialog-buttonset").find("button").first().find("span:nth-child(2)").hide().after("<span class=\'ui-button-text\' style=\'background: #0085ba; border-color: #0073aa #006799 #006799; color: #fff; padding-left: 1em;\'>Save changes</span>");';
|
326 |
echo 'jQuery(".ui-dialog-buttonset").find("button").first().find("span:nth-child(1)").hide();';
|
@@ -344,6 +355,8 @@ function quick_adsense_vi_customize_adcode_form_save_action() {
|
|
344 |
$vicodeSettings['native_text_color'] = ((isset($_POST['quick_adsense_vi_code_settings_native_text_color']))?$_POST['quick_adsense_vi_code_settings_native_text_color']:'');
|
345 |
$vicodeSettings['font_family'] = ((isset($_POST['quick_adsense_vi_code_settings_font_family']))?$_POST['quick_adsense_vi_code_settings_font_family']:'');
|
346 |
$vicodeSettings['font_size'] = ((isset($_POST['quick_adsense_vi_code_settings_font_size']))?$_POST['quick_adsense_vi_code_settings_font_size']:'');
|
|
|
|
|
347 |
update_option('quick_adsense_vi_code_settings', $vicodeSettings);
|
348 |
$viCodeStatus = quick_adsense_vi_api_set_vi_code($vicodeSettings);
|
349 |
if(is_array($viCodeStatus) && (isset($viCodeStatus['status'])) && ($viCodeStatus['status'] == 'error')) {
|
321 |
echo '</div>';
|
322 |
echo '</div>';
|
323 |
echo '</div>';
|
324 |
+
echo '<div style="margin: 15px 0; padding: 5px; border: 1px solid #999999; border-radius: 5px; position: relative;">';
|
325 |
+
echo '<label style="font-weight: bold; position: absolute; left: 15px; top: -10px; background: #FFFFFF; color: #111111; padding: 0px 10px;">vi stories: GDPR Compliance</label>';
|
326 |
+
echo '<div style="margin: 10px 0 10px; padding: 0 10px; position: relative;">';
|
327 |
+
echo '<p>Enable GDPR Compliance confirmation notice on your site for visitors from EU.<br />If you disable this option make sure you are using a data usage authorization system on your website to remain GDPR complaint.</p>';
|
328 |
+
$gdprComplainceOptions = array(
|
329 |
+
array('text' => 'Status : Do not Show GDPR Authorization Popup', 'value' => 'false'),
|
330 |
+
array('text' => 'Status : Show GDPR Authorization Popup', 'value' => 'true')
|
331 |
+
);
|
332 |
+
echo quickadsense_get_control('select', '', 'quick_adsense_vi_code_settings_show_gdpr_authorization', 'quick_adsense_vi_code_settings_show_gdpr_authorization', ((isset($vicodeSettings['show_gdpr_authorization']))?$vicodeSettings['show_gdpr_authorization']:''), $gdprComplainceOptions);
|
333 |
+
echo '</div>';
|
334 |
+
echo '</div>';
|
335 |
echo '<script type="text/javascript">';
|
336 |
echo 'jQuery(".ui-dialog-buttonset").find("button").first().find("span:nth-child(2)").hide().after("<span class=\'ui-button-text\' style=\'background: #0085ba; border-color: #0073aa #006799 #006799; color: #fff; padding-left: 1em;\'>Save changes</span>");';
|
337 |
echo 'jQuery(".ui-dialog-buttonset").find("button").first().find("span:nth-child(1)").hide();';
|
355 |
$vicodeSettings['native_text_color'] = ((isset($_POST['quick_adsense_vi_code_settings_native_text_color']))?$_POST['quick_adsense_vi_code_settings_native_text_color']:'');
|
356 |
$vicodeSettings['font_family'] = ((isset($_POST['quick_adsense_vi_code_settings_font_family']))?$_POST['quick_adsense_vi_code_settings_font_family']:'');
|
357 |
$vicodeSettings['font_size'] = ((isset($_POST['quick_adsense_vi_code_settings_font_size']))?$_POST['quick_adsense_vi_code_settings_font_size']:'');
|
358 |
+
|
359 |
+
$vicodeSettings['show_gdpr_authorization'] = ((isset($_POST['quick_adsense_vi_code_settings_show_gdpr_authorization']))?$_POST['quick_adsense_vi_code_settings_show_gdpr_authorization']:'');
|
360 |
update_option('quick_adsense_vi_code_settings', $vicodeSettings);
|
361 |
$viCodeStatus = quick_adsense_vi_api_set_vi_code($vicodeSettings);
|
362 |
if(is_array($viCodeStatus) && (isset($viCodeStatus['status'])) && ($viCodeStatus['status'] == 'error')) {
|
quick-adsense.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin URI: http://quickadsense.com/
|
5 |
Description: Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
|
6 |
Author: Quicksense
|
7 |
-
Version: 2.
|
8 |
Author URI: http://quickadsense.com/
|
9 |
*/
|
10 |
/*
|
@@ -32,8 +32,10 @@ require_once(dirname(__FILE__).'/includes/content.php');
|
|
32 |
require_once(dirname(__FILE__).'/includes/api/vi.php');
|
33 |
require_once(dirname(__FILE__).'/includes/api/vi-constants.php');
|
34 |
require_once(dirname(__FILE__).'/includes/vi.php');
|
|
|
35 |
require_once(dirname(__FILE__).'/includes/adsense.php');
|
36 |
/*End Include Files*/
|
37 |
|
38 |
-
register_deactivation_hook(__FILE__, '
|
|
|
39 |
?>
|
4 |
Plugin URI: http://quickadsense.com/
|
5 |
Description: Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
|
6 |
Author: Quicksense
|
7 |
+
Version: 2.4
|
8 |
Author URI: http://quickadsense.com/
|
9 |
*/
|
10 |
/*
|
32 |
require_once(dirname(__FILE__).'/includes/api/vi.php');
|
33 |
require_once(dirname(__FILE__).'/includes/api/vi-constants.php');
|
34 |
require_once(dirname(__FILE__).'/includes/vi.php');
|
35 |
+
require_once(dirname(__FILE__).'/includes/vi-gdpr.php');
|
36 |
require_once(dirname(__FILE__).'/includes/adsense.php');
|
37 |
/*End Include Files*/
|
38 |
|
39 |
+
register_deactivation_hook(__FILE__, 'quick_adsense_vi_admin_notice_reactivate');
|
40 |
+
register_activation_hook(__FILE__, 'quick_adsense_vi_api_reset_settings');
|
41 |
?>
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: quickadsense
|
3 |
Tags: WordPress Plugin, adsense, google adsense, random adsense, random ads, advertising, adsense insertion, ad manager, ad, yahoo, google, ads, text insertion, widget, sidebar, admin, posts, plugin
|
4 |
Requires at least: 4.0
|
5 |
-
Tested up to: 4.9.
|
6 |
-
Stable tag: 2.
|
7 |
|
8 |
Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
|
9 |
|
@@ -46,8 +46,12 @@ Sign up for a [Google Adsense Account](http://adsense.google.com/) to generate r
|
|
46 |
== Frequently Asked Questions ==
|
47 |
|
48 |
Please feedback to [http://quickadsense.com/](http://quickadsense.com/) for any bug you might have found, or any suggestion you like to add.
|
49 |
-
|
50 |
== Change Log ==
|
|
|
|
|
|
|
|
|
51 |
= 2.3.2 =
|
52 |
* Bug fixes
|
53 |
* 3 option fields have been removed
|
@@ -172,6 +176,26 @@ Please feedback to [http://quickadsense.com/](http://quickadsense.com/) for any
|
|
172 |
|
173 |
= 1.0 =
|
174 |
* Initial public release.
|
175 |
-
* Date: 21-Sep-2009
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
|
177 |
|
2 |
Contributors: quickadsense
|
3 |
Tags: WordPress Plugin, adsense, google adsense, random adsense, random ads, advertising, adsense insertion, ad manager, ad, yahoo, google, ads, text insertion, widget, sidebar, admin, posts, plugin
|
4 |
Requires at least: 4.0
|
5 |
+
Tested up to: 4.9.6
|
6 |
+
Stable tag: 2.4
|
7 |
|
8 |
Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
|
9 |
|
46 |
== Frequently Asked Questions ==
|
47 |
|
48 |
Please feedback to [http://quickadsense.com/](http://quickadsense.com/) for any bug you might have found, or any suggestion you like to add.
|
49 |
+
|
50 |
== Change Log ==
|
51 |
+
= 2.4 =
|
52 |
+
* GDPR consent management module added
|
53 |
+
* Updated Privacy policy
|
54 |
+
|
55 |
= 2.3.2 =
|
56 |
* Bug fixes
|
57 |
* 3 option fields have been removed
|
176 |
|
177 |
= 1.0 =
|
178 |
* Initial public release.
|
179 |
+
* Date: 21-Sep-2009
|
180 |
+
|
181 |
+
== Privacy Policy ==
|
182 |
+
|
183 |
+
Users privacy is very important to us and we make extra effort not to collect data about the users to the maximum extend possible.
|
184 |
+
However to provide enhanced functionality we utilize the APIs from different third party services as listed below and the usage of those API are in accordance with their privacy policies.
|
185 |
+
|
186 |
+
= Geo Targeting =
|
187 |
+
|
188 |
+
To enable Geo Targeting functionality for Ads we have to send the visitor IP address to a third party service (http://freegeoip.net/ OR https://ipstack.com/) and the usage of thier API is in accordance to their privacy policy located at https://ipstack.com/privacy/.
|
189 |
+
This third party API is utilized only when you enable or use Geo Targetting features in the plugin admin.
|
190 |
+
|
191 |
+
= video intelligence =
|
192 |
+
|
193 |
+
The plugin provides deep integration with video intelligence to provide enhanced features and for easy integration with their services.
|
194 |
+
This third party API and features are utilized only when you enable or use video inteligence related features in the plugin admin and the usage of thier API and features are in accordance to their privacy policy.
|
195 |
+
|
196 |
+
video intelligence ("vi") as a third party, needs to process the user's technical data such as cookie ID, IP Address, Geo-Location and Device ID to personalize content and advertising and analyse our traffic.
|
197 |
+
You can find below a link vi's Legal webpage where there are transparently presented all GDPR relevant information.
|
198 |
+
Please access the link to check vi's Privacy Policy, Terms&Conditions pages, Opt Out Mechanism, Vendor and Purposes lists.
|
199 |
+
https://www.vi.ai/legals/
|
200 |
|
201 |
|