Plugin Directory


Ignore:
Timestamp:
03/23/2026 06:13:48 PM (5 days ago)
Author:
termageddon
Message:

Update to version 1.9.3 from GitHub

Location:
termageddon-usercentrics
Files:
20 edited
1 copied

Legend:

Unmodified
Added
Removed
  • termageddon-usercentrics/tags/1.9.3/README.txt

    r3440540 r3489326  
    55Tested up to: 6.9
    66Requires PHP: 7.2
    7 Stable tag: 1.9.2
     7Stable tag: 1.9.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    189189== Changelog ==
    190190
     191= 1.9.3 =
     192
     193**🚀 Performance:**
     194* Removed jQuery dependency from all frontend scripts, significantly reducing page weight and improving performance scores
     195* AJAX geo-location, Divi video, Elementor video, and PSL alternate logic now use vanilla JavaScript
     196* The plugin no longer enqueues jQuery on the frontend under any configuration
     197
    191198= 1.9.2 =
    192199
  • termageddon-usercentrics/tags/1.9.3/public/class-termageddon-usercentrics-public.php

    r3440540 r3489326  
    6363        // Load AJAX Mode scripts.
    6464        if ( Termageddon_Usercentrics::is_ajax_mode_enabled() ) {
    65             wp_enqueue_script( $this->plugin_name . '_ajax', TERMAGEDDON_COOKIE_URL . 'public/js/termageddon-usercentrics-ajax.min.js', array( 'jquery' ), $this->version, false );
     65            wp_enqueue_script( $this->plugin_name . '_ajax', TERMAGEDDON_COOKIE_URL . 'public/js/termageddon-usercentrics-ajax.min.js', array(), $this->version, false );
    6666
    6767            // Load ajax params for nonce.
     
    9292        }
    9393
    94         // Check for requirement of needing jQuery.
    95         if ( Termageddon_Usercentrics::is_integration_enabled( 'divi_video' )
    96           || Termageddon_Usercentrics::is_integration_enabled( 'elementor_video' )
    97           || Termageddon_Usercentrics::should_use_alternate_psl()
    98         ) {
    99             wp_enqueue_script( 'jquery' );
    100         }
     94        // Note: jQuery dependency has been removed from all frontend scripts.
     95        // divi_video, elementor_video, AJAX geo-location, and PSL alternate
     96        // all use vanilla JS.
    10197
    10298        // Load advanced configuration if needed
     
    201197        ?>
    202198        <script id="termageddon-psl-alternate-js">
    203             (function($) {
    204                 $(document).ready(function() {
    205                     jQuery('a#usercentrics-psl,.usercentrics-psl a').each(function() {
    206                         let newElem = jQuery(`<?php echo do_shortcode( '[uc-privacysettings]' ); ?>`);
    207                         if (!["","Privacy Settings"].includes(jQuery(this).text())) newElem.text(jQuery(this).text())
    208                         jQuery(this).replaceWith(newElem);
    209                     })
    210                     jQuery('button#usercentrics-psl,.usercentrics-psl button').each(function() {
    211                         let newElem = jQuery(`<?php echo do_shortcode( '[uc-privacysettings type="button"]' ); ?>`);
    212                         if (!["","Privacy Settings"].includes(jQuery(this).text())) newElem.text(jQuery(this).text())
    213                         jQuery(this).replaceWith(newElem);
    214                     })
    215                 })
    216             })(jQuery);
     199            (function() {
     200                function replacePSL() {
     201                    var linkTemplate = document.createElement('template');
     202                    linkTemplate.innerHTML = <?php echo wp_json_encode( do_shortcode( '[uc-privacysettings]' ) ); ?>;
     203                    var buttonTemplate = document.createElement('template');
     204                    buttonTemplate.innerHTML = <?php echo wp_json_encode( do_shortcode( '[uc-privacysettings type="button"]' ) ); ?>;
     205
     206                    var linkSource = linkTemplate.content.firstElementChild;
     207                    var buttonSource = buttonTemplate.content.firstElementChild;
     208
     209                    if (linkSource) {
     210                        document.querySelectorAll('a#usercentrics-psl, .usercentrics-psl a').forEach(function(el) {
     211                            var newElem = linkSource.cloneNode(true);
     212                            var text = el.textContent.trim();
     213                            if (text !== '' && text !== 'Privacy Settings') newElem.textContent = text;
     214                            el.replaceWith(newElem);
     215                        });
     216                    }
     217                    if (buttonSource) {
     218                        document.querySelectorAll('button#usercentrics-psl, .usercentrics-psl button').forEach(function(el) {
     219                            var newElem = buttonSource.cloneNode(true);
     220                            var text = el.textContent.trim();
     221                            if (text !== '' && text !== 'Privacy Settings') newElem.textContent = text;
     222                            el.replaceWith(newElem);
     223                        });
     224                    }
     225                }
     226                if (document.readyState === 'loading') {
     227                    document.addEventListener('DOMContentLoaded', replacePSL);
     228                } else {
     229                    replacePSL();
     230                }
     231            })();
    217232        </script>
    218233        <?php
  • termageddon-usercentrics/tags/1.9.3/public/js/termageddon-usercentrics-ajax.js

    r3238690 r3489326  
    3131    };
    3232
     33    const showElements = (selector) => {
     34        document.querySelectorAll(selector).forEach((el) => el.style.display = "");
     35    };
     36
     37    const hideElements = (selector) => {
     38        document.querySelectorAll(selector).forEach((el) => el.style.display = "none");
     39    };
     40
    3341    const updateCookieConsent = (hide) => {
    3442        if (!hide) {
     
    3644            //Show Consent Options
    3745            if (tuPSLHide)
    38                 jQuery("#usercentrics-psl, .usercentrics-psl").show();
     46                showElements("#usercentrics-psl, .usercentrics-psl");
    3947
    40             jQuery(tuToggle).show();
     48            showElements(tuToggle);
    4149
    4250            if (!UC_UI.isConsentRequired()) return UC_UI.closeCMP();
     
    4654            //Hide Consent Options
    4755            if (tuPSLHide)
    48                 jQuery("#usercentrics-psl, .usercentrics-psl").hide();
     56                hideElements("#usercentrics-psl, .usercentrics-psl");
    4957
    50             jQuery(tuToggle).hide();
     58            hideElements(tuToggle);
    5159
    5260            //Check for already acceptance.
     
    8391        if (tuDebug) console.log("UC: Making AJAX Call");
    8492
    85         // Build Ajax Query.
    86         var data = {
    87             action: "uc_geolocation_lookup",
    88             nonce: termageddon_usercentrics_obj.nonce, // We pass php values differently!
    89         };
     93        // Build form data for POST request.
     94        var formData = new FormData();
     95        formData.append("action", "uc_geolocation_lookup");
     96        formData.append("nonce", termageddon_usercentrics_obj.nonce);
    9097
    9198        if (typeof termageddon_usercentrics_obj.location !== "undefined")
    92             data["location"] = termageddon_usercentrics_obj.location;
     99            formData.append("location", termageddon_usercentrics_obj.location);
    93100
    94         // We can also pass the url value separately from ajaxurl for front end AJAX implementations
    95         jQuery
    96             .post(termageddon_usercentrics_obj.ajax_url, data)
    97             .done(function (response) {
     101        fetch(termageddon_usercentrics_obj.ajax_url, {
     102            method: "POST",
     103            credentials: "same-origin",
     104            body: formData,
     105        })
     106            .then(function (res) {
     107                if (!res.ok) throw new Error("HTTP " + res.status);
     108                return res.json();
     109            })
     110            .then(function (response) {
    98111                if (!response.success)
    99112                    return console.error(
     
    146159                updateCookieConsent(data.hide);
    147160            })
    148             .fail(function (response) {
     161            .catch(function (err) {
    149162                console.error(
    150163                    "Usercentrics: Invalid response returned. Showing widget as a default.",
    151                     response
     164                    err
    152165                );
    153166
  • termageddon-usercentrics/tags/1.9.3/public/js/termageddon-usercentrics-ajax.min.js

    r3238690 r3489326  
    1 const tuCookieHideName="tu-geoip-hide",tuDebug="true"===termageddon_usercentrics_obj.debug,tuPSLHide="true"===termageddon_usercentrics_obj.psl_hide,tuToggle="div#usercentrics-root,aside#usercentrics-cmp-ui";tuDebug&&console.log("UC: AJAX script initialized"),window.addEventListener("UC_UI_INITIALIZED",(function(){const getCookie=name=>{const value=`; ${document.cookie}`,parts=value.split(`; ${name}=`);if(2===parts.length)return parts.pop().split(";").shift()},getQueryParams=param=>{const params=new Proxy(new URLSearchParams(window.location.search),{get:(searchParams,prop)=>searchParams.get(prop)});return params[param]},setCookie=(name,value,days)=>{var expires="";if(days){var date=new Date;date.setTime(date.getTime()+24*days*60*60*1e3),expires="; expires="+date.toUTCString()}document.cookie=name+"="+(value||"")+expires+"; path=/"},updateCookieConsent=hide=>{if(!hide)return tuDebug&&console.log("UC: Showing consent widget"),tuPSLHide&&jQuery("#usercentrics-psl, .usercentrics-psl").show(),jQuery(tuToggle).show(),UC_UI.isConsentRequired()?UC_UI.showFirstLayer():UC_UI.closeCMP();tuDebug&&console.log("UC: Hiding consent widget"),tuPSLHide&&jQuery("#usercentrics-psl, .usercentrics-psl").hide(),jQuery(tuToggle).hide(),UC_UI.areAllConsentsAccepted()||UC_UI.acceptAllConsents().then(()=>{tuDebug&&console.log("UC: All consents have been accepted."),UC_UI.closeCMP().then(()=>{tuDebug&&console.log("UC: CMP Widget has been closed.")})})};if("undefined"==typeof UC_UI)return console.error("Usercentrics not loaded");const query_hide=""===getQueryParams("enable-usercentrics"),cookie_hide=getCookie("tu-geoip-hide");if(null==cookie_hide||tuDebug){tuDebug&&console.log("UC: Making AJAX Call");var data={action:"uc_geolocation_lookup",nonce:termageddon_usercentrics_obj.nonce};void 0!==termageddon_usercentrics_obj.location&&(data.location=termageddon_usercentrics_obj.location),jQuery.post(termageddon_usercentrics_obj.ajax_url,data).done((function(response){if(!response.success)return console.error("Unable to lookup location.",response.message||"");if(!response.data)return console.error("Location data was not provided.",response.data);const data=response.data;if(tuDebug&&console.log("TERMAGEDDON USERCENTRICS (AJAX)\nIP Address: "+data.ipAddress+"\nCity: "+(data.city||"Unknown")+"\nState: "+(data.state||"Unknown")+"\nCountry: "+(data.country||"Unknown")+"\nLocations: ",data.locations),query_hide)return tuDebug&&console.log("UC: Enabling due to query parameter override.","Showing Usercentrics"),updateCookieConsent(!1);setCookie("tu-geoip-hide",data.hide?"true":"false"),updateCookieConsent(data.hide)})).fail((function(response){console.error("Usercentrics: Invalid response returned. Showing widget as a default.",response),updateCookieConsent(!1)}))}else tuDebug&&console.log("UC: Cookie found.",(cookie_hide?"Showing":"Hiding")+" Usercentrics"),updateCookieConsent("true"===cookie_hide)}));
     1const tuCookieHideName="tu-geoip-hide",tuDebug="true"===termageddon_usercentrics_obj.debug,tuPSLHide="true"===termageddon_usercentrics_obj.psl_hide,tuToggle="div#usercentrics-root,aside#usercentrics-cmp-ui";tuDebug&&console.log("UC: AJAX script initialized"),window.addEventListener("UC_UI_INITIALIZED",function(){const e=e=>{document.querySelectorAll(e).forEach(e=>e.style.display="")},o=e=>{document.querySelectorAll(e).forEach(e=>e.style.display="none")},n=n=>{if(!n)return tuDebug&&console.log("UC: Showing consent widget"),tuPSLHide&&e("#usercentrics-psl, .usercentrics-psl"),e(tuToggle),UC_UI.isConsentRequired()?UC_UI.showFirstLayer():UC_UI.closeCMP();tuDebug&&console.log("UC: Hiding consent widget"),tuPSLHide&&o("#usercentrics-psl, .usercentrics-psl"),o(tuToggle),UC_UI.areAllConsentsAccepted()||UC_UI.acceptAllConsents().then(()=>{tuDebug&&console.log("UC: All consents have been accepted."),UC_UI.closeCMP().then(()=>{tuDebug&&console.log("UC: CMP Widget has been closed.")})})};if("undefined"==typeof UC_UI)return console.error("Usercentrics not loaded");const t=""===(r="enable-usercentrics",new Proxy(new URLSearchParams(window.location.search),{get:(e,o)=>e.get(o)})[r]);var r;const s=(e=>{const o=`; ${document.cookie}`.split(`; ${e}=`);if(2===o.length)return o.pop().split(";").shift()})("tu-geoip-hide");if(null==s||tuDebug){tuDebug&&console.log("UC: Making AJAX Call");var i=new FormData;i.append("action","uc_geolocation_lookup"),i.append("nonce",termageddon_usercentrics_obj.nonce),void 0!==termageddon_usercentrics_obj.location&&i.append("location",termageddon_usercentrics_obj.location),fetch(termageddon_usercentrics_obj.ajax_url,{method:"POST",credentials:"same-origin",body:i}).then(function(e){if(!e.ok)throw new Error("HTTP "+e.status);return e.json()}).then(function(e){if(!e.success)return console.error("Unable to lookup location.",e.message||"");if(!e.data)return console.error("Location data was not provided.",e.data);const o=e.data;if(tuDebug&&console.log("TERMAGEDDON USERCENTRICS (AJAX)\nIP Address: "+o.ipAddress+"\nCity: "+(o.city||"Unknown")+"\nState: "+(o.state||"Unknown")+"\nCountry: "+(o.country||"Unknown")+"\nLocations: ",o.locations),t)return tuDebug&&console.log("UC: Enabling due to query parameter override.","Showing Usercentrics"),n(!1);((e,o,n)=>{var t="";if(n){var r=new Date;r.setTime(r.getTime()+24*n*60*60*1e3),t="; expires="+r.toUTCString()}document.cookie=e+"="+(o||"")+t+"; path=/"})("tu-geoip-hide",o.hide?"true":"false"),n(o.hide)}).catch(function(e){console.error("Usercentrics: Invalid response returned. Showing widget as a default.",e),n(!1)})}else tuDebug&&console.log("UC: Cookie found.",(s?"Showing":"Hiding")+" Usercentrics"),n("true"===s)});
  • termageddon-usercentrics/tags/1.9.3/public/js/termageddon-usercentrics-integration-divi-video.js

    r3238690 r3489326  
    11window.addEventListener("load", function () {
    2     jQuery("div.et_pb_video_overlay_hover")
    3         .on("click", function (e) {
    4             jQuery(this).closest("div.et_pb_video_overlay").hide();
    5         })
    6         .find("a.et_pb_video_play")
    7         .attr("href", "javascript:void(0)");
     2    document.querySelectorAll("div.et_pb_video_overlay_hover").forEach(function (el) {
     3        el.addEventListener("click", function (e) {
     4            var overlay = this.closest("div.et_pb_video_overlay");
     5            if (overlay) overlay.style.display = "none";
     6        });
     7        var playLink = el.querySelector("a.et_pb_video_play");
     8        if (playLink) playLink.setAttribute("href", "javascript:void(0)");
     9    });
    810});
  • termageddon-usercentrics/tags/1.9.3/public/js/termageddon-usercentrics-integration-divi-video.min.js

    r3238690 r3489326  
    1 window.addEventListener("load",(function(){jQuery("div.et_pb_video_overlay_hover").on("click",(function(e){jQuery(this).closest("div.et_pb_video_overlay").hide()})).find("a.et_pb_video_play").attr("href","javascript:void(0)")}));
     1window.addEventListener("load",function(){document.querySelectorAll("div.et_pb_video_overlay_hover").forEach(function(e){e.addEventListener("click",function(e){var t=this.closest("div.et_pb_video_overlay");t&&(t.style.display="none")});var t=e.querySelector("a.et_pb_video_play");t&&t.setAttribute("href","javascript:void(0)")})});
  • termageddon-usercentrics/tags/1.9.3/public/js/termageddon-usercentrics-integration-elementor-video.js

    r3238690 r3489326  
    11window.addEventListener("load", function () {
    2     jQuery(".pp-media-overlay").on("click", function (e) {
    3         jQuery(this).hide();
     2    document.querySelectorAll(".pp-media-overlay").forEach(function (el) {
     3        el.addEventListener("click", function (e) {
     4            this.style.display = "none";
     5        });
    46    });
    57});
  • termageddon-usercentrics/tags/1.9.3/public/js/termageddon-usercentrics-integration-elementor-video.min.js

    r3238690 r3489326  
    1 window.addEventListener("load",(function(){jQuery(".pp-media-overlay").on("click",(function(e){jQuery(this).hide()}))}));
     1window.addEventListener("load",function(){document.querySelectorAll(".pp-media-overlay").forEach(function(e){e.addEventListener("click",function(e){this.style.display="none"})})});
  • termageddon-usercentrics/tags/1.9.3/termageddon-usercentrics.php

    r3440540 r3489326  
    1515 * Plugin Name:       Termageddon
    1616 * Description:       Each Termageddon license includes a consent solution. This plugin helps you install the consent solution with ease, while offering additional features.
    17  * Version:           1.9.2
     17 * Version:           1.9.3
    1818 * Author:            Termageddon
    1919 * Author URI:        https://termageddon.com
     
    3434 * Rename this for your plugin and update it as you release new versions.
    3535 */
    36 define( 'TERMAGEDDON_COOKIE_VERSION', '1.9.2' );
     36define( 'TERMAGEDDON_COOKIE_VERSION', '1.9.3' );
    3737
    3838define( 'TERMAGEDDON_COOKIE_PLUGIN_PATH', dirname( __FILE__ ) );// No trailing slash.
  • termageddon-usercentrics/tags/1.9.3/vendor/composer/installed.php

    r3440540 r3489326  
    22    'root' => array(
    33        'name' => 'termageddon/termageddon-usercentrics',
    4         'pretty_version' => 'dev-main',
    5         'version' => 'dev-main',
    6         'reference' => '982b3ac7ca467d3780878efd813a931029676c09',
     4        'pretty_version' => '1.9.3',
     5        'version' => '1.9.3.0',
     6        'reference' => '746c2a33dc2df0f78f326d19d8fbfac26742fe1c',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    4848        ),
    4949        'termageddon/termageddon-usercentrics' => array(
    50             'pretty_version' => 'dev-main',
    51             'version' => 'dev-main',
    52             'reference' => '982b3ac7ca467d3780878efd813a931029676c09',
     50            'pretty_version' => '1.9.3',
     51            'version' => '1.9.3.0',
     52            'reference' => '746c2a33dc2df0f78f326d19d8fbfac26742fe1c',
    5353            'type' => 'library',
    5454            'install_path' => __DIR__ . '/../../',
  • termageddon-usercentrics/trunk/README.txt

    r3440540 r3489326  
    55Tested up to: 6.9
    66Requires PHP: 7.2
    7 Stable tag: 1.9.2
     7Stable tag: 1.9.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    189189== Changelog ==
    190190
     191= 1.9.3 =
     192
     193**🚀 Performance:**
     194* Removed jQuery dependency from all frontend scripts, significantly reducing page weight and improving performance scores
     195* AJAX geo-location, Divi video, Elementor video, and PSL alternate logic now use vanilla JavaScript
     196* The plugin no longer enqueues jQuery on the frontend under any configuration
     197
    191198= 1.9.2 =
    192199
  • termageddon-usercentrics/trunk/public/class-termageddon-usercentrics-public.php

    r3440540 r3489326  
    6363        // Load AJAX Mode scripts.
    6464        if ( Termageddon_Usercentrics::is_ajax_mode_enabled() ) {
    65             wp_enqueue_script( $this->plugin_name . '_ajax', TERMAGEDDON_COOKIE_URL . 'public/js/termageddon-usercentrics-ajax.min.js', array( 'jquery' ), $this->version, false );
     65            wp_enqueue_script( $this->plugin_name . '_ajax', TERMAGEDDON_COOKIE_URL . 'public/js/termageddon-usercentrics-ajax.min.js', array(), $this->version, false );
    6666
    6767            // Load ajax params for nonce.
     
    9292        }
    9393
    94         // Check for requirement of needing jQuery.
    95         if ( Termageddon_Usercentrics::is_integration_enabled( 'divi_video' )
    96           || Termageddon_Usercentrics::is_integration_enabled( 'elementor_video' )
    97           || Termageddon_Usercentrics::should_use_alternate_psl()
    98         ) {
    99             wp_enqueue_script( 'jquery' );
    100         }
     94        // Note: jQuery dependency has been removed from all frontend scripts.
     95        // divi_video, elementor_video, AJAX geo-location, and PSL alternate
     96        // all use vanilla JS.
    10197
    10298        // Load advanced configuration if needed
     
    201197        ?>
    202198        <script id="termageddon-psl-alternate-js">
    203             (function($) {
    204                 $(document).ready(function() {
    205                     jQuery('a#usercentrics-psl,.usercentrics-psl a').each(function() {
    206                         let newElem = jQuery(`<?php echo do_shortcode( '[uc-privacysettings]' ); ?>`);
    207                         if (!["","Privacy Settings"].includes(jQuery(this).text())) newElem.text(jQuery(this).text())
    208                         jQuery(this).replaceWith(newElem);
    209                     })
    210                     jQuery('button#usercentrics-psl,.usercentrics-psl button').each(function() {
    211                         let newElem = jQuery(`<?php echo do_shortcode( '[uc-privacysettings type="button"]' ); ?>`);
    212                         if (!["","Privacy Settings"].includes(jQuery(this).text())) newElem.text(jQuery(this).text())
    213                         jQuery(this).replaceWith(newElem);
    214                     })
    215                 })
    216             })(jQuery);
     199            (function() {
     200                function replacePSL() {
     201                    var linkTemplate = document.createElement('template');
     202                    linkTemplate.innerHTML = <?php echo wp_json_encode( do_shortcode( '[uc-privacysettings]' ) ); ?>;
     203                    var buttonTemplate = document.createElement('template');
     204                    buttonTemplate.innerHTML = <?php echo wp_json_encode( do_shortcode( '[uc-privacysettings type="button"]' ) ); ?>;
     205
     206                    var linkSource = linkTemplate.content.firstElementChild;
     207                    var buttonSource = buttonTemplate.content.firstElementChild;
     208
     209                    if (linkSource) {
     210                        document.querySelectorAll('a#usercentrics-psl, .usercentrics-psl a').forEach(function(el) {
     211                            var newElem = linkSource.cloneNode(true);
     212                            var text = el.textContent.trim();
     213                            if (text !== '' && text !== 'Privacy Settings') newElem.textContent = text;
     214                            el.replaceWith(newElem);
     215                        });
     216                    }
     217                    if (buttonSource) {
     218                        document.querySelectorAll('button#usercentrics-psl, .usercentrics-psl button').forEach(function(el) {
     219                            var newElem = buttonSource.cloneNode(true);
     220                            var text = el.textContent.trim();
     221                            if (text !== '' && text !== 'Privacy Settings') newElem.textContent = text;
     222                            el.replaceWith(newElem);
     223                        });
     224                    }
     225                }
     226                if (document.readyState === 'loading') {
     227                    document.addEventListener('DOMContentLoaded', replacePSL);
     228                } else {
     229                    replacePSL();
     230                }
     231            })();
    217232        </script>
    218233        <?php
  • termageddon-usercentrics/trunk/public/js/termageddon-usercentrics-ajax.js

    r3238690 r3489326  
    3131    };
    3232
     33    const showElements = (selector) => {
     34        document.querySelectorAll(selector).forEach((el) => el.style.display = "");
     35    };
     36
     37    const hideElements = (selector) => {
     38        document.querySelectorAll(selector).forEach((el) => el.style.display = "none");
     39    };
     40
    3341    const updateCookieConsent = (hide) => {
    3442        if (!hide) {
     
    3644            //Show Consent Options
    3745            if (tuPSLHide)
    38                 jQuery("#usercentrics-psl, .usercentrics-psl").show();
     46                showElements("#usercentrics-psl, .usercentrics-psl");
    3947
    40             jQuery(tuToggle).show();
     48            showElements(tuToggle);
    4149
    4250            if (!UC_UI.isConsentRequired()) return UC_UI.closeCMP();
     
    4654            //Hide Consent Options
    4755            if (tuPSLHide)
    48                 jQuery("#usercentrics-psl, .usercentrics-psl").hide();
     56                hideElements("#usercentrics-psl, .usercentrics-psl");
    4957
    50             jQuery(tuToggle).hide();
     58            hideElements(tuToggle);
    5159
    5260            //Check for already acceptance.
     
    8391        if (tuDebug) console.log("UC: Making AJAX Call");
    8492
    85         // Build Ajax Query.
    86         var data = {
    87             action: "uc_geolocation_lookup",
    88             nonce: termageddon_usercentrics_obj.nonce, // We pass php values differently!
    89         };
     93        // Build form data for POST request.
     94        var formData = new FormData();
     95        formData.append("action", "uc_geolocation_lookup");
     96        formData.append("nonce", termageddon_usercentrics_obj.nonce);
    9097
    9198        if (typeof termageddon_usercentrics_obj.location !== "undefined")
    92             data["location"] = termageddon_usercentrics_obj.location;
     99            formData.append("location", termageddon_usercentrics_obj.location);
    93100
    94         // We can also pass the url value separately from ajaxurl for front end AJAX implementations
    95         jQuery
    96             .post(termageddon_usercentrics_obj.ajax_url, data)
    97             .done(function (response) {
     101        fetch(termageddon_usercentrics_obj.ajax_url, {
     102            method: "POST",
     103            credentials: "same-origin",
     104            body: formData,
     105        })
     106            .then(function (res) {
     107                if (!res.ok) throw new Error("HTTP " + res.status);
     108                return res.json();
     109            })
     110            .then(function (response) {
    98111                if (!response.success)
    99112                    return console.error(
     
    146159                updateCookieConsent(data.hide);
    147160            })
    148             .fail(function (response) {
     161            .catch(function (err) {
    149162                console.error(
    150163                    "Usercentrics: Invalid response returned. Showing widget as a default.",
    151                     response
     164                    err
    152165                );
    153166
  • termageddon-usercentrics/trunk/public/js/termageddon-usercentrics-ajax.min.js

    r3238690 r3489326  
    1 const tuCookieHideName="tu-geoip-hide",tuDebug="true"===termageddon_usercentrics_obj.debug,tuPSLHide="true"===termageddon_usercentrics_obj.psl_hide,tuToggle="div#usercentrics-root,aside#usercentrics-cmp-ui";tuDebug&&console.log("UC: AJAX script initialized"),window.addEventListener("UC_UI_INITIALIZED",(function(){const getCookie=name=>{const value=`; ${document.cookie}`,parts=value.split(`; ${name}=`);if(2===parts.length)return parts.pop().split(";").shift()},getQueryParams=param=>{const params=new Proxy(new URLSearchParams(window.location.search),{get:(searchParams,prop)=>searchParams.get(prop)});return params[param]},setCookie=(name,value,days)=>{var expires="";if(days){var date=new Date;date.setTime(date.getTime()+24*days*60*60*1e3),expires="; expires="+date.toUTCString()}document.cookie=name+"="+(value||"")+expires+"; path=/"},updateCookieConsent=hide=>{if(!hide)return tuDebug&&console.log("UC: Showing consent widget"),tuPSLHide&&jQuery("#usercentrics-psl, .usercentrics-psl").show(),jQuery(tuToggle).show(),UC_UI.isConsentRequired()?UC_UI.showFirstLayer():UC_UI.closeCMP();tuDebug&&console.log("UC: Hiding consent widget"),tuPSLHide&&jQuery("#usercentrics-psl, .usercentrics-psl").hide(),jQuery(tuToggle).hide(),UC_UI.areAllConsentsAccepted()||UC_UI.acceptAllConsents().then(()=>{tuDebug&&console.log("UC: All consents have been accepted."),UC_UI.closeCMP().then(()=>{tuDebug&&console.log("UC: CMP Widget has been closed.")})})};if("undefined"==typeof UC_UI)return console.error("Usercentrics not loaded");const query_hide=""===getQueryParams("enable-usercentrics"),cookie_hide=getCookie("tu-geoip-hide");if(null==cookie_hide||tuDebug){tuDebug&&console.log("UC: Making AJAX Call");var data={action:"uc_geolocation_lookup",nonce:termageddon_usercentrics_obj.nonce};void 0!==termageddon_usercentrics_obj.location&&(data.location=termageddon_usercentrics_obj.location),jQuery.post(termageddon_usercentrics_obj.ajax_url,data).done((function(response){if(!response.success)return console.error("Unable to lookup location.",response.message||"");if(!response.data)return console.error("Location data was not provided.",response.data);const data=response.data;if(tuDebug&&console.log("TERMAGEDDON USERCENTRICS (AJAX)\nIP Address: "+data.ipAddress+"\nCity: "+(data.city||"Unknown")+"\nState: "+(data.state||"Unknown")+"\nCountry: "+(data.country||"Unknown")+"\nLocations: ",data.locations),query_hide)return tuDebug&&console.log("UC: Enabling due to query parameter override.","Showing Usercentrics"),updateCookieConsent(!1);setCookie("tu-geoip-hide",data.hide?"true":"false"),updateCookieConsent(data.hide)})).fail((function(response){console.error("Usercentrics: Invalid response returned. Showing widget as a default.",response),updateCookieConsent(!1)}))}else tuDebug&&console.log("UC: Cookie found.",(cookie_hide?"Showing":"Hiding")+" Usercentrics"),updateCookieConsent("true"===cookie_hide)}));
     1const tuCookieHideName="tu-geoip-hide",tuDebug="true"===termageddon_usercentrics_obj.debug,tuPSLHide="true"===termageddon_usercentrics_obj.psl_hide,tuToggle="div#usercentrics-root,aside#usercentrics-cmp-ui";tuDebug&&console.log("UC: AJAX script initialized"),window.addEventListener("UC_UI_INITIALIZED",function(){const e=e=>{document.querySelectorAll(e).forEach(e=>e.style.display="")},o=e=>{document.querySelectorAll(e).forEach(e=>e.style.display="none")},n=n=>{if(!n)return tuDebug&&console.log("UC: Showing consent widget"),tuPSLHide&&e("#usercentrics-psl, .usercentrics-psl"),e(tuToggle),UC_UI.isConsentRequired()?UC_UI.showFirstLayer():UC_UI.closeCMP();tuDebug&&console.log("UC: Hiding consent widget"),tuPSLHide&&o("#usercentrics-psl, .usercentrics-psl"),o(tuToggle),UC_UI.areAllConsentsAccepted()||UC_UI.acceptAllConsents().then(()=>{tuDebug&&console.log("UC: All consents have been accepted."),UC_UI.closeCMP().then(()=>{tuDebug&&console.log("UC: CMP Widget has been closed.")})})};if("undefined"==typeof UC_UI)return console.error("Usercentrics not loaded");const t=""===(r="enable-usercentrics",new Proxy(new URLSearchParams(window.location.search),{get:(e,o)=>e.get(o)})[r]);var r;const s=(e=>{const o=`; ${document.cookie}`.split(`; ${e}=`);if(2===o.length)return o.pop().split(";").shift()})("tu-geoip-hide");if(null==s||tuDebug){tuDebug&&console.log("UC: Making AJAX Call");var i=new FormData;i.append("action","uc_geolocation_lookup"),i.append("nonce",termageddon_usercentrics_obj.nonce),void 0!==termageddon_usercentrics_obj.location&&i.append("location",termageddon_usercentrics_obj.location),fetch(termageddon_usercentrics_obj.ajax_url,{method:"POST",credentials:"same-origin",body:i}).then(function(e){if(!e.ok)throw new Error("HTTP "+e.status);return e.json()}).then(function(e){if(!e.success)return console.error("Unable to lookup location.",e.message||"");if(!e.data)return console.error("Location data was not provided.",e.data);const o=e.data;if(tuDebug&&console.log("TERMAGEDDON USERCENTRICS (AJAX)\nIP Address: "+o.ipAddress+"\nCity: "+(o.city||"Unknown")+"\nState: "+(o.state||"Unknown")+"\nCountry: "+(o.country||"Unknown")+"\nLocations: ",o.locations),t)return tuDebug&&console.log("UC: Enabling due to query parameter override.","Showing Usercentrics"),n(!1);((e,o,n)=>{var t="";if(n){var r=new Date;r.setTime(r.getTime()+24*n*60*60*1e3),t="; expires="+r.toUTCString()}document.cookie=e+"="+(o||"")+t+"; path=/"})("tu-geoip-hide",o.hide?"true":"false"),n(o.hide)}).catch(function(e){console.error("Usercentrics: Invalid response returned. Showing widget as a default.",e),n(!1)})}else tuDebug&&console.log("UC: Cookie found.",(s?"Showing":"Hiding")+" Usercentrics"),n("true"===s)});
  • termageddon-usercentrics/trunk/public/js/termageddon-usercentrics-integration-divi-video.js

    r3238690 r3489326  
    11window.addEventListener("load", function () {
    2     jQuery("div.et_pb_video_overlay_hover")
    3         .on("click", function (e) {
    4             jQuery(this).closest("div.et_pb_video_overlay").hide();
    5         })
    6         .find("a.et_pb_video_play")
    7         .attr("href", "javascript:void(0)");
     2    document.querySelectorAll("div.et_pb_video_overlay_hover").forEach(function (el) {
     3        el.addEventListener("click", function (e) {
     4            var overlay = this.closest("div.et_pb_video_overlay");
     5            if (overlay) overlay.style.display = "none";
     6        });
     7        var playLink = el.querySelector("a.et_pb_video_play");
     8        if (playLink) playLink.setAttribute("href", "javascript:void(0)");
     9    });
    810});
  • termageddon-usercentrics/trunk/public/js/termageddon-usercentrics-integration-divi-video.min.js

    r3238690 r3489326  
    1 window.addEventListener("load",(function(){jQuery("div.et_pb_video_overlay_hover").on("click",(function(e){jQuery(this).closest("div.et_pb_video_overlay").hide()})).find("a.et_pb_video_play").attr("href","javascript:void(0)")}));
     1window.addEventListener("load",function(){document.querySelectorAll("div.et_pb_video_overlay_hover").forEach(function(e){e.addEventListener("click",function(e){var t=this.closest("div.et_pb_video_overlay");t&&(t.style.display="none")});var t=e.querySelector("a.et_pb_video_play");t&&t.setAttribute("href","javascript:void(0)")})});
  • termageddon-usercentrics/trunk/public/js/termageddon-usercentrics-integration-elementor-video.js

    r3238690 r3489326  
    11window.addEventListener("load", function () {
    2     jQuery(".pp-media-overlay").on("click", function (e) {
    3         jQuery(this).hide();
     2    document.querySelectorAll(".pp-media-overlay").forEach(function (el) {
     3        el.addEventListener("click", function (e) {
     4            this.style.display = "none";
     5        });
    46    });
    57});
  • termageddon-usercentrics/trunk/public/js/termageddon-usercentrics-integration-elementor-video.min.js

    r3238690 r3489326  
    1 window.addEventListener("load",(function(){jQuery(".pp-media-overlay").on("click",(function(e){jQuery(this).hide()}))}));
     1window.addEventListener("load",function(){document.querySelectorAll(".pp-media-overlay").forEach(function(e){e.addEventListener("click",function(e){this.style.display="none"})})});
  • termageddon-usercentrics/trunk/termageddon-usercentrics.php

    r3440540 r3489326  
    1515 * Plugin Name:       Termageddon
    1616 * Description:       Each Termageddon license includes a consent solution. This plugin helps you install the consent solution with ease, while offering additional features.
    17  * Version:           1.9.2
     17 * Version:           1.9.3
    1818 * Author:            Termageddon
    1919 * Author URI:        https://termageddon.com
     
    3434 * Rename this for your plugin and update it as you release new versions.
    3535 */
    36 define( 'TERMAGEDDON_COOKIE_VERSION', '1.9.2' );
     36define( 'TERMAGEDDON_COOKIE_VERSION', '1.9.3' );
    3737
    3838define( 'TERMAGEDDON_COOKIE_PLUGIN_PATH', dirname( __FILE__ ) );// No trailing slash.
  • termageddon-usercentrics/trunk/vendor/composer/installed.php

    r3440540 r3489326  
    22    'root' => array(
    33        'name' => 'termageddon/termageddon-usercentrics',
    4         'pretty_version' => 'dev-main',
    5         'version' => 'dev-main',
    6         'reference' => '982b3ac7ca467d3780878efd813a931029676c09',
     4        'pretty_version' => '1.9.3',
     5        'version' => '1.9.3.0',
     6        'reference' => '746c2a33dc2df0f78f326d19d8fbfac26742fe1c',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    4848        ),
    4949        'termageddon/termageddon-usercentrics' => array(
    50             'pretty_version' => 'dev-main',
    51             'version' => 'dev-main',
    52             'reference' => '982b3ac7ca467d3780878efd813a931029676c09',
     50            'pretty_version' => '1.9.3',
     51            'version' => '1.9.3.0',
     52            'reference' => '746c2a33dc2df0f78f326d19d8fbfac26742fe1c',
    5353            'type' => 'library',
    5454            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.