=== Tribii Hotel Booking Engine ===
Contributors: danieltribii
Tags: hotel, booking, booking engine, direct booking, reservations
Requires at least: 6.4
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

Free booking engine for hotels, B&Bs, hostels, campsites and rentals. 0% commission on direct bookings. Works with any theme.

== Description ==

Put your Tribii booking engine on your WordPress site: a full booking flow with rooms,
dates, extras and card payment, on your own domain and under your own name.

Guests book directly with you. Tribii takes **no commission** on anything sold through
it, and the money goes straight to your own Stripe account.

= Why a plugin and not a snippet =

Tribii gives you an embed snippet that works on any website. On WordPress it often does
not survive the journey: the block editor strips `<script>` tags out of Custom HTML, so
pasting the snippet by hand can silently produce nothing at all — no error, no empty box,
just a page with no booking on it.

This plugin removes that step. Paste your widget ID once and add a block, a shortcode, or
a floating button that follows guests around the site.

= What you get =

* **Tribii Booking** block — the whole booking flow, in any page
* **Tribii Search bar** block — a compact dates and guests bar for a hero section
* **Shortcodes** `[tribii_booking]` and `[tribii_search]` for the Classic editor, Elementor and other page builders
* **A floating booking button** on every page, from one checkbox
* **A Verify button** that confirms the connection and tells you which property it found

= Nothing to maintain =

The booking engine itself is served by Tribii, not bundled here. New features, fixes and
translations arrive on their own; this plugin only ever needs updating when WordPress
itself changes.

= You need a Tribii account =

This plugin connects an existing Tribii property to your site. Creating an account is
free and takes a few minutes: [tribii.com](https://tribii.com/). Tribii is free up to 20
rooms, with no commission and no contract.

= Privacy and external services =

This plugin adds a script tag and an iframe served from `app.tribii.com`, which is what
renders the booking flow for your guests. Booking data is handled by Tribii under its own
[privacy policy](https://tribii.com/privacy) and [terms](https://tribii.com/terms).

The plugin itself stores only your widget ID and one checkbox in your WordPress options
table. It sets no cookies and collects nothing about your visitors. When you press
**Verify** in the settings screen, your site makes one request to
`app.tribii.com/api/widget/settings` carrying your widget ID, so the screen can show which
property it belongs to.

= Source code and build =

Everything in this plugin is human-readable except the two block scripts under `build/`,
which are compiled by @wordpress/scripts (webpack). Their unminified source ships
alongside them in `src/`, so nothing here is a black box:

* `src/booking/index.js` builds `build/booking/index.js`
* `src/search/index.js`  builds `build/search/index.js`

To regenerate them from a checkout:

1. `npm install`
2. `npm run build`

The exact command is `wp-scripts build --webpack-src-dir=src --output-path=build`, kept
in the bundled `package.json`. No other file in the plugin is generated, minified or
obfuscated, and the plugin bundles no third-party libraries.

== Installation ==

1. Install and activate the plugin.
2. Go to **Settings → Tribii Booking**.
3. Paste your widget ID. You will find it in Tribii under **Settings → Integrations**.
4. Press **Verify** to confirm it found the right property.
5. Tick the floating button, or add a block to a page.

== Frequently Asked Questions ==

= Do I need a Tribii account? =

Yes. The plugin connects a property you already have in Tribii. An account is free at
[tribii.com](https://tribii.com/).

= Where do I find my widget ID? =

In Tribii, open **Settings** and then **Integrations**. It starts with `wid_`.

= I pressed Verify and it says the domain is not allowed =

Tribii can restrict a widget to one website. In Tribii, open **Settings → Property** and
check that the website field is this site's address.

= Can I run more than one property on one WordPress site? =

Yes. Set the site-wide widget ID for the main one, then give any individual block or
shortcode its own `id="wid_..."`.

= Does it work with my page builder? =

Yes. Use the shortcodes; they work anywhere a page builder accepts one.

= Does it slow my site down? =

The script loads asynchronously and the booking flow loads in an iframe, so it never
blocks your page from rendering. One script is loaded per page however many blocks are on
it.

== Screenshots ==

1. The settings screen, connected to a property.
2. The Tribii Booking block in the page editor.
3. Both blocks in the block inserter.

== Changelog ==

= 1.0.0 =
* First release.
