=== Homepage Popup Notice ===
Contributors: tsxcc
Tags: popup, notice, announcement, 弹窗, 弹窗公告
Requires at least: 5.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.5
License: GPL v3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

A lightweight WordPress popup plugin with 3 styles for announcements, notifications, or ads.

== Description ==

Homepage Popup Notice (弹窗公告) is a simple yet powerful popup plugin for WordPress. Display announcements, promotions, or important notices on your site's homepage with three distinct styles. No complex configuration needed — just activate, customize, and go.

= Features =

* **3 Popup Styles**: Centered card popup, modal overlay, and toast notification
* **Customizable Content**: Logo image, button text, links, and color options
* **Visual Style Selector**: Click preview cards to switch styles instantly
* **Smart Display**: Cookie-based frequency control (once per day per user)
* **Lightweight**: No external dependencies, minimal footprint
* **Beautiful Admin UI**: Flat, colorful, block-based settings page
* **Help Center**: Built-in help tab with FAQ and contact info

= Style Preview =

* **Style 1 — Centered Card Popup**: A centered card with logo avatar, close button, and action link. Perfect for brand announcements.
* **Style 2 — Modal Overlay**: Full-screen semi-transparent overlay with centered modal. Ideal for important notices.
* **Style 3 — Toast Notification**: Growl/Toast-style notification that auto-dismisses. Great for subtle alerts.

= Usage =

1. Activate the plugin
2. Go to Settings → Homepage Popup Notice
3. Choose your popup style and customize content
4. Save and view your site!

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` directory, or install via WordPress plugin installer.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Go to **Settings → Homepage Popup Notice** to configure.

== Frequently Asked Questions ==

= The popup is not showing. What should I do? =

Please check:
1. The plugin is activated and you've saved popup content in settings.
2. Enable "Cookie fix" in the plugin settings.
3. Check browser console for JavaScript errors.

= My site's JavaScript broke after installing this plugin. =

WordPress ships with a modern version of jQuery. This plugin uses the built-in jQuery. If you encounter issues, try updating your theme.

= Does the popup show every page load? =

No. Style 1 and Style 2 use cookies to remember when a user closes the popup, so it only shows once per day per user.

= Can I customize the popup appearance? =

Yes! Each style has its own content editor and color options in the plugin settings.

= Does this plugin work with caching plugins? =

Yes. The popup is rendered via wp_footer action and works with most caching plugins.

== Screenshots ==

1. Plugin settings page — visual style selector with preview cards
2. Style 1 — Centered card popup with logo
3. Style 2 — Modal overlay popup
4. Style 3 — Toast notification

== Changelog ==

= 1.0.5 =
* i18n: Fixed help tab answers not translated (quote escaping in source strings)

= 1.0.4 =
* i18n: All source strings now in English, translated to zh_CN via .po/.mo
* i18n: Added zh_CN translation files (languages/)
* i18n: Regenerated .pot template

= 1.0.3 =
* New: Flat and colorful admin UI redesign
* New: Help tab with FAQ, contact author and plugin intro
* New: Dropdown arrow and description for notification position
* Update: High-resolution style preview images
* Fix: Style 3 notification script loading

= 1.0.2 =
* Renamed js.cookie.js to cookie.js for broader filesystem compatibility

= 1.0.1 =
* Removed custom CSS/JS input fields (WP.org guideline compliance)
* Replaced inline style/script tags with wp_add_inline_style / wp_add_inline_script
* Fixed nonce sanitization (wp_unslash + sanitize_text_field)
* Removed bundled jQuery (use WordPress built-in)
* Updated js-cookie to v3.0.8
* Removed load_plugin_textdomain() (automatic in WP 4.6+)
* Tested with WordPress 7.0

= 1.0.0 =
* Complete rewrite: WordPress Settings API replaces Redux Framework
* All obfuscated/encrypted code removed
* External update checker removed
* Phone-home tracking on activation removed
* Bundled Redux Framework removed
* New admin page: Settings → Homepage Popup Notice
* Full i18n support (.pot file included)
* All functions prefixed with hppn_
* All output properly escaped (esc_*, wp_kses_post)
* Complete sanitize callback for all options
* Visual style selector with preview images
* Color picker and media upload support
* Tested with WordPress 6.9

== Upgrade Notice ==

= 1.0.3 =
New admin UI and help tab added. Settings remain unchanged.

= 1.0.1 =
Security and guideline compliance update. Custom CSS feature has been removed. Please review your popup styling after updating.

= 1.0.0 =
This is a complete rewrite. You will need to reconfigure your popup settings after upgrading. Please back up your old settings before updating.