=== Alnora - Booking for Private Clinics ===
Contributors: Alnoraclinic
Tags: booking, appointments, clinic, doctor, medical
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.1
Stable tag: 1.2.6
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Appointment booking and clinic management built exclusively for private medical practices.

== Description ==

Alnora replaces the usual tangle of a generic booking plugin + spreadsheets with one focused product made for private clinics with 1–10 doctors: dentists, psychologists, cosmetic clinics, dermatologists, physiotherapists and GPs.

Features in this version:

* Doctor profiles with photo, email, bio and per-doctor weekly working hours (with breaks).
* Categories for both doctors and services — group and label them; doctor categories are shown on the booking form.
* Bookable services with a rich description (and an optional "Read more" popup on the booking form), duration, buffer time, price and colour.
* "Offered by" — assign each service to specific doctors, or leave it available to every doctor.
* A modern, multi-step booking wizard for patients (choose doctor → service → date & time → details), embeddable via shortcode or Gutenberg block.
* A slot-availability engine that respects working hours, breaks, buffers, existing bookings and your booking window.
* Patient records with email/phone encrypted at rest (AES-256) and a SHA-256 email hash for lookups.
* GDPR consent capture with timestamp + IP logging, plus optional automatic deletion of inactive patient records after a configurable number of years (off by default).
* Transactional emails: booking confirmation to the patient, notification to the clinic, status-change emails and automatic reminders (hourly cron).
* A clean, branded wp-admin: dashboard with stats, a searchable appointment list with inline status control and an at-a-glance "More info" details popup, plus searchable doctor and service screens and patient and settings screens.
* Dates and times throughout the booking form, emails and admin follow your WordPress date and time format (Settings → General).
* REST API under the `alnora-clinic/v1` namespace.

**Languages**

The patient-facing booking form and the transactional emails are available in 13 languages out of the box — English, German, French, Spanish, Italian, Dutch, Polish, Czech, Swedish, Danish, Norwegian, Ukrainian and Russian — chosen with a single **Patient language** setting (independent of your site language). Every string is translation-ready via the `alnora-clinic` text domain and standard `.mo`/`.po` files, so you can add or refine languages with tools like Loco Translate. (Localised month names in email dates additionally require the matching WordPress language to be installed under Settings → General → Site Language.)

**Upgrade to Alnora Pro**

Need more than booking? [Alnora Pro](https://alnora-booking.com/pricing/) adds:

* Online payments and refunds with Stripe and PayPal, plus configurable deposits.
* Recurring appointments and a patient waitlist.
* SMS and WhatsApp reminders (via Twilio).
* Google Calendar and Microsoft Outlook two-way calendar sync.
* Telehealth video links (Zoom and Google Meet).
* A patient self-service portal (view, cancel and rebook appointments; download documents).
* Encrypted medical records with prescription and diagnosis PDFs.
* Branded invoice PDFs.
* Multiple clinic locations.
* Fully branded styling
* Fully customisable email templates
* Shortcode pre-filtering by doctor, service and location.
* Zapier webhooks, CSV import and a full GDPR toolkit (export, erasure, audit log).


Learn more and see pricing at [alnora-booking.com](https://alnora-booking.com/pricing/).

== Installation ==

1. Upload the `alnora-clinic` folder to `/wp-content/plugins/`.
2. Activate **Alnora** through the *Plugins* menu in WordPress. On activation the plugin creates its database tables, custom roles and a **Book an Appointment** page containing the booking shortcode.
3. Go to **Alnora → Doctors** and add at least one doctor (set their working hours).
4. Go to **Alnora → Services** and add at least one service.
5. Visit the auto-created booking page (link shown under **Alnora → Settings**) to test a booking.

== Notes for developers ==

* The booking form and admin tables are dependency-free **vanilla JavaScript** (no build step required). The optional Gutenberg block uses `wp.element` and also needs no build step.
* For production, define a fixed encryption key in `wp-config.php`:
  `define( 'ALNC_ENCRYPTION_KEY', 'your-32-char-random-key-here' );`
  If omitted, a key is generated and stored once in the options table so the plugin works out of the box.

== External Services ==

This plugin connects to **Freemius**, a third-party service we use for software licensing, update delivery and — only if you opt in — anonymous usage analytics and diagnostics.

When and what data is sent: on activation the plugin shows an opt-in screen. If you click "Allow & Continue", it sends your site URL, your WordPress and PHP versions, and the email address of the admin who opts in, so we can deliver updates, verify licences and provide support. If you click "Skip", no data is sent and the plugin remains fully functional. If you later purchase or activate a Pro licence, licence and site-activation details are exchanged with Freemius to validate it.

Service provider: Freemius, Inc. — Terms of Service: https://freemius.com/terms/ — Privacy Policy: https://freemius.com/privacy/

Aside from Freemius, the plugin does not connect to any other external service. All assets (fonts, scripts and styles) are bundled with the plugin and served from your own site.

== Frequently Asked Questions ==

= Does the booking form work with any theme? =
Yes. The booking wizard is rendered inside a scoped `.alnc-booking` container with its own styles. A small CSS reset neutralises common theme interference (button padding, box-shadow, etc.).

= How do I embed the booking form? =
Place the shortcode `[alnora_booking]` on any page, or use the **Alnora Booking Form** Gutenberg block. A **Book an Appointment** page is created automatically on activation.

= Can I pre-select a doctor or service in the shortcode? =
Pre-selecting a doctor or service via shortcode attributes (e.g. `doctor="1" service="2"`) is available in **Alnora Pro**. The free version embeds the full booking wizard with the plain `[alnora_booking]` shortcode.

= Is patient data stored securely? =
Patient email and phone are encrypted at rest using AES-256. A SHA-256 hash of the email is stored separately for lookups. GDPR consent is recorded with a timestamp and IP address.

= How many doctors can I add? =
There is no limit — add as many doctors as your clinic needs, each with their own profile, working hours and services.

= Where do I configure email notifications? =
Go to **Alnora → Settings → Email & reminders**. You can set the from name, from address, admin notification email and reminder lead time.

= Does it work with WPML or Polylang? =
All strings are translation-ready via the `alnora-clinic` text domain. Full WPML/Polylang compatibility is planned for a future release.

== Screenshots ==

1. The multi-step booking wizard as patients see it on the front end.
2. The appointments list with inline status control.
3. The doctor profile editor with working hours and break configuration.
4. The dashboard with appointment stats at a glance.
5. The settings screen with autosave.

== Changelog ==

= 1.2.6 =
* Fix: on the booking form, choosing a doctor who offers no services now shows a clear "this doctor doesn't work with this service — please choose another doctor" message, instead of the unrelated "no free slots on this day" notice.

= 1.2.5 =
This is a big feature update. Your data is preserved; new database tables and columns are created automatically on update.

* New: categories for doctors and services — create, edit and assign categories to organise your team and your services. Doctor categories are shown under each doctor on the booking form.
* New: rich service descriptions, with an optional per-service "Read more" popup on the booking form.
* New: "Offered by" — assign a service to specific doctors, or leave it available to every doctor. The booking form only shows each doctor the services they offer.
* New: search the Doctors and Services lists in the admin.
* New: GDPR retention — optionally auto-delete (anonymise) inactive patient records after a set number of years. Off by default; configure under Settings → GDPR.
* New: a "More info" popup in the Appointments list showing the full booking details at a glance.
* New: the booking form shows the clinic timezone beneath the title, so patients can see which timezone the available times are in.
* Improvement: dates and times across the booking form, emails and admin now follow your WordPress date and time format (Settings → General).
* Improvement: more of the booking page now follows the Patient language setting, including the appointment self-cancellation notices and the timezone label.
* Change: doctors are now organised with categories instead of a single specialisation field.
* Change: the main admin menu is now labelled "Alnora Clinic".
* Improvement: doctor cards in the booking form no longer render an empty line when a doctor has no category set.
* Improvement: admin notices now display at the top of every Alnora screen, above the page title (previously only some screens).

= 1.2.4 =
* New: an optional upgrade path to Alnora Pro, with account and licence management, powered by Freemius. Any usage tracking is opt-in only — the plugin asks first and works fully if you skip. See the External Services section.
* Change: pre-selecting a doctor or service through `[alnora_booking]` shortcode attributes is now part of Alnora Pro; the free version embeds the standard booking wizard.
* Improvement: admin notices now display cleanly at the top of the Alnora screens.

= 1.2.3 =
* Hardening: the public availability and available-dates REST endpoints now only return slots for an active doctor and an active service actually offered by that doctor, so availability for inactive/hidden resources can no longer be enumerated. Added range validation for the requested month/year.
* Translations: completed and updated the bundled translations for all 13 supported languages.

= 1.2.2 =
* Fix (important): deleting the plugin no longer erases your data. Doctors, services, patients, appointments and settings are now kept on uninstall so they survive a reinstall; data is removed only if you explicitly enable "Delete all data when the plugin is uninstalled" under Settings → GDPR.
* Improvement: removed the WordPress admin focus ring on settings toggle checkboxes for a cleaner look.

= 1.2.1 =
* New: built-in translations for the booking form and patient emails in 13 languages (English, German, French, Spanish, Italian, Dutch, Polish, Czech, Swedish, Danish, Norwegian, Ukrainian, Russian), selectable via the new **Patient language** setting.
* New: patient emails are now sent in the configured Patient language regardless of the site language.
* Improvement: translations now use standard WordPress `.mo`/`.po` language files (editable with Loco Translate) and ship a complete `.pot`.
* Fix: appointment reference numbers could collide after an appointment was deleted, causing a "Could not save the appointment" error on booking. References are now generated reliably.

= 1.2.0 =
* New: patients can cancel their own appointment via a secure link included in the appointment confirmation email.
* New: "Minimum cancellation notice (hours)" setting under Booking rules — controls how close to the appointment a patient may still cancel online (set to 0 to allow any time before the appointment).
* New: cancelled appointments show a tooltip in the Appointments list indicating whether they were cancelled by the client or the clinic.
* New: the clinic receives a notification email when a patient cancels their own appointment.

= 1.1.1 =
* Fix: settings sub-pages (Shortcodes, Booking rules, Email & reminders, GDPR) could return "Sorry, you are not allowed to access this page". They are now hidden from the sidebar without affecting access.

= 1.1.0 =
* New: search the Appointments list by reference, patient name, email or phone.
* New: search the Patients list by name, email or phone.
* New: the Appointments list now hides past days by default, with a "Show past appointments" button to reveal them (today's appointments stay visible so they can still be marked Completed / No-show).
* New: "Load more" on the Appointments list — the first 10 rows load instantly and more are revealed on demand for faster page rendering.
* New: an information icon beside the "Status" column header explains what each appointment status means.
* Improvement: hidden settings sub-pages are now removed from the admin menu in PHP instead of via a CSS :has() rule, removing an expensive per-interaction style recalculation in the admin.
* Improvement: the WordPress media library is now loaded only on the Doctors screen (where the photo uploader needs it), speeding up the other admin pages.
* Improvement: consistent button focus styling in the admin.

= 1.0.0 =
* Initial release: doctors, services, working hours, availability engine, booking wizard, patient records, GDPR consent log, transactional emails, reminders and branded admin.

== Upgrade Notice ==

= 1.2.6 =
Fixes a misleading message on the booking form when a doctor has no services assigned. No database or configuration changes.

= 1.2.5 =
Big update: categories for doctors and services, rich service descriptions with a "Read more" popup, per-service "Offered by" doctors, admin search, optional GDPR auto-deletion of inactive patients, an appointment details popup, WordPress date/time formats and the clinic timezone on the booking form. Your data is preserved; new tables and columns are created automatically.

= 1.2.4 =
Adds an optional Alnora Pro upgrade path via Freemius (usage tracking is opt-in). Pre-selecting a doctor/service through shortcode attributes has moved to Alnora Pro.

= 1.2.3 =
Security hardening for the public booking endpoints, plus completed translations for all 13 languages. Recommended for all users.

= 1.2.2 =
Important data-safety fix: your data is now preserved when the plugin is deleted (removed only if you opt in). Recommended for all users.

= 1.2.1 =
Adds built-in translations for the booking form and patient emails in 13 languages, and fixes a booking error caused by duplicate reference numbers.

= 1.2.0 =
Adds patient self-cancellation links in booking emails and a minimum cancellation notice setting.

= 1.1.1 =
Fixes a permissions error when opening some settings sub-pages. Recommended for all 1.1.0 users.

= 1.1.0 =
Adds search to the Appointments and Patients lists, a past-appointments filter, faster admin rendering, and status help. No database or configuration changes.

= 1.0.0 =
Initial release — no upgrade steps required.
