=== 152on ===
Contributors: topyr
Tags: cookie banner, cookie consent, 152-fz, personal data, consent log
Requires at least: 5.0
Tested up to: 7.1
Requires PHP: 7.0
Stable tag: 1.0.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Cookie banner, trackers blocked until consent, consent checkbox in forms and a tamper-evident consent log under Russian law 152-FZ.

== Description ==

152on helps Russian website owners comply with Federal Law 152-FZ «On personal data». This plugin connects a WordPress site to the 152on service. Enter your site key once — everything else works automatically:

* a cookie banner with equal «Accept» and «Reject» buttons and category settings;
* Yandex Metrica, Google Analytics, VK, Top.Mail.Ru, Meta and other trackers stay blocked until the visitor agrees — no matter how they were added (theme, another plugin, Google Tag Manager);
* an empty consent checkbox with a link to the consent text is added to every form that collects a phone number or e-mail (Contact Form 7, WPForms, Elementor, WooCommerce checkout and others);
* embedded YouTube, RUTUBE, VK Video and maps show a «Allow and show» placeholder until consent;
* every choice is written to a consent log stored in Russia, protected by a hash chain;
* a small «Cookie settings» button lets visitors change or withdraw consent at any time.

**Why a plugin and not just a line of code.** The tag must run before any analytics script. Caching and optimization plugins often defer, combine or move scripts, and the tag ends up after the trackers. The plugin prints the tag first in `<head>` and excludes it from WP Rocket, Autoptimize, LiteSpeed Cache, SiteGround Optimizer, WP-Optimize and Cloudflare Rocket Loader optimizations.

The plugin itself stores only your site key. A 152on account is required: https://152on.ru — the first 7 days are free.

== External services ==

This plugin connects to the 152on service (https://152on.ru), operated in Russia. It is required for the plugin to work.

* **What is loaded.** On every page of your site the visitor's browser loads the 152on tag from `https://152on.ru/t/<your site key>.js`. The request contains the usual browser data (IP address, user agent, page address as referrer).
* **What is sent.** When a visitor makes a choice in the banner or ticks the consent checkbox in a form, the tag sends to `https://152on.ru/api/consent/events`: a random visitor ID, the choice and categories, the page address without parameters, the version of the consent text; for forms — the phone number or e-mail, which the server immediately turns into a keyed hash and does not store. The IP address is stored with the last octet removed. Once a day per page the tag also reports its position on the page (key, page address) so the dashboard can tell if it is installed correctly.
* **Why.** To block trackers until consent and to keep evidence of consent, as required by 152-FZ (Article 9, part 3). The site owner is the personal data operator; 152on processes the data on the owner's behalf.

Terms of service: https://152on.ru/offer
Privacy policy: https://152on.ru/privacy

== Installation ==

1. Install and activate the plugin.
2. Add your site in the 152on dashboard at https://152on.ru/app and copy the line of code.
3. Go to Settings → 152on, paste the line (or just the site key) and save.
4. Click «Open the site and check». If a caching plugin is used, clear its cache.

== Frequently Asked Questions ==

= Do I need to remove Yandex Metrica or other counters from the theme? =

No. Leave them as they are: the tag keeps them switched off until the visitor clicks «Accept».

= A form should not get the consent checkbox (search, login). =

Add the `data-152on-skip` attribute to the form or to a block around it.

= How do I add a «Cookie settings» link to the footer? =

Use the `[152on_settings]` shortcode.

= Does the plugin work without a 152on account? =

No, the banner, blocking and consent log are provided by the 152on service.

== Screenshots ==

1. Settings → 152on: paste the line of code or the site key.

== Changelog ==

= 1.0.3 =
* The tag is put first in the copy of the page that cache plugins (WP-Optimize, WP Rocket, W3 Total Cache, WP Super Cache, LiteSpeed Cache) save, not only in the page sent to the first visitor.

= 1.0.2 =
* The page cache of WP Rocket, WP-Optimize, W3 Total Cache, WP Super Cache, SiteGround Optimizer, Autoptimize and LiteSpeed Cache is purged when the plugin is activated, updated or the site key is saved, so visitors do not get old copies of pages without the tag.

= 1.0.1 =
* The tag stays first in `<head>` even when another plugin (for example, a slider) inserts its scripts or styles at the top of the page.

= 1.0.0 =
* First release: site key setting, tag first in `<head>`, exclusions for caching and optimization plugins, «Cookie settings» shortcode.
