=== Cookietrix – Cookie Banner & Consents for 152-FZ ===
Contributors: akklex
Donate link: https://genius-bot.ru/plugins/#donat
Tags: cookie banner, gdpr, 152-fz, consent, privacy policy
Requires at least: 6.9
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Cookie banner that blocks analytics, ads and embeds until consent, policy generator and consent checkboxes in forms for Russian law 152-FZ.

== Description ==

Cookietrix helps Russian websites follow Federal Law No. 152-FZ "On Personal Data": visitors decide which cookies to allow, forms collect a separate consent to personal data processing, and the required documents are generated from your company details.

Plugin homepage with screenshots and setup steps (in Russian): [genius-bot.ru/plugins/cookietrix/](https://genius-bot.ru/plugins/cookietrix/)

= Cookie banner =

* Categories: necessary, statistics, marketing and third-party content. Visitors can accept all, keep only necessary cookies or choose categories. Both main buttons have equal weight – no dark patterns.
* **Blocks scripts until consent:** Yandex Metrica, Google Analytics and Tag Manager, Top.Mail.Ru, LiveInternet, VK and Meta pixels, Yandex and Google ads, TikTok pixel, Jivo and Bitrix24 chat widgets.
* **Blocks embeds until consent:** YouTube, Rutube, VK Video, Vimeo, Yandex Maps and Google Maps are replaced with a placeholder and an "Allow and show" button.
* Works with page caching: blocking is applied to the HTML for everyone and lifted in the browser after consent.
* A small button and the `[cookietrix_settings]` shortcode let visitors change their choice at any time.
* "Ask for consent again" after you change the documents.
* Supports the WP Consent API, so plugins that respect consent (for example, Visitrix) follow the visitor's choice.

= Documents =

* Personal data processing policy, a separate consent to processing (required by 152-FZ since September 2025) and a cookie policy, generated from your company details.
* Pages are created as drafts so you can review them before publishing. Updates keep previous versions in revisions.
* The cookie policy lists the third-party services found on your site.

= Consent checkboxes in forms =

* Comments, registration, Contact Form 7 and the WooCommerce classic checkout: a required checkbox with links to the consent and the policy is added automatically and checked on the server.
* Any other form (Elementor, WPForms, theme forms) by CSS selector.

= Site check =

* Finds third-party services on your pages, shows where their data is processed and whether they are blocked before consent.
* Checks that the documents are published, the banner and the form checkboxes are on and the site uses HTTPS.

The documents are templates for a typical website. They are not legal advice.

== External services ==

Cookietrix does not connect to any external service and does not send any data outside your site.

* The plugin contains a list of known third-party services (for example Google Analytics, Google Tag Manager, Google Maps, Meta Pixel, Yandex Metrica, YouTube). These domains are used only to recognize the scripts and embeds that your site already loads, so that Cookietrix can block them until the visitor consents. Cookietrix never loads these services itself and never sends anything to them.
* Embedded videos and maps are replaced with a placeholder; the original embed is loaded from its own service only after the visitor clicks "Allow" or accepts the matching category.
* The "Site check" tab requests pages of your own site (the home page and a few public pages) with the WordPress HTTP API to find services that load before consent. These requests go only to your own site's address.
* The visitor's choice is stored in a first-party cookie in the visitor's browser; no consent data leaves your site.

== Installation ==

1. Install and activate the plugin.
2. Open **Settings → Cookietrix → Documents**, fill in your company details and click **Create / update documents**. Review and publish the three pages.
3. Check the banner settings and the forms.
4. Open **Site check** and click **Check the site**.

== Frequently Asked Questions ==

= Does the plugin send data anywhere? =

No. Cookietrix does not connect to any external service. The site check requests only your own pages. The visitor's choice is stored in the `cookietrix` cookie in the visitor's browser.

= My analytics script is not blocked. =

Run the site check: it shows each service and whether it loads before consent. Scripts added in an unusual way (for example, inside another plugin's bundled file) cannot be detected. Developers can add services with the `cookietrix_services` filter.

= Will blocking break my site? =

Google Fonts and reCAPTCHA are reported by the site check but never blocked, because blocking them would break the design or the forms. You can turn off script or embed blocking and any category in the settings.

= Does it work with the WooCommerce block checkout? =

The block checkout does not allow plugins to add fields to the place order area yet. Set the personal data policy as the Terms and conditions page in WooCommerce settings and enable the terms checkbox there.

= Developer hooks =

* `cookietrix_services` (filter) – service catalog used for blocking and the site check.
* `cookietrix_block_page` (filter) – return false to skip blocking on a page.
* `cookietrix_scan_urls` (filter) – pages checked by the site check.
* `cookietrix:change` (JavaScript event on `document`) – fired when the visitor's choice changes.
* `window.cookietrix.has( 'statistics' )` – current consent in JavaScript.

== Screenshots ==

1. Cookie banner with categories.
2. Site check with found services.
3. Documents generated from your company details.

== Changelog ==

= 1.0.3 =
* Page rewriting uses the WordPress template enhancement output buffer (WordPress 6.9 or newer); the plugin no longer opens its own output buffer.
* Admin styles are loaded with wp_enqueue_style.
* Readme: documented that the plugin does not use external services.

= 1.0.2 =
* New: a “Donate” button on the plugin pages and a Donate link on the Plugins screen.

= 1.0.1 =
* The banner and the settings button move above fixed bars at the bottom of the screen (chat widgets, sticky panels, mobile menus) instead of covering them.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
