• Resolved kalkat

    (@kalkat)


    I am using the WPSpeed ​​caching plugin by JExtensions. When I enable it, the banner does not display.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author fabiodalez

    (@fabiodalez)

    I installed WPSpeed on a test site and could reproduce it right away, even with WPSpeed’s default settings. There were two separate causes. WPSpeed’s image optimisation rewrites the whole page through PHP’s HTML parser, which strips the closing tags from the template the banner is built from, so the banner ended up with zero height and no buttons. On top of that, when WPSpeed combines and defers the scripts, FAZ started up a moment too early and failed halfway.

    Both are fixed in the next release. If you’d like to try it before then, here is a test build: https://github.com/fabiodalez-dev/FAZ-Cookie-Manager/releases/download/v1.34.0-beta2/faz-cookie-manager-1.34.0-beta2-full.zip — upload it from Plugins → Add New → Upload Plugin and choose “Replace current with uploaded” (your settings are kept), then click WPSpeed’s “Clear Cache”.

    One note if you use WPSpeed Pro: its “Remove unused JS” option holds every script until the visitor first interacts with the page, so the banner would only appear after a scroll or a click. If you have it enabled, please add FAZ Cookie Manager to its critical JS list.

    Thread Starter kalkat

    (@kalkat)

    Thanks for the quick response.
    I’m using WPSpeed ​​Pro. After uploading the test build, it works perfectly without needing to add any scripts to the exclusion list.
    However, if I do need to exclude something from “Remove unused JS” in the future, could you let me know the filename to exclude?

    Thanks again. You’re awesome. The plugin is fantastic—a real lifesaver.

    I’m sending a donation.

    Plugin Author fabiodalez

    (@fabiodalez)

    Glad it works, and thanks for testing the build and reporting back.

    On the exclusion question: there is a reason it worked without you adding anything, and it is worth knowing before you ever need to. The plugin already tags every script it enqueues with the opt-out attributes the major optimisers honour: data-no-defer, data-no-optimize, data-no-minify, data-cfasync=”false” and data-ao-skip. That is deliberate rather than incidental, because a deferred or delayed consent banner defeats the point of the plugin. The banner and the interceptor that blocks third-party trackers before consent have to run at page load, not at the first click, otherwise the trackers released by that same click get to run alongside the banner.

    If “Remove unused JS” ever does strip something anyway, exclude the directory rather than a filename:

    /wp-content/plugins/faz-cookie-manager/frontend/js/

    That covers every bundle at once. On a default install only two of them load, script.min.js and a11y.min.js, but gcm.min.js, tcf-cmp.min.js, wca.min.js and microsoft-consent.min.js appear as soon as the matching feature is on (Google Consent Mode, IAB TCF, WP Consent API, Microsoft UET and Clarity), and a path exclusion keeps working when you turn one of those on later. There is also a second reason: with WP_DEBUG or SCRIPT_DEBUG on, the plugin serves script.js instead of script.min.js, so an exclusion written against the minified name would quietly stop matching.

    There is one more path worth excluding together with it:

    /wp-content/uploads/faz-cookie-manager/assets/

    That directory holds a small generated file, config-.js, which carries the provider blocking patterns and the cookie category map. It is separate from the main bundle so your visitors’ browsers can cache it instead of receiving it inside every page. The main bundle merges it back before it runs, so if that file is removed the bundle loses the patterns it blocks with. Note the hash in the name: it is computed from the contents, so the filename changes whenever your cookie or category configuration changes. Excluding it by its current exact filename would work today and silently stop working the next time you edit a category, which is exactly the kind of failure nobody notices.

    One case where none of this applies: if you turn on “Ad-blocker compatibility mode” in Banner Control, the bundles stop being separate files and are inlined into the page, so there is nothing left to exclude.

    Thread Starter kalkat

    (@kalkat)

    Thank you, Fabio, for the comprehensive explanations. Have a great day.

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.