=== Faro Legal ===
Contributors: farowp
Tags: cookies, privacy policy, gdpr, lssi, spain
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 0.3.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Legal notice, privacy policy and cookie policy for Spain, plus a cookie banner that waits for consent.

== Description ==

Faro Legal is built for small businesses in Spain that need their website to be in order without hiring a developer for every change.

FaroWP is the brand behind this plugin: <a href="https://farowp.com/">farowp.com</a>.

What it does:

* **Writes the three documents** — legal notice (article 10 LSSI-CE), privacy policy (articles 13 and 14 GDPR, LOPDGDD) and cookie policy (article 22.2 LSSI-CE, AEPD criteria) — from the details you enter once: name or company name, tax ID, address, contact e-mail, phone, activity, hosting provider.
* **Shows a cookie banner** where accepting and rejecting are equally easy, nothing is pre-ticked, no analytics or marketing cookie is set before the visitor decides, and the choice can be changed at any time.
* **Keeps the evidence**: every choice is stored with its date, the categories accepted, the version of the texts and a hashed IP address. The log is paginated, can be searched by date range and filtered by category, and the CSV export respects those filters.
* **Export ready for an inspection**: one row per consent, with id, UTC and local date, whether analytics, marketing or only necessary cookies were accepted, the version of the texts, the language, the place the choice was made, the hashed IP and the browser. UTF-8 with BOM so Excel opens the accents correctly.
* **Says what it deletes**: rows older than 24 months are removed automatically and the panel tells you how many went and when.
* **Guides you the first time**: a five-step wizard opens when you activate it, asks only what the law needs and writes everything at the end. There is a help page with the shortcodes and how to hold a script until the visitor accepts.
* **Links the three documents in the footer** (configurable style and text) and offers the shortcode `[faro_legal_enlaces]` for themes with their own footer.
* **Google Consent Mode v2** (optional): Analytics and Ads start denied and only change when the visitor decides.

The texts are written in Spanish for Spanish sites and in English for English sites. The plugin does not call any third-party service, does not send data anywhere and does not add tracking of its own.

**The texts are drafts, not legal advice.** Review them with a professional before publishing: the plugin cannot know your specific processing activities.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install it from the plugins screen.
2. Activate it.
3. Go to **Faro Legal → Settings** and fill in the details of the site owner.
4. Open **Faro Legal → Documents** to see the three pages the plugin wrote.

The banner appears on the front end as soon as analytics or marketing categories are enabled.

== Frequently Asked Questions ==

= Does it block Google Analytics by itself? =

Not by magic. You mark the scripts that must wait with `type="text/plain"` and `data-faro-consent="analitica"` (or `marketing`), and the plugin activates them only when the visitor accepts that category. Scripts loaded by another plugin can be filtered with its own hooks; the PHP helper `faro_legal_tiene_consentimiento( 'analitica' )` is available for that.

= What happens if I change the texts? =

Change the *Version of the texts* field. Visitors are asked again and the log shows which version each one accepted.

= Is there a setup wizard? =

Yes. It opens by itself the first time you activate the plugin and it is always available in Faro Legal → Setup wizard. Five steps: who owns the site, hosting, cookie categories, banner and footer, and a summary with the button that publishes the three pages.

= How does a visitor change their choice later? =

There is a floating cookie button on every page (Settings → Changing the choice, you can move it to the right or hide it) and the shortcode `[faro_legal_configurar]` can be placed in the footer, the menu or the cookie policy. Both reopen the configurator with the current choice already marked. Withdrawing consent has to be as easy as giving it.

= Where is the consent log stored? =

In the site database, in its own table. Rows older than 24 months are deleted automatically. It is not sent anywhere.

= What happens to old consents? =

Rows older than 24 months are deleted automatically. When that happens the panel shows a notice with the number of rows removed and the date, with a link to hide it.

= Can I search the consent log? =

Yes. The Consents screen has a paginated list (20 rows per page), a date range (from/to) and four category filters that combine with the dates. The CSV export exports exactly what the filters show.

= How long does the choice last? =

As long as you set in Settings → Consent duration: 3, 6, 12 or 24 months. When it expires, the banner asks again.

= Does it work with Google Analytics and Google Ads? =

Yes, with Consent Mode v2 enabled: the plugin sends the default consent (everything denied) before any tag and the update when the visitor chooses. Tags loaded by GTM or another plugin then respect the signals.

= Is the banner shown when the site has no analytics or marketing cookies? =

No. With both categories disabled only strictly necessary cookies remain, and those do not need consent.

== Screenshots ==

1. Settings: the details of the site owner.
2. Documents: the three pages written by the plugin.
3. Cookie banner on the front end.
4. Consent log with the choices recorded.

== Changelog ==

= 0.2.0 =
* Setup wizard in five steps, opened on activation, and a Help page with shortcodes and script blocking.
* Link to the plugin website (farowp.com) in the panel header, in the plugin row and, optionally, in the footer.
* Consent log with date range search, category filters and pagination; inspection-ready CSV export and a notice when the retention deletes old rows.
* New panel: overview with figures, document status, consent log with filters and pagination.
* Legal links in the footer, with light/dark style, optional text and the shortcode [faro_legal_enlaces].
* Floating button to reopen the cookie settings, with its position configurable.
* Google Consent Mode v2 (default denied, updated when the visitor chooses).
* Consent duration configurable (3, 6, 12 or 24 months).
* Spanish translation completed (137 strings in the catalogue).

= 0.1.0 =
* First version: documents, banner, consent log and CSV export.
