=== Terminy Booking ===
Contributors: amitry
Tags: booking, appointments, calendar, scheduling, reservations
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Appointment booking that shows how full each day is at a glance. Setup wizard, staff and services, industry presets and notifications.

== Description ==

Terminy turns a WordPress site into an appointment booking system. What sets it apart from a plain slot list is how availability is shown: every day in the calendar is drawn as a small vessel, and the liquid level in it is that day's occupancy. A visitor sees which days are quiet before clicking anything, and the exact number of free slots is always printed next to it.

Everything runs on your own site. There is no external service, no account to create, no per-booking fee, and the plugin makes no outbound HTTP requests of any kind.

**Setup wizard**

Pick an industry preset (hair salon, medical practice, physiotherapy, beauty, tattoo, driving school, car workshop, coaching, veterinary, personal training), adjust the services and staff it proposes, choose a colour scheme. The booking page is created for you. Running the wizard a second time does not duplicate anything.

**Booking logic**

* Working hours per staff member, or business defaults, including split shifts
* Buffer time before and after each service
* Lead time and booking horizon
* Absences and holidays per staff member or for the whole business
* Timezone and daylight-saving safe
* Double-booking protection with database locking
* "Anyone" assignment that spreads bookings across the team

**Calendar and widget**

* Flat day cells whose liquid level shows how busy the day is, with the number of free slots next to them
* Choose whether a full cell means "fully booked" or "lots of free slots"
* The nearest free appointment is offered before a day is even picked
* Six colour schemes
* Respects `prefers-reduced-motion`, ARIA labels, full keyboard navigation
* On a phone, picking a day swaps the month view for that day's times instead of stacking them

**Notifications**

Confirmation, reminder, reschedule and cancellation emails with editable placeholder templates and an ICS calendar attachment. Staff members get their own notification and a personal ICS feed URL for Google, Outlook or Apple Calendar.

**Waiting list**

When a day is full, customers can join a waiting list and are notified automatically as soon as a slot frees up.

**Cancellation and rescheduling**

Every confirmation email carries a secure manage link. The customer can cancel or move the appointment within a deadline you set. A cancellation triggers the waiting list.

**Editor integration**

A native block with live controls, a native Elementor widget, and the `[terminy]` shortcode.

**Privacy**

A consent checkbox is required on every booking. Terminy registers with the WordPress personal-data export and erasure tools, and anonymizes inactive customer records after a retention period you choose.

**Payments**

"Pay on site" is built in and records the payment state on each appointment. Additional gateways register themselves through the `terminy_payment_gateways` filter.

**For developers**

Over 60 documented actions and filters, listed in `docs/HOOKS.md` inside the plugin folder. Add-ons can attach a whole feature area through `terminy_admin_menu`, `terminy_register_rest_routes` and `terminy_wizard_result` without patching core files.

**Shortcode**

`[terminy]` with optional attributes: `service="3" staff="2" skin="rose" water="on|off" water_mode="booked|free" parallax="on|off"`

== Installation ==

1. Upload the `terminy-booking` folder to `/wp-content/plugins/`, or install the ZIP under Plugins, Add New, Upload Plugin.
2. Activate Terminy.
3. The setup wizard opens by itself. Walk through it; it takes a few minutes.
4. The booking page is live. Open it to see what your customers see.

== Frequently Asked Questions ==

= Does a full cell mean "fully booked" or "lots of free slots"? =

Whichever you prefer. By default bookings fill the cell, so a full cell means a full day. You can switch to the tank reading under Terminy, Settings, Design & water. Either way the number of free slots is printed next to the calendar, so nobody has to guess.

= Can customers cancel or move an appointment themselves? =

Yes. Every confirmation email contains a secure manage link. You set the deadline, 24 hours by default. A cancellation notifies the waiting list automatically.

= Does Terminy send data to an external service? =

No. The plugin makes no outbound HTTP requests. Appointment data never leaves your database. Notification emails go out through `wp_mail()`, like any other WordPress email.

= Is Terminy suitable under the GDPR? =

Terminy keeps everything local, requires a consent checkbox, integrates with the WordPress data export and erasure tools, and anonymizes inactive customer records after a retention period you set. Please note that for medical practices appointment data can be health data under Art. 9 GDPR, so review your record of processing activities.

== Screenshots ==

1. The booking widget: each day is a small vessel whose liquid level shows how busy that day is.
2. Picking a day reveals the free times next to the calendar, with the exact count.
3. The details step: a short form and a one-line recap of the appointment.
4. The setup wizard proposes services, staff and opening hours for the chosen industry.
5. The admin week calendar with the day's appointments and statistics.

== Changelog ==

= 1.1.0 =
* Changed: the mobile app connection (device pairing, the app API and the App & devices screen) is no longer part of this plugin. It moved to the separate Terminy Pro add-on, which attaches through the documented hooks. Appointments, staff, services and settings are untouched.
* New: `terminy_admin_menu`, `terminy_register_rest_routes`, `terminy_wizard_result` and `terminy_admin_notices` let an add-on attach a complete feature area without patching core files. See `docs/HOOKS.md`.
* Changed: the plugin folder and text domain are now `terminy-booking`. Existing settings, appointments and shortcodes are unaffected.
* Security: a review access code stored in clear text by earlier versions is removed from the database on update.
* Fixed: several strings were not translatable, the currency symbol in the setup wizard ignored the setting, and the plural of "%d slot free" used the English two-form rule in every language. The count now comes from the server, where the translation picks the right form.
* Fixed: running the setup wizard again with new service names left those services without any staff member, so nobody could book them. Staff members that already existed are now assigned to the services the wizard adds; their existing assignments are not touched.
* Changed: the calendar attachment of confirmation emails is written once under its final name instead of being renamed, and calendar downloads send a `nosniff` header.
* Changed: the hook reference moved from `HOOKS.md` to `docs/HOOKS.md`, and the plugin passes Plugin Check 2.1.0 with zero errors and zero warnings.
* Changed: the calendar is flat now. Every bookable day is a plain square holding the day's occupancy as liquid with a slowly moving surface; a quiet day still holds a little, closed and past days hold none, and a fully booked day is a solid square. No rims, shadows or highlights.
* Changed: the widget is narrower (680px instead of 760px) and the month has a fixed width, so it no longer stretches across a wide page. The day panel shows the picked day as the same small vessel, the date, the number of free times and the times themselves; the big glass and its caption are gone.
* New: before a day is picked, the panel offers the nearest free appointment with one button. The continue button names the chosen time ("Continue with 10:30"), months slide in from the side you came from, and the times fade in one after another.
* Fixed: a theme that turns every `svg` into a block element pushed the vessel on the confirmation screen to the left.
* Changed: translations are no longer bundled. WordPress.org generates and delivers them through translate.wordpress.org, so every locale is covered instead of only the ones shipped here.
* Removed: the "Pro & hooks" admin page. The hook reference it showed lives in `docs/HOOKS.md`, which is complete and always current.

= 1.0.7 =
* Fixed: on screens narrower than 900px a theme could hide the widget's button row completely, including "book now", by styling its own off-canvas menu with the same class name. The widget now states its own layout rather than inheriting whatever the theme has, so a name clash can no longer take the booking button away.
* Fixed: form fields could be stretched to several hundred pixels tall by a theme rule the widget never asked for.
* Fixed: on a phone the booking page could be scrolled about 32px sideways, because the soft glows behind the card bleed wider than the screen. They are clipped now.
* Changed: the calendar days now read as glasses. Each open day has a rim, a floor and a water level, so an empty day looks like an empty glass instead of a blank box, and a single booking is still visible as a sliver.
* Changed: the step indicator is now numbered markers on a rail that fills up as the visitor moves forward, with a tick on the steps already behind them.
* Changed: the widget is narrower (760px instead of 980px) and the details form narrower still. Site owners can set `--ty-max` on `.terminy-widget` to change it.

= 1.0.6 =
* Changed: on a phone, picking a day now replaces the calendar with that day's times instead of adding them below it. The page no longer grows longer with every tap, and a "change date" button goes back.

= 1.0.5 =
* Fixed: staff members and services could not be deleted once any appointment had ever referenced them, even one that was long past or cancelled. Now only upcoming, still-active appointments protect an entry; everything else can be removed for good.
* Fixed: deleting a staff member or service no longer empties the name on past appointments. The name is kept on the record, so the history stays readable.
* Fixed: running the setup wizard again added a second set of services and staff on top of the existing ones. Names that already exist are reused now, and the last step asks whether the existing entries should be kept or replaced.

= 1.0.4 =
* New: review and demo access under Terminy, App & devices. A revocable pairing code with a long validity that can be redeemed more than once, for app store review and for demos.

= 1.0.3 =
* Changed: every calendar day is a small vessel again, and the water level inside the cell shows how busy that day is.
* Changed: softer water tones, so a bright colour scheme no longer shouts.
* Changed: much shorter "Your details" step, two form fields per row on wider screens.
* Fixed: input font size raised to 16px so iOS no longer zooms in when a field is focused.

= 1.0.2 =
* Changed: minimalist booking widget with neutral surfaces and a single accent colour.
* Fixed: parallax background glows were clipped with hard edges; layers now fade out softly and stay within bounds while scrolling.
* Changed: the "Date & time" step keeps a stable height instead of growing downwards.

= 1.0.1 =
* New: reschedule appointments, with an availability check that ignores the appointment's own slot. Customers receive a "new time" email with an updated ICS instead of a cancellation.
* New: `terminy_booking_rescheduled` action and a rescheduled email template with `{old_date}` and `{old_time}` placeholders.
* New: app endpoints for absences and customer history.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.1.0 =
The mobile app connection moved to the separate Terminy Pro add-on. If you have a phone paired with the Terminy app, install Pro to keep using it. Your appointments, staff, services and settings are not affected.

= 1.0.7 =
Fixes a bug that could hide the booking button on phones when the active theme used the same CSS class names. Recommended for every site.
