=== Book My Appointments – Booking Form ===
Contributors: alticllc
Tags: booking, appointments, scheduling, calendar, embed
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Embed your Book My Appointments booking form on any WordPress page. Works with Gutenberg, Elementor, Divi, and all page builders.

== Description ==

**Book My Appointments** lets your customers book appointments directly from your WordPress website. Connect your Book My Appointments account and embed the booking form anywhere on your site.

= Features =

* **One-click connect** — Link your Book My Appointments account with a single click
* **Shortcode** — Use `[bookmyappointments]` in any page, post, or widget
* **Gutenberg block** — Native block editor support with live preview
* **Elementor widget** — Drag-and-drop widget for Elementor
* **Divi compatible** — Works out of the box with Divi's text and code modules
* **Responsive** — Automatically resizes to fit any screen
* **Google Tag Manager** — Optional GTM integration for conversion tracking
* **Lightweight** — No bloat, loads only on pages where the form is used

= How It Works =

1. Install and activate the plugin
2. Go to **Book My Appointments** in your WordPress admin menu
3. Click **Connect Book My Appointments** to link your account (or create a free account)
4. Add the booking form to any page using the shortcode, Gutenberg block, or Elementor widget
5. Your customers can now book appointments directly from your website

= Shortcode =

Basic usage — the settings page shows the shortcode for your connected business,
ready to copy:
`[bookmyappointments slug="your-business-slug"]`

Leaving the slug off uses the business connected in the plugin settings:
`[bookmyappointments]`

With custom options:
`[bookmyappointments slug="your-business-slug" height="600" view="full"]`

= Shortcode Attributes =

* `slug` — Your business slug (uses default from settings if not specified)
* `height` — Form height in pixels (default: 800)
* `view` — Display mode: "form" (form only) or "full" (with business card) (default: form)
* `gtm_id` — Google Tag Manager container ID (optional)

== Installation ==

1. Upload the `bookmyappointments` folder to `/wp-content/plugins/`
2. Activate the plugin through the **Plugins** menu in WordPress
3. Go to **Book My Appointments** in your admin menu
4. Click **Connect Book My Appointments** to link your account
5. Add the booking form to any page

== Frequently Asked Questions ==

= Do I need a Book My Appointments account? =

Yes. You can create a free account at [app.bookmyappointments.com](https://app.bookmyappointments.com).

= Does it work with my page builder? =

Yes! The plugin works with Gutenberg, Elementor, Divi, WPBakery, Beaver Builder, and any page builder that supports WordPress shortcodes.

= Can I embed multiple booking forms on one site? =

Yes. Use the `slug` attribute to specify different business slugs:
`[bookmyappointments slug="location-a"]`
`[bookmyappointments slug="location-b"]`

= Does the plugin slow down my site? =

No. The embed script loads asynchronously and only on pages where the booking form is used.

== External services ==

This plugin relies on the Book My Appointments service (operated by Altic LLC, the publisher of this plugin) to render the booking form and manage appointments.

**Booking form embed script**

On pages where the booking form is used (via the shortcode, Gutenberg block, or Elementor widget) — and on the plugin's admin settings page preview — the plugin loads an embed script from `https://go.bookmyappointments.com/embed-gtm.min.js`. This script is needed to display the booking form. When it loads, the site visitor's browser sends standard web request data (IP address, browser user agent, and the URL of the page) to go.bookmyappointments.com, together with the configured business slug, the selected view mode, and (if configured) your Google Tag Manager container ID. When a visitor books an appointment, the information they enter in the form (such as their name, contact details, and chosen appointment time) is sent to and processed by the Book My Appointments service.

**Account connection**

When you click "Connect Book My Appointments" on the plugin settings page, your browser is taken to `https://app.bookmyappointments.com` to sign in to your Book My Appointments account. After you approve the connection, your business slug is sent back to your site's admin callback URL. No data from your WordPress site is sent during this step other than the callback URL itself.

This service is provided by Book My Appointments: [Terms of Service](https://bookmyappointments.com/terms), [Privacy Policy](https://bookmyappointments.com/privacy).

== Screenshots ==

1. Plugin settings page — connect your account
2. Booking form embedded on a page
3. Gutenberg block in the editor
4. Elementor widget configuration

== Changelog ==

= 1.0.2 =
* Fixed: the admin-only "no business slug configured" notice could be picked up by SEO plugins building the page's meta description, putting that text in search results. It is now suppressed everywhere the content is scraped as plain text — wp_head, excerpts, feeds, and REST — and shows only in the visible page body.

= 1.0.1 =
* Fixed: the Gutenberg block and Elementor widget rendered an empty form when the business slug field was left blank — a blank field now correctly falls back to the slug from plugin settings
* Fixed: the embed script is now printed even when a page or theme builder renders the shortcode after the footer scripts have gone out
* Fixed: embeds added to the page after load (Elementor popups and tabs, AJAX-loaded content) now initialise
* Changed: the settings page shows the shortcode for your connected business, with the slug filled in and a copy button
* Changed: each embed gets a unique element id, so several forms can sit on one page

= 1.0.0 =
* Initial release
* Shortcode support
* Gutenberg block
* Elementor widget
* One-click account connection
* Google Tag Manager integration
