=== codefokus Opening Hours with German Public Holidays ===
Contributors: codefokus
Tags: opening hours, business hours, holidays, germany, schema
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Show your opening hours with a live "open now" status that automatically knows the German public holidays of your federal state.

== Description ==

Most opening hours plugins show "Open" on Easter Monday or All Saints' Day, unless you enter every holiday by hand – every year. This plugin calculates the public holidays of all 16 German federal states itself and shows the correct status automatically:

* **"Open now · until 6:00 pm"** / **"Closing soon"** / **"Closed now · opens tomorrow at 8:00 am"**
* **"Closed today (All Saints' Day) · opens tomorrow at 9:00 am"**

= Deutsch =

Öffnungszeiten mit Live-Status („Jetzt geöffnet · bis 18 Uhr“), die die gesetzlichen Feiertage deines Bundeslands automatisch kennen – lokal berechnet, ohne externe API. Deutsche Übersetzungen werden über translate.wordpress.org bereitgestellt.

= Languages =

The plugin is fully translatable. German translations are provided via translate.wordpress.org – contributions in any language are welcome.

= Features =

* Public holidays for all 16 federal states, including movable holidays (Easter, Ascension, Whit Monday, Corpus Christi) and special cases such as Day of Repentance and Prayer (Saxony), International Women's Day (Berlin, Mecklenburg-Western Pomerania), World Children's Day (Thuringia) and Reformation Day.
* **5 designs:** Classic, Card, Banner, Minimal and Compact (for sidebars and footers) – with live preview on the settings page.
* Own title, custom colors for accent, "open" and "closed", and the block editor's color, spacing and font size options.
* Group days with the same hours ("Mon – Fri 9:00 – 17:00").
* Up to two time slots per day (e.g. lunch break).
* Optional: closed on Christmas Eve and New Year's Eve.
* Closures and company holidays as date ranges.
* List of upcoming closures – holidays are only listed if you would otherwise be open that day.
* Live status that keeps working with page caching: the status is updated in the browser every minute.
* Block for the block editor and a shortcode for classic editor, widgets and page builders.
* Optional schema.org `OpeningHoursSpecification` (JSON-LD) including closed days for search engines.
* Preview of all calculated holidays on the settings page, so you can check them.
* No external requests, no tracking, no cookies – GDPR friendly.

= Shortcode =

`[ohgh_opening_hours]`

Attributes:

* `status="yes|no"` – live status (default: yes)
* `table="yes|no"` – weekly hours (default: yes)
* `closures="3"` – number of upcoming closures, 0 hides the list (default: 3)
* `design="classic|card|banner|minimal|compact"` – design (default: as set on the settings page)
* `title="Opening hours"` – optional title
* `group="yes|no"` – group days with the same hours (default: no; always on for "compact")
* `accent_color`, `open_color`, `closed_color` – custom colors as hex values, e.g. `open_color="#2e7d32"`

Examples:

* Card with title: `[ohgh_opening_hours design="card" title="Öffnungszeiten"]`
* Status only, e.g. for the header: `[ohgh_opening_hours design="minimal" table="no" closures="0"]`
* Footer: `[ohgh_opening_hours design="compact"]`

= For developers =

* Filter `ohgh_holidays( array $holidays, int $year, string $state )` – add or remove holidays (e.g. local holidays such as the Augsburg Peace Festival).
* Filter `ohgh_schema_data( array $data )` – modify the JSON-LD.

Developed by [codefokus](https://codefokus.de).

== Installation ==

1. Install and activate the plugin.
2. Go to **Settings → Opening Hours**, choose your federal state and enter your hours.
3. Make sure your timezone under **Settings → General** is set to "Berlin".
4. Add the block "Opening Hours (German Holidays)" or the shortcode `[ohgh_opening_hours]` to a page.

== Frequently Asked Questions ==

= Which holidays are included? =

All public holidays that apply to an entire federal state. Holidays that only apply in some municipalities (Corpus Christi in parts of Saxony and Thuringia, Assumption Day in parts of Bavaria, Augsburg Peace Festival) are not included automatically – add them as a closure or via the `ohgh_holidays` filter.

= Does the status work with caching plugins? =

Yes. The page contains the schedule for the next 30 days and the status is recalculated in the visitor's browser every minute, so a cached page still shows the correct status.

= Does the plugin connect to external services? =

No. All holidays are calculated locally.

= Can I use it for Austria or Switzerland? =

Not yet – planned for a future version.

= Do you support opening hours past midnight (e.g. 6 pm – 2 am)? =

Not in version 1.0. As a workaround, enter 18:00–23:59 and 00:00–02:00 on the following day.

= I already use an SEO plugin with schema data. =

The schema output is off by default. Only enable it if no other plugin outputs your opening hours.

== Screenshots ==

1. Five designs: Classic, Card, Banner, Minimal and Compact – with live open/closed status.
2. Public holidays of your federal state are calculated automatically, e.g. Corpus Christi in Bavaria.
3. Settings page: federal state, weekly hours with lunch break, holiday options and holiday preview.

== Changelog ==

= 1.0.0 =
* Initial release.
