=== POPUP Zyrex ===
Contributors: zyrexpl
Donate link: https://paypal.me/zyrexpl?country.x=PL&locale.x=pl_PL
Tags: popup, pop-up, modal, banner, exit-intent
Requires at least: 5.3
Tested up to: 7.0
Stable tag: 2.2.1
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Lightweight popup/banner plugin with multiple triggers, positions, targeting, analytics — translated into 6 languages.

== Description ==

**POPUP Zyrex** is a simple, lightweight and modern plugin that lets you display popups (banners) on your WordPress site. Increase conversions — announce promotions, newsletter sign-ups, events or new arrivals.

**Available in 6 languages:** English, Polski, Deutsch, Français, Español, Italiano.

**Features:**

* **Two content types**: image banner or HTML/text with headline, body and CTA button.
* **3 trigger types**: after time, after scroll, exit-intent (attempt to leave the page).
* **5 positions**: modal (center), bottom-right/bottom-left slide-in corner, top bar, bottom bar.
* **Scheduling**: optional start/end date — popup turns on and off automatically (e.g. Black Friday).
* **Targeting**: whole site, specific page, all entries of a post type (pages/posts/products), posts in category or with tag, device (desktop/mobile), user state (logged-in/logged-out).
* **Built-in analytics**: views, clicks, closes, CTR — global and per popup.
* **WordPress Media Library** integration.
* **Color picker** for the close-button and CTA accent.
* **Lightweight frontend** (~4 KB JS + CSS) — no jQuery dependency.
* **Security**: nonces, capability checks, prepared statements, input sanitization, `wp_kses_post` on HTML bodies.

**Other features:**

* Configurable hide-after-close cookie duration.
* Open/close animations with `prefers-reduced-motion` support.
* Accessibility: ESC to close, `aria-modal`, focus-visible on buttons.
* Multiple popups running simultaneously with independent rules.
* Translation-ready (text domain `popup-zyrex`) — bundled translations for English, Polish, German, French, Spanish, Italian.
* Uninstall drops all plugin data cleanly.

Author: <a href="https://zyrex.pl">zyrex.pl</a>

== Installation ==

1. Upload the `popup-zyrex` folder to `/wp-content/plugins/` or install via the WordPress plugin screen.
2. Activate the plugin on the **Plugins** screen.
3. Open the **POPUP** menu in the admin panel.
4. Click **Add new**, fill in the fields, pick an image, and click **Add popup**.
5. Go back to the list and activate the popup with the **Activate** button.

The UI adapts automatically to your WordPress site language (English, Polski, Deutsch, Français, Español, Italiano).

== Frequently Asked Questions ==

= How long does the popup stay hidden after close? =

One day by default. Change it per popup in the "Hide duration after close (days)" field.

= Can I show a popup only on a selected page? =

Yes — in the "Targeting" section pick a specific page or "All pages".

= Can I show a popup only on mobile or only on desktop? =

Yes. In targeting choose "Desktop only" or "Mobile only".

= What is exit-intent? =

The popup appears when the visitor moves their cursor toward the tab close / address bar (desktop), or performs a quick upward scroll (mobile).

= Does the plugin slow down my site? =

No. The frontend is ~4 KB JS and ~2 KB CSS, loaded only when at least one popup is active for the current page.

= What languages are supported? =

English, Polski, Deutsch, Français, Español, Italiano out of the box. The plugin ships with a `.pot` file so any other language can be added.

== Screenshots ==

1. Lista popupów z podglądem obrazków, trigerami, pozycjami i statystykami.
2. Formularz tworzenia popupu — treść, zachowanie i targetowanie w jednym widoku.
3. Zakładka Statystyki z podsumowaniem wyświetleń, kliknięć i CTR.
4. Popup w modalu na froncie (pozycja "Modal (środek)") z własnym kolorem akcentu.

== Changelog ==

= 2.2.1 =
* Compatibility: tested with WordPress 7.0 and its new "Modern" admin theme.
* Requires PHP raised to 7.4 (aligned with the WordPress 7.0 minimum).
* Performance: active popups are now cached in a transient and only re-queried when a popup is saved.
* Code quality: passes the official Plugin Check tool with no errors or warnings.

= 2.2.0 =
* NEW: HTML/text content type — popups with a headline, body (HTML allowed) and a CTA button, instead of just a banner image.
* NEW: Scheduling — optional start/end date per popup, so campaigns turn on and off automatically.
* NEW: Expanded targeting — whole site, specific page, all entries of a post type (pages / posts / products), posts in a category, posts with a tag.
* Fix: Mobile device detection is now more robust (matchMedia + viewport width + user-agent check).
* i18n: 19 new strings added to all bundled translations (English, Polish, German, French, Spanish, Italian).
* Tested up to: WordPress 6.9.

= 2.1.0 =
* NEW: Internationalization — source strings refactored to English; bundled translations for English, Polish (pl_PL), German (de_DE), French (fr_FR), Spanish (es_ES), Italian (it_IT).
* NEW: `.pot` file updated with English msgids for translators.
* Fix: scroll trigger could fire immediately on short pages where the initial viewport already covered the threshold.

= 2.0.0 =
* NOWE: Wyzwalacze — czas, scroll, exit-intent.
* NOWE: Pozycje — modal, rogi (slide-in), paski góra/dół.
* NOWE: Targetowanie po urządzeniu (desktop/mobile) i statusie użytkownika.
* NOWE: Integracja z Biblioteką Mediów WordPress (zamiast własnego uploadera).
* NOWE: Color picker dla kolor akcentu przycisku zamykania.
* NOWE: Statystyki — wyświetlenia, kliknięcia, zamknięcia, CTR.
* NOWE: Konfigurowalny czas cookie po zamknięciu.
* NOWY: Nowy interfejs administracyjny z zakładkami i kartami.
* Poprawki bezpieczeństwa: nonce na wszystkich formularzach, capability checks, przygotowane zapytania SQL, sanityzacja danych wejściowych, walidacja uploadów przez Bibliotekę Mediów.
* Refactor: frontend bez jQuery, lekki (~4 KB JS).
* Dostępność: klawisz ESC, atrybuty ARIA, focus-visible, `prefers-reduced-motion`.
* i18n: tekstdomena `popup-zyrex`, plik POT.
* Fix: uninstall.php czyścił złą nazwę tabeli — teraz poprawnie usuwa dane.

= 1.2.2 =
* Aktualizacja dla WP 6.7.1.

= 1.2.1 =
* Drobne poprawki.

== Upgrade Notice ==

= 2.2.1 =
WordPress 7.0 compatible, transient caching for active popups, passes Plugin Check. Recommended.

= 2.2.0 =
HTML/text content type, popup scheduling, expanded targeting (post types, categories, tags), mobile detection fix.

= 2.1.0 =
Bundled translations for English, Polish, German, French, Spanish, Italian + scroll-trigger fix.

= 2.0.0 =
Big update: new triggers (scroll, exit-intent), positions, targeting, analytics, security hardening. Recommended.
