=== Simple Popups ===
Contributors: smallapis
Tags: popup, popups, exit intent, modal, popup builder
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.3.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Popup builder that loads nothing on pages without a popup. Exit-intent, scroll, timed and click popups, templates, dates. 3 popups free.

== Description ==

Most popup plugins load their whole runtime on every page and then work out that there is nothing to
show. This one decides first, in PHP, from a single stored list, and loads nothing at all on the pages
that do not need it: no CSS, no JavaScript, no database query. On the pages that do, it is about five
kilobytes with no jQuery and no framework.

= Start from a template =

Pick **Newsletter**, **Discount code**, **Announcement bar** or **Before you go** and the popup opens
with its text and sensible settings already filled in. Change the words, preview it on your site,
publish. Or start from a blank popup.

= What you can do =

* Open the popup **after a delay**, **when the visitor scrolls** past a point, **when they are about
  to leave**, **when they stop moving** for a while, or **when they click something** you point to,
  such as a button or a menu item.
* **Never show it again** to someone who clicked its button or sent its form.
* Show it **once per visit**, **once every so many days**, or **every time**.
* Show it **everywhere**, **on the home page**, **only on chosen pages**, **everywhere but chosen
  pages**, or **on chosen content types**, and on **all screens, desktop only or mobile only**.
* Show it to **everyone**, only to **visitors who are not signed in**, or only to **signed-in users**.
* Give it **a start date and an end date**, for a sale or an event, and it switches itself on and off.
* Put it in the **middle**, in a **corner**, or as a **bar across the top**.
* Set the width, three colours, rounded corners, the dimmed background, the close cross and one
  call-to-action button. The button text colour is chosen automatically so it stays readable.
* **Preview any popup on your site** before it goes live, visible to you only.

The content is the normal WordPress editor, so a popup is written the way a page is, and a newsletter
form from your provider can go straight in.

= Built on the browser's own dialog =

Popups are native HTML `<dialog>` elements. The browser itself keeps keyboard focus inside a popup
that dims the page, closes it on Escape, puts it above everything else on the page, and hands focus
back when it closes. When several popups qualify at the same moment, they open one after the other,
never stacked. Animations respect `prefers-reduced-motion`.

= Free and paid =

Every trigger, every targeting rule and every template is in the free version. Exit intent, scroll,
devices and dates are not held back for a paid tier.

Three live popups are free, for good. Drafts and scheduled popups do not count, so you can prepare as
many as you like. A fourth one is saved as a draft rather than refused, so nothing you wrote is lost.

Beyond three, a Smallapis key unlocks as many as you need, and the same key unlocks every other plugin
in the family on the same site. The free version needs no account.

= Things it deliberately does not do =

* No A/B testing, no analytics, no funnel builder.
* No email list management: put your provider's form inside the popup.
* No exit intent on touch screens, because there is no honest signal for it. Those visitors get the
  popup after 25 seconds instead, and the settings say so.

= External service =

Only if you enter a licence key, the plugin checks it about once a day with the Smallapis service at
https://smallapis.com/v1/me. The request carries the key and, like every request WordPress
makes, the address of your site. Nothing about your visitors or your content is sent. Without a key,
nothing is ever sent anywhere. Terms and privacy: https://smallapis.com/legal.html

== Installation ==

1. Install and activate.
2. A **Popups** menu appears. Add one.
3. Write the content, choose when it opens, save a draft, press **Preview on the site**, then publish.

== Frequently Asked Questions ==

= Does it slow my site down? =

On a page with no popup, nothing is loaded and no query runs. On a page with one, about five
kilobytes, loaded with `defer`.

= Why did my fourth popup save as a draft? =

Three live popups is the free limit. The content is kept as a draft rather than refused. Unpublish
one of the others, or use a key.

= Can I open a popup from a menu item or a button? =

Yes. Choose "On a click" and type a CSS selector such as `.join-us`, after giving your button or menu
item that class. A link to `#newsletter` works too, with the selector `a[href="#newsletter"]`.

= Who can create popups? =

People who can change the site's appearance, administrators by default. A popup appears on every page,
so authors and contributors cannot publish one.

= Why does my popup not open? =

Check, in this order: it is **published** (drafts never show); the page matches **Where**; your
screen matches **Screens** and **Who**; today is inside its **dates**. Then remember the frequency:
once you have seen it, it waits for the next visit or the next period. **Preview on the site**
ignores all of that and opens it at once, which tells you whether the content itself is fine.

= How do I stop it from coming back? =

Choose **Once per visit** or **Once every few days**, and tick **Never show it again to a visitor
who clicked its button or sent its form**. That choice is remembered in the visitor's browser.

= Does it set cookies or track visitors? =

No cookie and no tracking. To respect the frequency, the browser remembers that a popup was shown,
in its own local storage, and nothing leaves the visitor's device. Nothing is sent to us or to
anyone else.

= Does it work with caching plugins? =

Yes. The popup is in the page, and every timing decision happens in the visitor's browser, so a cached
page behaves exactly like an uncached one. Two settings depend on the page itself: **Who** (most
caches do not store pages for signed-in users, so this works as expected) and the **start date**: a
page cached before that date shows the popup once the cache is refreshed. The end date is also
checked in the browser, so a cached page never shows a popup past its end.

== Screenshots ==

1. The whole configuration of a popup, on one screen.
2. A popup on a page, with the page dimmed behind it.
3. The settings screen with the live count.

== Changelog ==

= 1.3.0 =
* New: four templates (newsletter, discount code, announcement bar, before you go), offered on a new popup and on an empty list.
* New: "when the visitor stops" trigger, after a number of seconds without moving, scrolling or typing.
* New: show a popup to everyone, only to visitors who are not signed in, or only to signed-in users.
* New: start and end dates. The end date is also checked in the browser, so a cached page never shows an expired popup.
* New: never show a popup again to a visitor who clicked its button or sent its form.
* Changed: clearer directory description and answers on cookies, frequency and popups that do not open.

= 1.2.0 =
* New: a Get a key button in the plugin header. After paying, one click activates the key on the site it was bought from, no copy and paste.
* New: once the plugin has done its job, a short request for a review, on its own screens only, which can be put off or turned off.

= 1.1.1 =
* Changed: the Smallapis service moved to its own domain, smallapis.com.

= 1.1.0 =
* New: preview any popup on your site before publishing it, visible to you only.
* New: "everywhere but chosen pages", a page picker, and desktop-only or mobile-only popups.
* New: popups are native `<dialog>` elements: focus is kept inside, Escape closes, focus returns.
* New: several popups that qualify at once open one after the other instead of stacking.
* New: the button text colour follows the button colour, so it always reads.
* Changed: the front end reads one stored list instead of querying the database on every page.
* Changed: only people who can edit the site's appearance can create popups.
* Fixed: popup content no longer runs the page's content filters, which could let other plugins act
  on it or replace it.
* Fixed: embedded forms were stripped from the popup content.
* Fixed: "only these pages" could match a category whose number equalled a page's.
* Fixed: "home page only" also matched the blog page.
* Fixed: a key check could slow down a visitor's page; it now happens in the background.
* Fixed: an invalid click selector stopped every popup on the page.
* Fixed: a scheduled popup could go live past the free limit.
* Fixed: with a key, popups beyond twenty were silently dropped.

= 1.0.0 =
* First release.
