Description
AfterDone Holiday Hours shows a business’s weekly opening hours (store hours, office hours, or business hours), a live “Open now” or “Closed – Thanksgiving Day” badge, and a list of upcoming closures. Public holidays for the country you choose, and for a region when the calendar has one, are applied automatically. You do not have to type in Christmas, Easter Monday, or a bank holiday every year.
Bundled holiday tables list 248 countries and territories for 2026 through 2031 (a few have no dates in this release, see the FAQ), with regions for 34 of them (for example US states, Canadian provinces, German states, and the four nations of the United Kingdom). The tables are files inside the plugin. Nothing is downloaded and no API key is needed.
The badge is calculated in the visitor’s browser from the embedded schedule and the visitor’s clock. It is checked again about once a minute from that same schedule, in the business time zone. A full-page cache can store the page, and it still will not freeze yesterday’s open or closed state. Browsers without JavaScript get the same calculation from PHP at request time. The page also includes OpeningHoursSpecification and specialOpeningHoursSpecification JSON-LD. Special hours are the days that differ from the weekly schedule, such as a holiday that closes a normally open day.
Who it is for
Shops, restaurants, cafés, clinics, salons, offices, libraries, and any site that needs to answer “are you open today?” and “are you open on the holiday?” on its own website.
What you can set
- Weekly hours, with a second interval for a lunch break. A closing time earlier than the opening time stays open past midnight.
- A country and, where the bundled calendar has them, a region. Countries with no bundled dates are left out of the list.
- Per-holiday “Open on this holiday” checkboxes. Checked holidays use the weekly schedule. Some holidays start checked: days when shops usually stay open, and an observed date within three days of the same holiday, so the business is not closed on both dates.
- Per-holiday overrides: stay closed, use regular hours, or set custom hours. An override replaces the checkbox for that holiday name.
- Manual closures for a vacation or a one-off date, including custom hours.
- A named time zone. The badge uses that zone, not the visitor’s zone.
- Optional LocalBusiness JSON-LD. It is on until you turn it off.
Shortcode
[holiday_hours view="all" days="60" show_holiday_names="1" location=""]
viewisbadge,week,closures, orall.daysis how many days ahead the closures list looks (1–180).show_holiday_nameshides public-holiday names when set to0. Labels you wrote for manual closures stay visible.locationis accepted and ignored. Every value uses the schedule from this plugin’s settings screen. A separate add-on can read the attribute.
The AfterDone Holiday Hours block has the same choices, including an optional location attribute with the same meaning.
Holidays
Dates for 2026 through 2031 are bundled. They are generated from python-holidays 0.82 (MIT). The plugin does not ship that library’s code, and it does not use the date-holidays dataset. See THIRD-PARTY-NOTICES.txt for the copyright and license. Names are in English when python-holidays provides an English catalog. Otherwise the library’s default language is used, so Italy’s names are Italian.
A normal public holiday is closed. A holiday flagged as usually open for shops, and an observed date within three days of the same holiday, uses the weekly schedule until you change it. If several holidays fall on one day, every one of them must be open on the weekly schedule, or all of them must be set to the same custom hours. Otherwise the day stays closed. A manual closure on that date wins.
Privacy
AfterDone Holiday Hours does not phone home, load a CDN, or send analytics. CSS and JavaScript are files in the plugin. There is no Freemius SDK. A separate add-on is its own plugin. The hooks it can use are listed in the FAQ.
Source code and build
Unminified block source is in src/ (index.js, edit.js, and block.json). build/index.js is the unminified webpack build of those files. This copy of the plugin also includes package.json, package-lock.json, webpack.config.js, babel.config.js, and scripts/finalize-build.mjs. From the plugin directory, run npm ci && npm run build.
Blocks
This plugin provides 1 block.
- AfterDone Holiday Hours Opening hours, a live open or closed badge, and upcoming closures with public holidays.
Installation
- Upload the
afterdone-holiday-hoursfolder to/wp-content/plugins/, or install the zip from the Plugins screen. - Activate AfterDone Holiday Hours.
- Open Settings, then Holiday Hours. Enter the weekly hours, time zone, and country.
- Add the AfterDone Holiday Hours block, or the
[holiday_hours]shortcode, to a page.
FAQ
-
Why does the badge say “Opening hours” for a moment?
-
That placeholder is what a cached page is allowed to store. The browser replaces it with “Open now” or “Closed” as soon as the script runs. The status is not saved into the HTML, so a page cache cannot show a stale one.
-
What do visitors without JavaScript see?
-
PHP calculates the same status and puts it in a noscript block. A full-page cache can freeze that fallback. The scripted badge is the cache-safe one.
-
How do I stay open on a holiday?
-
On the settings screen, check “Open on this holiday”, or add the holiday’s name and choose “Regular hours” or “Custom hours”. The name has to match the bundled calendar. Save the country first if the list is empty.
-
My business is open on some public holidays. What should I do?
-
Some bundled holidays start open, on your weekly hours. In the United States that includes Columbus Day, Veterans Day, Indigenous Peoples’ Day where that is the name of the Columbus Day holiday, Native Americans’ Day, and the day after Thanksgiving (including “Friday After Thanksgiving” and Maryland’s American Indian Heritage Day). An observed date also starts open when the same holiday is already listed within three days, so the badge does not close both days. Independence Day (observed) on Friday 3 July 2026 starts open. Independence Day on Saturday 4 July 2026 stays closed. Uncheck “Open on this holiday” to close any of these. Other public holidays, including Thanksgiving Day and Christmas Day, stay closed until you check the box or add an override.
-
Which countries are included?
-
The bundled tables cover 248 countries and territories, generated from python-holidays 0.82. The settings screen lists every one that has at least one date in 2026 through 2031. Ukraine, Sri Lanka, Bouvet Island, Heard Island and McDonald Islands, and the British Indian Ocean Territory have no dates in that release, so they are not listed. Use manual closures for those places.
-
Does it work with page caching?
-
Yes. The open or closed badge and the closures list are worked out in the visitor’s browser from the schedule embedded in the page, so a cached page does not freeze yesterday’s status. While the page stays open, the badge reads that same schedule again about once a minute, in the business time zone, without another request to your site. If a performance plugin delays JavaScript until the visitor interacts with the page, the open or closed text waits until that script runs. Exclude
afterdone-holiday-hours/assets/js/from that delay setting. -
Which day wins when rules overlap?
-
A manual closure is used first. Then holiday overrides. Then the public holiday, which is closed. Then the weekly hours. If two manual rows cover the same date, the first one wins. The closing time is already closed: 17:00 means 17:00 is not open.
-
Can hours run past midnight?
-
Yes. Set the closing time earlier than the opening time, for example 18:00 to 02:00. The business stays open until 02:00 the next day. A closing time of 00:00 ends at midnight and does not continue. The open and closed result uses the business time zone’s wall clock, including on the mornings when clocks change for daylight saving.
-
What if a holiday falls on only one side of an overnight interval?
-
The interval belongs to the day it opens.
- A public holiday or manual closure on that start day removes the interval, including the part after midnight. The next morning is not open because of it.
- A public holiday or manual closure on the next day changes only that next day’s own hours. The business stays open until the interval’s closing time, then follows the next day.
JSON-LD records the after-midnight time on the start day’s
OpeningHoursSpecification, withclosesearlier thanopens. A special of 00:00–00:00 closes that date’s own intervals. It does not delete a tail that belongs to the previous day. -
Why were some hours left out when I saved?
-
Overlapping intervals are removed. That includes two ranges on the same day, and an overnight interval that runs into the next day’s hours. On one day, the later start time is the one removed. The overnight interval is kept instead of the next day’s overlapping hours. The settings screen shows an error when this happens. A close of 02:00 and a next-day open of 02:00 do not overlap, because 02:00 is already closed.
-
Do ordinary closed weekdays show in the closures list?
-
No. The weekly table shows those. The closures list is public holidays and manual closures that are shut all day.
-
How far ahead do the holiday tables go?
-
2026 through 2031. After that, weekly hours and manual closures still work, and public holidays are not filled in until a plugin update ships new tables.
-
Does it add structured data for search engines?
-
By default, yes. The first Holiday Hours widget on a page prints a Schema.org
LocalBusinessJSON-LD block withopeningHoursSpecificationandspecialOpeningHoursSpecificationfor holidays and closures. It includes the business name if you set one, and no address. Settings, then Holiday Hours, then “Output structured data (JSON-LD)” turns the block off. Turn it off when Yoast, Rank Math, or another SEO plugin already prints your business. A developer can also remove it with thehhours_jsonldfilter by returning false or an empty array. Any other value that is not an array leaves the block as it was. When the block is on, the filter can still change it, for example to add your address. -
Does the plugin track visitors or load anything from another site?
-
No. It makes no runtime HTTP requests.
-
Where is the source for the block editor script?
-
src/index.js and
src/edit.jsare the files that were written for the block.build/index.jsis the unminified build of those files. Packages such as@wordpress/blocksare loaded from WordPress and are not copied into the build. Rebuild steps are in Source code and build. -
Can a separate add-on extend this plugin?
-
Yes. A separate plugin can use these hooks. This plugin does not include a license check.
hhours_loadedruns when this plugin has loaded.hhours_settingsfilters the sanitized settings. The result is sanitized again.hhours_settings_savedruns as settings are saved.hhours_render_settingsfilters the settings for one shortcode or block, after they have been sanitized. Thelocationattribute is passed through. The result is not sanitized again.hhours_holidaysfilters the holiday rows embedded in the page. The browser badge uses that list.hhours_nowfilters the UTC instant used for the no-JS fallback.hhours_statusfilters that no-JS status. It does not change the browser badge.hhours_jsonldfilters the JSON-LD.-
hhours_markupfilters the HTML.HHours_Renderer::config_from_settings() builds the engine config, including the holiday list, for an add-on that needs to ask “open or closed?” outside the widget.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“AfterDone Holiday Hours – Opening Hours with Automatic Public Holidays” is open source software. The following people have contributed to this plugin.
ContributorsInterested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.0.3
- Plugin name is AfterDone Holiday Hours – Opening Hours with Automatic Public Holidays. Text domain is afterdone-holiday-hours.
- The no-JavaScript badge fallback no longer prints a style tag. An enqueued inline script adds the hhours-js class, and the stylesheet hides the placeholder when that class is absent.
- Block source and the build tools are included in the plugin. See Source code and build.
1.0.2
- Holidays where shops usually stay open, including United States Columbus Day and Veterans Day, use regular weekly hours until you change them. An observed date within three days of the same holiday is not closed as well.
- Settings lists the selected country’s holidays with an “Open on this holiday” checkbox. Schedules saved in 1.0.1 keep the overrides you already set.
- “Output structured data (JSON-LD)” turns off the LocalBusiness block. The
hhours_jsonldfilter turns it off when it returns false or an empty array. - The open or closed badge refreshes about once a minute from the schedule already on the page, in the business time zone.
- Ukraine, Sri Lanka, Bouvet Island, Heard Island and McDonald Islands, and the British Indian Ocean Territory are left out of the country list because those tables have no dates for 2026 through 2031.
- Readme name, tags, and description.
1.0.1
- The shortcode and block accept a
locationattribute. This plugin still renders the one schedule from its settings screen for every value. hhours_render_settingslets a separate add-on supply the settings for one shortcode or block.HHours_Renderer::config_from_settings()is public so an add-on can evaluate a schedule with the same holiday list as the badge.
1.0.0
- Initial release.
- Weekly hours may cross midnight. The badge stays open until that closing time on the next day, including across daylight-saving changes and the new year.
- A holiday or manual closure on the day an overnight interval opens removes the next morning as well. A holiday on the next day does not cut that tail short.
- Overlapping intervals are rejected on the settings screen.
- JSON-LD keeps a past-midnight interval on the day it opens.
- Tested with WordPress 7.1.5.