ID Popup

Changelog

1.5

Released: March 2026
* Updated short description and tags.
* Synchronised plugin version with stable tag.

1.4

Security Hardening
* Added wp_die() after wp_send_json_error() in AJAX handler to prevent continued execution after unauthorized access.
* Whitelisted the type parameter in the AJAX search handler against known post types — unknown types are rejected with wp_die().
* Switched popup_link sanitization from sanitize_text_field() to esc_url_raw() — correct WordPress standard for URL fields stored in the database.
* Added strict allowlist validation for display_rules using in_array() with type checking.
* Cast all specific_ids to integers using intval — eliminates any possibility of string injection through ID fields.
* Applied esc_html() to post titles and absint() to IDs in AJAX JSON responses.
* Applied esc_attr() to desktop_max_width in inline style output.

Bug Fixes
* Fixed auto-close value of 0 not working — parseInt(0) || 15000 was incorrectly evaluating to 15000. Now uses isNaN() check so 0 correctly disables auto-close.
* Fixed mobile skip logic — data() returns a string but was compared with === 0 (integer). Wrapped with parseInt() for correct type coercion.
* Fixed scheduling logic — previously required both start AND end dates to evaluate; now each date boundary is checked independently.
* Removed dead $preview_style PHP variable that was computed but never used.

Performance
* Added no_found_rows: true and update_post_term_cache: false to the frontend WP_Query to skip unnecessary database queries.
* Popup HTML is now skipped in PHP entirely if neither desktop nor mobile images are set.

1.3

Released: March 2026

New: WooCommerce Display Rules
* Added All Product Pages display rule — shows popup on any WooCommerce single product page.
* Added Specific Product Page(s) display rule — target individual WooCommerce products by name using the Select2 search interface.
* WooCommerce rules are only rendered in the admin dropdown when WooCommerce is active (class_exists(‘WooCommerce’)).
* AJAX search handler now supports product post type when specific_products rule is selected.

Select2 Improvements
* Placeholder text dynamically updates based on selected display rule: “Search pages…”, “Search posts…”, or “Search products…”.
* Select2 search field now appears for specific_products rule in addition to specific_pages and specific_posts.

Display Rule Precision
* “All Single Posts” now uses is_singular(‘post’) instead of is_single() — correctly excludes custom post types and WooCommerce products.
* “Specific Post(s)” rule now uses is_singular(‘post’) + get_queried_object_id() matching — consistent with the specific pages and products pattern.
* “Specific Page(s)” now uses get_queried_object_id() for ID matching instead of passing an array to is_page().

1.2

Released: March 2026

Multiple Popups Architecture (Major Feature)
* Migrated from a single WordPress Options API settings page to a Custom Post Type (id_popup).
* Each popup is now an independent WordPress post with its own title, settings, and lifecycle.
* Added dedicated Popups menu item in the WordPress admin sidebar with a custom dashicon.
* Three separate native WordPress Meta Boxes replace the single settings form: Media Setup, Display Rules & Scheduling, and Appearance & Behavior.
* Meta box headers styled with the plugin’s red theme using CSS targeting native WP postbox elements.
* Added automatic one-time data migration from the old id_popup_settings option into a new “Default Popup” post — no data loss on upgrade.

Frontend Multi-Popup Support
* Frontend now uses WP_Query to loop all published id_popup posts.
* Each popup evaluated independently for scheduling and display rules.
* HTML output switched from singleton IDs (#id-popup) to classes (.id-popup-container, .id-popup-overlay) to support multiple simultaneous popups on one page.
* Per-popup delay and auto-close timings passed via data-delay and data-autoclose attributes — no global JS variables.

Image Handling
* Each popup independently skips rendering if no image is configured for the current device type.
* Device detection (data-has-desktop, data-has-mobile) evaluated fresh per popup per page load.

1.1

Released: March 2026

WordPress Media Library Integration
* Replaced plain URL input fields with the native WordPress Media Uploader.
* Plugin now stores WordPress Attachment IDs instead of raw image URLs — more robust, survives media library reorganization.
* Image URLs are dynamically resolved at render time using wp_get_attachment_image_url().
* Added attachment_url_to_postid() fallback for any legacy string URL values still in the database.
* Added live image previews in the admin for both desktop and mobile images.
* Added remove (×) button on image thumbnails — clears the attachment ID and hides the preview without a page reload.

Display Rules Expansion
* Added All Pages display rule.
* Added All Single Posts display rule.
* Added Specific Page(s) display rule with Select2 live search.
* Added Specific Post(s) display rule with Select2 live search.
* “Specific Page/Post” field dynamically shows/hides based on the selected rule (hidden by default).

Select2 Integration
* Integrated Select2 library for the specific page/post ID selection.
* AJAX-powered live search for pages and posts.
* Selected items displayed as removable pill tags.
* Automatically clears selections when an incompatible display rule is chosen.

Field Defaults
* Desktop Max Width defaults to 900px.
* Auto Close defaults to 15 seconds.
* Delay Before Opening defaults to 3 seconds.
* Target URL defaults to #.

1.0

Released: 2024

  • Initial release.
  • Responsive popup image support for desktop and mobile.
  • Popup scheduling with start and end dates.
  • Display location control: entire site, homepage, or single post.
  • Overlay color and opacity controls.
  • Linkable popup image.
  • Auto-close timer.
  • Popup delay setting.

Plugin Website
Visit website

Version:
1.5
Last Updated
March 21, 2026
Active Installs
10
Requires
WordPress 5.6
Tested Up To
WordPress 6.7.5
Requires PHP
7.4

Share Post

Join our newsletter.

Get insights into what’s happening at ChangelogWP right in your inbox. We don’t believe in spam.