=== CluForge Business Hours ===
Contributors: cluforge
Tags: business hours, opening hours, business, shortcode
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 1.2.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Weekly hours, overnight trading, live status and one scheduled special-hours period for a single business.

== Description ==

CluForge Business Hours works independently, without a licence or account.

* One business and one interval per weekday.
* Overnight intervals and an explicit 24-hours checkbox.
* Site timezone followed dynamically, or a custom business timezone.
* One inclusive special date range: notice, closure or temporary weekly hours.
* Accessible Business Hours tab and [cluforge_business_hours] live status shortcode.
* Server-rendered fallback, live refresh at schedule transitions and refresh on return to the page.
* Optional phone and Google Maps directions links. Maps opens only when a visitor follows the link.
* Header left/right and fixed top left/right placement, with configurable fixed offsets.

No licensing, premium features, external updater or tracking is included in Free.
The optional CluForge Business Hours Pro extension adds split intervals, multiple
exception periods, advanced presentation and Pro configuration transfer.

== Installation ==

1. Upload the cluforge-business-hours folder to wp-content/plugins or upload the ZIP.
2. Deactivate the legacy business-hours plugin before CluForge takes ownership.
3. Activate CluForge Business Hours and open CluForge > Business Hours in administration.
4. Review business details, timezone and weekly hours. Enable the tab if desired.
5. Add [cluforge_business_hours] to content for live status.

Business settings use one save form with Business details, Weekly hours, Special
hours and Widget setup tabs. Unsaved edits are not applied to public output.
Pro schedules and appearance, if installed, have separate save scopes.

== Frequently Asked Questions ==

= How do overnight and 24-hour days work? =
22:00 to 02:00 opens on the selected weekday and closes the following day.
Opening is inclusive and closing is exclusive. Schedule-changing special-period
boundaries clip carry-over at midnight. Select Open and 24 hours for a whole day;
time fields are ignored. Equal opening and closing times alone are invalid.

= Which timezone is used? =
Site mode follows wp_timezone(), including later WordPress timezone changes.
Custom mode stores an IANA timezone identifier. Daylight-saving gaps advance by
the gap; ambiguous openings use the earlier occurrence and closings the later.

= What happens if the legacy plugin is still active? =
CluForge remains inactive on the frontend and shows an administrator notice.
It does not change the legacy plugin's hooks, output or settings.

= Is legacy data preserved? =
Migration is versioned, resumable and idempotent. Original legacy options remain
unchanged as rollback data. Migrated sites retain phone/address and explicitly
use Australia/Melbourne. Migrated pages retain temporary legacy-shortcode support.
Invalid imported schedules are disabled with review warnings. Existing CluForge
settings are not silently replaced: explicit import requires administrator
permission, a nonce and confirmation of the displayed replacement values.

= What happens when live refresh fails? =
Useful current/fallback output remains visible with an unavailable notice.
Opening the tab or returning to the page retries. Automatic recovery is bounded
to three retries at 30 seconds, 2 minutes and 5 minutes. Success restores normal
transition-based scheduling. JavaScript is required for live correction.

= Do cached pages need purging? =
Exclude /wp-json/cluforge-business-hours/v1/hours from server/CDN REST caching.
For LiteSpeed, retain the exact exclusion:
^/wp-json/cluforge-business-hours/v1/hours$
Live REST refresh corrects status in existing widget/shortcode markup. Purge
page caches after structural changes, including enabling a previously absent
widget, placement/offset changes or extension presentation changes. Without
JavaScript, cached fallback HTML may stay stale until expiry or purge.

= Can fixed tabs overlap my theme? =
Fixed positions attach to the viewport and may require administrator offset
adjustment to clear theme controls. Header positions sit below a detected site
header, falling back to fixed placement if no suitable header is found.

= Does uninstall delete my data? =
No. Deactivation and uninstall intentionally retain business-hours settings,
schema/migration metadata and legacy rollback data. There is no uninstall.php
cleanup. Take a backup before removing retained options manually.

== Extension API ==

Free 1.2.0 provides extension API 1.1 with scheduling API 1.0 compatibility.
Free owns schedule evaluation, standard markup, placement and live refresh.
Trusted registered presentations may apply validated root decoration. Existing
Free settings and migration schema are unchanged; no resave is required.
See docs/extension-api.md for the versioned contracts.

== Changelog ==

= 1.2.1 =
* Add shared CluForge dashboard, product navigation and bundled help.
* Improve administration contrast, wrapping controls and keyboard navigation.
* Preserve schedules, migration, settings, REST and frontend behaviour.


= 1.2.0 =
* Add versioned schedule-provider and presentation contracts with atomic fallback.
* Add validated decoration on the standard widget/status roots.
* Improve administration navigation, form guidance and keyboard error recovery.
* Preserve Free settings, migration, public REST and placement behavior.

= 1.0.6 =
* Disclose replacement placement and offsets before legacy import.
* Show the legacy ownership warning once on the settings page.

== Upgrade Notice ==

= 1.2.0 =
Existing settings do not require resaving. Review theme placement and exclude the
live hours REST endpoint from caching. Free continues independently of Pro.

== CluForge administration ==
CluForge > Dashboard lists installed editions and locally cached licence information.
An active plugin does not itself establish licence entitlement. Product settings and
enquiry URLs remain compatible; settings and licence operations retain their existing controls.
