=== LP-CC Consent ===
Contributors: YOUR_WORDPRESS_ORG_USERNAME, freemius
Tags: cookie consent, gdpr, cookie banner, consent banner, privacy
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.7.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Lean cookie consent for WordPress. Blocks tracking scripts and embeds until visitors agree. Works behind page caches.

== Description ==

LP-CC Consent shows a consent banner and keeps scripts and embeds blocked until the visitor agrees. It stays small on purpose: no TCF, no Google Consent Mode, no cookie scanner.

**Cache friendly.** The page HTML is identical for every visitor. The decision happens in the browser, so the plugin works behind page caches and CDNs.

**What the free version does**

* Opt-in banner for all visitors with the categories Statistics and Marketing
* Google Analytics 4: enter the ID, the plugin loads the code only after consent. Pro adds Meta Pixel and Microsoft Clarity
* Up to three custom scripts, blocked until consent
* Two-click placeholders for embeds that you mark by hand (`data-src` and `data-lpcc`)
* Banner colors and position
* Consent log as proof of consent (random ID, no IP address). It runs by default, because you must be able to prove consent. The admin screen shows a table and lets you delete a consent ID
* Link or menu item to reopen the settings and withdraw consent
* Banner texts in English and German, further languages by adding a file. The language comes from Polylang, WPML or TranslatePress, otherwise from the site language
* Admin screens in English and German, translatable
* No tracking pixel fallback for visitors without JavaScript, because it would bypass the consent

**What Pro adds**

* Geo split: visitors from EU, EEA, UK and Switzerland always see the opt-in banner
* Choose for all other countries: opt-in banner (default) or opt-out without a banner, with a "Do not sell or share my personal information" link. Opt-out needs your confirmation that you bear the legal responsibility. The plugin provides the function and makes no promise of legal compliance
* Global Privacy Control: with opt-out, a visitor whose browser sends GPC keeps statistics and marketing off
* Editable list of countries with opt-in
* Automatic blocking of third-party iframes, such as YouTube or Google Maps
* Up to 20 custom scripts
* Logo, font, corner radius and width of the banner
* Banner texts in the settings
* Cookie lifetime and a button to reset all consents
* Log dashboard: search by consent ID, filters, key figures, CSV export, history per consent ID, adjustable retention
* Updates and email support

Pro is sold through Freemius. Without Pro, every visitor sees the opt-in banner. That is the safe default.

**No legal advice.** The plugin is a tool. It does not guarantee that your website complies with the GDPR or any other law. You stay responsible for your privacy policy, your legal basis and your settings.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install it from the Plugins screen.
2. Activate the plugin.
3. Open Settings, then LP-CC Consent. Enter your GA4 ID (Pro: also Meta Pixel ID and Microsoft Clarity Project ID) and the links to your privacy policy.
4. Add the withdraw link to your footer or menu: use the shortcode `[lpcc_settings_link]`, or give any link the CSS class `lpcc-open`.
5. Clear your page cache.

To block your own scripts, use the settings field, or mark them by hand:

`<script type="text/plain" data-lpcc="marketing">...</script>`

To block an embed behind a two-click placeholder:

`<iframe data-src="https://..." data-lpcc="marketing"></iframe>`

Categories are `statistics` and `marketing`.

== Frequently Asked Questions ==

= Does it work with page caching? =

Yes. The HTML is the same for everyone. After you change settings, clear the cache once.

= Does the plugin load Google Analytics, Meta Pixel or Clarity before consent? =

No. They stay blocked until the visitor agrees to the matching category.

= How do I let visitors change their decision? =

Use the shortcode `[lpcc_settings_link]`, the PHP function `lpcc_settings_link()`, or give any link or menu item the CSS class `lpcc-open`.

= Can I change the banner colors to match my theme? =

Yes. Set the colors in the settings, or use the CSS variables `--lpcc-bg`, `--lpcc-fg`, `--lpcc-accent` and `--lpcc-accent-fg` in your theme.

= Can I change the texts? =

Yes, with the filters `lpcc_texts` and `lpcc_texts_all`. In Pro you can also change the main texts in the settings.

= Does the plugin make my website GDPR compliant? =

No plugin can promise that. It helps you load scripts only after consent. Compliance depends on your whole website and your legal setup.

= What happens when my Pro license expires? =

The plugin falls back to the free features. Your Pro settings stay saved.

== External services ==

This plugin can connect to third-party services. Here is what happens, and when.

**Freemius (licensing, updates and opt-in).** The plugin includes the Freemius SDK. After activation it shows an opt-in screen. You can skip it. If you agree, Freemius receives basic data about your site and your user account, such as the site URL, the WordPress and PHP version, the plugin version and your name and email address. Pro licenses, updates and support run through Freemius. Terms: https://freemius.com/terms/ Privacy: https://freemius.com/privacy/

**Google Analytics 4.** Only if you enter an ID in the settings. The code loads from www.googletagmanager.com after the visitor agrees to the category you chose for it. Google: https://policies.google.com/privacy

**Meta Pixel (Pro only).** Only if you enter an ID in the settings. The code loads from connect.facebook.net after the visitor agrees to the Marketing category. Meta: https://www.facebook.com/privacy/policy/

**Microsoft Clarity (Pro only).** Only if you enter a Project ID in the settings. The code loads from www.clarity.ms after the visitor agrees to the category you chose for it. Clarity records sessions and heatmaps. Microsoft: https://privacy.microsoft.com/privacystatement

**MaxMind GeoLite2 (Pro only).** The Pro version downloads the GeoLite2 Country database from download.maxmind.com with your MaxMind account ID and license key. The lookup of a visitor's country happens on your own server. No visitor IP address is sent to MaxMind. Privacy: https://www.maxmind.com/en/privacy-policy

**Consent log (on by default).** The log stores a random consent ID, the time, the consent version and the choice in your own database. It stores no IP address and no user agent. Mention it in your privacy policy.

== Changelog ==

= 1.7.0 =
* Changed: the consent log now runs in Free as well, and the checkbox "Log consent decisions (mandatory)" is on by default. You must be able to prove consent (Art. 7(1) GDPR). The setting text says so and warns when you switch it off
* New (Free): the log is shown as a table with paging. You can delete all entries of a consent ID
* New (Pro): log dashboard with search by consent ID, filters (period, action, version, statistics, marketing), key figures (consent rate per category), CSV export and the history of a consent ID. The default period is the last 30 days
* Update: on existing sites the log is switched on, and all visitors are asked for consent once more so that every consent has a consent ID. Clear the page cache after the update
* Add a paragraph about the consent log to your privacy policy

= 1.6.1 =
* Changed (Pro): in opt-out mode visitors from the other countries see their own introduction text ("We use cookies for analytics and marketing. They are active by default. You can switch them off here at any time."). Visitors from the EU, EEA, UK and Switzerland keep the opt-in text. You can edit the new text per language under Texts

= 1.6.0 =
* New (Pro): choose what visitors from the other countries get. Opt-in banner (new default) or opt-out without a banner. Opt-out can only be saved with your confirmation that you bear the legal responsibility, and only when the geo database is loaded
* New (Pro): with opt-out, Global Privacy Control switches statistics and marketing off
* New (Pro): the footer link says "Do not sell or share my personal information" in opt-out mode
* Changed: visitors from the other countries now see the opt-in banner by default, on new and existing sites. Whoever relied on the old behavior (no banner) switches to opt-out under Geo and consent log
* Changed: the geo endpoint is only asked in opt-out mode. With opt-in there is no extra request
* Clear the page cache after switching the mode. Opt-out states from before the change no longer apply

= 1.5.0 =
* Changed: all banner buttons look the same by default. Set the color of the main button and the others follow. In the EU, accepting and rejecting must be equally easy
* New: optional different colors for single buttons, with a warning that this may not comply with the GDPR
* New: "Save selection" is its own button next to "Accept all" and "Essential only"
* New: border color for the banner and the group boxes. Each group (Essential, Statistics, Marketing) now sits in its own box
* New: the privacy policy URL can be relative, for example /datenschutz
* Changed: German banner texts use the formal "Sie"
* Changed: the settings page has tabs (Services, Custom scripts, Design, Texts, Geo and consent log, Help). Each tab saves only its own fields
* Fixed: the group selection stayed visible in themes without a rule for the hidden attribute

= 1.4.0 =
* New: multilingual banner. The language comes from Polylang, WPML or TranslatePress, otherwise from the language of the site
* New: banner texts for another language go into a file lang/banner-<code>.php, missing texts fall back to English
* Changed: the admin screens use English as source text with a German translation (text domain lpcc-consent-banner, folder languages/)
* Changed: the custom texts (Pro) are offered for every available language
* Changed: if only the German privacy policy URL is set, every language links to it (before: no link in other languages)

= 1.3.0 =
* New: choose the category (Statistics or Marketing) per service for Google Analytics 4 and Clarity
* New (Pro): Microsoft Clarity by ID
* Changed: Meta Pixel by ID is now a Pro feature
* Changed: banner texts name the active services
* Changed: withdrawing consent removes the cookies of the services
* Changed: the free version allows three custom scripts

= 1.2.0 =
* New: split into a free core and Pro
* New: banner position and colors in the settings
* New: custom scripts in the settings (free: 1, Pro: up to 20)
* New (Pro): automatic blocking of third-party iframes
* New (Pro): logo, font, corner radius, width and banner texts in the settings
* New (Pro): cookie lifetime and consent reset
* New (Pro): editable country list and behavior outside the list
* Changed: geo split and consent log are Pro features

= 1.1.0 =
* New: optional consent log (proof of consent, no IP address)

= 1.0.0 =
* First release: opt-in banner, geo split, script gating, two-click embeds, GA4

== Upgrade Notice ==

= 1.7.0 =
The consent log now runs in Free and Pro. On existing sites it is switched on and all visitors see the banner once more. Clear the page cache after the update and add a paragraph about the log to your privacy policy.

= 1.6.1 =
New introduction text for opt-out mode (Pro). Clear the page cache after the update.

= 1.6.0 =
Visitors from outside the EU, EEA, UK and Switzerland now see the opt-in banner by default. If you used the old behavior without a banner (Pro), choose opt-out again under Geo and consent log and confirm your responsibility. Clear the page cache afterwards.

= 1.2.0 =
Geo split and consent log are now part of Pro. Without a Pro license, all visitors see the opt-in banner.
