=== Explorates Booking ===
Contributors: explorates, jbclot
Tags: booking, reservation, calendar, widget, tourism
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Show your Explorates booking calendar or full product pages on WordPress, with a block or a shortcode. No code to copy and paste.

== Description ==

Explorates Booking embeds your [Explorates](https://www.explorates.com/en/) account directly in your WordPress pages and posts. Enter your organization ID once, pick a product, and your visitors can check availability and book without leaving your site.

Two ways to show a product:

* the **booking calendar** on its own, to drop under your own description;
* the **full product page** — photos, description, prices and booking — when you would rather not rewrite everything in WordPress.

This plugin requires an Explorates account. Explorates is a booking and e-commerce platform for tour and activity operators.

**Features**

* An "Explorates widget" block with a product picker, a display switch and a live preview inside the editor
* A `[explorates_widget product="…"]` shortcode for classic editors, page builders and widget areas, with `type="page"` for the full product page
* Global appearance settings (primary color, border, language, first day of the week, price on calendar days), overridable per shortcode
* A connection test and a preview on the settings screen, so you can check everything before publishing
* Your product list is fetched server-side and cached for one hour: your visitors' browsers never call the Explorates API

The plugin does not reimplement the booking widget. It prints the official embed markup and loads the very same script your Explorates dashboard gives you, so the widget always behaves exactly as it does everywhere else.

> The plugin runs on PHP 7.4, but **PHP 8.1 or newer is recommended** — PHP 7.4 is end of life and no longer receives security fixes.

**Useful links**

* [Official website](https://www.explorates.com/en/)
* [How the booking system works](https://www.explorates.com/en/reservation-system/)
* [Pricing](https://www.explorates.com/en/pricing)
* [Book a demo](https://www.explorates.com/en/book-a-demo)

== Installation ==

1. Upload the `explorates-booking` folder to `/wp-content/plugins/`, or install the plugin from the Plugins screen.
2. Activate the plugin.
3. Open the "Explorates" menu and enter your organization ID, then click "Test connection".
4. Insert the "Explorates widget" block, or paste the shortcode, in any page.

== Frequently Asked Questions ==

= Where do I find my organization ID? =

In your Explorates dashboard, open the embed code of any product: the `data-organization-id` value is your organization ID.

= Do I need an Explorates account? =

Yes. The plugin displays the booking widget of an existing Explorates account; it cannot work on its own.

= Can I display several of them on the same page? =

Several **product pages** on one page work fine. The **booking calendar**, however, is limited to one per page: if you insert more than one, only the first becomes active. Use one page per product, or the product page display, in the meantime.

= What is the difference between the calendar and the product page? =

The calendar shows availability and takes the booking, and nothing else — useful when your own page already describes the activity. The product page shows everything Explorates holds about the product (photos, description, prices) with the booking on top, so a single block gives you a complete page.

Pick it in the block settings, or add `type="page"` to the shortcode.

= Which languages does the widget support? =

French and English. Set it explicitly in the settings, or leave "Automatic" to follow your site language.

= Does the plugin work with page builders? =

Yes, through the shortcode, in any builder that renders WordPress shortcodes.

== Source code ==

This plugin is fully GPL-2.0-or-later. The block editor script shipped in
`build/index.js` is compiled from the human-readable sources included in the
plugin under `src/block/` (`index.js`, `edit.js`, `block.json`).

It is built with @wordpress/scripts, with no custom configuration. The build
tooling ships with the plugin, so from the plugin directory, with Node.js
installed:

`npm install && npm run build`

That regenerates `build/` from `src/block/`. The minified output may differ
slightly from one webpack release to the next; `src/block/` is the
authoritative version of this code.

No other file in this plugin is compiled, minified or obfuscated.

== External services ==

This plugin connects to two services operated by Explorates. Both are required for the plugin to do anything at all.

**1. Explorates API — https://api.explorates.com**

Used in the WordPress admin only, to list the published products of your organization so you can pick one in the block editor or on the settings screen.

* When: when an administrator opens the plugin settings screen, clicks "Test connection" or "Refresh the product list", and when an editor opens a page containing the Explorates block. Responses are cached for one hour.
* What is sent: your Explorates organization ID, sent as an HTTP header from your server. No visitor data, no personal data and no site content is sent.
* Requests are made server-side. Your visitors' browsers never contact this service.

**2. Explorates booking widget — https://widget.explorates.com**

The booking widget itself, loaded in your visitors' browsers on any page where you inserted the block or the shortcode. This is the service that displays availability and takes bookings.

* When: on every front-end page view that contains the widget.
* What is sent: your organization ID, the product ID and the appearance options you configured, plus whatever your visitor enters in the booking form (name, email and booking details) when they make a booking. The visitor's IP address and browser user agent reach the service as part of the request, as with any embedded content.
* Analytics: the widget loads Explorates' own product analytics (PostHog, self-proxied through the widget host) to measure how the booking funnel performs. This runs inside the widget, is operated by Explorates, and is covered by the privacy policy linked below.
* In the WordPress admin, the same service is loaded in an iframe to render the previews on the settings screen and in the block editor.

Both services are operated by Explorates and are what the plugin exists to display; installing and configuring it with your organization ID is what enables them. Nothing is sent anywhere until you enter that ID.

Terms of use: https://www.explorates.com/en/terms-of-use/
Privacy policy: https://www.explorates.com/en/privacy-policy/

== Screenshots ==

1. The settings screen: organization ID, connection test, appearance defaults and a live preview.
2. The "Explorates widget" block in the editor, with the display switch, the product picker and a live preview.
3. The booking calendar on a published page.
4. The full product page on a published page.

== Changelog ==

= 1.0.0 =
* Initial release: booking calendar and product page displays, block, shortcode, settings screen, connection test and previews.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
