=== Booking Widget for Mews ===
Contributors: wpassistbiz, indyzen
Plugin URI: https://wp-assist.biz/booking-widget-for-mews
Author URI: https://wp-assist.biz
Tags: booking, hotel, mews, reservation, booking-engine
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.1.6
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Easily integrate the Mews Booking Engine into your WordPress site with shortcodes and a Gutenberg block.

== Description ==

**Booking Widget for Mews** simplifies the integration of the [Mews Booking Engine](https://www.mews.com/) into any WordPress website. Hotels, rental companies, and hospitality businesses can add a "Book Now" button or link anywhere on their site using simple shortcodes or the included Gutenberg block.

= Features =

* **Easy setup** — just enter your Mews Configuration ID and you are ready to go.
* **Default widget** — `[bwfm_booking_widget]` displays arrival/departure date pickers and a "Check Availability" button, matching the standard Mews Booking Engine experience.
* **Multiple modes** — use `mode="button"` for a simple button, or `mode="hidden"` to load the engine invisibly for use with your own UI elements.
* **Shortcodes** — `[bwfm_booking_button]` for a button and `[bwfm_booking_link]` for a link that opens the booking engine.
* **Gutenberg block** — a native "Mews Booking Button" block with text and style controls.
* **Open Elements** — define CSS selectors so any existing element on your site can open the booking engine on click.
* **Language & Currency** — set default language and currency for the booking engine.
* **Demo mode** — test with the Mews demo environment before going live.
* **Developer-friendly** — action and filter hooks for extensions and customization.

= How It Works =

1. Install and activate the plugin.
2. Go to **Settings > Mews Booking** and enter your Configuration ID.
3. Add `[bwfm_booking_widget]` to any page — it displays date pickers and a "Check Availability" button by default. Visitors pick dates, click the button, and the Mews Booking Engine opens with their dates pre-filled.
4. Alternatively, use `[bwfm_booking_button]` for a simple booking button, or `[bwfm_booking_widget mode="hidden"]` to load the engine invisibly alongside your own custom buttons.

== External services ==

This plugin relies on external services operated by Mews Systems B.V. (“Mews”) to load and run the booking engine.

**Mews Distributor (production)**

When a page uses a booking shortcode or the included block, the plugin loads JavaScript from:

`https://api.mews.com/distributor/distributor.min.js`

This script is required to display the Mews Booking Engine and handle availability and reservations. Your saved Configuration ID(s) are passed to this script when the page loads so the correct property is targeted. No visitor personal data is sent to Mews until the visitor interacts with the booking flow.

* [Mews Terms of Service](https://www.mews.com/en/legal/terms-and-conditions)
* [Mews Privacy Policy](https://www.mews.com/en/legal/privacy-statement)

**Mews Demo API**

If you enable **Demo Mode** in the plugin settings (Advanced tab), the booking engine uses Mews’ demo environment. The front-end code then directs API traffic to:

`https://api.mews-demo.com`

This happens only while Demo Mode is on. The same Configuration ID(s) from your settings are used against the demo sandbox for testing; no live bookings are made. The same Mews terms and privacy policy apply.

== Installation ==

1. Upload the `booking-widget-for-mews` folder to the `/wp-content/plugins/` directory, or install directly through the WordPress plugin screen.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Navigate to **Settings > Mews Booking** to configure your Mews Configuration ID.
4. Add `[bwfm_booking_widget]` to any page to display the date selection form and "Check Availability" button, or use `[bwfm_booking_button]` / the Gutenberg block for a simple button.

== Frequently Asked Questions ==

= Where do I find my Mews Configuration ID? =

You can find it in Mews Operations under your Booking Engine configuration. See the [Mews documentation](https://docs.mews.com/booking-engine-guide/faq#where-can-i-get-configuration-id) for detailed instructions.

= Can I use multiple Configuration IDs? =

Yes. Enter multiple IDs separated by commas in the settings. This enables Chain mode for multi-property setups.

= Does this plugin work with page builders? =

Yes. The shortcodes work in any page builder that supports WordPress shortcodes. A native Gutenberg block is also included.

= Can I customize the button appearance? =

You can add custom CSS classes via the "Button CSS Class" setting or the `class` shortcode attribute. For advanced styling options including date pickers, color customization, and multiple skins, see **Booking Widget for Mews Pro**.

= Where is the source code? =

Development is on GitHub at [Ariolix-Dev/booking-widget-for-mews](https://github.com/Ariolix-Dev/booking-widget-for-mews). WordPress.org SVN is updated from that repository by GitHub Actions.

== Screenshots ==

1. Settings page with Configuration ID and display options.
2. The booking button rendered on the front end.
3. Gutenberg block in the editor.

== Changelog ==

= 1.1.6 =
* Fix: WordPress.org banner and icon assets now use the required pixel sizes (banner 772×250 and 1544×500, icon 128×128 and 256×256 square) so the directory no longer stretches 1376×768 source files.

= 1.1.5 =
* Fix: Load the official Mews widget script in the document head (`https://api.mews.com/distributor/distributor.min.js`) so the booking overlay opens. The previous footer/`app.mews.com` loader left `Mews` undefined when the page initialized the widget.
* Fix: Exclude the Mews loader from WP Rocket, Autoptimize, and LiteSpeed delay/defer/minify.
* Docs: Document the GitHub source repository used for development and WordPress.org releases.

= 1.1.1 =
* Fix: Updated the Pro upgrade link to `wp-assist.biz`.
* Build: Improved GitHub Actions deploy flow (SVN deploy skips cleanly when no release artifact exists; artifact actions updated for Node 24 compatibility).

= 1.1.0 =
* Security: Shortcode output is sanitized with `wp_kses_post()` after the `bwfm_shortcode_output` filter so returned HTML meets WordPress.org escaping expectations (including filtered output).
* Build: GitHub Actions release archives use `booking-widget-for-mews.zip` (no version suffix in the filename) to match WordPress.org submission expectations.

= 1.0.7 =
* Compliance: Removed WordPress.org directory banner/icon from the plugin package (use SVN assets folder after approval).
* Compliance: Documented external services in readme (Mews Distributor script and Mews Demo API).
* Security: Escape Pro/extension HTML injected via `bwfm_widget_form_extra_fields` with `wp_kses()`.
* Naming: Primary shortcodes are now `[bwfm_booking_widget]`, `[bwfm_booking_button]`, and `[bwfm_booking_link]`; legacy `[mews_*]` names remain registered as aliases.

= 1.0.6 =
* Fix: Removed duplicate Plugin URI header to satisfy WordPress.org review feedback.

= 1.0.5 =
* Fix: Updated WordPress compatibility metadata and addressed Plugin Check recommendations.

= 1.0.4 =
* Fix: Resolved settings disappearing when saving across different tabs.

= 1.0.3 =
* Fix: Moved GitHub Actions workflow to the correct directory to enable automated releases.

= 1.0.2 =
* Fix: Resolved automated release pipeline issues.

= 1.0.1 =
* Enhancement: Added underlying compatibility for the new Pro Appearance Customizer and Live Preview features.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.1.6 =
Correctly sized WordPress.org banner and icon assets. No settings changes required.

= 1.1.5 =
Fixes the booking overlay not opening after Mews changed the required widget loader. No settings changes required.

= 1.1.1 =
Maintenance release: fixes the Pro upgrade URL and hardens CI/SVN deploy automation; no settings changes required.

= 1.1.0 =
Security and packaging update: shortcode HTML is further hardened for WordPress.org guidelines; no settings changes required.

= 1.0.7 =
WordPress.org compliance release: use `[bwfm_booking_widget]`, `[bwfm_booking_button]`, and `[bwfm_booking_link]` in new content; old `[mews_*]` shortcodes still work.

= 1.0.0 =
Initial release of Booking Widget for Mews.
