=== Nexu Smart Discount Notifications ===
Contributors: nexuwp
Donate link: https://nexuwp.com/product/woocommerce-deal-notification-popups-manager-increase-conversions-with-smart-discount-popups-scheduling-targeting/
Tags: discount, notifications, popup, alerts, marketing
Requires at least: 5.0
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.19.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Intelligent discount notification system that displays attractive discount alerts with advanced scheduling and customization features.

== Description ==

Nexu Smart Discount Notifications is a powerful WordPress plugin that helps you increase sales and engage visitors with intelligent discount notifications. Display attractive discount alerts at the perfect time with advanced scheduling and customization options.

### Key Features

**🎯 Smart Display System**
* Intelligent timing and frequency control
* Position notifications on left or right side
* Smooth animations and transitions
* Mobile-responsive design

**⏰ Advanced Scheduling**
* Daily, weekly, monthly, or custom intervals
* Time range restrictions
* Active days selection
* Holiday exclusions
* Minimum interval between displays

**🎨 Full Customization**
* Text-only, image-only, or combined content
* Custom colors, fonts, and styling
* Background images and gradients
* Rounded corners and shadows
* Custom dimensions

**👥 Smart Targeting**
* Target specific pages or all pages
* User role targeting (guests, members, customers)
* Device-specific display options
* Custom page conditions

**📊 Detailed Analytics**
* Display statistics and click tracking
* User engagement metrics
* Device and browser analytics
* Performance reports

**🔊 Sound Alerts**
* Optional notification sounds
* Volume control
* Accessibility-friendly

**🛡️ Security & Performance**
* Nonce verification for all actions
* Sanitized inputs and escaped outputs
* Optimized database queries
* Caching-friendly design

### Perfect For

* **E-commerce stores** - Promote sales and discounts
* **Service businesses** - Announce special offers
* **Bloggers** - Highlight important content
* **Marketers** - Increase conversion rates
* **Agencies** - Client campaign management

### WooCommerce Integration

Seamlessly integrates with WooCommerce to:
* Target customers vs. guests
* Display on shop pages
* Show discount codes
* Track purchase conversions

### Developer Friendly

* Clean, well-documented code
* WordPress Coding Standards compliant
* Translation ready (i18n)
* Extensive hooks and filters
* PSR-4 autoloading

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/nexu-smart-discount-notifications/` directory, or install through WordPress admin
2. Activate the plugin through the 'Plugins' screen in WordPress
3. Go to Settings > Discount Notifications to configure the plugin
4. Create your first notification and customize display settings
5. Test the notification on your frontend

== Frequently Asked Questions ==

= Does this plugin work with caching plugins? =

Yes! Nexu Smart Discount Notifications is designed to work with all major caching plugins. Notifications are loaded dynamically to avoid caching conflicts.

= Can I display different notifications to different user types? =

Absolutely! You can target notifications based on user roles, login status, and even WooCommerce customer status.

= Will this slow down my website? =

No. The plugin is optimized for performance with minimal database queries and efficient caching. Assets are only loaded when needed.

= Can I customize the appearance completely? =

Yes! You have full control over colors, fonts, sizes, positioning, animations, and more through the admin interface.

= Does it work on mobile devices? =

Yes! All notifications are fully responsive and optimized for mobile, tablet, and desktop viewing.

= Can I schedule notifications for specific times? =

Yes! You can set active time ranges, specific days of the week, and even exclude holidays from display.

= Is it translation ready? =

Yes! The plugin is fully translation ready with complete .pot file included. RTL languages are also supported.

= Can I track notification performance? =

Yes! Built-in analytics show display counts, click rates, user engagement, and device statistics.

== Screenshots ==

1. **Admin Dashboard** - Clean, modern interface for managing notifications
2. **Notification Editor** - Easy-to-use editor with live preview
3. **Display Settings** - Advanced scheduling and frequency controls
4. **Analytics Dashboard** - Detailed performance statistics
5. **Frontend Display** - Beautiful notification on website
6. **Mobile View** - Responsive design on mobile devices

== Changelog ==

= 1.19.4 =
* UI: Full redesign of the notification edit modal and all tabs for a cleaner, modern look.
* UI: Refined tab navigation (pill style), form sections, inputs, and footer.
* UI: Improved spacing, typography, and scroll behavior inside the modal.

= 1.19.3 =
* UX: Minimum Interval now auto-adjusts when incompatible with Frequency and Maximum Displays.
* Fix: Save validation shows clear error when min_interval would prevent reaching max_displays in the period.
* UI: Dynamic hint shows max allowed hours based on current frequency and max displays settings.

= 1.19.2 =
* UI: Added 3px white gap between notification card and colored border for cleaner visual separation.

= 1.19.1 =
* Fix: Restored border color/width from settings - user-selected border (e.g. red) now displays correctly.
* Fix: Removed :focus outline to avoid double border; only the border from settings is shown.

= 1.19.0 =
* UI: Replaced modal border settings with primary blue border (2px #3b82f6) to avoid double border with focus outline.
* UX: Notification modal now uses consistent blue outline as main border instead of stacking borders.

= 1.18.0 =
* Behavior: Removed guest identity dependency on IP for display logic and frequency checks.
* Privacy: Guests are now identified with a persistent anonymous cookie ID instead of IP-based hashing.

= 1.17.0 =
* Fix: Implemented missing AJAX handlers for Advanced > Maintenance Actions buttons.
* Fix: Added secure backend processing for cleanup stats, reset counters, export settings, and import settings.
* Security: Added nonce/capability validation and import JSON sanitization for maintenance actions.

= 1.16.0 =
* UI: Removed the Database Migration section from Advanced Settings.
* Cleanup: Removed unused admin handler for the deleted migration button.

= 1.15.0 =
* Fix: Corrected modal footer `Cancel` button styling conflict with `.sdn-modal-close`.
* UI: Limited circular close-icon styles to non-secondary modal close buttons only.

= 1.14.0 =
* Fix: Resolved frontend popup close button shape issue where theme CSS could make it oval.
* UI: Hardened close button styling with strict square sizing and reset rules for consistent circular rendering.

= 1.13.0 =
* UI: Replaced header icon with a Nexu-style dashicon.
* UI: Updated header icon background from blue to Nexu indigo-violet gradient.

= 1.12.0 =
* UI: Updated admin settings styling to better match other Nexu plugins.
* UI: Aligned colors, spacing, typography, header, navigation rail, and action button visuals with Nexu design language.

= 1.11.0 =
* Branding: Updated plugin author details to Nexu WP Dev Group.
* Branding: Updated plugin URI to the official NexuWP product page.

= 1.10.0 =
* UX: Added direct `Settings` action link on the WordPress Plugins page for faster access.

= 1.9.0 =
* Branding: Renamed plugin display name to Nexu Smart Discount Notifications.
* Branding: Updated admin page slug and related settings routes to `nexu-smart-discount-notifications`.
* Branding: Updated text domain to `nexu-smart-discount-notifications` for consistent Nexu naming.

= 1.8.0 =
* Security: Restricted `sdn_preview_notification` endpoint to authenticated admin context only.
* Security: Added explicit capability checks for preview AJAX handlers.
* Hardening: Removed public (`nopriv`) preview route to reduce attack surface.

= 1.7.0 =
* Fixed: Removed per-visitor transient writes for session ID generation to prevent wp_options growth.
* Fixed: Switched runtime rate limiting to object cache only, avoiding transient spam on sites without persistent cache.
* Maintenance: Added daily cleanup for legacy `sdn_*` transient rows in wp_options to recover from historical bloat.
* Stability: Added bounded batch cleanup strategy to avoid long-running database locks during cleanup.

= 1.4.0 =
* Performance: Eliminated HTML bloat - notifications now loaded dynamically via AJAX
* Performance: Optimized tracking with sendBeacon API (non-blocking, faster)
* Performance: Reduced page weight by removing inline notification data from PHP render
* Enhancement: Improved client-side filtering with dismissed notification tracking
* Enhancement: Added device type detection and filtering on client-side
* Optimization: Consolidated multiple AJAX requests into efficient single calls
* Developer: New optimized AJAX endpoint 'sdn_fetch_notification' for better performance
* Developer: Refactored JavaScript to support dynamic notification loading
* Code Quality: Improved code structure and reduced server load
* Compatibility: Better cache plugin compatibility with dynamic loading approach

= 1.2.0 =
* Fixed: Replaced date() with gmdate() and current_time() for timezone-safe operations
* Fixed: Improved database query safety with proper $wpdb->prepare() usage
* Fixed: Replaced json_encode() with wp_json_encode() for better compatibility
* Fixed: Corrected DROP TABLE implementation in uninstall with proper phpcs:ignore comments
* Improved: Moved inline CSS from PHP to external stylesheet for better performance
* Improved: Replaced Persian strings with English translatable strings
* Code Quality: Enhanced WordPress Coding Standards compliance
* Code Quality: Improved database query security and performance
* Compatibility: All code now fully compatible with WordPress 6.8

= 1.1.3 =
* Security: Enhanced nonce verification with proper sanitization
* Security: Proper sanitization of $_SERVER variables throughout plugin
* Security: Improved $_POST and $_GET data handling with wp_unslash()
* Security: Added proper sanitization for $_COOKIE data
* Security: Wrapped all error_log() calls with WP_DEBUG checks
* Performance: Added wp_cache implementation for database statistics
* Code Quality: Removed deprecated load_plugin_textdomain() function
* Code Quality: Converted anonymous functions to named methods for better testability
* Code Quality: Added translator comments for translatable strings with placeholders
* Standards: Updated "Tested up to" header to WordPress 6.8
* Standards: Improved PHPCS compliance throughout the codebase
* Compatibility: Version number synchronized across all files

= 1.0.0 =
* Initial release
* Smart notification display system
* Advanced scheduling options
* Full customization controls
* User targeting features
* Analytics and reporting
* WooCommerce integration
* Mobile responsive design
* Translation ready
* Security hardened

== Upgrade Notice ==

= 1.19.4 =
Notification edit modal and all tabs redesigned for a cleaner, modern UI.

= 1.19.3 =
Minimum Interval auto-adjusts and validates against Frequency/Max Displays.

= 1.19.2 =
3px white gap added between notification card and border.

= 1.19.1 =
Border color/width from settings now apply correctly; no more double outline.

= 1.19.0 =
Notification modal now uses a single blue border instead of double borders when combined with focus styles.

= 1.18.0 =
Guest tracking for display limits now uses anonymous cookie IDs instead of IP-based identifiers.

= 1.17.0 =
Fixes Advanced Maintenance buttons by adding complete backend AJAX handlers and secure processing.

= 1.16.0 =
Removes the Database Migration block from Advanced Settings for a cleaner admin interface.

= 1.15.0 =
Fixes broken modal `Cancel` button appearance caused by close-icon style overlap.

= 1.14.0 =
Fixes frontend close button rendering so the dismiss icon stays fully circular across themes.

= 1.13.0 =
Refines header branding by updating icon style and removing legacy blue icon background.

= 1.12.0 =
Visual refresh for admin settings to match the unified Nexu plugin dashboard style.

= 1.11.0 =
Updates plugin author details and official product URL to NexuWP branding.

= 1.10.0 =
Adds a direct Settings button in the Plugins list for quick configuration access.

= 1.9.0 =
Branding update. Plugin name, slug, and text domain now use the Nexu naming convention.

= 1.8.0 =
Security hardening update. Preview AJAX route is now admin-only with stricter permission checks.

= 1.7.0 =
Critical maintenance update for high-traffic sites. Stops legacy per-visitor transient growth in wp_options and adds automatic cleanup for old SDN transients.

= 1.4.0 =
Major performance update! Notifications now load dynamically via AJAX for better speed and reduced page weight. Uses sendBeacon for optimized tracking. Safe update with no breaking changes.

= 1.2.0 =
Important code quality and compatibility improvements. Fixed timezone handling, improved database query safety, and enhanced WordPress coding standards compliance. Safe update with no breaking changes.

= 1.1.3 =
Security and performance improvements. Enhanced sanitization, added caching, and improved WordPress coding standards compliance. Safe update with no breaking changes.

= 1.0.0 =
Initial release of Nexu Smart Discount Notifications. Start engaging your visitors with intelligent discount alerts!

== Privacy Policy ==

Nexu Smart Discount Notifications respects user privacy:

* **Data Collection**: Only collects anonymous display and interaction statistics
* **IP Addresses**: Hashed for privacy protection
* **No Personal Data**: Does not collect or store personal information
* **GDPR Compliant**: Follows all GDPR requirements
* **Data Retention**: Statistics are automatically cleaned up after 90 days

== Support ==

For support, documentation, and updates:

* **Website**: https://nexuwp.com/
* **Documentation**: https://nexuwp.com/product/woocommerce-deal-notification-popups-manager-increase-conversions-with-smart-discount-popups-scheduling-targeting/
* **Support Forum**: WordPress.org support forums
* **Support**: https://nexuwp.com/

== Credits ==

Developed by **Nexu WP Dev Group**
* Website: https://nexuwp.com/
* Support: https://nexuwp.com/

Special thanks to the WordPress community for their continuous support and feedback.
