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

Self-hosted appointment booking: services, weekly hours, free-slot picking, double-booking prevention and email confirmations.

== Description ==

WhenPilot is a lightweight appointment booking plugin for small businesses — salons, clinics, consultants, tutors. Everything stays on your own site; there is no third-party booking service.

**Features**

* Define **services** (name, duration, optional price, description).
* Set your **weekly opening hours** in a simple text format (e.g. `Mo-Fr 09:00-17:00`).
* Visitors book with the `[whenpilot]` shortcode: pick a service, a date, and a **free time slot** computed from your hours and existing bookings.
* **Double-booking prevention**: slots are re-validated on the server before saving, with a configurable capacity (e.g. number of staff).
* **Admin inbox**: see upcoming/pending/confirmed/cancelled bookings, confirm, cancel or delete.
* **Email confirmations** to the customer and a notification to you, plus emails when you confirm or cancel.
* Configurable lead time, how far ahead people can book, currency label and an optional auto-confirm.
* Uses your site's timezone. Works with any theme.

**Usage:** create a page, add the shortcode `[whenpilot]`, and publish.

All features described above are fully functional in this plugin — no time limits, no usage caps, no locked options. WhenPilot does not connect to any external service. A separately distributed companion plugin offers additional features (multiple staff/resources with custom fields, automatic email reminders) but is not required for the plugin to work.

== Privacy ==

Bookings (name, email, optional phone and notes) are stored in your own database and emailed to you and the customer. No data is sent to any third party.

== Installation ==

1. Upload the `whenpilot` folder to `/wp-content/plugins/`, or install the zip via Plugins → Add New → Upload.
2. Activate the plugin (this creates the tables and a sample service).
3. Go to Bookings → Services to add your services, and Bookings → Settings for your hours.
4. Add `[whenpilot]` to a page.

== Frequently Asked Questions ==

= Can two people book the same time? =
Only up to the capacity you set (default 1). Slots are re-checked on the server at the moment of booking, so overlaps are prevented.

= Does it support online payment? =
Not in this version — it collects booking requests. You confirm them from the admin inbox.

= Which timezone is used? =
Your WordPress site timezone (Settings → General).

= Is there a paid version? =
WhenPilot Pro adds unlimited services, capacity greater than 1, multiple staff/resources, custom form fields and automatic email reminders. The free version on this page is fully functional for a single service and is not time-limited.

== Screenshots ==

1. The booking form on the front-end with the inline month calendar — visitors pick a date, then a free time slot.
2. The customer fills in name, email and an optional note before confirming the booking.
3. Admin inbox showing pending, confirmed and cancelled bookings with one-click status changes.
4. Service and weekly opening hours configuration in the admin settings.

== Changelog ==

= 1.0.4 =
* Renamed the plugin from "Booking Light" to "WhenPilot" with new slug `whenpilot`.
* Removed all artificial feature caps: unlimited services and capacity above 1 are now fully available out of the box.
* Lowered the top-level admin menu position (70) so the plugin no longer competes with core WordPress menu items.
* Internal cleanup: all prefixes, hooks, options, table names, shortcode and class names updated to the new name.

= 1.0.3 =
* Hardening: all custom-table queries now use `$wpdb->prepare()` with the `%i` identifier placeholder for table names, and `$wpdb->insert/update/delete` calls are marked with explicit phpcs:ignore comments. No functional changes.
* Bumped minimum WordPress version to 6.2 (required by the `%i` placeholder).

= 1.0.2 =
* Fixed: calendar weekday columns could be misaligned when the site's "Week starts on" was not Sunday.

= 1.0.1 =
* New: the booking form now uses an inline month calendar to pick the date (closed days and past dates are greyed out) instead of a plain date field.

= 1.0.0 =
* Initial public release: services, weekly hours, free-slot booking form, double-booking prevention, admin inbox and email confirmations.
