=== 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.2
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, specialisation, bio, languages and per-doctor weekly working hours (with breaks).
* Bookable services with duration, buffer time, price and colour.
* 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.
* 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, appointment list with inline status control, plus doctor, service, patient and settings screens.
* 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.)

== 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 does not connect to, or send any data to, external services. 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? =
Yes. Use `[alnora_booking doctor="1" service="2"]` where the numbers are the doctor/service IDs shown in their respective admin screens.

= 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.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.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.
