=== Quotel Hotel Booking - Hotel Booking, Reservation & Room Management for WordPress ===
Contributors: riko910
Donate link: https://tarikul.top/
Tags: hotel booking, hotel reservation, room booking, booking calendar, woocommerce hotel
Requires at least: 5.9
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.5.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

WordPress hotel booking plugin with rooms, pricing, availability, calendar and React booking form. Online payments require Pro.

== Description ==

**Quotel Hotel Booking** is an all-in-one **hotel booking plugin for WordPress** built for hotels, resorts, B&Bs, guest houses, vacation rentals and any property that takes room reservations. It ships a custom **Rooms** catalog, **bookings database**, **smart pricing**, **availability rules** and a clean React-powered dashboard — all free.

Designed to be production-ready out of the box: install, activate the **setup wizard**, add rooms, drop a shortcode on a page and start taking bookings.

= Free vs. Pro =

**Everything is free** except online customer payment. With the free plugin you get real bookings, manual bookings, calendar editing, reports, CSV export, emails, rooms, shortcodes and the full admin UI.

**Online WooCommerce checkout** (customer pay-now, product sync, order lifecycle) requires [Quotel Hotel Booking Pro](https://www.tarikul.top/plugins/quotel-hotel-booking/) with an active license. Activate it under **Hotel Booking → License / Get Pro**.

Pro pricing: **$49 / 1 year**, **$69 / 3 years**, **$150 lifetime**.

[Plugin homepage »](https://www.tarikul.top/plugins/quotel-hotel-booking/)

= Why choose Quotel Hotel Booking =

* **Hotel reservation system** in one plugin – rooms, bookings, calendar, pricing, reports.
* **WooCommerce-native online payments** – use any WooCommerce gateway (Stripe, PayPal, bank transfer, COD, etc.).
* **React-powered booking form** – fast, accessible, mobile-first checkout flow.
* **REST API first** – every screen is driven by `qhb/v1` so you can build custom integrations.
* **No lock-in** – open code, GPLv2, translation-ready, runs on any standard WordPress host.

= Core features =

**Rooms & content**

* Custom post type `qhb_room` with archive support (pretty URLs under `/rooms/` by default).
* Taxonomies for **room types** and **amenities** (categorise and filter rooms).
* Rich room editor with featured image, gallery, pricing meta and a dedicated **single-room** layout including an optional gallery modal and a "Continue to booking" CTA.

**Bookings & availability**

* Custom tables for **bookings**, **per-day availability**, **pricing rules**, **extra services** and **booking-service** links.
* Date-range availability checks; supports multiple units per room type.
* Guest and logged-in booking flows; settings for guest booking, required phone and cancellation windows.
* **Manual bookings** for staff (admin capability) via the REST API.

**Smart pricing**

* Base and weekend rates per room.
* Optional date-range **pricing rules**.
* **Tax** and **long-stay discounts** (weekly / monthly) via Settings.
* Server-side **pricing endpoint** so the booking summary always matches what is actually charged.

**WooCommerce integration**

* Each room syncs to a **catalog-hidden variable WooCommerce product** with Standard / Weekend rate variations.
* Bookings are linked to **WooCommerce order IDs**.
* Order status drives booking lifecycle (pending payment → confirmed; cancelled/refunded → released).
* Optional **"Pay now"** link in the pending-payment email using the WooCommerce order pay URL.

**Admin experience**

* Top-level **Hotel Booking** menu: Welcome, Dashboard, Bookings, Calendar, Settings.
* **Setup wizard** on first activation: hotel basics, booking rules, notifications, optional WooCommerce auto-install.
* **Booking calendar** – month and timeline-style views, room filter, booking density indicator and per-day management.
* **Reports** REST endpoints: dashboard stats, revenue, bookings, occupancy, room performance, guest analytics, **CSV export**.

**Guest experience**

* Shortcode-driven React apps for the entire reservation journey.
* Compact **booking bar** for hero sections and home pages with Flatpickr date picker.
* Deep-link friendly URLs with `qhb_room`, `check_in`, `check_out`, `adults`, `children` and `room_type` query args.

**Security & roles**

* Custom capability `manage_hotel_bookings` (granted to administrators on activation).
* REST routes use nonces and dedicated permission callbacks for public vs. admin operations.
* All input is sanitized; output is escaped; SQL is built with `$wpdb->prepare()`.

= Available shortcodes =

Drop any of these shortcodes on a page or post. Default pages are auto-created on first activation if they do not already exist.

`[qhb_booking_form]`
Renders the multi-step React booking wizard (search → pick a room → guest details → summary → checkout). Mounts to `#qhb-booking-root`. Best placed on the **Book a Room** page.

`[qhb_room_search]`
Renders the filterable room search and results grid. Mounts to `#qhb-search-root`. Best placed on a **Search Rooms** page.

`[qhb_my_bookings]`
Lists the current user's bookings (logged-in only). Mounts to `#qhb-mybookings-root`. Best placed on a **My Account / My Bookings** page.

`[qhb_booking_bar]`
A compact horizontal booking strip with check-in / check-out date pickers, rooms / adults / children counters, room category dropdown and a "Book now" button. Use it inside hero sections, sidebars or the home page. Submitting it deep-links into the page that hosts `[qhb_booking_form]`.

Available `[qhb_booking_bar]` attributes:

* `redirect` – override the booking page URL. Defaults to the auto-created **Book a Room** page or `/book/`.
  * Example: `[qhb_booking_bar redirect="https://example.com/reservations/"]`
* `button` – override the submit button label. Defaults to "Book now".
  * Example: `[qhb_booking_bar button="Check availability"]`

= Backwards compatibility =

The legacy `[hbm_booking_form]`, `[hbm_room_search]`, `[hbm_my_bookings]` and `[hbm_booking_bar]` shortcodes from version 1.0.0 are still registered as transparent aliases, so any pages you saved earlier keep working unchanged. The previous REST namespace `hbm/v1` is also still served alongside the new `qhb/v1`.

= Technical snapshot =

* **Text domain:** `quotel-hotel-booking` (translation-ready; works with Loco Translate, WPML, Polylang and standard `.po` / `.mo` files).
* **REST namespace:** `qhb/v1` – e.g. `/wp-json/qhb/v1/rooms`, `/bookings`, `/settings`, `/pricing`, `/availability`, `/calendar/...`, `/reports/...`.
* **Custom post type:** `qhb_room` (rewrite slug `rooms`).
* **Taxonomies:** `qhb_room_type`, `qhb_amenity`.
* **Database tables (using your `$wpdb->prefix`):** `qhb_bookings`, `qhb_pricing_rules`, `qhb_availability`, `qhb_extra_services`, `qhb_booking_services`.
* **Capability:** `manage_hotel_bookings` (assigned to administrators on activation).

= Requirements =

* WordPress **5.9** or higher.
* PHP **7.4** or higher.
* **WooCommerce** is recommended for online payments – the booking → checkout flow is built around it.

= Use cases =

* Single hotel or boutique hotel booking system.
* Resort with several room categories.
* B&B / guest house reservation form.
* Vacation rental landing page with check-in / check-out widget.
* Inn or homestay running on WordPress + WooCommerce.

== Installation ==

1. Upload the `quotel-hotel-booking` folder to `/wp-content/plugins/`, or install the ZIP via **Plugins → Add New → Upload Plugin**.
2. Activate **Quotel Hotel Booking** on the **Plugins** screen.
3. Follow the onboarding flow at **Hotel Booking → Welcome** (and install / activate WooCommerce if prompted).
4. Visit **Hotel Booking → Settings** and confirm currency, check-in / check-out times, tax, emails and booking rules.
5. Add rooms under **Hotel Rooms** in the admin menu (set base price, weekend price, capacity, amenities).
6. (Optional) Drop `[qhb_booking_bar]` into your home page hero and `[qhb_booking_form]` on a booking page (auto-created on first activation).
7. Visit **Settings → Permalinks** and click **Save** to refresh rewrite rules if `/rooms/` URLs return 404.

== Frequently Asked Questions ==

= Which shortcodes does the plugin provide? =

Four shortcodes: `[qhb_booking_form]`, `[qhb_room_search]`, `[qhb_my_bookings]` and `[qhb_booking_bar]`. The legacy `hbm_*` versions still work as aliases. See **Description → Available shortcodes** for parameters.

= Where do guests pay for their booking? =

With **Quotel Hotel Booking Pro**, guests pay through **WooCommerce** (any gateway). Without Pro, guests can still complete a booking and you collect payment offline.

= Do I have to use WooCommerce? =

No. The free plugin works without WooCommerce — bookings are confirmed and you handle payment separately. WooCommerce + Pro is only needed for online customer checkout.

= What URL pattern is used for single rooms? =

Rooms use the `qhb_room` post type; permalinks default to the `rooms` rewrite slug (e.g. `yoursite.com/rooms/deluxe-king/`). If links 404 after install, visit **Settings → Permalinks** and click **Save**.

= Can I block dates, override prices or add seasonal rates? =

Yes. Use the admin **Calendar** (per room) to close dates or override the nightly price. Date-range pricing rules and weekly / monthly long-stay discounts are configured under **Settings**. Closed days and overrides are stored in the `qhb_availability` and `qhb_pricing_rules` tables.

= Is guest checkout supported? =

Yes, when enabled in **Settings → Booking**. You can also require a phone number or restrict booking to logged-in users only.

= Does the plugin support multiple units per room type? =

Yes. Each room can be configured with multiple bookable units; availability checks decrement only the requested unit count and the booking remains "available" while units remain.

= How do I translate the plugin? =

Use the text domain **`quotel-hotel-booking`**. Generate or edit language files with [Loco Translate](https://wordpress.org/plugins/loco-translate/), Poedit or WPML, then place MO files under `wp-content/languages/plugins/`.

= What is the difference between the free plugin and Pro? =

The **free plugin** includes the full hotel booking system: rooms, bookings, calendar editing, manual bookings, reports, CSV export, emails, shortcodes and admin tools. Guests can book; payment is collected offline.

**Quotel Hotel Booking Pro** unlocks **online payments** only:

* WooCommerce checkout for customers.
* Room → WooCommerce product auto-sync.
* Pay-now links and order-status booking lifecycle.
* Daily booking digest and priority auto-updates.

Pro pricing: **$49 / 1 year**, **$69 / 3 years**, **$150 lifetime**.

Activate under **Hotel Booking → License / Get Pro**.

= I had real bookings before 1.1.0. Will I lose them? =

No. Existing bookings remain in the database and continue to render in the admin **Bookings** list.

= Will my old shortcodes still work after updating from 1.0.0? =

Yes. All `[hbm_*]` shortcodes are kept as transparent aliases that forward to the new `[qhb_*]` versions, and the `hbm/v1` REST namespace is still served alongside `qhb/v1`. On first load after the update, a one-time migration renames the database tables, custom post type, taxonomies, options and order meta keys from `hbm_*` to `qhb_*`.

= Does uninstall remove the booking data? =

No. Deactivating the plugin does not drop the custom tables or delete bookings. If you need a clean removal, back up first and remove the booking-related tables and options manually.

== Screenshots ==

1. **Hotel Booking → Dashboard** – at-a-glance stats, occupancy and recent bookings (React).
2. **Bookings** – filterable list with status badges, search and detail views.
3. **Calendar** – month or timeline view with legend, room filter and per-day management.
4. **Settings** – tabbed UI for general, booking, payment, pricing, email and display options.
5. **Booking wizard** – React-powered search → room → guest → summary → WooCommerce checkout.
6. **Room search** – grid of bookable rooms with filters and pricing.
7. **Booking bar** – compact hero strip with date pickers, room and guest counts.

== Changelog ==

= 1.5.0 =
* tested upto updated

= 1.4.0 =
* Free / Pro model simplified: **all features are free** except online customer payments.
* Pro unlocks WooCommerce checkout, product sync and payment lifecycle only.
* Removed all demo / preview data from dashboard, bookings and reports.
* Booking form accepts real reservations without Pro; offline confirmation when payments are locked.
* Updated Pro pricing display: $49 (1 year), $69 (3 years), $150 (lifetime).
* Admin notices, License page and Settings payment tab updated to match the new model.

= 1.3.1 =
* New: **Deposits** — charge a percentage or fixed deposit online with the balance collected at check-in. The WooCommerce order records full price, deposit due and balance, and the booking summary shows the amount due now.
* New: **Coupon codes** — apply WooCommerce coupons (percentage / fixed, with expiry and min/max spend validation) on the booking summary; discount flows through pricing, booking and the order.
* New: **Request (approval) booking mode** — hold bookings for staff approval before payment. Guests and admins are notified; new Approve / Decline actions appear in the admin Bookings list with a dedicated "Request" status filter.
* New: **Display settings now active** — rooms-per-page pagination on the room grid, selectable gallery style (grid / slider / masonry) on single-room pages, and optional guest reviews via WordPress comments.
* New: **Custom email templates** — editable confirmation and cancellation subject/message with placeholders (`{guest_name}`, `{booking_id}`, `{room_name}`, `{check_in}`, `{check_out}`, `{total_price}`, `{hotel_name}`, and more). Leave blank to use the built-in branded designs.
* New: **Advanced integrations tab** — Twilio **SMS** confirmation texts, plus an **iCalendar (.ics) feed** for iCal export and Google Calendar subscription (tokenized feed URL shown in settings).
* New: Daily **check-in reminder** emails and configurable **From name / From address** applied to all notifications.
* Improved: server-side enforcement of minimum / maximum booking nights, and per-field sanitization when saving settings via REST.
* New REST routes: `POST /qhb/v1/bookings/{id}/approve` and `POST /qhb/v1/bookings/{id}/decline`; `pricing` / `availability` endpoints and public settings now expose deposit, coupon, booking-mode and display options.

= 1.3.0 =
* Update: Margin 0 for WordPress 7 issue.

= 1.2.0 =
* Update: License page updated convert it into react.

= 1.1.0 =
* New: License page at **Hotel Booking → License / Get Pro** with activation, status display, expiry tracking and one-click deactivation.
* New: Pro detection helpers (`qhb_is_pro_plugin_active()`, `qhb_is_pro_licensed()`, `qhb_can_use_pro_mutations()`) consumed by REST gates, admin React and the public booking form.
* New: Preview mode for the front-end booking form, admin Bookings list, dashboard stats and calendar when running without an active Pro license.
* Gated: real booking creation, manual bookings, cancellation, calendar editing (close dates / availability / bulk update) and CSV export now require Quotel Hotel Booking Pro with an active license. The corresponding REST endpoints return a `qhb_pro_required` (HTTP 402) error when called without a license.
* Gated: WooCommerce auto-product-sync on room save and the order-status → booking-status pipeline are Pro-only.
* Improved: license-aware admin notices on every Hotel Booking screen.
* Improved: every `qhbAdmin` / `qhbPublic` localized object now carries `proPluginActive`, `proLicensed`, `upgradeUrl` and `licenseStatus` so any extension can react to the licence state.
* Daily WP-Cron license re-verification (`qhb_daily_license_check`) keeps the local status in sync with the QueueCommerce server.
* No data loss: existing bookings remain readable in the admin even without Pro; disabling Pro flips write paths off but read access is preserved.
* Rebrand: unified internal prefix from `hbm_` to `qhb_` to match the plugin slug.
* New `[qhb_booking_bar]` shortcode for hero / home-page booking strips with Flatpickr date pickers.
* New `[qhb_booking_bar]` attributes: `redirect` (booking page URL) and `button` (submit label).
* All public shortcodes renamed to `[qhb_booking_form]`, `[qhb_room_search]`, `[qhb_my_bookings]`, `[qhb_booking_bar]`.
* REST namespace renamed to `qhb/v1`. Legacy `hbm/v1` is still registered for backwards compatibility.
* PHP class names rebranded from `HBM_*` to `QHB_*`; constants from `HBM_*` to `QHB_*`.
* Filenames rebranded from `class-hbm-*.php` to `class-qhb-*.php`.
* Database tables, custom post type, taxonomies, options and post / order meta keys renamed to the `qhb_*` prefix with a one-time migration on update.
* Backwards-compatibility aliases: `[hbm_*]` shortcodes still resolve, `hbm/v1` REST routes still work, `Hotel_Booking_Manager` class and `HBM()` accessor still exist.
* Updated `readme.txt` with full shortcode reference, SEO-friendly description, FAQ and screenshot list.

= 1.0.0 =
* Initial public release.
* Custom post type and taxonomies for rooms.
* Bookings, availability, pricing rules and extra-services schema.
* WooCommerce variable-product sync (Standard / Weekend) and order-status driven booking lifecycle.
* REST API for the React admin and public apps.
* React admin: welcome / setup wizard, dashboard, bookings, calendar, settings.
* React public: booking form, room search, my bookings; server-side pricing endpoint.
* Email notifications for pending payment (with pay link), confirmation and cancellation.
* Single-room template, styling and assets.

== Upgrade Notice ==

= 1.4.0 =
All booking features are now free. Only online WooCommerce payments require Pro. Demo/preview data removed. Existing bookings are preserved.

= 1.1.0 =
Plugin-wide rebrand from `hbm_*` to `qhb_*`. Old shortcodes, REST routes and class names are kept as aliases. A one-time migration renames database tables, the room post type, taxonomies, options and order meta. **Back up your database before updating.**

= 1.0.0 =
First stable release. Install WooCommerce before going live if you need online payments.

== Privacy ==

The plugin stores booking data you collect from guests (name, email, phone, dates, party size, optional notes) in the WordPress database and may associate each record with a WooCommerce **order ID** for payment tracking. Treat this data according to your privacy policy and applicable law (GDPR, CCPA, etc.). Email delivery uses WordPress' `wp_mail()` facilities. No data is sent to third parties by the plugin itself.
