=== Watrix Popup Banner ===
Contributors: watrix
Tags: popup, banner, modal, promotion, announcement
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 1.4.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Display image popups and banners from the WordPress admin with no code. Rotation, 9 positions, scheduling, animations, and per-image links.

== Description ==

Watrix Popup Banner lets you show image popups and banners on your site without writing any code. Create a banner from the admin, pick images, and configure how and when it appears.

Features:

* Separate images for desktop (PC) and mobile (SP); the PC image is reused when no SP image is set
* Multiple images with rotation (configurable interval) or random display
* 9 display positions (four corners, four edge centers, screen center) and a width (px) setting
* Scheduling with start/end date and time, evaluated against your site time zone
* Six entrance animations: none (instant), fade, slide-in, pop-in, zoom-up, and rotate-zoom (respects prefers-reduced-motion)
* Close button with Esc key support and a configurable delay (0–60000 ms) before the close button appears; the Esc key works even during the delay
* Re-display suppression days (0 = show every time), remembered per visitor via browser localStorage
* Configurable display delay (0–60000 ms) before the banner appears after page load
* Drop shadow on/off and rounded corners (0–100 px)
* Per-image link URLs (empty image = no link); "open links in a new tab" applies to all image links of the banner
* Subtle hover effect on linked banners (press-in, respects prefers-reduced-motion, no accidental firing on touch devices)

日本語補足:

* PC用/SP用の画像をそれぞれ指定できます（SP未設定時はPC画像を流用）。
* 複数画像のローテーション（切替間隔指定）またはランダム表示に対応します。
* 表示位置は9箇所、幅はpxで指定します。
* 表示期間（開始/終了日時）はサイトのタイムゾーン設定に基づいて判定します。開始日時は含み、終了日時は含みません（開始 <= 現在 < 終了）。
* 表示アニメーションは6種から選べます（通常/フェード/スライドイン/ポップイン/ズームアップ/回転ズーム）。
* 閉じるボタンの表示遅延中もEscキーでバナーを閉じられます。
* 再表示抑止は訪問者のブラウザのlocalStorage（キー: bpop_closed_{バナーID}）に保存し、個人を識別する情報は保存しません。
* v1ではアンインストール時にデータ（バナー投稿・設定）を削除しません。

== Installation ==

1. Upload the plugin to `wp-content/plugins/` or install it from Plugins > Add New, then activate it.
2. Open the "バナーPopup" (Banner) menu in the admin and add a new banner.
3. Select a PC image (required), configure position, schedule, width, and other options as needed, then publish.

== Frequently Asked Questions ==

= Do I need to write any code? =

No. Everything is configured from the admin screen. You select images from the media library and set options with form controls.

= What happens when there is no mobile (SP) image? =

The desktop (PC) image is used on mobile as well, so a banner is always shown when a PC image is set.

= How are the start and end times evaluated? =

Scheduling uses your site time zone. The start time is inclusive and the end time is exclusive (start <= now < end). A banner whose start time equals its end time is never shown.

= My site uses a page cache or CDN. Will an expired banner keep showing? =

No. The period is checked both on the server and in the browser, so an expired banner will not keep showing even from cached HTML. However, the start of display can be delayed by the cache TTL; purge the cache at the start time if you need it to be exact.

= How is "do not show again" remembered? =

It is stored in the visitor's browser localStorage (key: `bpop_closed_{banner ID}`). No personally identifiable information is stored. If localStorage is unavailable (for example, private browsing), no error occurs and the banner is shown every time.

= I changed the suppression days but visitors who already closed the banner still do not see it. Why? =

The suppression is calculated and saved from the suppression days at the moment the banner was closed, so changing it later does not affect visitors who already closed it. To reliably show it to everyone again, create and publish a new banner (the banner ID changes, so it is excluded from the closed memory).

== Screenshots ==

1. Banner displayed on the front end. / フロントエンドでのバナー表示例。
2. Banner settings screen in the admin (images, position, schedule, animation, etc). / 管理画面のバナー設定画面（画像・表示位置・期間・アニメーション等）。
3. Banner list in the admin. / 管理画面のバナー一覧。

== Changelog ==

= 1.4.4 =
* 改善: WordPress.org プラグインページのスクリーンショットを差し替え（コードの変更はありません）

= 1.4.3 =
* 変更: カスタム投稿タイプの識別子と投稿メタキーに固有プレフィックスを付与（WordPress.org ガイドライン準拠。未公開のため既存データへの影響なし）

= 1.4.2 =
* 改善: リンク付きバナーにホバーすると不透明度0.8＋少し右下に沈む押し込み演出（prefers-reduced-motion対応・タッチ端末では誤発火しない）

= 1.4.1 =
* 変更: 管理画面サイドバーのメニュー表示を「バナーPopup」に変更

= 1.4.0 =
* 機能: バナーにドロップシャドウを付けるか選択可能に（ON/OFF）
* 機能: バナーの角丸を指定可能に（0〜100px・0=角丸なし）

= 1.3.0 =
* 機能: バナーが表示されるまでの遅延時間をミリ秒で指定可能に（0〜60000ms・0=即時）
* 変更: 既定のリンク先を廃止し、画像ごとのリンク先に一本化（「リンクを新しいタブで開く」は全画像リンクに適用）
* 改善: 画像が1枚以下のとき、表示モード・切替間隔をグレーアウトして操作不可に（2枚以上で自動的に有効化）

= 1.2.1 =
* 修正: 再表示抑止日数を 0 に変更しても、過去に閉じた記憶（localStorage）が残っていると表示されない問題。0 = 毎回表示が設定変更後も確実に効くように（古い記憶は自動掃除）

= 1.2.0 =
* 機能: 表示アニメーションを6種から選択可能に（通常/フェード/スライドイン/ポップイン/ズームアップ/回転ズーム・prefers-reduced-motion対応）
* 機能: 閉じるボタンの表示タイミングをミリ秒指定（0〜60000ms・遅延中もEscキーは有効）
* 機能: 画像ごとにリンク先URLを指定可能（空の場合は既定のリンク先を使用）
* 修正: メディアライブラリで画像をクリックするだけで複数選択できるように（multiple: add）

= 1.1.0 =
* 改善: 設定画面（メタボックス）を4セクション構成に再設計（画像2カラム・表示位置3×3グリッド・期間横並び・モード連動の間隔disabled）
* 改善: 閉じるボタンの中心をバナー右上角に配置（画面端オフセット20pxで9位置とも画面内）
* 改善: 閉じる時に0.4秒のフェードアウト（prefers-reduced-motion対応）

= 1.0.0 =
* 初回リリース。

== Upgrade Notice ==

= 1.4.2 =
Linked banners now show a subtle press-in hover effect. No settings changes are required.
</content>
