{"id":19018812,"date":"2026-09-13T09:54:28","date_gmt":"2026-09-13T09:54:28","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/cmplz_banner_loaders-wp_enqueue_scripts-hook-never-fires\/"},"modified":"2026-09-13T09:54:28","modified_gmt":"2026-09-13T09:54:28","slug":"cmplz_banner_loaders-wp_enqueue_scripts-hook-never-fires","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/cmplz_banner_loaders-wp_enqueue_scripts-hook-never-fires\/","title":{"rendered":"cmplz_banner_loader&#8217;s wp_enqueue_scripts hook never fires"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>Question:<\/strong> what could cause an <code>add_action('wp_enqueue_scripts', ...)<\/code> call made unconditionally in a class constructor to register successfully (object exists, method works when called directly) but never actually fire during a real page-load\/dispatch cycle, with no error anywhere in the log? Is there a known interaction with GTM4WP, Directorist, Rank Math, or Astra that&#8217;s been reported before?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Environment:<\/strong><\/p>\n\n\n\n<ul>\n<li>WordPress 7.1, PHP 8.4.24, locale es_ES<\/li>\n\n\n\n<li>Complianz GDPR\/CCPA Cookie Consent Banner (free) 7.5.5<\/li>\n\n\n\n<li>Theme: Astra + Astra Child (Astra Addon 4.13.9)<\/li>\n\n\n\n<li>Other active plugins that touch the frontend: Directorist 8.9.4, Rank Math SEO 1.0.278, Google Tag Manager for WordPress (GTM4WP \/ duracelltomi-google-tag-manager), HTTP Headers, Limit Login Attempts Reloaded, All-in-One WP Migration, Backuply, Novamira\/Novamira Pro (site management), Gravity Forms, Font Awesome<\/li>\n\n\n\n<li>No caching plugin active (LiteSpeed Cache plugin present but deactivated), no page-cache headers observed on responses<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What I configured:<\/strong><\/p>\n\n\n\n<ul>\n<li>Fresh install, ran through the setup wizard once<\/li>\n\n\n\n<li><code>country_company = ES<\/code>, <code>regions = eu<\/code>, <code>eu_consent_regions = yes<\/code><\/li>\n\n\n\n<li>Confirmed via <code>cmplz_get_cookiebanners()<\/code> that exactly 1 banner exists (ID 1, &#8220;Banner A&#8221;), <code>disable_cookiebanner = 0<\/code><\/li>\n\n\n\n<li>Confirmed the generated banner CSS file exists on disk at <code>wp-content\/uploads\/complianz\/css\/banner-1-optin.css<\/code> (17KB, non-empty)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The bug:<\/strong><br \/>On a real, uncached frontend request (verified with a headless Chromium\/Playwright session \u2014 not just curl, to rule out a JS-execution artifact), <strong>none of Complianz&#8217;s own assets are ever requested<\/strong>: no <code>cmplz-cookiebanner<\/code> script, no <code>cmplz-postscribe<\/code>, nothing. Only a plugin CSS file (<code>cookieblocker.css<\/code>) loads. No banner renders, no script gets rewritten to <code>type=\"text\/plain\"<\/code>, and Google Analytics (loaded via Google Tag Manager, unrelated to Complianz) fires a real <code>g\/collect<\/code> hit on first load with no consent gate at all.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What I ruled out before reporting this:<\/strong><\/p>\n\n\n\n<ol>\n<li><strong>Not a code bug<\/strong>: calling <code>COMPLIANZ::$banner_loader-&gt;enqueue_assets()<\/code> directly via WP-CLI works perfectly \u2014 it registers the <code>cmplz-cookiebanner<\/code> script handle in <code>$wp_scripts-&gt;registered<\/code> with no errors or exceptions (tried\/caught <code>\\Throwable<\/code>).<\/li>\n\n\n\n<li><strong>Not a business-logic gate<\/strong>: <code>COMPLIANZ::$banner_loader-&gt;site_needs_cookie_warning()<\/code> returns <code>true<\/code>. <code>analytics_configured()<\/code> returns <code>true<\/code>.<\/li>\n\n\n\n<li><strong>Not a fatal error being swallowed<\/strong>: <code>wp-content\/debug.log<\/code> has no entries from today\/this session at all (stale entries from Aug 27 only, from a previous plugin \u2014 <code>business-directory-plugin<\/code> \u2014 that isn&#8217;t even active anymore).<\/li>\n\n\n\n<li><strong>Not WordPress&#8217;s plugin auto-pause mechanism<\/strong>: <code>get_option('_wp_paused_plugins')<\/code> and <code>get_option('_wp_paused_themes')<\/code> are both empty\/false.<\/li>\n\n\n\n<li><strong>Not server\/page caching<\/strong>: no <code>Cache-Control<\/code>\/<code>Age<\/code>\/<code>X-Cache<\/code> style headers on any response; the &#8220;no-caching-plugin-active&#8221; state was confirmed via <code>wp plugin list<\/code>.<\/li>\n\n\n\n<li><strong>Not visitor geolocation<\/strong>: confirmed the test request&#8217;s outbound IP geolocates to Sevilla, Spain (i.e., squarely inside the configured <code>eu<\/code> region), via <code>ipinfo.io<\/code>.<\/li>\n\n\n\n<li><strong>Not a stale\/cached page-view<\/strong>: re-tested with cache-busting query strings and fresh Playwright sessions each time, same result every time.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What I couldn&#8217;t determine without deeper access:<\/strong><br \/>Since the constructor of <code>cmplz_banner_loader<\/code> unconditionally calls <code>add_action('wp_enqueue_scripts', [...], PHP_INT_MAX - 50)<\/code>, and <code>COMPLIANZ::$banner_loader<\/code> <em>is<\/em> a valid instantiated object of that class (confirmed via WP-CLI), the hook registration itself should be happening on every request \u2014 including real frontend ones. I don&#8217;t have access to a live debugger (Xdebug) or a way to hook into a real production HTTP request&#8217;s execution to see whether something removes this specific action after registration, or whether <code>instantiate_classes()<\/code>\/<code>hooks()<\/code> is for some reason skipped entirely on real frontend dispatch versus the WP-CLI context. That&#8217;s the piece I need your help with.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Happy to provide a full <code>debug.log<\/code> with <code>WP_DEBUG<\/code> temporarily enabled, or run any diagnostic snippet you&#8217;d like via WP-CLI if that&#8217;s faster than a support back-and-forth.<\/p>\n","protected":false},"template":"","class_list":["post-19018812","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19018812","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19018812\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19018812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}