=== Soglasno: Cookie Consent & 152-FZ ===
Contributors: prohortech
Tags: cookie, consent, 152-fz, gdpr, yandex metrika
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Cookie banner and personal data consent for Russian websites (Federal Law 152-FZ): analytics and ads start only after consent.

== Description ==

Soglasno helps a WordPress site owner in Russia handle cookies and consent to personal data processing under Federal Law No. 152-FZ "On Personal Data".

The plugin interface is in Russian.

**What it does**

* Cookie banner with three modes: consent with categories, consent (accept / reject), or notice only.
* Four categories: necessary, analytics, marketing, functional. Names and descriptions are editable.
* Analytics and advertising scripts run only after the visitor agrees to their category. Built-in setup by ID for Yandex Metrika (Webvisor, click map, accurate bounce), Top.Mail.ru, VK Ads pixel, Google Analytics 4 and Google Tag Manager.
* Auto-blocking: tracking scripts added by the theme, other plugins or pasted into the site code are found by their address and held until consent. The list is extendable.
* Withdrawing consent is as easy as giving it: a floating cookie button or a `[soglasno_settings]` link in the footer. Cookies of withdrawn categories are deleted.
* Links to your documents: pick a page of the site or paste a link to the consent document, cookie policy and privacy policy. They are used in the banner and in form checkboxes. Since 1 September 2025 consent to personal data processing must be a separate document.
* Consent checkbox (unchecked by default, required) in WordPress comments, registration and Contact Form 7.
* Compliance checklist and a home page check for trackers.
* Works with page caching: the decision is made in the browser, so the cached page is the same for everyone.
* The banner is rendered in Shadow DOM, so theme styles do not break it. Keyboard accessible, no layout shift.

**Developer API**

* JavaScript: `window.soglasno.has('analytics')`, `soglasno.open()`, events `soglasno:consent` and `soglasno:change` on `document`.
* PHP: `sglsn_has_consent( 'marketing' )` for non-cached pages; filters `sglsn/blocked_domains`, `sglsn/front_config`, `sglsn/form_checkbox`, `sglsn/settings_defaults`; action `sglsn/consent_saved`.
* Any `<script>` or `<iframe>` with `data-soglasno-category="analytics"` and `type="text/plain"` is started after consent.

**Pro version**

Soglasno Pro is a separate add-on sold on [wp-addon.ru](https://wp-addon.ru/soglasno/). It adds a consent log with statistics and proof for the regulator, consent checkboxes in Fluent Forms, WPForms, Elementor and WooCommerce, a document generator that creates the pages, your own scripts manager, an automatic cookie table, a full-site scanner, embed blocking and an advanced banner designer. The free version is fully functional without it.

**Important**

The plugin provides tools, not legal advice. Review your documents with a lawyer for your business.

== Installation ==

1. Install the plugin from the WordPress plugin directory or upload the ZIP in "Plugins → Add New".
2. Activate it. The setup wizard opens automatically.
3. Enter the operator details, check the counters found on your home page, pick the banner look and add links to your documents.
4. Open your site in a private window to see the banner as a new visitor.
5. All settings are in "WP-ADDON → Согласие 152-ФЗ" in the admin menu.

== Frequently Asked Questions ==

= Yandex Metrika is already added by my theme. Do I need to remove it? =

No. Keep "Auto-blocking" on: the plugin finds the Metrika code by its address and starts it after consent. Use "Check home page" on the "Counters and scripts" tab to confirm.

= Does the plugin work with caching plugins? =

Yes. The page is the same for every visitor; the banner and script start are decided in the browser. After changing settings, clear the page cache.

= Where is the visitor's choice stored? =

In the `soglasno_consent` cookie in the visitor's browser: settings version, chosen categories, date and a random ID. It contains no personal data.

== External services ==

The plugin itself does not send data to external services.

When the site administrator enters a counter ID or enables a service, the plugin adds that service's official code to the site pages. The code is loaded from the service only after the visitor agrees to the service's cookie category. The service then receives the visitor's page address, browser and device data and sets its cookies, according to its own terms:

* Yandex Metrika (mc.yandex.ru) — web analytics. [Terms](https://yandex.ru/legal/metrica_termsofuse/), [Privacy policy](https://yandex.ru/legal/confidential/).
* Top.Mail.ru and VK Ads pixel (top-fwz1.mail.ru) — web analytics and ad measurement. [Terms](https://help.mail.ru/top/legal/terms), [Privacy policy](https://vk.company/ru/company/privacy/).
* Google Analytics 4 and Google Tag Manager (googletagmanager.com) — web analytics and tag management. [Terms](https://marketingplatform.google.com/about/analytics/terms/us/), [Privacy policy](https://policies.google.com/privacy).

== Screenshots ==

1. Compliance checklist.
2. Banner designer with live preview.
3. Counters and auto-blocking.
4. Consent checkbox in forms.

== Changelog ==

= 1.0.2 =
* Code cleanup after Plugin Check: the WP-ADDON menu no longer uses shared hooks.

= 1.0.1 =
* The plugin page moved to the shared WP-ADDON admin menu together with other wp-addon.ru plugins.

= 1.0.0 =
* First release.
