=== SchoolSlots ===
Contributors: jupe51, freemius
Tags: school, booking, appointment, education, calendar
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 9.8.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Effortless parent-teacher meeting scheduling, weekly teacher consultation hours, and printable PDF/QR ticket confirmations for schools.

== Description ==

**SchoolSlots** is a dedicated appointment scheduling and parent-teacher conference management plugin designed specifically for primary schools, high schools, and educational institutions.

It allows school administrators to organize school-wide **Central Parent-Teacher Conferences** as well as recurring **Individual Weekly Teacher Consultation Hours** through a single, responsive booking interface.

= Key Features in SchoolSlots =

* **Central Parent-Teacher Conferences:** Create and manage unlimited active school-wide conference events with custom start/end times, customizable slot durations (e.g., 5, 10, 15, 20, or 30 minutes), and buffer times between appointments.
* **Weekly Individual Teacher Consultations:** Configure recurring weekly consultation days, lesson periods, time windows, and lunch/break intervals for each teacher. The frontend date picker automatically aligns parent selections to the teacher's official consultation day.
* **Absent Teacher Handling:** Mark specific teachers as absent for a central conference. Instead of generating bookable slots, parents see a polite notice with the teacher's direct email address to arrange an alternative meeting.
* **Strict Double-Booking & Collision Protection:**
  * Prevents parents from booking multiple slots with the same teacher within the same conference or consultation day.
  * Prevents parent time collisions (a parent cannot book two different teachers at the exact same time slot on the same day).
  * Real-time race-condition protection ensures two parents cannot reserve the same teacher slot simultaneously.
  * Automatically blocks past dates and expired time slots on the current day.
* **Automated Email Confirmations & Calendar Invites (.ics):** Sends instant HTML confirmation emails to both parents and teachers, complete with an attached `.ics` calendar file (compatible with Google Calendar, Apple Calendar, and Outlook). Optional automatic BCC copy to the school secretary.
* **Printable PDF / QR Confirmation Tickets & One-Click Cancellation:** Every booking includes a downloadable, print-ready confirmation ticket featuring a locally generated ISO/IEC 18004 SVG QR code and a secure one-click cancellation link that immediately frees up the slot and notifies the teacher.
* **Automated Morning Reminders:** Built-in daily cron job dispatches a chronological schedule summary to teachers and appointment reminders to parents on the morning of the consultation.
* **GDPR Compliance & Data Anonymization:** Configure a custom data retention period (in days) and run one-click GDPR personal data anonymization for past events while preserving aggregate booking counts, or purge test bookings before going live.

= Quick Start & Shortcode =

1. Navigate to **SchoolSlots -> Settings** to enter your school's official name, address, secretary email, and consultation cutoff deadlines.
2. Add your teaching staff and their room numbers/weekly consultation hours under **SchoolSlots -> Teachers & Rooms**.
3. Optionally create a school-wide conference under **SchoolSlots -> Events**.
4. Place the `[schoolslots]` shortcode on any public WordPress page to display the booking form.

= Standalone SchoolSlots Pro Edition =

For institutions requiring advanced event types and campus-wide automation, the standalone **SchoolSlots Pro** plugin (available at [schoolslots.com](https://www.schoolslots.com) and [schoolslots.hu](https://www.schoolslots.hu)) extends the system with:

* **Sibling Route Planner:** Branch-and-bound backtracking algorithm that calculates optimal, conflict-free meeting itineraries across multiple children and teachers with a unified family ticket.
* **Quota-Based Open Days & Senior Photo Sessions:** Dedicated registration workflows with live daily capacity bars and multi-day custom schedules.
* **School Ball & Gala Tickets:** Guest list CSV import and single-dispatch QR admission tickets.
* **Mobile Camera QR Check-in Scanner:** PWA camera scanner with REST API validation and audio feedback for entrance staff.
* **Bulk CSV Import/Export & Executive Analytics:** One-click teacher roster CSV import, filtered booking CSV exports, Chart.js workload visualizations, and automated nightly GDPR/deadline cron reports.

== Installation ==

1. Upload the `schoolslots` folder to the `/wp-content/plugins/` directory, or install the plugin directly through the WordPress plugins screen.
2. Activate the plugin through the 'Plugins' screen in WordPress. The required database tables (`school_teachers`, `school_events`, `school_bookings`) are created automatically upon activation.
3. Configure your institution details under **SchoolSlots -> Settings**.
4. Embed the `[schoolslots]` shortcode into any page where parents should book appointments.

== Frequently Asked Questions ==

= How do Central Conferences differ from Individual Consultations? =
Central Conferences are specific school-wide event dates created under **SchoolSlots -> Events** where all available teachers accept bookings within a shared time window. Individual Consultations use the recurring weekly consultation day and time window configured on each teacher's profile under **SchoolSlots -> Teachers & Rooms**.

= How are QR codes and .ics calendar files generated? =
All SVG QR codes (ISO/IEC 18004 Version 1-L) and `.ics` iCalendar files are generated 100% locally on your WordPress server without relying on any third-party external APIs, ensuring full student and parent data privacy.

= What happens when a parent cancels an appointment? =
When a parent clicks the cancellation link in their confirmation email or on their ticket, the booking record is removed, the time slot immediately becomes available again on the public booking grid, and the assigned teacher receives an automatic cancellation notice via email.

== Changelog ==

= 9.8.4 =
* Compliance: Removed all artificial Lite restrictions in Event Management (unlimited active central conferences and freely configurable custom slot durations are now fully enabled in the free edition).
* Compliance: Removed bundled third-party licensing SDK from the WordPress.org edition to ensure a 100% standalone, self-contained plugin.
* Security: Added strict `check_ajax_referer()` nonce verification across all public and admin AJAX endpoints (`schoolslots_get_slots`, `schoolslots_process_booking`) and capability checks (`current_user_can('manage_options')`) across all admin views.
* Standards: Standardized all global functions, options, AJAX actions, cron hooks, and constants to use the `schoolslots_` prefix.
* Standards: Replaced raw `<style>` and inline `<script>` tags with standard `wp_enqueue_style()`, `wp_add_inline_style()`, `wp_enqueue_script()`, and `wp_add_inline_script()` calls.

= 9.8.3 =
* Initial public release featuring central parent-teacher conferences, weekly individual teacher consultations, conflict detection, PDF/QR ticket generation, `.ics` calendar attachments, and GDPR anonymization tools.