=== Chile Consiente ===
Contributors: asentic
Tags: consent, cookies, privacy, gdpr, consent mode
Requires at least: 6.2
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

Consent and privacy for Chilean law (Law 21.719 and 19.628), with GDPR support. Cookie banner without dark patterns and Google Consent Mode v2.

== Description ==

**Chile Consiente** is a consent and privacy compliance plugin built for Chile. Unlike European cookie plugins that are only translated, it speaks the language of Chilean **Law 21.719** and **Law 19.628**: the Personal Data Protection Agency, the data subject rights, and the December 2026 enforcement date. The plugin interface and the generated documents are in Chilean Spanish, with English available for sites that serve European visitors.

Features:

* Consent banner (accept / reject / configure) with **no dark patterns**: rejecting is as easy as accepting.
* Blocks cookies and trackers **before** consent (compatible with `wp_consent_api`, Google Site Kit and others).
* **Google Consent Mode v2** (GA4 and AdSense).
* **Auditable consent log** (controller's proof), exportable to CSV.
* **Privacy policy generator** in Chilean Spanish, ready to edit.
* **International data transfer** notice.
* **Configurable regime**: Chile (21.719 + 19.628), European Union (GDPR) or both, with texts in Spanish and English. Made for Chilean businesses that serve European customers (tourism, exporters).
* **Law 21.663 posture** (informational): security.txt, Article 8 duties checklist, and reminders of the ANCI reporting deadlines.

Works with full-page caching (WP Super Cache and similar): the state is resolved in the browser, so a cached page never exposes trackers to a visitor who has not consented. Persistence uses the REST API and falls back to admin-ajax when the REST API is restricted, with no server configuration changes required.

This plugin is a project by [Asentic](https://www.asentic.cl). It makes no undeclared external calls: all processing happens on your own site.

== Installation ==

1. Upload the `chile-consiente` folder to `/wp-content/plugins/`, or install it from Plugins > Add New and search for it by name.
2. Activate it.
3. Go to **Settings > Chile Consiente** and choose the regime (Chile, European Union or both).
4. Check the cookie categories your site uses and, if you want, generate the privacy policy page with one click.

The banner appears automatically to visitors who have not decided yet. No coding required.

== Frequently Asked Questions ==

= Does it work if I serve European customers? =
Yes. Choose the "Both" regime to cover Chilean Law 21.719 and the GDPR at the same time, with the banner and the policy in Spanish and English.

= Does it work with caching (WP Super Cache, LiteSpeed, Cloudflare)? =
Yes. Blocking is always applied in the HTML, and the browser re-enables scripts based on each visitor's actual decision, so a cached page never leaks trackers to someone who did not consent.

= What data does the consent log store? =
One row per decision with the date, the accepted categories, the policy version, and a hash (HMAC) that serves as proof. It stores no name or email: the identifier is anonymous. You can export it to CSV or clear it from the admin panel.

= Does it block Google Analytics and AdSense before consent? =
Yes, and it also enables Google Consent Mode v2, so Google receives the correct signals when the visitor accepts or rejects.

= Does it replace a security plugin? =
No. Chile Consiente focuses on consent and privacy. The Law 21.663 posture is informational; technical site hardening is handled by other tools.

= What happens if I uninstall it? =
Uninstalling removes its options and the log table. The privacy policy page you generated is kept (it is your content).

== Screenshots ==

1. Consent banner: accept, reject and configure with the same visual weight (no dark patterns).
2. "Configure" view: the visitor chooses by category; necessary cookies are always on.

== Changelog ==

= 1.0.0 =
* First public release.
* Consent banner with no dark patterns (accept / reject / configure by category).
* Tracker blocking before consent in three layers (wp_consent_api, rewriting to text/plain, and Google Consent Mode v2), compatible with full-page caching.
* Auditable consent log with an HMAC proof, exportable to CSV.
* Privacy policy generator in Chilean Spanish (aligned with 21.719 / GDPR).
* International data transfer notice and the `[chile_consiente_transferencias]` shortcode.
* Configurable regime Chile / European Union / both, with texts in Spanish and English.
* Informational Law 21.663 posture: security.txt (RFC 9116), Article 8 checklist and ANCI deadlines.
* Resilient persistence: REST API with an automatic admin-ajax fallback for sites that restrict the REST API.

== Upgrade Notice ==

= 1.0.0 =
First public release of Chile Consiente.
