=== DeveloperSD Popup Builder ===
Contributors: developersd, sudipdebnath
Tags: popup, popup builder, marketing, lead generation, exit intent
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.1.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A lightweight, high-performance popup builder with advanced triggers, display conditions, popup chaining, and full page-builder support.

== Description ==

DeveloperSD Popup Builder lets you create unlimited popups, trigger them in any combination of ways (exit intent, scroll depth, timer, click, WooCommerce events, and more), chain them into multi-step sequences, and target them with fine-grained display conditions — all without loading a single byte of JS or CSS on pages that have no popup.

**Key features**

* Six built-in themes (Classic, Minimal, Glass, Modern, Dark, Marketing) combinable with nine positions (center, fullscreen, bottom sheet, slide-in, corner, announcement bar, and more)
* Every common trigger type: manual, page load, delay, scroll percentage, scroll-to-element, exit intent (desktop and mobile), click/hover by CSS selector, form submit, URL parameter, custom JS events, and WooCommerce cart/checkout/thank-you hooks
* Full page-builder support: edit popup content with Elementor, Divi, Beaver Builder, Bricks, or the block editor
* Fine-grained display conditions: page/post targeting, login state, user role, device, referrer, UTM source, and cookie presence
* Cache-safe frequency control (cookie + localStorage), so popups keep working correctly behind full-page caching
* Popup chaining with automatic circular-chain prevention
* Built-in analytics (views, opens, closes, conversions, clicks) with CSV export
* Accessible by default: focus trap, ARIA roles, keyboard navigation, and `prefers-reduced-motion` support

== Installation ==

1. Upload the `developersd-popup-builder` folder to `/wp-content/plugins/`.
2. Activate the plugin through the "Plugins" menu in WordPress.
3. Go to Popups → Add New to create your first popup.

== Frequently Asked Questions ==

= Why doesn't the Popup post type show up in my page builder's post-type list? =

Elementor, Divi, Beaver Builder, and Bricks each have their own settings screen listing which post types their builder is enabled for. Find that screen in your builder's own settings (for Elementor: Elementor → Settings → General → Post Types) and enable "Popup" there.

= Will popups slow down my site? =

No CSS or JavaScript from this plugin loads on any page that has no eligible popup — eligibility is resolved server-side before any asset is enqueued.

= Does this work with page caching plugins? =

Yes. Popup display-frequency state (has a visitor already seen/closed a popup) is tracked entirely client-side via cookies and localStorage, never written from PHP, so a fully-cached page is never a problem.

= How do I open a popup from my own button or link? =

Three ways: the `[developersd_popup id="X"]` shortcode, adding a `data-dsdpb-trigger="X"` attribute to any existing element, or calling `dsdpbOpen(X)` from your own JavaScript. All three are also shown on the popup's own edit screen.

== Changelog ==

= 1.1.3 =
* Scoped the popup-chain validation admin notice to the Popups screen only, instead of the global `admin_notices` hook, so it can never appear on unrelated wp-admin pages.

= 1.1.2 =
* Further WordPress Plugin Check compliance: prefixed all plugin-defined variables in top-level template/uninstall files (`uninstall.php`, `templates/popup-wrapper.php`, `admin/views/analytics-page.php`) with `dsdpb_`, since PHP treats variables in a directly-required file as global scope.
* Documented the remaining unavoidable direct-database-call notice on the analytics aggregate query with an explicit `phpcs:ignore` (no core WordPress API exists for an aggregate query over a plugin's own custom table; the query is already parameterized via `$wpdb->prepare()` and cached).
* Updated "Tested up to" in readme.txt.

= 1.1.1 =
* WordPress Plugin Check compliance pass: removed the manual `load_plugin_textdomain()` call (WordPress core auto-loads translations since 4.6); replaced interpolated table names in SQL with `$wpdb->prepare()` using the `%i` identifier placeholder; removed `suppress_filters` from internal queries, since forcing it off can break other plugins (multilingual, access-control) that filter which posts are visible; properly unslashed `$_SERVER` input before sanitizing.
* Raised the minimum required WordPress version to 6.2 (needed for the `%i` prepare placeholder above).
* Added short-lived object-cache caching to the Analytics dashboard's aggregate query, invalidated immediately whenever a new event is recorded.
* Restructured the plugin's build so development-only files (the unit test suite, manual testing checklist, and internal build-phase notes) are no longer included in the distributed plugin zip.

= 1.1.0 =
* The Popup post type is now public/publicly queryable so Elementor, Divi, Beaver Builder, and Bricks can offer it in their own "enable this post type" settings; direct front-end visits to a popup's single URL by anyone without edit rights are redirected to the homepage.
* One-time rewrite-rules flush on update so the change above takes effect without a manual permalinks resave.
* "Close on ESC key by default" / "Close on overlay click by default" in Settings are now true site-wide master switches: turning one off stops that close method for every popup immediately, including popups with their own Close Behavior setting on.
* Fixed: unchecking a true-by-default checkbox in the popup editor (Close on ESC, Close on Overlay, Close Button Enabled, Close on Form Submit, Reduced Motion Safe, Storage Fallback) was silently reverted back to checked on every save.
* Fixed: popup content containing a form shortcode (or any shortcode relying on the current post) rendered using the host page's content instead of the popup's own content.
* Fixed: entrance animation did not play for triggers that fire later in the page lifecycle (e.g. exit intent), only for early triggers like page load.
* Redesigned the Settings page (card layout, spacing) and unified the toggle-switch design used across the Settings page and the popup editor.
* Themes ("Skin" renamed to "Theme" in the UI) now have real, distinct visual identities — background, accent color, button/heading styling — instead of most of them looking nearly identical.
* Every settings field now has inline help text explaining what to enter, with example values.
* Added a "Shortcode & Manual Trigger" panel to the popup edit screen itself.

= 1.0.0 =
* Initial release: plugin architecture, custom post type and settings schema, admin UI, page-builder-aware popup editor, frontend rendering engine, trigger engine, display conditions engine, cookie/frequency manager, popup chaining with validation, analytics, and accessibility/performance features.

== Upgrade Notice ==

= 1.1.3 =
Admin notice scoping fix for WordPress.org directory review compliance. No behavior changes for end users.

= 1.1.2 =
Additional WordPress Plugin Check compliance fixes. No behavior changes for end users.

= 1.1.1 =
WordPress Plugin Check compliance fixes and a minimum-WordPress-version bump to 6.2. No behavior changes for end users.

= 1.1.0 =
Fixes several settings that were not being respected (Close on ESC/Overlay, and other popup-editor toggles) and enables page-builder support for the Popup post type. Recommended for all users.
