=== TableEngine – Restaurant Table Reservations === Contributors: codersuraz Tags: restaurant, reservations, booking, floor plan, stripe Requires at least: 6.0 Tested up to: 7.1 Requires PHP: 7.4 Stable tag: 1.0.5 License: GPLv2 or later Guests pick their exact table on your real floor plan, deposits cut no-shows, and you pay no per-cover fees. Your bookings, your guests, your site. == Description == **Your restaurant, booked the way guests actually choose: by the table.** Most reservation tools ask for a date, a time and a party size, then decide the table for the guest. TableEngine shows guests your real dining room, the window seats, the booth in the corner, the terrace, and lets them pick the one they want. They book with confidence, and you get fewer "can we move to a different table?" conversations at the door. = Keep the revenue you earn = Booking platforms charge per cover, take a monthly subscription, or both, and the guest relationship ends up on their marketplace instead of your website. TableEngine runs on your own WordPress site: * **No per-cover fees, no commission, no booking caps.** The free plugin takes unlimited reservations. You pay only Stripe's normal card fees, and only if you choose to take deposits. * **Your guest list stays yours.** Every booking and guest record is stored in your own database. Nothing is sent to us. * **Bookings happen on your website.** Guests stay on your brand and your menu pages, not on a directory that also lists the competitor down the street. = Fewer empty tables = No-shows cost the most on your busiest nights. TableEngine lets you ask for a deposit when it matters: * Charge a fixed amount or an amount per guest, only for larger parties if you like. * The table is held while the guest pays, so two people can't book it at once. * Refunds go out automatically when guests cancel in time, so honest guests are never penalised and you don't spend time processing refunds. * Reminder emails go out before every visit, and guests can cancel online, which frees the table for someone else instead of leaving it empty. = Never overbook = Availability is worked out per table, not per time slot. TableEngine knows how long each party stays (larger parties can get more time), the turnover buffer between sittings, your opening hours, special hours and closed dates, and how many guests can start at once so the kitchen isn't swamped. If a booking would clash, it isn't offered. Phone and walk-in bookings you add yourself are checked against the same rules. = Set up in an afternoon, not a week = Draw your room in a drag-and-drop builder: round, square, long, oval and booth tables, plus walls, bar, kitchen, doors, windows, plants and labels, with snapping, guides and undo. A sample room is ready when you activate the plugin. Add the shortcode or block to a page and you're taking bookings. = Looks right on every phone = Most bookings happen on mobile. The floor plan scales to any screen, supports pinch-zoom and pan, can turn wide rooms to portrait on phones, and has a list view when a map isn't practical. Colours, fonts, corner radius and a light or dark theme match the widget to your site. = Built for the way you run service = * **One clear dashboard:** today, this week and upcoming, as a list or a per-table timeline, with approve, seat and complete in one click. * **Your choice of control:** confirm bookings automatically or approve each one; let guests choose a table, let them leave it to you, or always assign tables yourself. * **Know your regulars:** guest records build up automatically, with visit counts across bookings. * **Privacy built in:** WordPress' personal-data export and erase tools work with TableEngine's bookings and guests. = What's in the free plugin = * Visual floor plan builder and a booking widget with map and list views * Unlimited rooms, bookings, tables and guests * Stripe deposits with table holds, webhooks and automatic refunds * Reservations dashboard with timeline, manual bookings and internal notes * Confirmation, pending, cancellation and reminder emails, plus alerts to the restaurant, all editable * Opening hours, special hours, closed dates, dining durations, buffers and pacing * Guest self-service: view and cancel online, add to calendar * Spam protection: honeypot and rate limiting = TableEngine Pro = When you need more, TableEngine Pro adds the tools of a full table-management system without the per-cover pricing: floors and levels, combined tables, services and shifts, guest profiles and tags, guests changing their own bookings, card-on-file no-show protection, SMS and WhatsApp reminders, a live floor view for hosts, a waitlist, reports, multiple locations, experiences and ticketed events, promo codes and gift vouchers, and more payment providers. Your free setup and data carry straight over. == Installation == 1. Upload the `tableengine` folder to `/wp-content/plugins/`, or install it from Plugins → Add New. 2. Activate it. A sample room ("Main Dining Room") is created so you can try it straight away. 3. Lay out your tables under TableEngine → Floor plans. 4. Put the `[tableengine]` shortcode or the "Table booking" block on a page, and choose that page in TableEngine → Settings → General → Booking page (used for "manage booking" links in emails). 5. Optional: turn on deposits under TableEngine → Settings → Payments (see "Stripe setup" below). == Usage == 1. Activate the plugin. A sample "Main Dining Room" is created. 2. Edit your layout under TableEngine → Floor plans. 3. Add `[tableengine]` (or the "Table booking" block) to a page and select that page in Settings → General → Booking page. 4. Optional: `[tableengine room="2" title="Book the terrace"]`. Add `lazy="1"` to load the widget only when `tableengine.boot( element )` is called from JavaScript (used by popups). == Stripe setup == 1. Settings → Payments: enable payments, choose Test/Live and paste your publishable and secret keys. 2. In the Stripe Dashboard → Developers → Webhooks, add the endpoint shown in settings (`/wp-json/tableengine/v1/stripe/webhook`) with the events: payment_intent.succeeded, payment_intent.processing, payment_intent.payment_failed, payment_intent.canceled, charge.refunded, charge.dispute.created 3. Paste the webhook signing secret and use "Test connection". == Privacy == TableEngine stores the details guests enter when booking (name, email, phone, requests, IP address) in your WordPress database and keeps a guest record per email address with visit counts. Nothing is sent to us. * When payments are enabled, booking and payment details are sent to Stripe (https://stripe.com/privacy) to process the deposit, and Stripe.js is loaded on the booking page. * When "Add to calendar" buttons are on, the booking confirmation shows a Google Calendar link. The booking's date, time and restaurant details are passed to Google Calendar only when a guest clicks it (https://policies.google.com/privacy). Nothing is sent otherwise. == Developer hooks == All PHP hooks are prefixed `tableengine_`. JavaScript hooks run on a shared `@wordpress/hooks` instance at `window.tableengine.hooks`; enqueue your script with a dependency on `tableengine-hooks` and add its handle through the `tableengine_script_dependencies` filter so it loads before the app boots. **Availability** Filters: tableengine_valid_date, tableengine_day_ranges, tableengine_candidate_times, tableengine_booking_duration, tableengine_candidate_tables (add combined tables: units with a `members` array), tableengine_table_fits, tableengine_table_state, tableengine_slot, tableengine_auto_assign, tableengine_blocking_reservations, tableengine_find_table. **Bookings** Filters: tableengine_validate_booking, tableengine_booking_data, tableengine_booking_response, tableengine_reservation_insert_data, tableengine_statuses, tableengine_non_booking_statuses (statuses left out of stats, dashboard totals and reports), tableengine_payment_statuses, tableengine_guest_can_cancel (runs for every status), tableengine_qualifies_for_refund, tableengine_format_public, tableengine_format_admin, tableengine_reservations_query_where, tableengine_reservations_scope (location ids that admin views and totals are limited to; null = all), tableengine_admin_fields, tableengine_client_ip. Actions: tableengine_booking_submitted, tableengine_reservation_created, tableengine_reservation_updated, tableengine_reservation_before_delete, tableengine_reservation_deleted, tableengine_status_changed, tableengine_admin_saved. Meta: `TableEngine\Reservations::get_meta() / update_meta() / delete_meta()` (WordPress metadata API, type `tableengine_reservation`). **Guests** Filters: tableengine_guest_insert_data, tableengine_guest_summary. Helpers: `TableEngine\Guests::update()`, `TableEngine\Guests::clean_tags()`. Actions: tableengine_guest_created, tableengine_guest_updated, tableengine_guest_stats_refreshed, tableengine_guest_deleted. Privacy: WordPress personal-data exporter/eraser built in; `TableEngine\Privacy::anonymise_reservation()`, `TableEngine\Privacy::delete_guest()`; filters tableengine_privacy_export_reservation, tableengine_privacy_policy_text; action tableengine_reservation_anonymised. Meta: `TableEngine\Guests::get_meta() / update_meta() / delete_meta()` (type `tableengine_guest`). **Payments** Filters: tableengine_payment_gateways (register a `TableEngine\Gateway` subclass), tableengine_active_gateway, tableengine_deposit_amount (receives date/time/table context), tableengine_payment_required, tableengine_payment_intent_params. Actions: tableengine_payment_completed, tableengine_payment_authorized, tableengine_payment_refunded, tableengine_stripe_event. Filters: tableengine_guest_refund_amount (minor units refunded when a guest cancels; 0 = all). Payment statuses include `authorized` (card hold) and `released`. Also: tableengine_stripe_events (webhook events listed in settings), tableengine_availability_tables_response. A gateway's `start()` may return `mode: 'setup'` (with optional title, note, buttonLabel) to save a card instead of charging. **Notifications** Filters: tableengine_notification_events, tableengine_notification_channels (add a channel callable), tableengine_should_notify, tableengine_reminders_enabled, tableengine_email_template (templates for new email types; `TableEngine\Emails::template()`), tableengine_email_placeholders, tableengine_email_html_placeholders (placeholders that expand to markup), tableengine_email_html (replace the whole email layout; receives the email type), tableengine_email_args, tableengine_admin_email_rows. Actions: tableengine_notification_sent, tableengine_before_notify, tableengine_after_notify. Restaurant alerts for new types: add an `admin_{type}_notify` setting and filter tableengine_admin_email_subject. **Floor plans** Filters: tableengine_floorplans (rooms in play), tableengine_floorplan_row, tableengine_table_shapes, tableengine_decor_kinds, tableengine_sanitize_element, tableengine_sanitize_plan_data, tableengine_public_plans. **Settings, admin and front end** Filters: tableengine_menu_title, tableengine_menu_icon, tableengine_brand_name, tableengine_brand_logo_url, tableengine_manage_base_url, tableengine_capability( $cap, $area ) (areas: bookings, floorplans, guests, reports, payments, settings — check with `TableEngine\Plugin::can( $area )`; REST permission callbacks via `$rest->can( $area )`), tableengine_settings_schema (fields accept `wide`; a `show_if` value may be a list of allowed values), tableengine_sanitize_settings, tableengine_sanitize_field_{type}, tableengine_settings_values (effective values), tableengine_pre_save_settings (receives the already-sanitised settings), tableengine_settings_redirect, tableengine_admin_header_actions (HTML; printed through wp_kses()), tableengine_admin_header_actions_allowed_html, tableengine_public_config, tableengine_inline_css, tableengine_admin_pages (render a screen with `Admin::page_shell()`; `Admin::page_header( $title, $actions )` for the top bar), tableengine_admin_config (includes `can` per area and `nonBooking` statuses), tableengine_script_dependencies, tableengine_widget_boot, tableengine_widget_strings, tableengine_tables, tableengine_show_upsell. Actions: tableengine_settings_field_{type}, tableengine_settings_form_start, tableengine_before_widget, tableengine_after_widget, tableengine_admin_enqueue, tableengine_deactivated, tableengine_register_frontend_assets, tableengine_enqueue_frontend_assets, tableengine_rest_routes, tableengine_loaded, tableengine_migrate, tableengine_uninstalled. **JavaScript** Renderer: `TableEngineRender.registerShape(shape, fn, chairs)` (optional chair placement), `TableEngineRender.registerDecor(kind, fn, color)`; action tableengine.render.plan. Booking widget (`window.tableengine.booking` exposes the DOM helpers; `tableengine.boot( el )` starts a lazy widget): filters tableengine.booking.request, .submit, .steps, .views, .stepLabel, .submitStep, .canContinue, .continueLabel, .deposit, .validate, .validateField, .payload, .paymentView, .tableCard, .bookingCard, .findTable, .listTables, .tableState, .mapTarget, .isSelected; actions tableengine.booking.init, .rendered, .bodyRendered, .detailsForm, .created, .manage, .mapDrawn, .tablesLoaded. Floor plan builder (`window.tableengine.builder`, incl. addRoom( name, data ), switchRoom, fit): filters tableengine.builder.palette, .shapes, .propGroups, .multiPropGroups, .roomGroups, .roomTab (a room's tab button), .savePayload; actions tableengine.builder.shell, .ready. Reservations dashboard (`window.tableengine.admin`; `admin.php?page=tableengine&new=1&name=&email=&phone=&party=` opens a prefilled booking): filters tableengine.admin.editorPayload, .guestBadges, .rowFlags; actions tableengine.admin.detail, .editor, .ready, .timeline (timeline element, layout context). == Frequently Asked Questions == = Do guests need an account? = No. Guests book with their name, email and (optionally) phone, and get a private link to view or cancel their booking. (Changing a booking online is part of TableEngine Pro.) = Can I take deposits? = Yes, with Stripe: a fixed amount or an amount per guest, only for larger parties if you like. The table is held while the guest pays. Refunds can be automatic when guests cancel in time. = Does it work with my theme and page builder? = The widget is a shortcode and a block, styled to inherit your fonts, with its own colours and light/dark themes under Settings → Appearance. = How is this different from a booking platform? = Booking platforms usually charge per cover or a monthly fee, and guests book on their site. With TableEngine there are no booking fees, guests book on your website, and the guest data lives in your own database. You keep full control of your tables, rules and emails. = How is this different from other reservation plugins? = Many reservation plugins are a request form: the guest asks for a time and someone on staff checks whether a table is free. TableEngine checks real availability per table as the guest books, and lets them choose the table on your floor plan. Deposits and automatic refunds are included in the free plugin. = Is the free version limited? = No. There's no limit on rooms, bookings, tables or guests, and no time limit. Everything in the free plugin works without a licence key. = What does TableEngine Pro add? = TableEngine Pro (a separate premium download) adds multiple locations, floors and levels, services and shifts, combined tables, custom form fields, guest profiles, online booking changes, card-on-file guarantees, SMS and WhatsApp, the live floor view, waitlist, reports, experiences and ticketed events, promo codes and gift vouchers, more payment providers and more. = Where is my data stored? = In your own WordPress database. See "Privacy" above for the services that are only contacted when you switch them on. == Screenshots == 1. The booking widget: date, time and party size. 2. Choosing a table on the floor plan. 3. The floor plan builder. 4. Reservations: list and per-table timeline. 5. Settings. == Changelog == = 1.0.5 = * Security: admin top-bar actions are printed through wp_kses(); settings field attributes and the .ics download are escaped at output. * Security: the reservations scope filter now takes location ids instead of raw SQL (tableengine_reservations_scope). * Fix: select settings with an options callback render and save correctly. = 1.0.4 = * Renamed the plugin to TableEngine. * Fix: addressed WordPress.org plugin review and Plugin Check findings. * Fix: the phone agent books on the caller's number only and stops texting after refusals. = 1.0.3 = * New: TableEngine logo mark and icons across the admin menu, top bar and block inserter. * Improved: the booking widget can now be prefilled via URL parameters (`tableengine_date`, `tableengine_time`, `tableengine_party`) or JavaScript, and supports custom slot badges. * Changed: the floor plan builder no longer limits the number of rooms. * Changed: the Custom CSS setting was removed from the free plugin; add widget CSS in Appearance → Customize → Additional CSS instead. * Security: cancelling a booking with a refund from the dashboard now requires the payments permission. * Fix: selected calendar days and time slots keep their active styling when hovered, and popup booking steps keep a consistent width. * Pro & Business: AI booking assistant (Anthropic, OpenAI, Google Gemini and OpenAI-compatible providers), AI phone agent on a Twilio number, demand-based deposits, and loyalty points, tiers and gift-voucher rewards. = 1.0.2 = * Improved: the booking widget no longer redraws itself on every change. Picking the guest count, date, time, an occasion or a table updates only what changed, so it feels faster and keyboard focus stays put. * Fix: "Continue" could be pressed while times were being re-checked after changing the guest count. * Fix: the table step briefly showed tables for the previously chosen time. = 1.0.1 = * Fix: activating the plugin on a new site could stop with a fatal error. * Fix: the floor plan builder could refuse to add rooms, and fail to open when no room existed yet. * Fix: a site where activation didn't complete now gets the sample room on first load. * Improved: plugin description and FAQ. = 1.0.0 = * First release: floor plan builder, booking widget with map and list views, Stripe deposits, reservations dashboard and timeline, email notifications and reminders, guest self-service (view, cancel), privacy tools. == Upgrade Notice == = 1.0.5 = Security hardening from the WordPress.org plugin review. = 1.0.4 = Compliance fixes from the WordPress.org plugin review. = 1.0.3 = New brand icons, booking widget URL prefill, hover and popup layout fixes, plus 4 premium modules (AI assistant, AI phone agent, demand deposits and loyalty rewards). = 1.0.2 = Smoother, faster booking widget and two small booking-step fixes. = 1.0.1 = Fixes an activation error on new sites and a floor plan builder problem adding rooms. Recommended for everyone. = 1.0.0 = First release.