=== Legal Banner - Cookie Consent & Privacy ===
Contributors: sodasoftllc
Tags: cookie consent, cookie banner, gdpr, ccpa, privacy policy
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.4.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add your Legal Banner cookie consent banner to WordPress in one click. The banner, cookie scans and policies are managed in Legal Banner.

== Description ==

This plugin connects your WordPress site to [Legal Banner](https://legalbanner.com), a cookie consent service, and shows your banner on your site. Click **Connect**, sign in or create a free account, confirm, and you are done: the banner is live and your site is scanned for cookies.

= What the plugin does =

* Shows your Legal Banner cookie banner on every public page, loaded first in the page so it can hold analytics and advertising scripts until the visitor consents.
* Shows whether the banner is live, the consent rules that apply and your published policies, without leaving WordPress.
* Lets visitors change their choice later with a "Cookie settings" button: the `[legalbanner_preferences]` shortcode or the "Cookie settings button" block.
* Links or embeds your privacy, cookie and other policies with `[legalbanner_policy]`, and can create a WordPress page for each published policy in one click.
* Lets you hide the banner on specific pages, post types or for logged-in users.
* Includes diagnostics under **Tools, Legal Banner** and a debug report you can copy.
* Works on multisite: each site connects on its own, and the network administrator has an overview and a switch that pauses the banner on every site.

= What it does not do =

* Banner design, consent rules, cookie scanning and policy writing happen in your Legal Banner account, not in WordPress.
* It adds no "powered by" link to your site.
* It does not track you or your visitors, and has no usage statistics.
* It does not give legal advice. You decide what your site needs.

= External service =

This plugin relies on Legal Banner, a service operated by Sodasoft LLC. It does nothing until you connect it.

* **When you connect:** your site address, WordPress version and plugin version are sent to legalbanner.com so the site can be added to your account. You confirm this on legalbanner.com.
* **Once a day:** the plugin tells Legal Banner it is still installed (Site ID and plugin version only).
* **When you open the plugin's settings:** it reads your site's status, consent rules and published policy list from legalbanner.com. The answer is cached for 12 hours.
* **On every page your visitors view:** their browser loads the banner script and the banner's settings from legalbanner.com, and records the visitor's consent choice there, as your consent log. This is the service the plugin exists to provide.
* **Only if you choose to embed policy text:** the policy text is fetched from legalbanner.com and cached for 12 hours.
* **Only when you click "Run checks" under Tools:** the plugin requests the banner script, its settings and your own homepage to check they load.

Legal Banner [Terms of Service](https://legalbanner.com/terms) and [Privacy Policy](https://legalbanner.com/privacy).

== Installation ==

1. In WordPress, go to **Plugins, Add New, Upload Plugin**, choose the ZIP and click **Install Now**, then **Activate**. Once the plugin is listed on WordPress.org you can also search for "Legal Banner" there.
2. Go to **Settings, Legal Banner** and click **Connect to Legal Banner**.
3. Sign in, or create a free account, and confirm. You come back to WordPress with the banner live.

If your server blocks the redirect, use **Other ways to connect**: paste a connect code from **Integrations** in Legal Banner, or your Site ID.

== Frequently Asked Questions ==

= Do I need a Legal Banner account? =

Yes. The plugin connects WordPress to Legal Banner. A free account is enough to start; you create it while connecting.

= Will it slow my site down? =

The banner script is about 14 KB compressed and served from a CDN. It loads first so that it can hold trackers back until consent, which is the reason to have a consent banner.

= My caching or optimisation plugin moves or delays scripts. =

Exclude `legalbanner.js` from "delay JavaScript", "defer JavaScript" and "combine JavaScript" options. **Tools, Legal Banner, Run checks** tells you if anything loads before the banner.

= How do visitors change their choice later? =

Add the "Cookie settings button" block, or the `[legalbanner_preferences]` shortcode, for example in your footer. `[legalbanner_preferences style="link" text="Cookie settings"]` shows it as a link.

= How do I show my privacy policy? =

Publish it in Legal Banner, then click **Create pages in WordPress** in the plugin settings. Each page holds a `[legalbanner_policy]` shortcode and always shows the latest published version. Use `[legalbanner_policy type="cookie"]` (or privacy, terms, refund, disclaimer) anywhere else.

= What if Legal Banner is unavailable? =

Your site keeps working; the banner does not appear until the service is back. You can hide the banner at any time with **Hide the banner**.

= Does it work on multisite? =

Yes. Activate it per site or for the whole network. Each site connects to its own Legal Banner site. Network administrators find an overview and an emergency switch under **Network Admin, Settings, Legal Banner**.

= What happens when I delete the plugin? =

All of its settings and cached data are removed from every site. Pages it created for your policies stay, because you may have edited them.

== Screenshots ==

1. Not connected yet: one button to connect, and what connecting shares.
2. Connected: banner status, consent rules and policy pages at a glance.
3. Advanced settings: where the banner shows and how it loads.
4. Diagnostics under Tools, with a copyable debug report.

== Changelog ==

= 1.4.0 =
* Changed: the banner now loads first in the page and synchronously, so it can hold analytics and advertising scripts until the visitor consents. Sites that used the old default (deferred) are moved to the new one; an explicit async setting is kept.
* New: settings screen rebuilt around one action at a time: connect, then see whether the banner is live, the consent rules that apply, and your published policies.
* New: `[legalbanner_preferences]` shortcode and "Cookie settings button" block, so visitors can change or withdraw consent.
* New: `[legalbanner_policy]` shortcode (link or embedded text) and one-click creation of WordPress pages for published policies, optionally kept out of search results.
* New: hide the banner on chosen post types, paths or for logged-in users.
* New: Tools, Legal Banner: checks that the banner loads and is first on your homepage, and a copyable debug report.
* New: multisite network overview and an emergency switch that pauses the banner on every site.
* New: clear notice instead of an error on PHP or WordPress versions below the minimum.
* Changed: "Disable for admins" is now "Hide it from administrators"; existing settings carry over.
* Changed: uninstall removes the plugin's data from every site of a network.
* Security: every call from the plugin to Legal Banner after connecting is authenticated with the site's own key. Sites connected with a version older than 1.1.0 are asked to connect again; the banner keeps showing meanwhile.

= 1.3.0 =
* New: one-click connect. Legal Banner finds or adds the site for this domain and sends you back with everything set up.
* Changed: connecting switches the banner on, verifies the installation and sends the first heartbeat.

= 1.2.0 =
* Fixed: the banner could fail to load in header mode.
* Fixed: the daily heartbeat was never sent.
* Added: no script in feeds or REST responses; no double printing.

= 1.1.0 =
* Per-site install token for verify and heartbeat.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.4.0 =
The banner now loads first in the page so it can hold trackers until consent. If a caching plugin delays JavaScript, exclude legalbanner.js from it.
