=== CookieFácil — LGPD Cookie Consent ===
Contributors: pagopagotec
Tags: lgpd, cookie consent, google consent mode, cookies, privacy
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

LGPD-compliant cookie consent banner for WordPress. Blocks tracking scripts before consent, supports Google Consent Mode v2, and logs every consent choice.

== Description ==

CookieFácil makes LGPD compliance straightforward for WordPress sites. Install the plugin, connect your free account, and your cookie consent banner is live in minutes — no coding required.

**Script blocking that actually works**

Most cookie plugins show a banner but still let Google Analytics, Meta Pixel, and other tracking scripts run immediately on page load. CookieFácil intercepts 40+ known tracking scripts and blocks them until the visitor gives explicit consent — as required by LGPD Article 7 and GDPR Article 6.

**Google Consent Mode v2 built in**

Google requires Consent Mode v2 for all sites using Google Ads or GA4. CookieFácil automatically sends the correct consent signals (`ad_storage`, `analytics_storage`, `ad_user_data`, `ad_personalization`) before any Google tag fires — so you keep Analytics modeling even for users who decline.

**Consent logs for audit defense**

Every consent choice is logged with a timestamp, banner version, and anonymized identifier — no personal data stored. Export your logs as CSV for ANPD audit defense or client reporting.

= Features =

* LGPD-compliant opt-in consent banner
* Blocks 40+ tracking scripts before consent (GA4, Meta Pixel, Hotjar, TikTok, and more)
* Google Consent Mode v2 with correct default and update states
* Consent log with exportable CSV
* Banner customizer — colors, position, layout, and texts via your SaaS dashboard
* WhatsApp widget blocking (optional)
* Test mode for administrators
* Works with page caching plugins (WP Super Cache, W3 Total Cache, LiteSpeed Cache)
* Lightweight — ~17KB banner JS, no jQuery required
* GDPR and CCPA compatible

= How It Works =

1. Create a free account at [cookiefacil.com.br](https://cookiefacil.com.br)
2. Register your site and copy your API Key and Site ID
3. Install this plugin, paste your credentials in Settings → CookieFacil
4. Your consent banner goes live automatically

The banner is served from CookieFácil's CDN and configured through the SaaS dashboard. Script blocking, consent logging, and analytics are handled by the SaaS backend.

= External Service =

This plugin connects to **cookiefacil.com.br**, a SaaS service operated by PagoPagoTec, to:

* Load the cookie consent banner JavaScript from `cdn.cookiefacil.com.br`
* Validate your API Key and Site ID
* Store consent logs (no PII — only hashed identifiers, timestamps, and consent choices)
* Retrieve banner configuration, analytics, and billing information

**Data transmitted to cookiefacil.com.br:**

* Your Site ID (to identify the site making the request)
* Visitor consent choices (accept all / reject all / custom) with category selections
* Timestamp and banner version at time of consent
* Anonymized session identifier (raw IP addresses are never stored — hashed with SHA-256)

No personal data (names, email addresses, raw IP addresses) is stored in consent logs.

* Privacy policy: https://cookiefacil.com.br/politica-de-privacidade
* Terms of service: https://cookiefacil.com.br/termos-de-uso

By using this plugin, you agree to the CookieFácil Terms of Service and Privacy Policy.

= LGPD Compliance Disclaimer =

This plugin assists with LGPD cookie consent management but does not replace legal counsel. Consult a qualified attorney or Data Protection Officer (DPO) for a complete LGPD compliance assessment specific to your organization.

= Privacy =

* Consent logs store only a hashed visitor identifier (SHA-256), timestamp, consent choices, and banner version — no personal data
* No data is collected from the WordPress admin area
* The "Protegido por CookieFácil" credit link is optional and can be enabled or disabled in Settings

== Installation ==

= Automatic installation =

1. Go to **Plugins → Add New** in your WordPress admin
2. Search for "CookieFacil"
3. Click **Install Now**, then **Activate**
4. Go to **CookieFacil → Settings** and enter your API Key and Site ID

= Manual installation =

1. Download the plugin zip file
2. Go to **Plugins → Add New → Upload Plugin**
3. Upload the zip file and click **Install Now**
4. Activate the plugin
5. Go to **CookieFacil → Settings** and enter your API Key and Site ID

= After activation =

1. Create a free account at [cookiefacil.com.br](https://cookiefacil.com.br)
2. Register your site to get your Site ID
3. Generate an API Key in your account settings
4. Paste both values in **CookieFacil → Settings**

== Frequently Asked Questions ==

= Do I need to create an account? =

Yes. CookieFácil is a SaaS service — the plugin connects to cookiefacil.com.br to load your banner and store consent logs. A free plan is available with no credit card required.

= Is there a free plan? =

Yes. The free plan supports 1 site with up to 2,000 visitors per month. No credit card required. Sign up at [cookiefacil.com.br](https://cookiefacil.com.br).

= Does this plugin make my site LGPD compliant? =

This plugin helps you collect and manage cookie consent as required by the LGPD. However, full LGPD compliance also requires a privacy policy, proper data handling practices, and — in some cases — a Data Protection Officer. We recommend consulting a qualified attorney for a complete assessment. This plugin assists compliance; it does not guarantee it.

= Does it work with Google Analytics 4? =

Yes. The plugin blocks GA4 tracking scripts until analytics consent is granted, and automatically sends Google Consent Mode v2 signals so GA4 can use modeled data for visitors who decline.

= Does it work with caching plugins? =

Yes. The plugin is compatible with WP Super Cache, W3 Total Cache, LiteSpeed Cache, and Cloudflare. The consent banner is served via CDN and loaded asynchronously — it does not interfere with cached pages.

= Will this slow down my site? =

No. The banner JavaScript is approximately 17KB (minified and compressed), loaded asynchronously, and served from a global CDN. It adds no jQuery or heavy frameworks to your site.

= Can I customize the banner? =

Yes. Log in to your CookieFácil dashboard at cookiefacil.com.br to customize banner colors, position (bottom-left, bottom-right, bottom bar, center modal), button texts, and cookie categories.

= Is consent data stored in Brazil? =

Yes. Consent logs are stored on servers located in São Paulo, Brazil (Hostinger VPS), satisfying LGPD data residency requirements.

= What scripts does the plugin block? =

The plugin identifies and blocks 40+ known tracking scripts, including: Google Analytics 4, Google Ads, Google Tag Manager, Meta Pixel, Hotjar, TikTok Pixel, LinkedIn Insight Tag, Microsoft Clarity, HubSpot, Intercom, and more.

= Can I use this on multiple sites? =

Yes. Paid plans support multiple sites under a single account. The free plan supports 1 site.

= Where do I find my API Key and Site ID? =

Log in to [cookiefacil.com.br](https://cookiefacil.com.br), go to Settings for your API Key, and go to Sites for your Site ID (format: `cf_XXXXXXXX`).

= What happens if a visitor does not interact with the banner? =

No non-essential scripts are loaded until the visitor makes an explicit choice. The banner remains visible until a choice is made. Consent is not assumed from inaction.

== Screenshots ==

1. CookieFácil SaaS dashboard — visitor and consent overview
2. Banner customizer — colors, position, and layout
3. Consent log — timestamped records ready for audit defense
4. Cookie consent banner on a live site
5. Cookie preference center — granular category controls

== Changelog ==

= 1.0.0 =
* Initial release
* LGPD-compliant opt-in cookie consent banner
* Google Consent Mode v2 support with correct default and update states
* Automatic script blocking (40+ scripts and trackers)
* Consent logging with CSV export for audit defense
* Banner customizer (colors, position, layout, texts) via SaaS dashboard
* WhatsApp widget blocking (optional)
* Test mode for administrators
* Compatible with major caching plugins

== Upgrade Notice ==

= 1.0.0 =
Initial release.
