Changeset 2456545
- Timestamp:
- 01/14/2021 07:59:26 PM (5 years ago)
- Location:
- better-gdpr/trunk
- Files:
-
- 3 edited
-
better-gdpr.js (modified) (1 diff)
-
better-gdpr.php (modified) (3 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
better-gdpr/trunk/better-gdpr.js
r2407095 r2456545 1 const bettergdpr_js_url = document.getElementById("bettergdpr_js").src;2 1 var bettergdpr_tenant; 3 2 var bettergdpr_full_domain; 4 3 var bettergdpr_full_url_dir; 5 if (bettergdpr_js_url) { 6 var bettergdpr_url = new URL(bettergdpr_js_url); 7 if (bettergdpr_url) { 8 bettergdpr_tenant = bettergdpr_url.searchParams.get('tenant'); 9 if (bettergdpr_tenant) { 10 bettergdpr_full_domain = "https://"+bettergdpr_tenant+".privacybunker.cloud/"; 11 bettergdpr_full_url_dir = bettergdpr_url.protocol + '//' + bettergdpr_url.host; 12 if ( bettergdpr_url.port ) { 13 bettergdpr_full_url_dir = bettergdpr_full_url_dir + ':' + bettergdpr_url.port; 4 5 const bettergdpr_temp_scripts = document.getElementsByTagName('script'); 6 for (var index = 0; index < bettergdpr_temp_scripts.length; index++) { 7 if (bettergdpr_temp_scripts[index].src && 8 bettergdpr_temp_scripts[index].src.includes('/better-gdpr.js?')) { 9 var bettergdpr_url = new URL(bettergdpr_temp_scripts[index].src); 10 if (bettergdpr_url) { 11 bettergdpr_tenant = bettergdpr_url.searchParams.get('tenant'); 12 if (bettergdpr_tenant) { 13 bettergdpr_full_domain = "https://"+bettergdpr_tenant+".privacybunker.cloud/"; 14 bettergdpr_full_url_dir = bettergdpr_url.protocol + '//' + bettergdpr_url.host; 15 if ( bettergdpr_url.port ) { 16 bettergdpr_full_url_dir = bettergdpr_full_url_dir + ':' + bettergdpr_url.port; 17 } 18 bettergdpr_full_url_dir = bettergdpr_full_url_dir + bettergdpr_url.pathname.replace('/better-gdpr.js', '/'); 19 alert('good'); 14 20 } 15 bettergdpr_full_url_dir = bettergdpr_full_url_dir + bettergdpr_url.pathname.replace('/better-gdpr.js', '/'); 16 } 17 21 } 18 22 } 19 23 } -
better-gdpr/trunk/better-gdpr.php
r2456392 r2456545 12 12 * Plugin URI: https:/privacybunker.io 13 13 * Description: GDPR & Cookie Consent plugin built by PrivacyBunker.io team. 14 * Version: 0.2. 414 * Version: 0.2.5 15 15 * Author: Yuli Stremovsky 16 16 * Author URI: https://securitybunker.io … … 390 390 $subdomain = get_option( 'bettergdpr_subdomain', '' ); 391 391 if ($subdomain == '') { 392 print("<!-- bettergdpr_subdomain empty -->");393 392 return; 394 393 } 395 394 $srv = "https://".$subdomain.".privacybunker.cloud/"; 396 $css_file = plugin_dir_url( dirname( __FILE__ ) ) . 'better-gdpr/better-gdpr.css'; 397 print("<script id='bettergdpr_js' src='".plugin_dir_url( dirname( __FILE__ ) ) ."better-gdpr/better-gdpr.js?tenant=".$subdomain."' type='text/javascript'></script>"); 398 #wp_enqueue_script( 'bettergdpr_js', plugin_dir_url( dirname( __FILE__ ) ) . 'better-gdpr/better-gdpr.js?tenant=' . $subdomain ); 395 //print("<script id='bettergdpr_js' src='".plugin_dir_url( dirname( __FILE__ ) ) ."better-gdpr/better-gdpr.js?tenant=".$subdomain."' type='text/javascript'></script>"); 396 wp_enqueue_script( 'bettergdpr_js', plugin_dir_url( dirname( __FILE__ ) ) . 'better-gdpr/better-gdpr.js?tenant=' . $subdomain ); 399 397 } 400 398 … … 404 402 add_action( 'registration_errors', 'bettergdpr_registration_check', 10, 3); 405 403 add_action( 'user_register', 'bettergdpr_registration_save'); 406 //add_action( 'wp_enqueue_scripts', 'bettergdpr_cookie_consent', 1);407 add_action( 'wp_footer', 'bettergdpr_cookie_consent');404 add_action( 'wp_enqueue_scripts', 'bettergdpr_cookie_consent', 1); 405 //add_action( 'wp_footer', 'bettergdpr_cookie_consent'); 408 406 409 407 if ( 'yes' === get_option( 'woocommerce_enable_myaccount_registration' ) ) { -
better-gdpr/trunk/readme.txt
r2456392 r2456545 4 4 Tags: gdpr, privacy, privacy-tools, compliance, cookie-consent, security, cookie-banner, GDPR-compliance, general-data-protection-regulation, law, saas, regulations 5 5 Requires at least: 4.7 6 Tested up to: 5. 56 Tested up to: 5.6 7 7 Stable tag: 4.3 8 8 Requires PHP: 7.0 … … 59 59 Under the hood, user consent categories are saved in a special cookie called: "BETTERGDPR". So, when the page loads, the plugin checks the value of the "BETTERGDPR" cookie and injects the approved JavaScript code. If it is a new site visitor, we will show the user our cookie consent popup. 60 60 61 = Free takeaway = 62 63 We run a privacy training for startup founders and architects. It is available completely for FREE: 64 https://basebunker.com/ 61 65 62 66 == Frequently Asked Questions == … … 75 79 76 80 == Changelog == 81 82 = 0.2.5 = 83 * Use standard callback to place javascript. 77 84 78 85 = 0.2.4 =
Note: See TracChangeset
for help on using the changeset viewer.