=== Cookiemator ===
Contributors: ramgonzalvez
Tags: cookies, gdpr, rgpd, consent, privacy
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.6

License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Advanced 2-layer GDPR/AEPD cookie consent management with preventive script blocking, Consent Mode v2, hybrid scanner, and audit logs.

== Description ==

**Cookiemator** is a lightweight, comprehensive, and self-hosted solution designed to comply with European GDPR (RGPD) and Spanish AEPD cookie guidelines in WordPress without relying on external monthly subscriptions.

= Key Features =

* **Two-Layer Compliance (AEPD & GDPR Guidelines):** Initial first-layer banner featuring "Accept all" and "Reject all" buttons with identical size, color, and visual prominence (zero dark patterns), plus a "Settings" button in third position.
* **Multi-Tab Preferences Modal (Second Layer):** Popup modal with Consent, Details, and About Cookies tabs, granular category switches, and a top-right close button (X).
* **Preventive Script & Iframe Blocking:** Automatically intercepts non-essential scripts (Analytics, advertising pixels, heatmaps) and external iframes (YouTube, Vimeo, Google Maps) until the visitor grants explicit consent.
* **Native Google Consent Mode v2:** Outputs default and updated signals (`ad_storage`, `ad_user_data`, `ad_personalization`, `analytics_storage`, and `personalization_storage`) directly in `<head>`.
* **Hybrid Cookie Catalog (Automated WP-Cron Scanner + Manual Editor):** Periodically scans your site HTML and active cookies via WP-Cron (daily, weekly, or monthly) while allowing you to manually add, edit, or remove cookies.
* **GDPR Audit Log in Database:** Records each user consent with a unique UUID and anonymized IP address, ready to export as CSV.
* **Built-in Shortcodes:** Use `[rgcookies_link]` to reopen the preferences modal from anywhere and `[rgcookies_declaration]` to display the categorized cookie declaration table on your Cookie Policy page.

= External Services =

This plugin does not send any data to external servers by itself. However, it allows the site administrator to optionally configure conditional loading (strictly after user consent) for the following third-party services:

* **Google Fonts:** If the administrator selects a Google Font (Inter, Poppins, Roboto, Montserrat) instead of inheriting the theme font, the stylesheet is loaded from `https://fonts.googleapis.com` ([Google Privacy Policy](https://policies.google.com/privacy)).
* **Google Analytics 4 / Google Tag Manager / Google Ads:** If the administrator configures their tracking IDs in the plugin settings, scripts connect to `https://www.googletagmanager.com` only after the visitor accepts the corresponding category ([Google Privacy Policy](https://policies.google.com/privacy)).
* **Meta Pixel (Facebook):** If a Pixel ID is configured, it connects to `https://connect.facebook.net` after Marketing consent is granted ([Meta Privacy Policy](https://www.facebook.com/about/privacy/)).
* **TikTok Pixel:** If a Pixel ID is configured, it connects to `https://analytics.tiktok.com` after Marketing consent is granted ([TikTok Privacy Policy](https://www.tiktok.com/legal/page/eea/privacy-policy/en)).
* **LinkedIn Insight Tag:** If a Partner ID is configured, it connects to `https://snap.licdn.com` after Marketing consent is granted ([LinkedIn Privacy Policy](https://www.linkedin.com/legal/privacy-policy)).
* **Microsoft Clarity:** If a Project ID is configured, it connects to `https://www.clarity.ms` after Analytics consent is granted ([Microsoft Privacy Statement](https://privacy.microsoft.com/en-us/privacystatement)).
* **Hotjar:** If a Site ID is configured, it connects to `https://static.hotjar.com` after Analytics consent is granted ([Hotjar Privacy Policy](https://www.hotjar.com/legal/policies/privacy/)).

== Installation ==

1. Upload the `cookiemator` folder to the `/wp-content/plugins/` directory or install it directly through the WordPress plugins screen.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Go to the **Cookiemator** menu in your WordPress admin to customize colors, logos, texts, and run the cookie scanner.

== Frequently Asked Questions ==

= How do I add a link to reopen the cookie settings panel in my footer or Cookie Policy page? =
You can insert the shortcode `[rgcookies_link text="Configure Cookies"]` or add a custom link in any WordPress menu pointing to `#cambiar-cookies`.

= How do I display the categorized cookie declaration table on my Cookie Policy page? =
Insert the shortcode `[rgcookies_declaration]` inside the content of your Cookie Policy page.

== Screenshots ==

1. Admin settings panel for design, colors, and typography customization.
2. Hybrid cookie catalog with automated periodic scanner and manual table editor.
3. GDPR consent audit log with CSV export.
4. First-layer cookie banner and second-layer preferences modal.

== Changelog ==

= 1.0.2 =
* Updated plugin name and slug for the WordPress.org submission.
* Enqueued styles and scripts and improved request and custom script handling.
* Fixed the admin menu label and tab navigation.

= 1.0.0 =
* Initial release.
