=== BookingFacil Reservations for Accommodations ===
Contributors: pabloaronnabookingfacil
Tags: booking, reservations, accommodation, payments, saas
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.3.7
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept online guest reservations for your accommodations and manage rates, availability, payments, and confirmations from WordPress.

== Description ==

BookingFacil Reservations for Accommodations connects WordPress accommodation websites with the BookingFacil SaaS platform. It lets property owners manage accommodation units, rates, availability, reservations, guests, and payment settings from WordPress.

Features include:

* Accommodation unit, rate, and availability management.
* Reservations, booking blocks, and guest CRM.
* Mercado Pago integration for online payments.
* Shortcodes to display a search form and accommodation catalog on any page.
* Housekeeping reporting.
* Discount coupons.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`, or install the ZIP through the WordPress Plugins screen.
2. Activate the plugin through the WordPress Plugins screen.
3. Go to “BookingFacil > License” and follow the steps to connect the site to the BookingFacil service.
4. Configure your property in “BookingFacil > Settings”.

== Frequently Asked Questions ==

= Do I need a license? =

Yes. The plugin requires an active BookingFacil subscription to synchronize accommodations, rates, and reservations with the central service.

= Can I use the plugin without Mercado Pago? =

Yes. You can enable pay-at-property or bank transfer as alternative payment methods.

= Where is my data stored? =

Accommodation, rate, and reservation data are synchronized with the BookingFacil service. The plugin stores the license API key and email in the WordPress options table.

== External services ==

This plugin connects to the following external services:

* **BookingFacil SaaS**: required to provide accommodation management, availability, reservations, license validation, and optional telemetry.
  * The plugin sends the site URL, configured property and reservation data, the license email and API key, and an installation identifier when needed to validate the license, synchronize the property, or process a reservation. If the administrator explicitly opts in to telemetry, it also sends the site name, administrator email, WordPress version, and plugin version.
  * Service terms: https://bookingfacil.com.ar/terminos
  * Privacy policy: https://bookingfacil.com.ar/privacidad
* **iCalendar (iCal) feeds**: used to provide accommodation availability feeds that property owners may optionally import into third-party calendar services, such as Airbnb or Booking.com.
  * The plugin provides a BookingFacil-hosted `.ics` feed URL containing availability and booking-blocking dates for an accommodation unit. The plugin does not send data directly to third-party calendar services; data is shared with them only if the property owner manually adds the feed URL to those services.
  * Privacy policy: https://bookingfacil.com.ar/privacidad
* **Mercado Pago**: used only when the administrator enables Mercado Pago payment processing or tests Mercado Pago credentials.
  * The plugin sends the merchant access token to Mercado Pago to verify the connected merchant account. When the administrator clicks "Test connection", the access token is sent to the `https://api.mercadopago.com/users/me` endpoint. Guest payment data is processed by Mercado Pago during payment flows.
  * Terms of service: https://www.mercadopago.com.ar/ayuda/terminos-y-condiciones_299
  * Privacy policy: https://www.mercadopago.com.ar/privacidad/declaracion-privacidad
* **Cloudflare Turnstile**: optional anti-bot protection for the public booking form when a Turnstile site key is configured by the BookingFacil service.
  * When the booking form is displayed, the visitor’s browser loads Cloudflare’s Turnstile script and sends the data required by Cloudflare to evaluate the challenge.
  * Terms of service: https://www.cloudflare.com/terms/
  * Privacy policy: https://www.cloudflare.com/privacypolicy/
* **WhatsApp**: optional contact links for property owners and guests.
  * When a visitor or administrator selects a WhatsApp contact link, their browser is redirected to `https://api.whatsapp.com/send` (or `https://wa.me`) with the configured phone number and the message text. No data is sent to WhatsApp until the link is selected.
  * Terms of service: https://www.whatsapp.com/legal/terms-of-service
  * Privacy policy: https://www.whatsapp.com/legal/privacy-policy

== Screenshots ==

1. Integrated availability search form.
2. Accommodation unit view.
3. Accommodation unit editor.
4. Confirmed reservation.
5. Booking calendar view.
6. Reservation view.
7. Payment methods.
8. Housekeeping control.

== Changelog ==

= 1.3.7 =
* Payment Methods & Checkout: fixed an access permission issue in the AJAX proxy where unauthenticated guests could not read the property's configured payment settings, causing the booking modal to fallback to On-Arrival Payment only instead of displaying active Mercado Pago and Bank Transfer options.
* Booking Modal: ensured asynchronous payment settings promise resolution in the unit detail modal and checkout step 2, instantly reflecting active payment options.

= 1.3.6 =
* Elementor Search Widget: added dedicated "Advanced Filters Panel" style section to customize panel background color, border color, section headings, amenity labels, and price min/max input fields.
* Advanced Filters Panel: updated default panel background to a subtle adaptive translucent glassmorphism effect to ensure white labels remain perfectly legible over dark and image backgrounds.
* SaaS License Management: fixed low-contrast text visibility for "Connection" and "API Key" table labels under the admin dark theme.
* SaaS License Management: fixed plan usage progress bars (Accommodation Unit Types and Physical Rooms/Cabins) by replacing invalid static CSS syntax with dynamic inline styles and dark track styling.

= 1.3.5 =
* Search Results & Catalog: converted search results and unit detail/checkout views into an elegant modal overlay, preventing background images and hero section layouts from stretching or clipping.
* Responsive Accommodation Grid: redesigned the accommodation cards layout to display in 3 columns on wide screens, 2 columns on tablets, and 1 column on mobile devices.
* Analytics & Conversion Funnel: native integration with Google Tag Manager (GTM) and Google Analytics 4 (GA4) eCommerce events via window.dataLayer (view_search_results, view_item, begin_checkout, purchase) to measure marketing funnels and ad ROI on Google Ads and Meta Pixel.
* General Settings: added a dedicated Google Tag Manager (GTM) Container ID field with automatic script injection and clear guidance for non-technical users.

= 1.3.4 =
* Elementor Search Widget: added brand color controls for search title, magnifying glass icon, field labels, search button (normal and hover), and advanced filters button (normal and hover).
* Elementor Search Widget: added interactive backdrop-filter blur slider to dynamically control container glassmorphism blur depth.

= 1.3.3 =
* Elementor Search Widget: optimized mobile layout with centered search icon and single-line title.
* Elementor Search Widget: full-width search submit button on mobile devices for improved touch accessibility.
* Advanced Filters: price range inputs (Min and Max) now seamlessly share 100% of available container width.
* Pre-Check-in Online: fixed CSS display conflict to ensure the public passenger registration form renders immediately upon loading.
* Pre-Check-in Online: automatic assignment of booking check-in and check-out dates to guest passenger records.

= 1.3.2 =
* Passenger Book and Transit Sheets: redesigned manual and edit modal into 5 themed blocks with a structured 2-column layout (Stay/Accommodation, Passenger info, Residence address, Vehicle & Transit, Minors & Observations).
* Added comprehensive transit and lodging fields: direct contact phone, city/locality, province, vehicle brand/model, vehicle plate/domain, and adult/child group counts.
* Fixed date picker and timezone handling (UTC offset shift) when loading, formatting, and editing check-in / check-out dates with Flatpickr.
* Booking Occupants Management: reorganized the internal occupants form in reservation management into 4 themed blocks with 2 columns, adding vehicle and contact phone badges in the occupants table.
* Enriched public pre-check-in, PDF official passenger book export (landscape A4), and CSV/Excel exports with the new vehicle, transit, and contact data.

= 1.3.1 =
* Setup Wizard improvements: full-width layout, automated diagnostic cards, Elementor/Front-Page shortcode detection, and per-unit rate breakdown.
* Rates and Availability: auto-load first unit on entry and enhanced selector with visual indicators for active, expired, and missing rates.
* License management: improved plan selection and checkout flow for coupon and trial accounts.
* Added escapeHtml helpers across admin scripts for enhanced UI security.

= 1.3.0 =
* Added support for multiple notification and contact email addresses in Settings.
* Added dedicated Mercado Pago email field, decoupling gateway payouts from notification emails.
* Added manual occupant/passenger registration without prior reservations in Passenger Book (ideal for campsites, parcel rentals, and direct guests).
* Fixed date modification panel display toggle in admin reservation modal.
* Added passengers endpoint to administrative proxy whitelist.

= 1.2.15 =
* Added booking-specific passenger records (BookingGuest) to support Argentina's Ley 18.828 passenger book requirements.
* Added admin occupant management in the reservation modal.
* Added secure public pre-check-in flow for guests.
* Added passenger book report with filters and PDF/CSV exports.
* Automatic creation of primary passenger from reservation holder in public and manual bookings.

= 1.2.14 =
* Removed remote image URLs from shortcode examples in the integration page.
* Removed inline <style> blocks from frontend QR payment status and moved spinner animation to frontend-common.css.
* Adjusted guest booking email subject/body to indicate "pending payment" status when the booking is not yet confirmed.

= 1.2.13 =
* Replaced remote sample asset URLs in admin integration examples and placeholders with local relative paths.
* Renamed localized JavaScript global variables to use the bookingFacil prefix (bookingFacilConfig, bookingFacilProxy, bookingFacilAdminFetch) complying with WordPress.org guidelines.
* Removed hardcoded fallback phone numbers from WhatsApp actions.

= 1.2.12 =
* Fixed loading of administrative styles and scripts on plugin submenu pages.

= 1.2.11 =
* Updated the plugin identity and English directory metadata.
* Sanitized proxied query parameters and JSON request bodies.
* Documented external services.
* Removed the unnecessary translation loading call for WordPress.org.

= 1.2.10 =
* Responsive layout improvements for accommodation cards.

== Upgrade Notice ==

= 1.3.7 =
* Fixes payment methods loading for guest reservations, allowing public visitors to see Bank Transfer and Mercado Pago options as configured by the property.

= 1.3.6 =
* Adds advanced filter styling controls to Elementor and fixes dark theme contrast and progress bar rendering on the SaaS License admin page.

= 1.3.5 =
* Adds modal overlay for search results and checkout, 3-column responsive grid, and native Google Tag Manager / GA4 eCommerce dataLayer conversion tracking.

= 1.3.4 =
* Adds brand color customization controls and interactive backdrop blur slider to the Elementor search widget.

= 1.3.3 =
* Mobile responsiveness enhancements for the Elementor search widget, full-width search button, balanced price filter inputs, and pre-check-in display fix.

= 1.3.2 =
* Major UI and data enhancement for the Passenger Book (Ley 18.828) and Booking Occupants: 5 themed blocks, vehicle brand/plate tracking, contact phones, provinces, and timezone date handling fixes.

= 1.3.1 =
* Enhances Setup Wizard diagnostics, unit-level rate status detection (active vs. expired), Elementor page builder shortcode detection, and admin UI improvements.

= 1.3.0 =
* Adds manual passenger registration for campsites/parcels, multiple notification emails, dedicated Mercado Pago email setting, and reservation modal UI fixes.

= 1.2.15 =
* Adds passenger/occupant registration, pre-check-in, and passenger book reporting to comply with local lodging regulations.

= 1.2.14 =
* Addresses WordPress.org review feedback: shortcode examples no longer reference remote images; all localized JS objects use the plugin prefix.

= 1.2.13 =
* Fixes remote asset call warnings and updates JavaScript global variable naming to comply with WordPress.org review requirements.

= 1.2.12 =
* Fixes administrative styles and scripts on plugin submenu pages.

= 1.2.11 =
* Recommended update with directory metadata, security, and external service documentation improvements.
