=== Pandao Booking ===
Contributors: pandaow
Tags: booking, hotel, reservations, vacation rental, availability calendar
Requires at least: 6.5
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

Commission-free direct bookings for hotels, B&Bs and holiday rentals: rates, live availability, online payments and a booking calendar.

== Description ==

Pandao Booking turns your WordPress site into a direct booking engine for your hotel, guest house, B&B, holiday home or apartments. Guests pick their dates, see what's available and what it costs, then book on your site with no commission, paying online or on arrival. You manage every stay from a drag-and-drop booking calendar, and the plugin emails guests at every step.

Try the live demo, which also runs Pandao Booking Pro: https://booking.pandao.eu (admin login: admin / admin123).

Everything in this plugin is free: no time limit, no locked features, nothing to unlock.

= Accommodation types and units =

* Accommodation types (rooms, suites, apartments, cottages…) built with the WordPress editor: description, featured image, gallery, facilities with icons, size and occupancy (adults, children, total, minimum).
* Units for each type, with your own names ("101", "Garden Cottage"). Online, a unit is never sold twice for the same night.
* Block a unit for maintenance or owner stays on the dates you choose.

= Rates, seasons and offers =

* A rate calendar for each accommodation type: nightly rates by period and by day of the week, the number of guests included in the rate, and extra-adult and child prices by age band.
* Stay restrictions: minimum and maximum stay, closed to arrival or departure on given days, and stop-sell.
* Copy a season to new dates in one go, with a price increase or decrease.
* Rate plans alongside the standard rate: non-refundable, breakfast included, early booking, last minute, free cancellation up to a set number of days before arrival, and promotions with their own stay and booking dates.
* Set rates and rules once for the whole property, then override them only where they differ: for one accommodation type or one period.

= Search and booking =

* Search by dates, adults and each child's age. Accommodation types that fit the whole party come first; when no single unit is big enough, the plugin suggests splitting the party across several units.
* An availability calendar that shows sold-out and closed nights, and suggests nearby dates when nothing is available.
* A booking form with guest details, extras, promo code and payment method. Prices are always recalculated on the server.
* Instant confirmation or booking on request: your choice.
* Payment on arrival, by bank transfer or by cheque. Ask for a deposit (a percentage, the first night, a fixed amount or the full stay) by a deadline, with an automatic reminder; unpaid bookings release their units once the deadline passes.
* A booking page for every guest, linked from each email: status, payments, balance due, and online cancellation while it's still free under the rate plan.

= Managing bookings =

* A dashboard of everything that needs your attention: bookings to confirm, payments due, today's arrivals and departures.
* A filterable bookings list, a details page for each booking, and quick actions: confirm, cancel with or without an email, record a payment.
* A full booking editor for phone and walk-in bookings: units, rate plans, prices kept exactly as you enter them, extras and discounts.
* A drag-and-drop booking calendar: move a stay to another unit or other dates, create a booking on free nights, and spot conflicts at a glance.
* Emails to the guest and to the property at every step, with templates you can override in your theme.
* Booking manager and Front desk roles alongside the Administrator.
* WordPress privacy tools: export or erase a guest's data, plus suggested text for your privacy policy.
* Site Health checks and WP-CLI commands (sample data for a test site, scheduled tasks).

= Modules =

Turn each module on or off in Booking › Settings › Modules.

* **Online payments**: cards through Stripe (Apple Pay and Google Pay included) and PayPal, on their secure checkout pages; the full stay or a deposit, with automatic refunds when a guest cancels within the free cancellation period.
* **Calendar sync**: connect each unit to Airbnb, Booking.com, Vrbo or Google Calendar through iCal. Their bookings block your dates and yours block theirs. Your site reads their calendars every 30 minutes, each platform reads yours on its own schedule, and any overlap is flagged.
* **Extras**: breakfast, parking, late check-out, baby cot… priced per stay or per night, per booking, unit, guest or adult; optional, or added to every booking.
* **Taxes & fees**: VAT included in your prices, a tourist tax per guest per night with a minimum age, and fees per night or per stay.
* **Promo codes**: a percentage or a fixed amount off the accommodation, with validity dates, a minimum stay or spend, a usage limit and one use per guest.
* **Enquiries**: when nothing is available, guests can send an enquiry that you reply to or turn into a booking.
* **Guest accounts**: guests sign in to see their bookings and book faster next time.

= Pandao Booking Pro =

Pandao Booking Pro is a separate paid plugin that adds the modules below. You don't need it to take bookings: nothing above is locked, limited or time-bound. Plans and details: https://items.pandao.eu/products/pandao-booking-pro/

* **Reviews**: verified post-stay reviews, email invitations, moderation with published guidelines, property responses and an average rating on your site.
* **Activities**: tours, lessons or tastings with their sessions and capacity, booked with a stay or on their own.
* **Reports**: occupancy, revenue, average daily rate, RevPAR and booking sources over any period; export bookings and guests to a spreadsheet.
* **Currencies**: show prices in each visitor's currency, for reference, at European Central Bank rates or your own.
* **Invoices**: numbered PDF invoices showing net prices, VAT by rate and tourist tax separately, and credit notes for cancellations; issued from the booking, after check-out or once the stay is paid; emailed to the guest, with a monthly list and export for your accountant.
* **WooCommerce payments**: guests pay through WooCommerce checkout with any gateway you've set up there (cards, mobile money, local banks). Units stay held during payment, and refunds go back through the gateway.

= Design =

Your booking pages look polished from day one: clean cards, an availability calendar, prices and totals that stand out, and the guest's choices clearly highlighted. Pick your colours in Booking › Settings › Appearance: a main colour for headings and prices, and an accent colour for buttons and selections. Your theme's fonts stay as they are. Prefer your theme's own look? Switch to its styles, and the plugin keeps only the layout.

= Blocks and shortcodes =

The plugin creates the Accommodation, Book now and My booking pages when you activate it. Every part of the booking flow is available as a block and as a shortcode, so it fits any page or theme:

* Booking search: `[pandao_booking_search]`
* Accommodation list: `[pandao_booking_accommodations]`
* Accommodation booking (dates, calendar, rates): `[pandao_booking_accommodation]`
* Booking form: `[pandao_booking_checkout]`
* Booking details: `[pandao_booking_booking]`
* Guest account (Guest accounts module): `[pandao_booking_account]`

= For developers =

* Override the site and email templates from a `pandao-booking/` folder in your theme.
* Styles scoped to `.pdb` and driven by CSS custom properties (`--pdb-…`).
* Actions and filters at every step, a REST API (`pandao-booking/v1`), and modules built only on the plugin's public API.
* Ready for WPML and Polylang (`wpml-config.xml`).

Available in English and French.

== Installation ==

1. Go to Plugins › Add New Plugin, search for "Pandao Booking", then install and activate it.
2. In Booking › Settings, enter your property's name and contact details, its currency, check-in and check-out times, and how bookings are confirmed and paid.
3. In Booking › Accommodation types, add your rooms, suites or homes and their units.
4. In Booking › Rates, set the prices of each accommodation type for your seasons.
5. Add the Accommodation page to your menu, and the Booking search block to your home page.

On a test site, `wp pandao-booking sample-data` creates sample accommodation types with their units, rates and rate plans, plus extras, taxes and a promo code when their modules are on.

== Frequently Asked Questions ==

= Can I manage several properties? =

No. The plugin is built for a single property, with as many accommodation types and units as you need.

= Does it work with my theme? =

Yes. Every part of the booking flow is a block or a shortcode, styled only inside its own container: the plugin's design never touches the rest of your site, and it uses your theme's fonts. With a block theme, accommodation pages get their own template, which you can edit in the Site Editor. To let your theme style everything, choose your theme's styles in Booking › Settings › Appearance. Styles use CSS custom properties (`--pdb-main`, `--pdb-accent`, `--pdb-radius`…), and you can copy any template into a `pandao-booking/` folder in your theme to customise it.

= Do I pay a commission on my bookings? =

No. The plugin takes nothing from your bookings. With online payments, you only pay your Stripe or PayPal fees.

= Can guests pay online? =

Yes, with the Online payments module: by card through Stripe (Apple Pay and Google Pay included) or with PayPal, on their secure pages. Enable Stripe or PayPal in Booking › Settings › Payment, then enter your Stripe keys or PayPal API credentials right below. Card details never touch your site.

= Can I prevent double bookings with Airbnb or Booking.com? =

Yes, with the Calendar sync module. Each unit has its own calendar link to add to the platform, and you paste the platform's calendar link in return. Your site reads the platform's calendar every 30 minutes; the platform reads yours on its own schedule, which may be less frequent. Any overlap is flagged on the dashboard and in the booking calendar.

= Why aren't unpaid bookings released on time? =

WordPress runs scheduled tasks when someone visits your site. On a quiet site, or when WP-Cron is disabled (`DISABLE_WP_CRON`), ask your host to call `wp-cron.php` every five minutes with a real cron job. Tools › Site Health warns you when tasks are running late.

= Does it work with page caching? =

Yes. The Book now and My booking pages tell caching plugins not to cache them (`DONOTCACHEPAGE` and no-cache headers). In your caching plugin, also exclude visitors who have the `pandao_booking_cart` cookie (a stay being booked).

= Is it GDPR compliant? =

The plugin stores only what a booking needs, and adds its section to the privacy policy WordPress suggests. The WordPress tools (Tools › Export Personal Data and Erase Personal Data) export and erase a guest's data; upcoming bookings are kept until the stay is over. No data leaves your site unless you turn on a module that needs it (see External services).

= What happens to my data if I delete the plugin? =

It's kept, so reinstalling brings back your bookings, rates and settings. To remove everything when you delete the plugin, first tick "Delete all data on uninstall" in Booking › Settings › Advanced.

= Can I translate the plugin? =

Yes, on translate.wordpress.org. English and French are included. The content you enter (accommodation types, rate plans, extras, emails) can be translated with WPML or Polylang.

== External services ==

The plugin doesn't contact any outside service on its own. The services below are used only when you turn on the related module and give it what it needs.

= Stripe (Online payments module) =

When you add your Stripe keys and a guest chooses to pay by card, the plugin creates a Stripe Checkout session (api.stripe.com) and sends the amount and currency, the booking reference, a short description of the stay, the guest's email address and the URLs that bring the guest back to your site. It retrieves the payment when the guest returns, and asks Stripe for a refund when a guest cancels within the free cancellation period. Stripe notifies your site of completed payments (webhook).

* Terms of service: https://stripe.com/legal/ssa
* Privacy policy: https://stripe.com/privacy

= PayPal (Online payments module) =

When you add your PayPal API credentials and a guest chooses PayPal, the plugin creates a PayPal order (api-m.paypal.com, or api-m.sandbox.paypal.com in sandbox mode) with the amount and currency, the booking reference, a short description of the stay, your property's name and the URLs that bring the guest back to your site. It captures the payment when the guest returns, and asks PayPal for a refund when a guest cancels within the free cancellation period.

* Terms of service: https://www.paypal.com/us/legalhub/paypal/useragreement-full
* Privacy policy: https://www.paypal.com/us/legalhub/paypal/privacy-full

= Booking platform calendars (Calendar sync module) =

For each calendar link you paste (Airbnb, Booking.com, Vrbo, Google Calendar or any platform with an iCal export), the plugin fetches that link every 30 minutes, and whenever you ask it to. The request includes the plugin's name and version and your site's URL. In return, the platform fetches the unit's calendar from your site: booked and closed nights only, with no guest names or details.

* Airbnb: https://www.airbnb.com/help/article/2908 (terms), https://www.airbnb.com/help/article/3175 (privacy)
* Booking.com: https://www.booking.com/content/terms.html (terms), https://www.booking.com/content/privacy.html (privacy)
* Vrbo: https://www.vrbo.com/legal/terms-and-conditions (terms), https://www.vrbo.com/legal/privacy (privacy)
* Google: https://policies.google.com/terms (terms), https://policies.google.com/privacy (privacy)

== Screenshots ==

1. Available accommodation for the dates searched, with the price for the whole stay.
2. The accommodation page: dates, guests, availability calendar and rate plans.
3. The booking form: guest details, extras, promo code and payment method.
4. The guest's booking page: status, payments and free cancellation.
5. The booking calendar: drag a stay to move it, or create a booking on free nights.
6. The rate calendar: nightly prices and units open for every accommodation type, day by day.
7. The booking editor, for a phone booking.
8. The dashboard: everything that needs your attention today.
9. The modules, each switched on or off in the settings.
10. The bookings list, with statuses, filters and search.

== Changelog ==

= 1.0.0 =
* Initial release: accommodation types and units, rates, seasons and rate plans, search and booking, payment on arrival, by bank transfer or by cheque, emails, a booking page for guests with free cancellation, bookings list and editor, booking calendar, dashboard, roles and privacy tools.
* Modules: online payments (Stripe, PayPal), calendar sync (iCal), extras, taxes & fees, promo codes, enquiries and guest accounts.
* English and French.
