=== RideDesk Widgets ===
Contributors: ridedesk
Tags: booking, transfer, taxi, chauffeur, rental
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Embed your RideDesk booking, enquiry and vehicle-rental forms anywhere on your site — via block or shortcode.

== Description ==

RideDesk Widgets connects your WordPress site to your [RideDesk](https://ridedesk.app) account. Drop a booking form, enquiry form or vehicle-rental form into any page or post — with live prices from your own rate card, address autocomplete, a route map, and 12 languages.

The forms are rendered by your RideDesk domain inside a responsive, auto-resizing frame. That means:

* **No configuration drift** — every improvement RideDesk ships appears on your site automatically. This plugin never needs an update for new form features.
* **Your branding** — colors, corner radius and behaviour are configured once in your RideDesk panel (Settings → Widgets) and apply everywhere.
* **Real prices, safe payments** — quotes are calculated server-side by RideDesk; optional online payment uses your own payment providers via RideDesk's hosted payment page.

**Requires a RideDesk account.** The widgets are part of RideDesk's Widgets add-on.

= Contact Form 7 integration =

Already using Contact Form 7? Enable the bridge under Settings → RideDesk Widgets and every successful CF7 submission is ALSO filed as an enquiry in your RideDesk panel — spam-classified, your team notified, matched to the customer's booking history. Your existing forms and their emails stay exactly as they are. Conventional CF7 field names (`your-name`, `your-email`, `your-tel`, `your-subject`, `your-message`) are mapped automatically; developers can remap custom forms via the `ridedesk_widgets_cf7_payload` filter.

= Usage =

Add the **RideDesk Widget** block in the editor, or use shortcodes:

* `[ridedesk_widget type="booking"]`
* `[ridedesk_widget type="enquiry"]`
* `[ridedesk_widget type="rental" lang="de" height="520"]`

== Installation ==

1. Install and activate the plugin.
2. Go to **Settings → RideDesk Widgets** and enter your RideDesk domain (shown in your RideDesk panel under Settings → Widgets).
3. Add the **RideDesk Widget** block — or a shortcode — to any page.

== External services ==

This plugin embeds forms from **your own RideDesk domain** (e.g. `yourcompany.ridedesk.app` or your custom domain connected to RideDesk) inside an iframe.

**Visitor attribution (on by default, Settings → RideDesk Widgets).** When enabled, every page of your site loads one small script, `https://<your-domain>/embed/attribution.js`, from your own RideDesk domain. It records — in the browser's `sessionStorage`, for the duration of the visit — the page the visitor arrived on, the referring website, any `utm_source`/`utm_medium`/`utm_campaign` parameters in the URL, the paths of the pages they view on your site, and a random id that groups those into one visit. That record is sent to your RideDesk account only when the visitor actually submits a booking or enquiry, so your bookings can tell you which campaign and which page produced them. **It sets no cookies and collects nothing a visitor types** — no names, emails, phone numbers or form contents. It loads on every page rather than only pages with a form because the arrival page is the thing being recorded. Switch it off in the plugin settings and no such request is made. [RideDesk privacy policy](https://ridedesk.app/legal/privacy)

Apart from that script, no data is sent anywhere until a visitor interacts with the embedded form. Depending on your RideDesk configuration, the embedded form itself may load:

* **RideDesk** (form content, address suggestions, prices) — [privacy policy](https://ridedesk.app/legal/privacy)
* **OpenStreetMap** map tiles — [privacy policy](https://osmfoundation.org/wiki/Privacy_Policy)
* **OSRM** (project-osrm.org) for route distance/duration
* **Cloudflare Turnstile** or **Google reCAPTCHA** for spam protection, if enabled in your RideDesk settings — [Cloudflare privacy](https://www.cloudflare.com/privacypolicy/), [Google privacy](https://policies.google.com/privacy)
* **Google Places** or **Photon (komoot.io)** address suggestions, depending on configuration

Server-side, the plugin only contacts your own RideDesk domain, and only when the optional Contact Form 7 bridge is enabled: successful CF7 submissions (the submitted name, email, phone, subject, message and the page URL) are forwarded to `https://<your-domain>/api/enquiries` so they appear in your RideDesk panel. With the bridge disabled, the plugin makes no server-side requests at all. Stored options: your RideDesk domain, a default language, the visitor-attribution toggle, and the Contact Form 7 bridge toggle and its key.

== Frequently Asked Questions ==

= Do I need a RideDesk account? =

Yes. The widgets render your organization's live booking forms, prices and vehicles from your RideDesk panel.

= Why is the form not showing? =

Check that your RideDesk domain is set under Settings → RideDesk Widgets, and that the Widgets add-on is active in your RideDesk plan.

= Can I use several widgets on one page? =

Yes — each frame resizes independently.

= Will my bookings tell me which ad or page produced them? =

Yes, with **Visitor attribution** left on (Settings → RideDesk Widgets). The booking form runs inside a frame, and a frame can only see the page it sits on — not the Google or Facebook campaign that brought the visitor to your site three pages earlier. The attribution script captures that on arrival and hands it to the form, so each booking in your RideDesk panel shows the campaign, the page the visitor landed on and the pages they read on the way.

= Does visitor attribution use cookies or collect personal data? =

No cookies, and nothing a visitor types. It keeps page paths, the referring site and campaign tags in the browser's own `sessionStorage`, and they are discarded when the visitor closes the tab. If you would rather not run it, untick it in the plugin settings.

== Changelog ==

= 1.1.0 =
* Visitor attribution: bookings and enquiries now record which campaign and which page brought the visitor. On by default; switch it off under Settings → RideDesk Widgets.

= 1.0.0 =
* Initial release: booking, enquiry and rental widgets via block + shortcode, auto-resizing frames, 12 languages, Contact Form 7 bridge.
