diff --git a/includes/Frontend/CookieNotice.php b/includes/Frontend/CookieNotice.php
index 6d54ddc..0448402 100644
--- a/includes/Frontend/CookieNotice.php
+++ b/includes/Frontend/CookieNotice.php
@@ -83,6 +83,7 @@ public function __construct() {
add_action( 'wp_footer', array( $this, 'render_banner' ) );
add_filter( 'script_loader_tag', array( $this, 'gate_analytics_scripts' ), 10, 2 );
add_filter( 'gtm4wp_consent_mode_default_enabled', array( $this, 'filter_gtm4wp_consent_default' ) );
+ add_filter( 'rocket_delay_js_exclusions', array( $this, 'exclude_from_wp_rocket_delay_js' ) );
}
// The endpoints must stay available for logged-out and logged-in visitors alike.
@@ -181,6 +182,32 @@ public function gate_analytics_scripts( $tag, $handle ) {
return preg_replace( '/^', $patterns ) );
+ $this->assertFalse( $this->is_excluded( '', $patterns ) );
+ }
+
+ /**
+ * Print every script FrontConsent outputs on a frontend page.
+ *
+ * @return string
+ */
+ private function render_frontconsent_scripts() {
+ ob_start();
+ $this->cookie_notice->render_consent_mode_default();
+ $this->cookie_notice->render_consent_bootstrap_script();
+ $this->cookie_notice->enqueue_assets();
+ wp_print_scripts( 'frontconsent-cookie-notice' );
+ return ob_get_clean();
+ }
+
+ /**
+ * Extract the