Feat/script Blocker#31
Merged
Merged
Conversation
…gory - Add script_loader_tag filter to block sourcebuster-js, wc-order-attribution, and wp_slimstat until analytics consent is given (type=text/plain + data-category attribute; vanilla-cookieconsent re-enables on accept) - Move sbjs_* autoClear from necessary to analytics — these are WooCommerce traffic-source tracking cookies, not essential cookies; placing them in necessary meant they could never be cleared on rejection - Expose warder_blocked_scripts filter for site-specific overrides
Documents the cookies that are genuinely essential so they appear correctly in the admin cookie table and are never auto-cleared: - cc_cookie (consent record) - wordpress_logged_in_*, wordpress_sec_*, wordpress_test_cookie (auth) - wp-settings-* (admin bar / customizer state) - wp_woocommerce_session_*, woocommerce_cart_hash, woocommerce_items_in_cart, woocommerce_recently_viewed (cart/session) - PHPSESSID (PHP session)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This release (v2.1.0) strengthens the plugin's out-of-the-box cookie handling by expanding the necessary cookie defaults and improving analytics script blocking behavior. The necessary category now ships with a comprehensive set of WordPress core and WooCommerce cookies pre-configured, reducing manual setup for the most common WordPress deployments. Analytics script blocking has been tightened so scripts are suppressed before consent is granted, and the
sbjs_*(SourceBuster.js) cookies have been moved from necessary to the analytics category, where they belong semantically. Version metadata has been updated across all canonical locations: the plugin header,WARDER_VERSIONconstant,package.json,readme.txt, andCHANGELOG.md.Cookie Defaults and Categorization:
inc/defaults.phpnow includes WordPress core cookies (wordpress_*,wp-settings-*,comment_author_*) and WooCommerce cookies (woocommerce_*,wc_*) in the necessary category defaults, eliminating manual configuration for standard WordPress and WooCommerce sites.sbjs_*cookies have been relocated from the necessary category to the analytics category, correcting a semantic misclassification since these cookies are used for traffic source attribution rather than core site functionality.Script Blocking and Frontend Behavior:
inc/frontend.phphas been updated to ensure analytics scripts are blocked prior to consent being recorded, closing a gap where scripts could execute before the user's preference was captured.page_scriptssetting and the vanilla-cookieconsent library's category-based blocking mechanism.Versioning and Release Metadata:
Version:header andWARDER_VERSIONconstant inwarder-cookie-consent.php,package.json,readme.txt(stable tag, changelog, and upgrade notice), andCHANGELOG.md.Files Changed:
CHANGELOG.md(Modified)inc/defaults.php(Modified)inc/frontend.php(Modified)package.json(Modified)readme.txt(Modified)warder-cookie-consent.php(Modified)