Changeset 3312680
- Timestamp:
- 06/16/2025 05:30:03 PM (10 months ago)
- Location:
- uniconsent-cmp
- Files:
-
- 2 added
- 8 edited
- 1 copied
-
tags/1.6.0 (copied) (copied from uniconsent-cmp/trunk)
-
tags/1.6.0/README.txt (modified) (4 diffs)
-
tags/1.6.0/includes/class-unic-cmp.php (modified) (1 diff)
-
tags/1.6.0/public/js/unic.js (modified) (1 diff)
-
tags/1.6.0/public/js/unic.min.js (added)
-
tags/1.6.0/uniconsent-cmp.php (modified) (3 diffs)
-
trunk/README.txt (modified) (4 diffs)
-
trunk/includes/class-unic-cmp.php (modified) (1 diff)
-
trunk/public/js/unic.js (modified) (1 diff)
-
trunk/public/js/unic.min.js (added)
-
trunk/uniconsent-cmp.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uniconsent-cmp/tags/1.6.0/README.txt
r3308091 r3312680 1 1 === UniConsent Cookie Consent CMP - Consent Manager === 2 Version: 1. 5.102 Version: 1.6.0 3 3 Contributors: uniconsent 4 4 Tags: cmp, cookie banner, cookie consent, iab, cookie … … 6 6 Tested up to: 6.8.1 7 7 Requires PHP: 7.4 8 Stable tag: 1. 5.108 Stable tag: 1.6.0 9 9 License: GPLv3 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 23 23 **Microsoft UET Consent Mode Support** 24 24 25 **Bing Ads Consent Mode Support ** 25 **Bing Ads Consent Mode Support** 26 27 **WP Consent API Support** 26 28 27 29 [UniConsent](https://www.uniconsent.com/) implements the IAB Transparency and Consent Framework for GDPR and Google Ad Manager/Adsense Consent Guidance. Most publishers have seen revenue increased substantially right after implemented and switched to UniConsent. … … 121 123 == Changelog == 122 124 125 = 1.6.0 = 126 * WP Consent API Support 127 123 128 = 1.5.7 = 124 129 * Fix warning for PHP 8.2+ -
uniconsent-cmp/tags/1.6.0/includes/class-unic-cmp.php
r3308091 r3312680 20 20 $this->version = UNIC_VERSION; 21 21 } else { 22 $this->version = '1. 5.10';22 $this->version = '1.6.0'; 23 23 } 24 24 $this->plugin_name = 'uniconsent-cmp'; -
uniconsent-cmp/tags/1.6.0/public/js/unic.js
r3308091 r3312680 1 // terser unic.js -o unic.min.js -c -m 2 function unic_wp_set_consent(type, value) { 3 if (typeof window.wp_set_consent == 'function') { 4 wp_set_consent(type, value); 5 } 6 } 7 8 function unic_wp_sync_consent() { 9 var dataLayer = window.dataLayer || []; 10 // Find last unic_data event 11 for (var i = dataLayer.length - 1; i >= 0; i--) { 12 var dlEvent = dataLayer[i]; 13 if (dlEvent.event === 'unic_data') { 14 var consent = dlEvent.CONSENT_MODE || {}; 15 var isOptIn = dlEvent.LOC === 'EU' || dlEvent.LOC === 'BR' || dlEvent.LOC === 'ZA'; 16 17 window.wp_consent_type = isOptIn ? 'optin' : 'optout'; 18 document.dispatchEvent(new CustomEvent('wp_consent_type_defined')); 19 20 var set = unic_wp_set_consent; 21 22 if (consent.functionality_storage === 'granted') { 23 set('functional', 'allow'); 24 } else { 25 set('functional', 'deny'); 26 } 27 if ( 28 consent.ad_storage === 'granted' || 29 consent.ad_user_data === 'granted' || 30 consent.ad_personalization === 'granted' 31 ) { 32 set('marketing', 'allow'); 33 } else { 34 set('marketing', 'deny'); 35 } 36 if (consent.analytics_storage === 'granted') { 37 set('statistics', 'allow'); 38 set('statistics-anonymous', 'allow'); 39 } else { 40 set('statistics', 'deny'); 41 set('statistics-anonymous', 'deny'); 42 } 43 if (consent.personalization_storage === 'granted') { 44 set('preferences', 'allow'); 45 } else { 46 set('preferences', 'deny'); 47 } 48 break; // Stop after first match 49 } 50 } 51 } 52 53 (function waitForUnicData() { 54 if (!window.dataLayer || !window.dataLayer.push) { 55 setTimeout(waitForUnicData, 100); 56 return; 57 } 58 59 // Patch push method to listen for future unic_data events 60 var originalPush = window.dataLayer.push; 61 window.dataLayer.push = function () { 62 for (var i = 0; i < arguments.length; i++) { 63 if (arguments[i] && arguments[i].event === 'unic_data') { 64 setTimeout(unic_wp_sync_consent, 0); 65 } 66 } 67 return originalPush.apply(this, arguments); 68 }; 69 70 // Wait for first unic_data event 71 (function waitForInitialUnic() { 72 var found = window.dataLayer.some(function (e) { 73 return e && e.event === 'unic_data'; 74 }); 75 if (found) { 76 unic_wp_sync_consent(); 77 } else { 78 setTimeout(waitForInitialUnic, 100); 79 } 80 })(); 81 })(); -
uniconsent-cmp/tags/1.6.0/uniconsent-cmp.php
r3308091 r3312680 4 4 * Plugin URI: https://www.uniconsent.com/?utm_source=wp-plugins 5 5 * Description: Leading Consent Management Platform for IAB TCF, GPP, GDPR, POPIA, CCPA, COPPA, and LGPD Compliance. 6 * Version: 1. 5.106 * Version: 1.6.0 7 7 * Author: UniConsent 8 8 * Author URI: https://www.uniconsent.com/?utm_source=wp-plugins … … 14 14 } 15 15 16 define( 'UNIC_CMP_VERSION', '1. 5.10' );16 define( 'UNIC_CMP_VERSION', '1.6.0' ); 17 17 18 18 function activate_unic_cmp() { … … 31 31 require plugin_dir_path( __FILE__ ) . 'includes/class-unic-cmp.php'; 32 32 33 //declare compliance with consent level API 34 $plugin_name = plugin_basename( __FILE__ ); 35 add_filter( "wp_consent_api_registered_{$plugin_name}", '__return_true' ); 36 37 function unic_cmp_enqueue_scripts() { 38 wp_enqueue_script( 39 'unic-cmp-script', // Handle 40 plugin_dir_url(__FILE__) . 'public/js/unic.min.js', 41 array(), 42 '1.6.0', 43 true 44 ); 45 } 46 add_action('wp_enqueue_scripts', 'unic_cmp_enqueue_scripts'); 47 33 48 function run_unic_cmp() { 34 49 -
uniconsent-cmp/trunk/README.txt
r3308091 r3312680 1 1 === UniConsent Cookie Consent CMP - Consent Manager === 2 Version: 1. 5.102 Version: 1.6.0 3 3 Contributors: uniconsent 4 4 Tags: cmp, cookie banner, cookie consent, iab, cookie … … 6 6 Tested up to: 6.8.1 7 7 Requires PHP: 7.4 8 Stable tag: 1. 5.108 Stable tag: 1.6.0 9 9 License: GPLv3 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 23 23 **Microsoft UET Consent Mode Support** 24 24 25 **Bing Ads Consent Mode Support ** 25 **Bing Ads Consent Mode Support** 26 27 **WP Consent API Support** 26 28 27 29 [UniConsent](https://www.uniconsent.com/) implements the IAB Transparency and Consent Framework for GDPR and Google Ad Manager/Adsense Consent Guidance. Most publishers have seen revenue increased substantially right after implemented and switched to UniConsent. … … 121 123 == Changelog == 122 124 125 = 1.6.0 = 126 * WP Consent API Support 127 123 128 = 1.5.7 = 124 129 * Fix warning for PHP 8.2+ -
uniconsent-cmp/trunk/includes/class-unic-cmp.php
r3308091 r3312680 20 20 $this->version = UNIC_VERSION; 21 21 } else { 22 $this->version = '1. 5.10';22 $this->version = '1.6.0'; 23 23 } 24 24 $this->plugin_name = 'uniconsent-cmp'; -
uniconsent-cmp/trunk/public/js/unic.js
r3308091 r3312680 1 // terser unic.js -o unic.min.js -c -m 2 function unic_wp_set_consent(type, value) { 3 if (typeof window.wp_set_consent == 'function') { 4 wp_set_consent(type, value); 5 } 6 } 7 8 function unic_wp_sync_consent() { 9 var dataLayer = window.dataLayer || []; 10 // Find last unic_data event 11 for (var i = dataLayer.length - 1; i >= 0; i--) { 12 var dlEvent = dataLayer[i]; 13 if (dlEvent.event === 'unic_data') { 14 var consent = dlEvent.CONSENT_MODE || {}; 15 var isOptIn = dlEvent.LOC === 'EU' || dlEvent.LOC === 'BR' || dlEvent.LOC === 'ZA'; 16 17 window.wp_consent_type = isOptIn ? 'optin' : 'optout'; 18 document.dispatchEvent(new CustomEvent('wp_consent_type_defined')); 19 20 var set = unic_wp_set_consent; 21 22 if (consent.functionality_storage === 'granted') { 23 set('functional', 'allow'); 24 } else { 25 set('functional', 'deny'); 26 } 27 if ( 28 consent.ad_storage === 'granted' || 29 consent.ad_user_data === 'granted' || 30 consent.ad_personalization === 'granted' 31 ) { 32 set('marketing', 'allow'); 33 } else { 34 set('marketing', 'deny'); 35 } 36 if (consent.analytics_storage === 'granted') { 37 set('statistics', 'allow'); 38 set('statistics-anonymous', 'allow'); 39 } else { 40 set('statistics', 'deny'); 41 set('statistics-anonymous', 'deny'); 42 } 43 if (consent.personalization_storage === 'granted') { 44 set('preferences', 'allow'); 45 } else { 46 set('preferences', 'deny'); 47 } 48 break; // Stop after first match 49 } 50 } 51 } 52 53 (function waitForUnicData() { 54 if (!window.dataLayer || !window.dataLayer.push) { 55 setTimeout(waitForUnicData, 100); 56 return; 57 } 58 59 // Patch push method to listen for future unic_data events 60 var originalPush = window.dataLayer.push; 61 window.dataLayer.push = function () { 62 for (var i = 0; i < arguments.length; i++) { 63 if (arguments[i] && arguments[i].event === 'unic_data') { 64 setTimeout(unic_wp_sync_consent, 0); 65 } 66 } 67 return originalPush.apply(this, arguments); 68 }; 69 70 // Wait for first unic_data event 71 (function waitForInitialUnic() { 72 var found = window.dataLayer.some(function (e) { 73 return e && e.event === 'unic_data'; 74 }); 75 if (found) { 76 unic_wp_sync_consent(); 77 } else { 78 setTimeout(waitForInitialUnic, 100); 79 } 80 })(); 81 })(); -
uniconsent-cmp/trunk/uniconsent-cmp.php
r3308091 r3312680 4 4 * Plugin URI: https://www.uniconsent.com/?utm_source=wp-plugins 5 5 * Description: Leading Consent Management Platform for IAB TCF, GPP, GDPR, POPIA, CCPA, COPPA, and LGPD Compliance. 6 * Version: 1. 5.106 * Version: 1.6.0 7 7 * Author: UniConsent 8 8 * Author URI: https://www.uniconsent.com/?utm_source=wp-plugins … … 14 14 } 15 15 16 define( 'UNIC_CMP_VERSION', '1. 5.10' );16 define( 'UNIC_CMP_VERSION', '1.6.0' ); 17 17 18 18 function activate_unic_cmp() { … … 31 31 require plugin_dir_path( __FILE__ ) . 'includes/class-unic-cmp.php'; 32 32 33 //declare compliance with consent level API 34 $plugin_name = plugin_basename( __FILE__ ); 35 add_filter( "wp_consent_api_registered_{$plugin_name}", '__return_true' ); 36 37 function unic_cmp_enqueue_scripts() { 38 wp_enqueue_script( 39 'unic-cmp-script', // Handle 40 plugin_dir_url(__FILE__) . 'public/js/unic.min.js', 41 array(), 42 '1.6.0', 43 true 44 ); 45 } 46 add_action('wp_enqueue_scripts', 'unic_cmp_enqueue_scripts'); 47 33 48 function run_unic_cmp() { 34 49
Note: See TracChangeset
for help on using the changeset viewer.