=== Bayle Booking Widget ===
Contributors: bayle
Tags: booking, restaurant, reservation, iframe
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.3.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Embed Bayle table booking on your restaurant website. Guests book in place; WordPress never holds API keys.

== Description ==

Bayle Booking Widget embeds the Bayle reservation form on a WordPress page.

This plugin is an interface to the Bayle booking service at `https://widget.bayle.food`. You need an active Bayle restaurant with the booking widget module turned on. The plugin stores only the restaurant slug and widget base URL. It does not store API keys and does not call Bayle food APIs from PHP.

Booking finishes inside the iframe. Guest name, email, phone, and optional notes entered in the form are sent to Bayle to create the reservation.

Add the **Bayle Booking** block, or the shortcode `[bayle_booking]`.

== External services ==

This plugin connects to the Bayle booking service, operated by Bayle (https://bayle.food). It is required: without it there is no booking form.

* Service: Bayle booking widget, loaded in an iframe from `https://widget.bayle.food` (or another official `https://*.bayle.food` host set by the site admin).
* When: every time a visitor loads a page that contains the Bayle Booking block or the `[bayle_booking]` shortcode, and when the visitor submits a reservation.
* What is sent: the restaurant slug and optional language code in the iframe URL; the visitor's IP address and the embedding site's address (referrer origin) as part of the normal page request; and, on submit, the reservation details the visitor types (name, email, phone, party size, date, time, optional notes).
* Human verification: inside the iframe, the form runs a Cap.js proof-of-work captcha from Bayle's own captcha service at `https://captcha.bayle.food` (the challenge script and verification API are loaded from that host when the visitor fills in the form). No Google reCAPTCHA or other third-party captcha is used, and the plugin itself does not load this script on your site.
* Why: to show live table availability and create the booking with the restaurant.
* Terms of Service: https://bayle.food/legal/terms/
* Privacy Policy: https://bayle.food/legal/privacy/

The plugin itself makes no server-side requests to Bayle, sets no cookies and adds no tracking.

== Installation ==

1. Upload the `bayle-booking-widget` folder to `/wp-content/plugins/`, or install the zip from Plugins → Add New → Upload Plugin.
2. Activate **Bayle Booking Widget**.
3. Open **Settings → Bayle Booking Widget**.
4. Set the restaurant slug (from Bayle restaurant CMS). Leave the widget base URL as `https://widget.bayle.food` unless Bayle gave you another host.
5. Optionally lock this site in restaurant CMS → Booking widget allowed hosts.
6. Insert the **Bayle Booking** block, or `[bayle_booking]`, on a page.

== Shortcode ==

Basic:

`[bayle_booking]`

Override the slug or language on one page:

`[bayle_booking slug="demo-pizza" lang="fi"]`

`base_url` can also be overridden, but only with an official `https://*.bayle.food` address; other values are ignored.

`lang` is matched to the restaurant's enabled storefront locales. If omitted, the plugin sends the WordPress site language.

== Frequently Asked Questions ==

= Do I need API keys in WordPress? =

No. Keys stay on Bayle servers. WordPress only iframes the public widget URL.

= Why is the form blank or “unavailable”? =

The restaurant slug must be correct, the booking widget module must be on, and the restaurant must be active. If you locked allowed hosts in CMS, this WordPress hostname must be on that list.

= Where does guest data go? =

Name, email, phone, and notes are submitted inside the Bayle iframe to create the reservation. This plugin does not keep a copy in the WordPress database.

== Changelog ==

= 0.3.0 =
* Block is now registered from block.json.
* Shortcode `base_url` override only accepts official `https://*.bayle.food` hosts; anything else falls back to the admin setting.
* Added suggested privacy policy text (Settings → Privacy).
* Added translation template (languages/bayle-booking-widget.pot) and GPLv2 LICENSE.
* Expanded External services section (including the captcha host) with Terms of Service and Privacy Policy links.
* Tested up to WordPress 7.1.

= 0.2.0 =
* Gutenberg block, translatable strings, and a production-ready install zip.

= 0.1.0 =
* Initial release with settings page and iframe shortcode.
