• Resolved nathaniel45

    (@nathaniel45)


    I have an odd issue using Minify. I have the Complianz plugin and WP-Optimize installed and when I enable Minify the site will not load all the way and consol shows Uncaught SyntaxError: redeclaration of let cmplzBlockedConten twpo-minify-footer-1e719319.min.js:463:6 note: Previously declared at line 449, column 6. With Minify on it’s duplicating the code below.

    With Minify off the code below is there once.

    <script id=”cmplz-cookiebanner-js-after”>

    let cmplzBlockedContent = document.querySelector(‘.cmplz-blocked-content-notice’);

        if ( cmplzBlockedContent) {

            cmplzBlockedContent.addEventListener(‘click’, function(event) {

            event.stopPropagation();

        });

    }

    </script>

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support wpmansour

    (@wpmansour)

    To fix the issue with the Complianz script being duplicated, you can exclude it from being minified by following these simple steps:

    1. Log into your WordPress Admin Dashboard.
    2. On the left-hand menu, click on WP-Optimize and go to the Minify tab.
    3. Scroll down to the JavaScript Options section.
    4. In the “Exclude JavaScript from minification” field, add this URL https://afee.net/wp-content/plugins/complianz-gdpr/cookiebanner/js/complianz.min.js
    5. Once you’ve added that, click Save Changes.

    Next, let’s clear the cache to make sure the changes take effect:

    1. Head over to the Cache tab (still under WP-Optimize).
    2. Click on the “Clear Cache” button, and you’re all set!

    After that, just check your site to see if it loads properly without the duplication issue. Let me know how it goes or if you need anything else—happy to help!

    Thread Starter nathaniel45

    (@nathaniel45)

    The thing that is odd is that only one website is doing this while not one of the other sites I administer has this issue. All sites have the same setup.

    I’ll give your fix a try. Thanks

    Thread Starter nathaniel45

    (@nathaniel45)

    Your fix won’t work as the code that is giving the issue is added to the footer.

    Plugin Support wpmansour

    (@wpmansour)

    Thanks for giving the initial solution a shot! Since it’s still not quite working, let’s tweak a couple of things and try again. First, in the Exclude JavaScript from processing field, add both of these lines:

    /wp-content/plugins/complianz-gdpr/cookiebanner/js/complianz.min.js
    /wp-content/plugins/complianz-gdpr/cookiebanner/js/*

    Next, head to the Minify settings and uncheck the “Enable merging of JavaScript files” option. Once that’s done, clear all the caches—including WP-Optimize, your server cache, any CDN cache you might be using, and don’t forget to clear your browser cache as well.

    Thread Starter nathaniel45

    (@nathaniel45)

    Before you posted I tried unchecking “Enable merging of JavaScript files” and that seems to have fixed the issue. I did not add the JS lines to exclude. Any idea why “Enable merging of JavaScript files” checked works on other sites but not this one? Same code and theme builder and other plugins.

    Plugin Support wpmansour

    (@wpmansour)

    Thank you for the update! To help us get to the bottom of this issue, could you kindly share the URLs of both the working site and the site where the issue is occurring? This will allow us to take a closer look and compare any potential differences behind the scenes.

    Additionally, if there have been any recent changes, such as new plugins, updates, or adjustments to settings, they could also potentially be causing this issue.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.