=== Kodo Banners ===
Contributors: pixalty
Tags: banner, announcement, notification, alert-bar, cta
Requires at least: 5.9
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 2.6.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Create announcement banners with a classic rich text editor and built-in button controls.

== Description ==

Kodo Banners lets you create site announcements, alert bars, and promotional banners from a clean WordPress admin interface. Write banner content with the WordPress classic visual editor, add an optional CTA button with dedicated fields, and control where and when each banner appears.

Features:

* Multiple banners with add/delete controls.
* Classic TinyMCE visual editor with media upload, links, formatting, and HTML quicktags.
* Built-in CTA button fields for text, URL, target, size presets, font size, colors, padding, radius, border, hover styles, and CSS.
* Top of body, inside header, footer, fixed bottom, manual shortcode, and CSS selector placement.
* Selector insertion methods: prepend, append, before, and after.
* Scheduling with start and remove dates.
* Disable on all posts, selected pages, custom post types, or path/wildcard rules.
* Close button with default, hours-based, or never-show-again persistence.
* Close button visibility controls for always visible or show on banner hover.
* Header margin/padding offsets.
* Position, z-index, wrapper colors, desktop/mobile font controls, banner height/padding, close color, and scoped CSS.
* Site-wide custom CSS and JavaScript, with options to keep them when a banner is hidden or closed.
* Role permissions for non-admin banner editors.
* Built-in admin documentation page.
* Translation-ready plugin UI and registered frontend banner strings for WPML and Polylang.
* Front-end debug mode.
* Optional known cache clearing on save.
* Shortcodes: [kodo_banner id="banner_1"] and [kodo_banners placement="manual"].

== Installation ==

1. Upload the `kodo-banner` folder to `/wp-content/plugins/`, or install the plugin from the WordPress Plugins screen.
2. Activate Kodo Banners.
3. Go to Kodo Banners > Add New to create your first banner.
4. Configure the banner content, styling, placement, schedule, and close button behavior.

== Usage ==

1. Activate Kodo Banners.
2. Go to Kodo Banners > All Banners or Add New.
3. Edit each banner on its own screen with the visual editor.
4. Add an optional CTA button.
5. Configure placement, schedule, close button, rules, and styling.
6. Save changes.

== Frequently Asked Questions ==

= Does Kodo Banners contact external services? =

No. Kodo Banners does not send data to external services and loads its CSS and JavaScript locally from the plugin folder.

= Who can save custom CSS and JavaScript? =

Only users with the WordPress `unfiltered_html` capability can save custom CSS and JavaScript fields. Other banner editors can continue editing regular banner settings while existing custom code is preserved.

= Is Kodo Banners translation ready? =

Yes. The plugin interface uses the `kodo-banner` text domain and can be translated with WordPress language packs or plugins such as Loco Translate. Frontend banner content, CTA button text, CTA button URL, banner title, and close button label are also registered as strings for WPML String Translation and Polylang.

== Shortcodes ==

Use a single banner:

`[kodo_banner id="banner_1"]`

Render all banners assigned to one placement:

`[kodo_banners placement="manual"]`

Legacy numeric shortcodes are mapped during migration when possible.

== Cookies ==

Kodo Banners only uses dismissal cookies when a banner close button is enabled and its after-close behavior is set to hide for hours or never show again. The cookie name is unique per banner.

== Privacy ==

Kodo Banners does not send data to external services. Dismissal preferences are stored in first-party browser cookies only when persistent close behavior is enabled for a banner.

== Support ==

For plugin information and support, visit [Pixalty](https://www.pixalty.com).

== Changelog ==

= 2.6.2 =
* Add a plugin languages path and load the `kodo-banner` text domain.
* Register per-banner frontend strings for WPML and Polylang translation workflows.
* Translate banner content, CTA button text, CTA URL, banner title, and close button label when rendering on the frontend.
* Remove broad serialized-option translation mapping in favor of safer per-field string registration.

= 2.6.1 =
* Restyle the Documentation page to match Kodo Popup documentation card sizing.
* Update the All Banners screen with WordPress-style status views, bulk actions, date filtering, select-all checkboxes, and table footer columns.

= 2.6.0 =
* Add a Kodo Banners Documentation admin menu page with setup, placement, styling, rules, close behavior, shortcode, and troubleshooting guidance.
* Add CTA button size presets and a dedicated CTA button font-size control.
* Move Close Button settings into the editor tabs between CTA Button and Styles.
* Keep hover-only close buttons absolutely overlaid without reserving banner content space.

= 2.5.0 =
* Prepare the plugin package for WordPress.org submission with plugin-specific metadata, license notice, and complete uninstall cleanup.
* Document external-service behavior and custom-code permissions in the readme.

= 2.4.9 =
* Adjust admin title toggle controls to use a 5px border radius.

= 2.4.8 =
* Remove the editor Publish card delete button so only the current save/publish workflow actions remain.
* Clarify the page-rule copy for selecting pages where a banner should be disabled.
* Let Kodo Banners admin screens use the default WordPress admin content width.

= 2.4.7 =
* Move banner save/publish/draft/delete actions into the Publish card and remove the sticky bottom action bar.
* Add published and draft-specific action buttons: Save, Convert to Draft, Save the Draft, and Publish.
* Prevent admin editor overflow from long shortcodes and custom-code labels, and remove unnecessary tab scrolling.

= 2.4.6 =
* Store the admin browser timezone offset for scheduled banners so datetime-local fields render at the expected local time.
* Compare schedule windows using absolute timestamps instead of WordPress offset-adjusted timestamps.

= 2.4.5 =
* Add an explicit schedule enable toggle and make scheduled dates apply only when enabled.
* Replace the Publish card enabled checkbox with a Publish button and draft/published status.

= 2.4.4 =
* Align the text domain and packaged folder with the plugin slug for Plugin Check.
* Remove an unused legacy settings renderer from the main plugin file.
* Clean Plugin Check findings for nonce handling, translator comments, render escaping, and uninstall variable prefixes.

= 2.4.3 =
* Require unfiltered-code permission for saving custom CSS and JavaScript, preserving existing custom code for delegated banner editors.

= 2.4.2 =
* Prepare plugin headers and readme metadata for WordPress.org submission.
* Add uninstall cleanup for saved options and custom capabilities.
* Restrict global plugin settings and role permission changes to administrators.
* Make cache clearing opt-in on fresh installs.

= 2.4.1 =
* Remove excess top spacing in tab panels.
* Restyle color pickers as compact pill controls.
* Stack website custom CSS and JavaScript labels above their editors.

= 2.4.0 =
* Convert the banner editor's main sections into tabs.
* Polish the admin layout with compact fields, cleaner panels, and a focused sidebar.

= 2.3.3 =
* Bump asset version for the close button hover visibility fix.

= 2.3.2 =
* Improve hover-only close button visibility handling.
* Reorganize close button settings into display and after-close behavior groups.

= 2.3.1 =
* Add close button persistence modes: default, hide for hours, and never show again.
* Add close button visibility modes: always visible or show on banner hover.

= 2.3.0 =
* Add mobile font size, banner height, and banner padding style controls.
* Allow deleting every banner and show an empty state on the All Banners page.

= 2.2.5 =
* Remove extra spacing around styled words and links inside banner text.

= 2.2.4 =
* Keep the close button transparent by default and show the circular fill only on hover/focus.

= 2.2.3 =
* Make the front-end close button smaller and remove border-like hover styling.

= 2.2.2 =
* Make the front-end close button circular and invert its colors on hover/focus.

= 2.2.1 =
* Tidy admin forms by placing field labels before controls in a consistent two-column layout.

= 2.2.0 =
* Add CTA button padding, border radius, border, and hover style controls.
* Rename Quick Styles to Styles and make banner styling always active.
* Improve the banner edit UI with grouped sections and title-row feature toggles.

= 2.1.0 =
* Split the admin into All Banners, Add New, per-banner edit, and Settings pages.
* Replace paired color text fields with color-picker-only controls.
* Refresh the admin layout with cleaner WordPress-style cards, grids, and a side settings column.

= 2.0.0 =
* Remove Gutenberg/custom-post-type editing and rebuild the plugin as a settings-based banner editor.
* Add classic TinyMCE banner editing with media, links, formatting, HTML quicktags, and dedicated CTA button fields.
* Keep placement, scheduling, close button, page rules, custom CSS/JS, role permissions, cache clearing, and shortcode features.

= 1.0.0 =
* Initial release.
