=== Maitro Widget ===
Contributors: maitro
Tags: reservations, restaurant, booking, table booking, gift cards
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Adds the Maitro reservation button and widget to your restaurant website. Guests book a table or buy a gift card without leaving your site.

== Description ==

[Maitro](https://maitro.nl) is a reservation and guest management system for restaurants in the Netherlands and Belgium. This plugin places the Maitro reservation widget on your WordPress website.

* A floating reservation button on every page, showing when the next table is free ("Free today · 19:30").
* The widget opens in a panel next to your page; on a phone it fills the screen.
* Optional gift card button, when gift card sales are switched on in Maitro.
* The block "Maitro reservation widget" or the shortcode `[maitro_widget]` puts the widget inside a page, for example on your reservations page.
* Your own buttons and menu items can open the widget with the link `#reserveren-open` (or `#reserveren-vouchers` for gift cards).

Button text, colour, position and style are set in Maitro under Settings → Widget. The plugin picks up changes automatically, so you never have to copy code again.

You need a Maitro account to use this plugin.

== Installation ==

1. In WordPress, go to Plugins → Add New Plugin and search for "Maitro".
2. Install and activate the plugin.
3. Go to Settings → Maitro and paste your restaurant key. You find it in Maitro under Settings → Widget → Keys → Public key.
4. Save. The reservation button now shows on your website.

Downloaded the plugin from Maitro itself (Settings → Widget)? That version already contains your key: upload it under Plugins → Add New Plugin → Upload Plugin, activate it, and you are done.

== Frequently Asked Questions ==

= Where do I change the text or colour of the button? =

In Maitro, under Settings → Widget. Save there; your website shows the change within an hour. Under Settings → Maitro in WordPress you can fetch it right away with "Fetch changes now".

= I only want the widget on my reservations page, not a button on every page =

Go to Settings → Maitro, switch off "Show the reservation button on every page", and add the block "Maitro reservation widget" (or the shortcode `[maitro_widget]`) to your reservations page.

= Does the widget set cookies? =

No. The widget sets no cookies and does no tracking. See "External services" below for what is sent to Maitro.

= My host does not allow plugins =

Copy the website code from Maitro (Settings → Widget → Place on your website) and paste it into your site's HTML instead.

== External services ==

This plugin connects to Maitro (app.maitro.nl), the reservation service run by Maitro, to show the reservation widget. It is needed for the plugin to work.

* **The widget script.** On every page of your site where the widget shows, the visitor's browser loads `https://app.maitro.nl/widget/embed.js`. The script shows the button and asks Maitro when the next table is free. When a guest opens the widget and books a table or buys a gift card, the details the guest enters (such as name, email address, phone number, party size, date and time, and any note) are sent to Maitro to process the reservation for your restaurant.
* **The button settings.** Once a restaurant key is set, your WordPress server asks `https://app.maitro.nl/api/public/widget-code` for the button settings of your restaurant: about once an hour in the background, when you open Settings → Maitro and when you click "Fetch changes now". It sends only your public restaurant key; Maitro returns the restaurant name and the button settings. Activating the plugin contacts no server.
* **Where the plugin is installed (optional, off by default).** Only if you switch on "Show in Maitro where this widget is installed" under Settings → Maitro, your WordPress server sends a short report to `https://app.maitro.nl/api/public/wordpress-melding`: right away, at most once a day while the plugin is active, and when you deactivate it or replace the key. The report contains your public restaurant key, the address of your site, the version of the plugin and of WordPress, whether the plugin came from Maitro itself or from this directory, and whether it is on or off. Your restaurant then sees in Maitro (Settings → Widget) on which sites the widget is installed. No information about your visitors is sent. Switch it off and nothing more is sent.

Maitro terms of service: https://maitro.nl/voorwaarden
Maitro privacy policy: https://maitro.nl/privacy

== Screenshots ==

1. The floating reservation button with the next free time.
2. The reservation widget opened from the button.
3. Settings → Maitro.

== Changelog ==

= 1.2.0 =
* The installation report is now optional and off by default: switch it on under Settings → Maitro.
* Activating the plugin no longer contacts Maitro; the button settings are fetched afterwards.

= 1.1.0 =
* The plugin tells Maitro on which site it is installed, so you see it in Maitro under Settings → Widget. See "External services" for exactly what is sent.

= 1.0.0 =
* First release: floating reservation button, widget block and shortcode, button settings from Maitro.

== Upgrade Notice ==

= 1.2.0 =
The installation report is now off unless you switch it on under Settings → Maitro.

= 1.1.0 =
Maitro now shows on which sites the widget is installed.

= 1.0.0 =
First release.
