| 开发者 |
rhand
gbogdan |
|---|---|
| 更新时间 | 2026年8月31日 10:03 |
| 捐献地址: | 去捐款 |
| PHP版本: | 8.0 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
type="text/plain" before the browser can run them, rather than being cleaned up afterwards.data-category, or register through a filtercc_cookie, wordpress_logged_in_*, wordpress_sec_*, wordpress_test_cookie, wp-settings-*, wp_woocommerce_session_*, woocommerce_cart_hash, woocommerce_items_in_cart, woocommerce_recently_viewed, PHPSESSID.
Performance and Analytics, off until accepted: Google Analytics (_ga*, _gid, _gat), Matomo (_pk_*, mtm_*) and SourceBuster (sbjs_*).
What it does not do
Stated plainly, so you can rule it out in thirty seconds rather than after installing:
cc_cookie. Nothing is written to your database, so there is no proof-of-consent export.<script type="text/plain" data-category="analytics" src="..."></script>
Or block a script that another plugin registered, by handle:
add_filter( 'warder_blocked_scripts', function ( $scripts ) { $scripts['my-analytics-handle'] = 'analytics'; return $scripts; } );
/wp-content/plugins/ and activate it there.data-category="analytics".No plugin can promise that. This one gives you the parts a consent flow needs — scripts held until consent, categories the visitor chooses individually, and a way to change that choice later. Compliance still depends on configuring it for what your site actually loads, and on the rest of your privacy practices.
It clears Google Analytics cookies, and it will hold the GA script if that script carries data-category="analytics" or if you register its handle through the warder_blocked_scripts filter. If you load GA through another plugin, add that plugin's script handle to the filter — see the developer section above. Only WooCommerce order attribution and SourceBuster are blocked automatically.
You can hold the GTM container itself the same way, with data-category on the snippet. The plugin does not emit Google Consent Mode v2 signals, so if your setup depends on those, this is not the right plugin for you.
No. It makes no external HTTP requests at all. The consent script is served from your own domain, and the visitor's choice is stored in their browser in the cc_cookie cookie. Nothing is transmitted to us or to anyone else.
Not on the server. The record lives in the visitor's own browser. If you need an auditable, exportable consent log stored in your database, use a plugin built for that.
The frontend is a single script, loaded deferred, about 18KB gzipped, plus a small inline stylesheet for the floating button. There are no external requests and no jQuery dependency.
Yes. Pick English, Dutch, German, French, Spanish or Italian under Settings > Warder Consent and the interface strings — "Manage preferences", "Accept current selection", the close label and so on — follow. The text you write yourself, such as the banner title, description, button labels and category names, is stored as you type it, so you write that part in your own language.
Yes. Settings are versioned with a timestamp that becomes part of the script URL, so a cached page always pulls the matching configuration.
Settings > Warder Consent, then "Add New Category" at the bottom of the page. Each category gets its own title, description and cookie list, and appears as a toggle in the preferences modal.
WordPress and WooCommerce session cookies are marked strictly necessary, and Google Analytics, Matomo and SourceBuster cookies sit in an analytics category that is off until accepted. The full list is in the description above, and all of it is editable.
Yes. The floating cookie button reopens the preferences modal at any time, and you can put it in any of the four corners or turn it off.
path set, so the library's own default (/) sent it on every subdirectory. It is now scoped to the current subsite's own path (still / on a normal single-site install, so single-site behaviour is unchanged).src/index.js set the banner language from the settings but only ever defined English strings, and the library throws from run() when the selected language has no translation. Because run() is async, that rejection escaped the surrounding try/catch and surfaced as an unhandled promise rejection with no banner on the page. Reproduced in a browser before and after the fix.console.log calls that shipped in the production bundle and ran for every visitor, including a dump of the plugin settings and the final consent configuration. Genuine error reporting is kept and now carries a "Warder Cookie Consent:" prefix.CookieConsent.run() is awaited properly, so an initialisation failure is reported to the console instead of becoming a silent unhandled rejection.data-category and the warder_blocked_scripts filter, and an explicit "What it does not do" list — no consent log, no Consent Mode v2, no cookie scanner, no CCPA flow — so the plugin can be ruled in or out before installing.cookie banner, cookie consent, consent management).== Source Code == moved below the changelog. The directory concatenates unrecognised sections into the Details tab in file order, so keeping it directly under the feature list put build instructions ahead of the description for every visitor.Tested up to.padding: 0 to .warder-preferences-toggle to prevent Astra Pro theme button styles (padding: 15px 30px) from distorting the floating toggle button and hiding its icon.dist/cookieconsent.bundle.js now begins with a comment banner (via webpack BannerPlugin) pointing to the uncompressed source and the public repository, so the source location is visible from within the compiled file itself. Comment extraction to a separate .LICENSE.txt is disabled so the banner stays inline.== Source Code == section higher in readme.txt (directly after the feature list) so the human-readable source reference is easy to find. No functional changes.CONTRIBUTING.md at the repository root with build-from-source, development setup, dependencies, and contribution guidelines.CONTRIBUTING.md, leaving a short "Contributing" pointer; renumbered the Composer install method.wp_slimstat from the default warder_blocked_scripts list — Slimstat is not bundled with WordPress or WooCommerce, so blocking it by default was dead code for most sites. Add it back via the warder_blocked_scripts filter if needed.sbjs_*); added common warder_blocked_scripts examples for Slimstat and MonsterInsights.warder_block_script_until_consent() — rewrites known analytics/marketing script tags to type="text/plain" data-category="<category>" so they are held by vanilla-cookieconsent until the user accepts the matching category. Covers sourcebuster-js (SourceBuster.js), wc-order-attribution (WooCommerce order attribution), and wp_slimstat (Slimstat Analytics) out of the box. Extend or replace the list with the warder_blocked_scripts filter.necessary category cookie defaults to cover the full WordPress and WooCommerce session surface: cc_cookie, wordpress_logged_in_*, wordpress_sec_*, wordpress_test_cookie, wp-settings-*, wp_woocommerce_session_*, woocommerce_cart_hash, woocommerce_items_in_cart, woocommerce_recently_viewed, PHPSESSID. Existing installs are unaffected (defaults only apply to new installs or when the necessary category has no cookies configured).sbjs_* (SourceBuster.js attribution cookies) moved from the necessary category to analytics in the default configuration — they are set by an optional tracking script, not by WordPress core.$_POST['warder_options'] array through a dedicated recursive sanitizer (warder_sanitize_options_input) before validation, instead of relying on a phpcs:ignore suppression. Description fields keep safe post HTML (wp_kses_post); all other fields are treated as plain text.wp_die() on a failed check.warder_validate_options() now guards every field with isset() (no PHP warnings on partial submissions under WP_DEBUG) and constrains current_lang to the supported language whitelist.wp_strip_all_tags() wrapper around the static preferences-toggle CSS (it is an HTML helper, not a CSS escaper).warder_allowed_languages(), warder_allowed_toggle_positions()) used by both validation and the admin dropdowns, instead of being hand-copied across three files. No change to available options or behaviour.warder_render_category_title_field()) that was dead code.src/index.js, webpack.config.js) and in the public GitHub repository.phpcs.xml now lints the inc/ directory (previously only the main file was scanned).inc/ — defaults.php, settings.php, ajax.php, admin.php, frontend.php. Main plugin file is now 26 lines (header, constants, requires). No behaviour changes.?warder_notice=saved after the redirect):not([form]) selectors and JS DOM repositioning that were workarounds for the old nested-form layoutform attribute/^_pk_/ and /^mtm_/) to the default analytics category, so new installs manage Matomo cookies out of the box alongside Google Analytics. Existing sites can add the same patterns under Settings > Cookie Consentregister_setting() updated to array format with explicit sanitize_callback key as required by WordPress.org guidelinesprivacy_policy_url now sanitized with esc_url_raw() instead of sanitize_text_field() for proper URL sanitization.distignore updated to include src/, webpack.config.js, and package.json in the WordPress.org build so the human-readable source is available to reviewers (guideline §4)warder_handle_admin_actions(), each with nonce verification and input sanitizationRequires at least and Requires PHP headers to the main plugin fileesc_html_e, esc_attr_e, esc_html__, esc_js) so admin UI text is translatable and escaped on output<script> to wp_add_inline_script() via admin_enqueue_scripts hookwp_strip_all_tags() before passing to wp_add_inline_style()== Source Code & Build Process == section to readme.txt documenting webpack build and GitHub source linkrhand