=== ClearCrumb – Cookie Consent & GDPR Cookie Banner ===
Contributors: clearcrumb
Tags: cookie consent, cookie banner, gdpr, ccpa, consent mode
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Fast, accessible cookie banner with script blocking, Google Consent Mode v2, consent log, GPC and EU/US rules. No pageview limits.

== Description ==

ClearCrumb shows a fast, accessible cookie banner and stores each visitor's choice in their own browser.

https://www.youtube.com/watch?v=MPHvy_QaW3I

* Auto-blocking: your services' scripts and embeds wait for consent, even on cached pages.
* Switching? Import your settings from Complianz, CookieYes or Cookiebot.
* A two-minute setup wizard: regions, scan, services, design.
* Works with WPML, Polylang and TranslatePress.
* Banner in 16 languages (EN, DE, FR, NL, ES, IT, PT, PL, SV, DA, FI, NO, CS, RO, AR, HE), picked from your site language, right-to-left included.
* A cookie policy page that keeps itself up to date: `[clearcrumb_cookie_policy]`, in English, German, French, Dutch, Spanish and Italian.
* A cookie scanner that checks up to 50 pages and finds the services your site uses.
* A Leak Test that shows what still loads before consent.
* A Compliance Score from 0 to 100 that tells you what to fix.
* A consent checkbox for Contact Form 7 and WPForms forms.
* A consent log in your own database: proof of every choice, kept as long as you choose (30 days to forever), with hashed IDs and IPs, and a CSV export.
* Region rules: GDPR opt-in for the EU, EEA, UK and Switzerland, US opt-out with Global Privacy Control.
* Google Consent Mode v2 (basic and advanced), Microsoft UET Consent Mode, Meta Pixel and TikTok Pixel consent APIs and the WP Consent API.
* Placeholders for blocked videos and maps, with a locally stored thumbnail and a "Load video" button.
* A library of 155 common services with their cookies, so visitors see who is behind each choice.
* Four banner layouts and six design styles, with a live preview while you edit.
* Accept, Reject and Preferences with four categories: necessary, preferences, statistics and marketing.
* Reject always looks exactly like Accept. Saying no is never harder than saying yes.
* A floating "cookie settings" button and a `[clearcrumb_preferences]` shortcode, so visitors can change their mind at any time.
* Small and quick: no jQuery, no external requests, the banner script loads deferred.
* Settings export and import as a JSON file, to set up your next site in seconds.
* WP-CLI commands: `wp clearcrumb scan` and `wp clearcrumb log export`.
* A dashboard widget with this week's consent rate.
* Block-editor blocks: Cookie policy and Cookie settings link.
* Keyboard and screen-reader friendly (WCAG 2.2 AA target).

ClearCrumb helps you meet cookie rules but is not legal advice.

= For developers =

`window.ClearCrumb.get()` returns the visitor's choice (or `null`), `ClearCrumb.has( 'statistics' )` checks one category, and `ClearCrumb.open()` opens the preferences. Every saved choice fires a `clearcrumb:consent` event on `document`.

= Source code & build =

Everything ships readable. The banner scripts and styles sit next to their minified copies (`assets/js/guard.js`, `assets/js/banner.js`, `assets/css/banner.css`). The admin app's source is in `src/admin/`, with the build tools in `src/tools/`. To rebuild `assets/admin/` and the `.min` files, run this inside the plugin's `src` folder (Node.js 18 or newer):

`npm install && npm run build`

== External services ==

ClearCrumb sends nothing about your visitors anywhere. Your server contacts two services only to fetch a video thumbnail for the placeholder that replaces a blocked embed, once per video, in the background:

* **YouTube** (Google): when a page contains a blocked YouTube embed, your server downloads the video's thumbnail image from `i.ytimg.com`. Only the video ID is sent. [Terms of Service](https://www.youtube.com/t/terms) · [Privacy Policy](https://policies.google.com/privacy)
* **Vimeo**: when a page contains a blocked Vimeo embed, your server asks `vimeo.com/api/oembed.json` for the thumbnail address and downloads the image from `i.vimeocdn.com`. Only the video ID is sent. [Terms of Service](https://vimeo.com/terms) · [Privacy Policy](https://vimeo.com/privacy)

The thumbnails are stored in your uploads folder and shown from your own site, so visitors' browsers contact neither service before they consent.

== Frequently Asked Questions ==

= How do I change the banner's look? =

Pick a layout, a design style and a button colour under ClearCrumb → Banner. For anything more, add your own CSS in WordPress under Appearance → Customize → Additional CSS (or Styles → Additional CSS in the Site Editor), with selectors that start with `#clearcrumb`.

= Where is the visitor's choice stored? =

In a first-party cookie named `clearcrumb_consent` on your own domain. A copy of the choice goes to your own database as proof (the consent log), with the consent ID and IP address shortened and hashed. Nothing is sent to anyone else.

= How do I add a "Cookie settings" link to my footer? =

Add the shortcode `[clearcrumb_preferences]`, or give any link the class `clearcrumb-open-preferences`.

== Screenshots ==

1. The banner on your site: Reject is as easy as Accept, and scripts wait until the visitor chooses.
2. Dashboard: banner status, Compliance Score, visitor choices and the latest consents.
3. Banner editor with a live preview: four layouts, six styles, your button colour, region rules.
4. Services and cookies, plus Google Consent Mode v2, Microsoft UET and pixel consent signals.
5. Cookie scanner and Leak Test: see what loads before and after consent.
6. Consent log in your own database, kept as long as you choose, with CSV export.
7. Five-step setup wizard: regions, scan, services, design, done.

== Changelog ==

= 1.0.4 =
* ClearCrumb Pro is out: the Pro buttons now say "Get ClearCrumb Pro" and lead to the pricing page.

= 1.0.3 =
* New "Ask everyone again" button under Banner: every visitor chooses again after you change your services or policy.
* Keyboard focus comes back after Accept, Reject or Save (to the link or button that opened the banner, else the floating button).
* Microsoft Clarity now gets the consent signal on the first Accept and on every page for returning visitors.
* Google Maps placeholders show a drawn map instead of a plain box, still without any request to Google before consent.
* The Compliance Score counts a [clearcrumb_preferences] link, the Cookie settings block or a .clearcrumb-open-preferences link as a way to change your mind.
* Themes and page builders (Elementor kits, Hello) can no longer repaint the banner switches and buttons, also on hover.
* WP-CLI: `wp clearcrumb log export` exports every record the log keeps by default.

= 1.0.2 =
* New option under Banner → Design: show a small "Powered by ClearCrumb" line in the banner (nofollow link). Off unless you switch it on.
* The plugin author name on the Plugins screen links to clearcrumb.com/about/.
* The Sunset style is now rose pink, so it no longer looks like Paper.
* Admin dropdowns show their arrow again.
* The floating "cookie settings" button now plays the ClearCrumb logo animation every 4 seconds (off for visitors who prefer reduced motion).

= 1.0.1 =
* Consent log: you choose how long records are kept (30 days to forever, one year by default), and you can download the log as a CSV file.
* Removed the Custom CSS field. Use WordPress's own Additional CSS instead; your design settings stay as they are.
* Works on PHP 7.4 again (the cookie domain check used a PHP 8 function).
* The region check now reads only the location headers it needs, sanitized.
* The source of the admin app and the build tools now ship in `src/`.

= 1.0.0 =
* First public release.
