=== PlgnPlay Popups ===
Contributors: plgnplay
Tags: popup, modal, notification bar, cookie, marketing
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.2
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A lightweight popup manager. Create multiple popups with image support, cookie-based dismissal, automatic re-display on updates, and expiry control.

== Description ==

PlgnPlay Popups is a lightweight popup manager for WordPress. Create and manage multiple popups directly from your WordPress admin without any coding required.

= Key Features =

* **Multiple Popups** - Create unlimited popups, each with independent settings.
* **Smart Cookie Management** - Popups are remembered after dismissal using cookies with a configurable duration.
* **Automatic Re-display on Update** - When you update a popup's content, all visitors see the updated version regardless of prior dismissal. This uses a versioning system that invalidates old cookies.
* **Media Library Integration** - Add images to your popups using the built-in WordPress Media Library.
* **Expiry Date Control** - Set an optional expiry date after which the popup automatically stops displaying.
* **Multiple Positions** - Choose from Center Modal, Bottom Right Slide-in, or Top Bar.
* **Display Delay** - Configure a delay before the popup appears.
* **Overlay Support** - Optional dark overlay behind center modals.
* **Accessible** - Keyboard navigation support, ARIA attributes, focus management, and reduced motion support.
* **Lightweight** - No external dependencies. Pure vanilla JavaScript on the frontend.
* **Translation Ready** - Fully internationalized with proper text domain support.
* **Clean Uninstall** - All data is removed when the plugin is deleted.

= How It Works =

1. Create a popup from the PlgnPlay Popups admin page.
2. Add your content using the WordPress editor, optionally attach an image.
3. Configure cookie duration, position, delay, and optional expiry date.
4. Activate the popup and it will display to your visitors.
5. When you update a popup, the internal version number increments, which changes the cookie identifier. This means all visitors will see the updated popup even if they previously dismissed the old version.

= Use Cases =

* Welcome messages for new visitors
* Promotional announcements and sale notifications
* Cookie consent notices
* Newsletter signup prompts
* Important site-wide announcements
* Event or deadline reminders

== Installation ==

= Automatic Installation =

1. Go to **Plugins > Add New** in your WordPress admin.
2. Search for "PlgnPlay Popups".
3. Click **Install Now** and then **Activate**.

= Manual Installation =

1. Download the plugin ZIP file.
2. Go to **Plugins > Add New > Upload Plugin** in your WordPress admin.
3. Upload the ZIP file and click **Install Now**.
4. Activate the plugin.

= Manual FTP Installation =

1. Download and extract the plugin ZIP file.
2. Upload the `plgnplay-popups` folder to `/wp-content/plugins/`.
3. Go to **Plugins** in your WordPress admin and activate PlgnPlay Popups.

== Frequently Asked Questions ==

= How do I create a popup? =

Navigate to **PlgnPlay Popups** in your WordPress admin sidebar and click **Add New Popup**. Fill in the title, content, and configure your preferred settings.

= Can I have multiple popups active at the same time? =

Yes. You can create and activate as many popups as you need. All active popups display together, so you can use different positions side by side — for example, a top bar announcement combined with a bottom-right notification.

= How does the cookie system work? =

When a visitor dismisses a popup, a cookie is set in their browser. The cookie name includes the popup's version number. The popup will not appear again until the cookie expires (based on your configured duration) or until you update the popup content.

= What happens when I update a popup? =

Each time you save changes to a popup, its internal version number increments. This changes the cookie identifier, so all visitors will see the updated popup even if they previously dismissed the older version.

= Can I set a popup to stop showing after a certain date? =

Yes. Each popup has an optional **Expiry Date** field. Once the expiry date passes, the popup will no longer be displayed to visitors.

= Does PlgnPlay Popups use custom post types? =

No. PlgnPlay Popups stores all data in the WordPress options table (`wp_options`) for simplicity and performance. No custom post types or custom database tables are created.

= Is the plugin accessible? =

Yes. Popups include ARIA attributes, keyboard navigation (Escape to close), proper focus management, and respect the `prefers-reduced-motion` media query.

= Will PlgnPlay Popups slow down my site? =

No. PlgnPlay Popups is lightweight with no external dependencies. The frontend uses vanilla JavaScript and minimal CSS. Assets are only loaded when active popups exist.

= How do I uninstall PlgnPlay Popups completely? =

Deactivate and delete the plugin from the **Plugins** page. All popup data stored in the database will be automatically removed.

== Screenshots ==

1. Admin popup list view showing all created popups with status, position, and actions.
2. Add/Edit popup form with content editor, image upload, and configuration options.
3. Center modal popup displayed on the frontend.
4. Bottom right slide-in popup on the frontend.
5. Top bar notification on the frontend.

== Changelog ==

= 1.0.0 =
* Initial release.
* Create and manage multiple popups.
* Cookie-based dismissal with configurable duration.
* Automatic re-display on popup content update via versioning.
* WordPress Media Library integration for popup images.
* Configurable expiry date for each popup.
* Three popup positions: Center Modal, Bottom Right, Top Bar.
* Display delay configuration.
* Dark overlay option for center modals.
* Full accessibility support.
* Translation ready.
* Clean uninstall.

== Upgrade Notice ==

= 1.0.0 =
Initial release of PlgnPlay Popups.
