Plugin Directory

Changeset 3312680


Ignore:
Timestamp:
06/16/2025 05:30:03 PM (10 months ago)
Author:
uniconsent
Message:

Release 1.6.0

Location:
uniconsent-cmp
Files:
2 added
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • uniconsent-cmp/tags/1.6.0/README.txt

    r3308091 r3312680  
    11=== UniConsent Cookie Consent CMP - Consent Manager ===
    2 Version: 1.5.10
     2Version: 1.6.0
    33Contributors: uniconsent
    44Tags: cmp, cookie banner, cookie consent, iab, cookie
     
    66Tested up to: 6.8.1
    77Requires PHP: 7.4
    8 Stable tag: 1.5.10
     8Stable tag: 1.6.0
    99License: GPLv3
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    2323**Microsoft UET Consent Mode Support**
    2424
    25 **Bing Ads Consent Mode Support **
     25**Bing Ads Consent Mode Support**
     26
     27**WP Consent API Support**
    2628
    2729[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.
     
    121123== Changelog ==
    122124
     125= 1.6.0 =
     126* WP Consent API Support
     127
    123128= 1.5.7 =
    124129* Fix warning for PHP 8.2+
  • uniconsent-cmp/tags/1.6.0/includes/class-unic-cmp.php

    r3308091 r3312680  
    2020            $this->version = UNIC_VERSION;
    2121        } else {
    22             $this->version = '1.5.10';
     22            $this->version = '1.6.0';
    2323        }
    2424        $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
     2function unic_wp_set_consent(type, value) {
     3  if (typeof window.wp_set_consent == 'function') {
     4    wp_set_consent(type, value);
     5  }
     6}
     7
     8function 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  
    44* Plugin URI: https://www.uniconsent.com/?utm_source=wp-plugins
    55* Description: Leading Consent Management Platform for IAB TCF, GPP, GDPR, POPIA, CCPA, COPPA, and LGPD Compliance.
    6 * Version: 1.5.10
     6* Version: 1.6.0
    77* Author: UniConsent
    88* Author URI: https://www.uniconsent.com/?utm_source=wp-plugins
     
    1414}
    1515
    16 define( 'UNIC_CMP_VERSION', '1.5.10' );
     16define( 'UNIC_CMP_VERSION', '1.6.0' );
    1717
    1818function activate_unic_cmp() {
     
    3131require plugin_dir_path( __FILE__ ) . 'includes/class-unic-cmp.php';
    3232
     33//declare compliance with consent level API
     34$plugin_name = plugin_basename( __FILE__ );
     35add_filter( "wp_consent_api_registered_{$plugin_name}", '__return_true' );
     36
     37function 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}
     46add_action('wp_enqueue_scripts', 'unic_cmp_enqueue_scripts');
     47
    3348function run_unic_cmp() {
    3449
  • uniconsent-cmp/trunk/README.txt

    r3308091 r3312680  
    11=== UniConsent Cookie Consent CMP - Consent Manager ===
    2 Version: 1.5.10
     2Version: 1.6.0
    33Contributors: uniconsent
    44Tags: cmp, cookie banner, cookie consent, iab, cookie
     
    66Tested up to: 6.8.1
    77Requires PHP: 7.4
    8 Stable tag: 1.5.10
     8Stable tag: 1.6.0
    99License: GPLv3
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    2323**Microsoft UET Consent Mode Support**
    2424
    25 **Bing Ads Consent Mode Support **
     25**Bing Ads Consent Mode Support**
     26
     27**WP Consent API Support**
    2628
    2729[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.
     
    121123== Changelog ==
    122124
     125= 1.6.0 =
     126* WP Consent API Support
     127
    123128= 1.5.7 =
    124129* Fix warning for PHP 8.2+
  • uniconsent-cmp/trunk/includes/class-unic-cmp.php

    r3308091 r3312680  
    2020            $this->version = UNIC_VERSION;
    2121        } else {
    22             $this->version = '1.5.10';
     22            $this->version = '1.6.0';
    2323        }
    2424        $this->plugin_name = 'uniconsent-cmp';
  • uniconsent-cmp/trunk/public/js/unic.js

    r3308091 r3312680  
     1// terser unic.js -o unic.min.js -c -m
     2function unic_wp_set_consent(type, value) {
     3  if (typeof window.wp_set_consent == 'function') {
     4    wp_set_consent(type, value);
     5  }
     6}
     7
     8function 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  
    44* Plugin URI: https://www.uniconsent.com/?utm_source=wp-plugins
    55* Description: Leading Consent Management Platform for IAB TCF, GPP, GDPR, POPIA, CCPA, COPPA, and LGPD Compliance.
    6 * Version: 1.5.10
     6* Version: 1.6.0
    77* Author: UniConsent
    88* Author URI: https://www.uniconsent.com/?utm_source=wp-plugins
     
    1414}
    1515
    16 define( 'UNIC_CMP_VERSION', '1.5.10' );
     16define( 'UNIC_CMP_VERSION', '1.6.0' );
    1717
    1818function activate_unic_cmp() {
     
    3131require plugin_dir_path( __FILE__ ) . 'includes/class-unic-cmp.php';
    3232
     33//declare compliance with consent level API
     34$plugin_name = plugin_basename( __FILE__ );
     35add_filter( "wp_consent_api_registered_{$plugin_name}", '__return_true' );
     36
     37function 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}
     46add_action('wp_enqueue_scripts', 'unic_cmp_enqueue_scripts');
     47
    3348function run_unic_cmp() {
    3449
Note: See TracChangeset for help on using the changeset viewer.