=== ActionBanner ===
Contributors: sbinternet
Tags: banner, alert, announcement, gutenberg, scheduling
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.4.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A simple scheduled call-to-action and announcement banner block for WordPress.

== Description ==

ActionBanner adds a Gutenberg block for time-sensitive announcements, alerts, events, and calls to action.

Features:

* Headline and optional description
* Optional CTA button
* Announcement, Action, Alert, and Event banner types
* Optional start and end dates
* Automatic front-end hiding outside the scheduled window
* Custom banner and button colors
* Optional new-tab links
* Responsive output
* No external service or account required

ActionBanner converts site-local schedule dates to UTC timestamps and evaluates visibility in an external frontend script. Scheduled banners remain in cached HTML and start hidden until JavaScript runs. No WP-Cron or AJAX is required. Start is inclusive; end is exclusive. Invalid, equal, or reversed dates keep the banner hidden.

Native Divi 5 integration is included. Schedule settings apply to all devices; old tablet/phone/hover/sticky schedule overrides are ignored. Divi uses its documented module registration and style metadata APIs. The theme controls whether declared block styles are loaded on demand; ActionBanner does not change that site-wide policy.

== Installation ==

1. Upload the `actionbanner` folder to `/wp-content/plugins/`, or install the ZIP through Plugins > Add Plugin > Upload Plugin.
2. Activate ActionBanner.
3. Edit a post or page and add the **Action Banner** block.
4. Configure the message, link, colors, and optional schedule in the block sidebar.

== Frequently Asked Questions ==

= Does the scheduling use my WordPress timezone? =

Yes. ActionBanner uses the timezone configured under Settings > General in WordPress.

= What happens after the end date? =

The banner stays in HTML but the external script hides it at the end timestamp, including on cached pages and pages already open. Timers may be delayed in background tabs; visibility is rechecked when the page becomes active. The visitor device clock is used.

= Does it require JavaScript on the front end? =

Yes, for scheduling and dismissal. Scheduled banners remain hidden if JavaScript is blocked or disabled. Unscheduled banners remain visible.

= Is scheduled content confidential? =

No. Future and expired banner content is present in page source. Scheduling controls visibility only.

= What about full-page caches? =

Time passing does not require a cache purge. Purge existing caches once after upgrading from 0.3.0 and after changing banner content, dates, or the site timezone so cached markup contains the new settings. Allow the external frontend script in your Content Security Policy. Banner custom colors still use inline styles; removing inline click handlers does not make all style policies compatible.

= How are daylight-saving transitions handled? =

Use the WordPress site timezone. Nonexistent spring-forward local times are rejected. Repeated fall-back minutes use PHP's timezone resolution; avoid that ambiguous hour if exact timing matters.

= Where is the build source? =

The Divi 5 Visual Builder bundle is built from editable source shipped in the plugin itself: `divi/visual-builder/src/` plus `package.json` and `webpack.config.js` in `divi/visual-builder/`. Run `npm install && npm run build` there to regenerate `divi/visual-builder/build/`. The Gutenberg block's editor and front-end scripts (`block/index.js`, `block/frontend.js`) require no build step; edit them directly.

== Changelog ==

= 0.4.0 =
* Cache-resilient scheduled visibility with external JavaScript and UTC timestamps.
* Shared renderer, schedule validation, and icon definitions for Gutenberg and Divi.
* Removed inline dismissal handlers; preserve focus on dismissal and expiration.
* Removed theme-internal requires, unused jQuery dependency, and unconditional Divi stylesheet enqueue.
* Non-responsive Divi content controls, native Gutenberg banner colors and contrast checking, explicit button contrast checking.
* Reproducible Divi build and allowlisted production distribution.
* Front-end script no longer uses syntax unsupported by older browsers.
* Divi module metadata is now read from disk once per request instead of on every render.


= 0.3.0 =
* Added a native Divi 5 Action Banner module with Visual Builder support.
* Gutenberg and Divi versions share the same core banner behavior and scheduling rules.
* Updated SB Internet plugin metadata.


= 0.2.1 =
* Updated author and product metadata for SB Internet.
* Synchronized plugin, block, and script asset version metadata.

= 0.2.0 =
* Added optional banner icons.
* Added dismissible banners.
* Added solid and outline button styles.
* Improved scheduling controls and editor preview.

= 0.1.0 =
* Initial release.
