Changeset 1881399
- Timestamp:
- 05/25/2018 12:46:37 PM (8 years ago)
- Location:
- quick-adsense
- Files:
-
- 42 added
- 5 edited
-
tags/2.4 (added)
-
tags/2.4/includes (added)
-
tags/2.4/includes/adsense.php (added)
-
tags/2.4/includes/api (added)
-
tags/2.4/includes/api/vi-constants.php (added)
-
tags/2.4/includes/api/vi.php (added)
-
tags/2.4/includes/content.php (added)
-
tags/2.4/includes/controls.php (added)
-
tags/2.4/includes/css (added)
-
tags/2.4/includes/css/admin.css (added)
-
tags/2.4/includes/css/gdpr.css (added)
-
tags/2.4/includes/defaults.php (added)
-
tags/2.4/includes/images (added)
-
tags/2.4/includes/images/advertisement-preview.png (added)
-
tags/2.4/includes/images/ajax-loader-flat.gif (added)
-
tags/2.4/includes/images/ajax-loader.gif (added)
-
tags/2.4/includes/images/jquery.minicolors.png (added)
-
tags/2.4/includes/images/privacy.png (added)
-
tags/2.4/includes/images/vi-big-logo.png (added)
-
tags/2.4/includes/images/vi-empty-graph.jpg (added)
-
tags/2.4/includes/images/vi-logo-large.png (added)
-
tags/2.4/includes/images/vi-logo-small.png (added)
-
tags/2.4/includes/images/vi-logo-square.png (added)
-
tags/2.4/includes/images/vi-no-data.jpg (added)
-
tags/2.4/includes/js (added)
-
tags/2.4/includes/js/Chart.bundle.min.js (added)
-
tags/2.4/includes/js/admin.js (added)
-
tags/2.4/includes/js/gdpr.js (added)
-
tags/2.4/includes/js/jquery.minicolors.js (added)
-
tags/2.4/includes/quicktags.php (added)
-
tags/2.4/includes/settings.php (added)
-
tags/2.4/includes/vi-gdpr.php (added)
-
tags/2.4/includes/vi.php (added)
-
tags/2.4/includes/widgets.php (added)
-
tags/2.4/quick-adsense.php (added)
-
tags/2.4/readme.txt (added)
-
tags/2.4/screenshot-1.png (added)
-
tags/2.4/screenshot-2.png (added)
-
trunk/includes/api/vi.php (modified) (7 diffs)
-
trunk/includes/css/gdpr.css (added)
-
trunk/includes/images/privacy.png (added)
-
trunk/includes/js/admin.js (modified) (2 diffs)
-
trunk/includes/js/gdpr.js (added)
-
trunk/includes/vi-gdpr.php (added)
-
trunk/includes/vi.php (modified) (2 diffs)
-
trunk/quick-adsense.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
quick-adsense/trunk/includes/api/vi.php
r1858974 r1881399 7 7 if(!is_wp_error($response) && (200 == wp_remote_retrieve_response_code($response))) { 8 8 $responseBody = json_decode($response['body']); 9 //echo '<pre>'; print_r($responseBody->data); echo '</pre>'; 9 10 if((json_last_error() == JSON_ERROR_NONE) && ($responseBody->status == 'ok')) { 10 11 $viSettings = array( … … 18 19 'adsTxtAPI' => $responseBody->data->adsTxtAPI, 19 20 'languages' => $responseBody->data->languages, 20 'jsTagAPI' => $responseBody->data->jsTagAPI, 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, 21 26 ); 22 27 delete_transient('quick_adsense_vi_api_settings'); … … 33 38 } 34 39 40 function quick_adsense_vi_api_reset_settings() { 41 delete_transient('quick_adsense_vi_api_settings'); 42 } 43 35 44 function quick_adsense_vi_api_get_signupurl() { 36 45 $viSettings = quick_adsense_vi_api_get_settings(); … … 71 80 return false; 72 81 } 82 } 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']; 73 98 } 74 99 return false; … … 317 342 } 318 343 319 //if(isset($selectedArgs['language']) && ($selectedArgs['language'] != '') && isset($selectedArgs['iabCategory']) && ($selectedArgs['iabCategory'] != '')) { /* Polling limiter temporarily removed as API now support defaults*/ 320 $viSettings = quick_adsense_vi_api_get_settings(); 321 if(($viSettings != false) && is_array($viSettings)) { 322 $viToken = quick_adsense_vi_api_get_publisher_token(); 323 if($viToken !== false) { 324 try{ 325 $response = wp_remote_request( 326 $viSettings['jsTagAPI'], 327 array( 328 'method' => 'POST', 329 'timeout' => 15, 330 'headers' => array( 331 'Content-Type' => 'application/json', 332 'Authorization' => $viToken 333 ), 334 'body' => json_encode($selectedArgs) 335 ) 336 ); 337 if(!is_wp_error($response)) { 338 if(400 == wp_remote_retrieve_response_code($response)) { 339 $responseBody = json_decode($response['body']); 340 if((json_last_error() == JSON_ERROR_NONE) && ($responseBody->status == 'error')) { 341 return array( 342 'status' => 'error', 343 'errorCode' => 'WIVI108', 344 'message' => $responseBody->error->description, 345 ); 346 } else { 347 return array( 348 'status' => 'error', 349 'errorCode' => 'WIVI107', 350 'message' => 'Response JSON error, Please try again later!', 351 ); 352 } 353 } else if(201 == wp_remote_retrieve_response_code($response)) { 354 $responseBody = json_decode($response['body']); 355 if((json_last_error() == JSON_ERROR_NONE) && ($responseBody->status == 'ok')) { 356 delete_transient('quick_adsense_vi_api_jstag'); 357 set_transient('quick_adsense_vi_api_jstag', $responseBody->data, YEAR_IN_SECONDS); 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' => 'WIVI105', 370 'message' => 'Unknown response code', 371 ); 372 } 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 ); 373 396 } 374 } catch(Exception $ex) {375 return array(376 'status' => 'error',377 'errorCode' => 'WIVI103',378 'message' => 'Exception during API communication',379 );380 397 } 381 } else{398 } catch(Exception $ex) { 382 399 return array( 383 400 'status' => 'error', 384 'errorCode' => 'WIVI10 2',385 'message' => ' Authorization Token is Missing',386 ); 387 } 388 //} else {389 /*return array(401 'errorCode' => 'WIVI103', 402 'message' => 'Exception during API communication', 403 ); 404 } 405 } else { 406 return array( 390 407 'status' => 'error', 391 'errorCode' => 'WIVI10 1',392 'message' => 'A PI is unreachable',393 ); */394 //}408 'errorCode' => 'WIVI102', 409 'message' => 'Authorization Token is Missing', 410 ); 411 } 395 412 } else { 396 413 return array( … … 403 420 404 421 function quick_adsense_vi_api_get_vi_code($settingsKey = '') { 405 //delete_transient('quick_adsense_vi_api_jstag');406 422 $jsTag = get_transient('quick_adsense_vi_api_jstag'); 407 423 if(($jsTag === false) || ($jsTag == '') || is_array($jsTag)) { … … 418 434 return '<script type="text/javascript">'.$jsTag.'</script>'; 419 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 } 420 487 ?> -
quick-adsense/trunk/includes/js/admin.js
r1858974 r1881399 750 750 var quick_adsense_vi_code_settings_font_family = jQuery('#quick_adsense_vi_code_settings_font_family').val(); 751 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(); 752 753 jQuery('.ui-dialog-content').html('<div class="quick_adsense_ajaxloader"></div>'); 753 754 jQuery('.quick_adsense_ajaxloader').show(); … … 765 766 'quick_adsense_vi_code_settings_font_family': quick_adsense_vi_code_settings_font_family, 766 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, 767 769 }, function(response) { 768 770 if(response.indexOf('###SUCCESS###') !== -1) { -
quick-adsense/trunk/includes/vi.php
r1858974 r1881399 322 322 echo '</div>'; 323 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>'; 324 335 echo '<script type="text/javascript">'; 325 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>");'; … … 345 356 $vicodeSettings['font_family'] = ((isset($_POST['quick_adsense_vi_code_settings_font_family']))?$_POST['quick_adsense_vi_code_settings_font_family']:''); 346 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']:''); 347 360 update_option('quick_adsense_vi_code_settings', $vicodeSettings); 348 361 $viCodeStatus = quick_adsense_vi_api_set_vi_code($vicodeSettings); -
quick-adsense/trunk/quick-adsense.php
r1846873 r1881399 5 5 Description: Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post. 6 6 Author: Quicksense 7 Version: 2. 3.27 Version: 2.4 8 8 Author URI: http://quickadsense.com/ 9 9 */ … … 33 33 require_once(dirname(__FILE__).'/includes/api/vi-constants.php'); 34 34 require_once(dirname(__FILE__).'/includes/vi.php'); 35 require_once(dirname(__FILE__).'/includes/vi-gdpr.php'); 35 36 require_once(dirname(__FILE__).'/includes/adsense.php'); 36 37 /*End Include Files*/ 37 38 38 register_deactivation_hook(__FILE__, 'quick_adsense_admin_notice_reactivate'); 39 register_deactivation_hook(__FILE__, 'quick_adsense_vi_admin_notice_reactivate'); 40 register_activation_hook(__FILE__, 'quick_adsense_vi_api_reset_settings'); 39 41 ?> -
quick-adsense/trunk/readme.txt
r1858974 r1881399 3 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 4 Requires at least: 4.0 5 Tested up to: 4.9. 46 Stable tag: 2. 3.25 Tested up to: 4.9.6 6 Stable tag: 2.4 7 7 8 8 Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post. … … 49 49 50 50 == Change Log == 51 = 2.4 = 52 * GDPR consent management module added 53 * Updated Privacy policy 54 51 55 = 2.3.2 = 52 56 * Bug fixes … … 175 179 * Date: 21-Sep-2009 176 180 177 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
Note: See TracChangeset
for help on using the changeset viewer.