=== Cadre Reservation ===
Contributors: cadrestudio
Tags: booking, reservation, appointment, event, calendar
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 1.0.11
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Booking form for events and visits: up to three preferred dates, a business-day calendar, a confirmation screen and email notifications.

== Description ==

Cadre Reservation adds a booking form to your site for open houses, tours, viewings, workshops and other events that visitors attend on a chosen date and time.
Visitors pick an event, choose up to three preferred dates and times, check their input on a confirmation screen and send it. The visitor receives an automatic reply and you receive a notification email.

= Free features =

* **Booking form** with your own fields: single-line and multi-line text, email (with an optional confirmation field), phone, select box, radio buttons, checkboxes and a number-of-guests field with two groups (for example adults and children).
* **Up to three preferred dates and times.** The 2nd and 3rd choices can be required, optional or hidden.
* **Business-day calendar**: regular closed days, event dates and date ranges, special opening days and temporary closures. Days that cannot be booked are not selectable.
* **Time slots** generated from a start time, an end time and an interval, shown as a drop-down list or as buttons.
* **Confirmation and thank-you screens** on the same page, on another page or at a URL you choose.
* **Email notifications**: an automatic reply to the visitor and a notification to you, with editable subjects and bodies, placeholders, several recipients and Cc/Bcc. Built-in SMTP settings are included; they apply only to the emails this plugin sends.
* **Spam protection** with Google reCAPTCHA v3 (optional) and per-address and per-session submission limits.
* **Design presets** (Standard, Minimal, Dark and Blue) so the form fits your theme.
* **Booking targets**: create a new post type for your events, or use existing ones. Take bookings for several post types (for example events and tours), each with as many events as you need, and limit a target to the categories you choose.
* **Privacy**: an optional consent checkbox for your privacy policy, and suggested text for the WordPress privacy policy guide.
* **Japanese sites**: Japanese public holidays can be treated as closed or open days, and the address can be filled in from a Japanese postal code. These features are used only when the site language is Japanese, and only after you turn them on (holiday handling, or a postal code field on the form).

Place the form with the `[cadre_reservation_form]` shortcode. A form page is created for you when you set up the plugin. To link an event to the form, put the `[cadre_reserve_button]` shortcode on the event page.

= Pro and Agency =

Cadre Reservation Pro is a separate plugin with more tools for running bookings day to day. It is not part of this free plugin. Pro and Agency are sold, licensed and updated through Freemius.

* Saving bookings in the database, a booking list with details, statuses, notes and CSV export
* Confirming a booking and sending a confirmation email with an .ics calendar file and a Google Calendar link, and cancelling a booking with a notice to the visitor
* Visit-day views: filters for today, tomorrow and the next 7 days, a printable visit schedule and a dashboard widget
* Capacity per time slot (counted by bookings or by number of guests), remaining places and an availability calendar
* Time slots and booking deadlines per event, and booking emails per event
* Self-cancellation links and reminder emails
* Custom CSS
* White label (Agency)

== Installation ==

1. Install and activate the plugin from **Plugins > Add New**, or upload the ZIP file there.
2. Open **Cadre Reservation** in the admin menu. On the post type settings, choose the post type that holds your events, or create a new one.
3. Check the form page that was created for you. Choose how to show the confirmation and thank-you screens.
4. Set your closed days, time slots, the notification address, the automatic reply and the sender address. If your site cannot send email reliably, set up SMTP.
5. Publish an event, open the form, choose a future date and send a test booking to an address you can read.

The setup is complete when the thank-you screen appears and both emails (to you and to the visitor) arrive.

== Frequently Asked Questions ==

= How do I install Pro after I buy it? =

1. After checkout, open the confirmation email from Freemius and click the link to activate your account.
2. Download the Pro ZIP file from the link shown in the plugin after activation, or from your Freemius account.
3. Go to **Plugins > Add New > Upload Plugin**, upload the ZIP file and activate it. The free version is deactivated automatically, and your settings are kept.
4. If Pro asks for a license key, enter the key from your purchase email.

= Does the free version store bookings? =

No. In the free version each booking is sent by email and is not saved in a database table.
While a visitor is filling in the form, the input is kept for about 10 minutes for the confirmation screen and for error messages. For the submission limits, the plugin keeps a keyed hash of the email address and of the session, a counter and an expiry time. Your emails, your mail service and your backups are outside the plugin.

= Can I take bookings for several post types? =

Yes. On the post type settings, add a booking target for each post type (for example "Events" and "Tours"). Each post type can hold as many events as you need.

= What happens when I delete the plugin? =

Your settings, your events and the form page are kept, and only the submission-limit counters are removed. Deactivating the plugin does not delete any data. To update, upload the new ZIP over the old one instead of deleting the plugin first.
This clean-up runs when an administrator deletes the plugin. If you delete it with WP-CLI, add `--user=` with an administrator account (for example `wp plugin uninstall cadre-reservation --user=admin`).

= I use an SMTP plugin. What should I set? =

Turn off the built-in SMTP of Cadre Reservation and send all mail, including the booking emails, through your SMTP plugin. Then send a test booking and check that both emails arrive. The built-in SMTP applies only to the emails Cadre Reservation sends; it never changes how other emails from your site are sent.

= The form does not work with my caching or optimization plugin. =

If your optimization plugin delays JavaScript until the visitor interacts with the page, exclude the form, confirmation and thank-you pages from the delay. Exclude the same pages from page caching.

= I see "$ is not a function" on the form page. =

Turn on the theme compatibility setting on the **Design** tab. It applies only to the pages that use the plugin's form.

= Can I read the event settings through the REST API? =

Public event settings can be read with `context=view`. Writing them through the REST API is not allowed; use the event edit screen. Settings that are not public are never returned.

== Screenshots ==

1. The reservation form. Visitors choose an event, then pick their preferred dates and times from a calendar.
2. The confirmation screen shown before the reservation is sent.
3. Per-event calendar settings on the edit screen: regular business days, specific dates or consecutive days, plus special opening and temporary closing days.
4. Global settings for closed weekdays, public holidays, the earliest bookable date and booking time slots.
5. The form builder: reorder fields, switch required/optional and add common fields such as phone number or address.
6. Auto-reply and notification email templates. Placeholders insert what the visitor entered.

== External services ==

This plugin connects to the services below, and only under the conditions described. For every request, the service also receives the usual connection information, such as the IP address of the browser or the server.

= Holidays JP (Japanese public holidays) =

Used to treat Japanese public holidays as closed or open days on the booking calendar.
It is off by default. It is used only on sites in Japanese, and only after an administrator sets Holiday Handling (in the settings or for an event) to treat public holidays as normal business days or as closed days. Then the browser loads the holiday list (https://holidays-jp.github.io/api/v1/date.json) when the booking form is shown, and your server loads the same list to check a submitted date (a list that loaded successfully is kept for one day; if loading fails, it is tried again with the next booking). No booking data is sent.
The list is published by the holidays-jp project ([project page](https://github.com/holidays-jp/api)) on GitHub Pages, which is run by GitHub: [GitHub Terms of Service](https://docs.github.com/en/site-policy/github-terms/github-terms-of-service), [GitHub Privacy Statement](https://docs.github.com/en/site-policy/privacy-policies/github-general-privacy-statement).

= zipcloud (Japanese postal code lookup) =

Used to fill in the address from a Japanese postal code on the booking form.
The form has no postal code field by default. Only on sites in Japanese, and only if you add a postal code field to the form: when a visitor types a postal code into it, the visitor's browser sends the postal code to https://zipcloud.ibsnet.co.jp/api/search. Nothing else is sent.
This service is provided by AIBISU Corp.: [Terms of use](https://zipcloud.ibsnet.co.jp/rule/api), [Privacy policy](https://ibsnet.co.jp/privacy-policy/).

= postal-code-api (fallback for the postal code lookup) =

Used only when zipcloud does not return an address, under the same conditions as zipcloud: the visitor's browser loads a file whose address contains the postal code (for the postal code 100-0001, https://madefor.github.io/postal-code-api/api/v1/100/0001.json). Nothing else is sent.
The data is published by the postal-code-api project ([project page](https://github.com/madefor/postal-code-api)) on GitHub Pages, which is run by GitHub: [GitHub Terms of Service](https://docs.github.com/en/site-policy/github-terms/github-terms-of-service), [GitHub Privacy Statement](https://docs.github.com/en/site-policy/privacy-policies/github-general-privacy-statement).

= Google reCAPTCHA =

Used to protect the booking form from spam. It is off by default and is used only after you turn it on and enter your own keys.
When it is on, the visitor's browser loads the reCAPTCHA script (https://www.google.com/recaptcha/api.js) only on pages that show the booking form (the input and confirmation screens), not on other pages such as event pages without the form, and when the form is sent, your server sends the reCAPTCHA token, your secret key and the visitor's IP address to https://www.google.com/recaptcha/api/siteverify.
This service is provided by Google: [Terms of Service](https://policies.google.com/terms), [Privacy Policy](https://policies.google.com/privacy).

= Freemius (plans, purchases and updates of the paid version) =

The plugin includes the Freemius SDK, which shows the plans and pricing page and the checkout for the paid version. The free version sends nothing to Freemius in the background, shows no opt-in screen and never sends your visitors' data or booking content.
When an administrator opens the pricing page in the admin, your server loads the plans and prices from Freemius (api.freemius.com). When an administrator starts a purchase, the browser opens the Freemius checkout (checkout.freemius.com). The address of the checkout page carries that administrator's first name, last name and email address; the site's home URL, title and language and an identifier that the SDK creates for the site; the versions of WordPress, PHP, this plugin and the SDK; whether the site is a multisite or a local site; and the admin addresses the checkout returns to after the purchase. It also carries the parameters of the admin page address from which the purchase was started (normally the plan, price, billing cycle and currency chosen on the pricing page; the SDK passes on any other parameter in that address as it is). Freemius states that these details are stored only when the purchase is completed.
This service is provided by Freemius: [Terms of Service](https://freemius.com/terms/), [Privacy Policy](https://freemius.com/privacy/).

= Email =

Booking emails are sent through the WordPress mail function, or through the SMTP server you enter in the settings. The SMTP server is used only for the emails this plugin sends; other emails from your site are not sent through it. The mail service you use receives the recipients and the content of the emails. Its terms and privacy policy depend on the service you choose.

The date picker uses the jQuery UI scripts that come with WordPress. Its stylesheet and icons (jQuery UI 1.13.2, MIT license) are included in the plugin in `assets/vendor/jquery-ui`, so nothing is loaded from an external server for them. EXTERNAL-SERVICES.txt in the plugin folder has the same information.

== Changelog ==

= 1.0.11 =
* First public release.
