=== Destinely Experiences Widget ===
Contributors: nkambwemedi
Tags: hotel, booking, experiences, widget, tourism
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 3.0.14
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Help hotel guests discover local experiences after booking and earn commission on every experience booked through your site.

== Description ==

Destinely Experiences Widget connects your WordPress hotel website to the [Destinely](https://www.destinely.com) platform. After a guest completes a hotel booking, the widget launcher appears on your booking confirmation page so guests can browse and book nearby experiences.

= Key features =

* Simple setup: Hotel ID, Hotel Name, and an enable toggle
* Loads the official Destinely embed script from destinely.com
* Automatic booking confirmation page detection (WooCommerce and common booking URL patterns)
* Widget appearance and behavior managed centrally in your Destinely hotel dashboard
* Mobile-responsive experience cards, booking, and secure Pesapal payments

= How it works =

1. Guest completes a hotel booking on your website
2. The plugin detects the booking confirmation page
3. The Destinely widget launcher appears with nearby experiences
4. Guest books an experience; your hotel earns commission

= External services =

This plugin loads JavaScript from `https://www.destinely.com` to display experiences, process bookings, and send analytics events required for widget operation. By using this plugin you agree to the [Destinely Terms of Service](https://www.destinely.com/terms) and [Privacy Policy](https://www.destinely.com/privacy).

Data sent to Destinely may include: Hotel ID, page URL, session ID, browser user agent, and booking-related events triggered on confirmation pages. No WordPress admin credentials are transmitted.

== Installation ==

1. Upload the plugin ZIP via **Plugins → Add New → Upload Plugin**
2. Activate **Destinely Experiences Widget**
3. Go to **Settings → Destinely Experiences Widget**
4. Enter your **Hotel ID** and **Hotel Name** from your [Destinely hotel dashboard](https://www.destinely.com/dashboard/hotel)
5. Enable the widget and save

== Frequently Asked Questions ==

= Do I need a Destinely account? =

Yes. Create a free hotel partner account at [destinely.com/hotel/register](https://www.destinely.com/hotel/register) to receive your Hotel ID.

= Can I customize the widget? =

Widget title, color, position, and display options are managed in your Destinely hotel dashboard under widget settings.

= Does this slow down my site? =

The embed script loads asynchronously in the footer and only when the widget is enabled and configured.

= Does it work with WooCommerce? =

Yes. The plugin detects WooCommerce checkout completion, order-received pages, and common confirmation URL and DOM patterns used by Tourfic and other hotel booking plugins.

== Screenshots ==

1. Plugin settings page with Hotel ID and enable toggle
2. Widget launcher on a hotel booking confirmation page
3. Experience cards with booking flow

== Changelog ==

= 3.0.14 =
* Fix: widget loads reliably on refresh (booking detection deadlock removed, delivery retries)
* Fix: admin analytics dedupe inflated view counts; widget tracks opens, clicks, and booking starts
* Fix: hotel embed matches widget-demo positioning with full-viewport iframe and click-through outside the widget
* WordPress.org review: Contributors set to nkambwemedi
* All frontend JS loaded via wp_enqueue_script, wp_add_inline_script, and assets/js/booking-detection.js (no raw script tags)
* Embed script uses async loading strategy and data attributes via script_loader_tag filter

= 3.0.11 =
* Fix: widget is clickable, loads experiences, and waits for show_delay before appearing (matches widget-demo)

= 3.0.10 =
* Fix: widget iframe only loads on booking confirmation pages (no longer affects the rest of the site)

= 3.0.9 =
* Embed loader includes booking detection, notification sound, and page blur (same behaviour as widget-demo)
* HTML embed snippets include destinelyConfig for code-based installs
* Settings menu uses full plugin name for WordPress.org guidelines

= 3.0.8 =
* Hotel sites now load the same React widget as destinely.com/widget-demo (no separate legacy UI)

= 3.0.7 =
* Booking detection waits until the widget is fully initialized before triggering
* Embed script loader uses a distinct id to avoid duplicate DOM id conflicts with the widget container

= 3.0.6 =
* Expanded booking confirmation detection for WooCommerce order-received pages, Tourfic, MotoPress Hotel Booking, HBook, WP Travel Engine, Amelia, and common thank-you URL patterns
* Fixed body-class detection when confirmation markers are on the document body element
* Shared detection patterns in assets/js/booking-detection-patterns.js

= 3.0.5 =
* Fixed plugin ZIP packaging to use forward-slash paths (resolves "Plugin file does not exist" on activation)

= 3.0.3 =
* Replaced inline script tags with wp_enqueue_script and wp_add_inline_script per WordPress.org guidelines
* Booking detection moved to enqueued assets/js/booking-detection.js

= 3.0.2 =
* Plugin header aligned with WordPress.org Plugin Check requirements (Description, Version, License, Tested up to)
* License header set to GPLv2 or later to match readme.txt
* ZIP built with Unix line endings and verified structure for WordPress upload

= 3.0.1 =
* WordPress.org Plugin Check: tested up to WordPress 7.0
* Removed manual load_plugin_textdomain() (WordPress.org loads translations automatically)
* Removed unused Domain Path header

= 3.0.0 =
* Complete rewrite for WordPress.org standards and simpler maintenance
* Settings reduced to Enable, Hotel ID, and Hotel Name only
* Removed unused legacy PHP classes and local JavaScript duplicates
* Admin CSS and validation properly wired
* Booking detection retained for WordPress and WooCommerce flows

= 2.7.0 =
* Config aligned with remote embed script and asset base URL

== Upgrade Notice ==

= 3.0.9 =
Same widget behaviour as destinely.com/widget-demo on plugin and code installs. Safe to upgrade.

= 3.0.8 =
Hotel widget now matches the live demo. Safe to upgrade.

= 3.0.7 =
Fixes widget launcher not appearing on some booking confirmation pages. Safe to upgrade.

= 3.0.6 =
Improved automatic detection on WooCommerce and other hotel booking confirmation pages. Safe to upgrade.

= 3.0.2 =
Fixes Plugin Check header validation. Safe to upgrade; no settings changes required.

= 3.0.1 =
Major cleanup release. Re-enter your Hotel ID and Hotel Name after upgrading if settings do not appear.

== Privacy Policy ==

This plugin stores three WordPress options locally: enable flag, Hotel ID, and Hotel Name. Widget analytics and booking data are processed by Destinely over HTTPS. See [destinely.com/privacy](https://www.destinely.com/privacy).
