=== Wavind – Surf & Wind Forecast and Booking Button ===
Contributors: wavind
Tags: surf forecast, wind forecast, kitesurf, surf school, booking
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Live wind and surf forecast for your spot, and a "Book on Wavind" button for your surf, kite or wing school.

== Description ==

For surf, kite, wing and windsurf schools, rentals, camps and clubs.

**Wavind forecast block** — a live forecast table for one spot: wind and gusts, swell height, direction and period, air temperature and a 0–100 session rating scored for the sport you teach (wind sports, surf, or both). Up to 7 days in 3-hour steps, in the spot's local time. Six languages.

**Book on Wavind button block** — opens your school's Wavind booking page, where riders see your sessions and book. A Wavind listing is free; bookings are free through 2027.

* Search for your spot right in the block editor — no codes to copy.
* No script runs on your pages: the forecast is an iframe and the button is a link.
* No cookies, no tracking of your visitors.
* Light, dark or follow the visitor's setting.
* Shortcodes for classic editors and page builders.

= Shortcodes =

`[wavind_forecast spot="https://go.wavind.app/forecasts/spots/your-spot--id" sport="surf" days="5"]`

Options: `spot` (a Wavind forecast URL or spot id), `name`, `sport` (wind, surf, optimal), `days` (1–7), `units` (kts, ms, kmh), `temp` (c, f), `waves` (auto, m, ft, off), `theme` (auto, light, dark), `locale` (en, pt, es, fr, de, pl), `credit` (yes / no, default no).

`[wavind_booking link="https://go.wavind.app/book/your-school" style="brand"]`

Options: `link` (your booking link from Wavind: My business → Share), `style` (brand, dark, light), `label`, `locale`, `popup` (yes / no).

Language defaults to your site's language, including in editor previews. A pasted booking link keeps its language (an unprefixed `/book/` link is English); a bare school slug uses the site language. Set `locale` to override either.

= Credit link =

The forecast block can show a small "Wind forecast for … — Wavind" link under the widget. It is off by default; switch it on in the block's **Credit link** panel (or `credit="yes"`) if you want to send visitors to the full forecast.

== External services ==

This plugin connects to Wavind (https://wavind.app), the service that provides the forecast and the booking pages.

* **Forecast widget** — each page view loads the widget from `https://go.wavind.app/embed/spots/…` in your visitor's browser. Sent: the spot and display options in the URL, plus what every browser sends when loading a page (IP address, user agent, your page as referrer). Wavind sets no cookies in the widget and stores nothing about the visitor.
* **Booking button** — a plain link to `https://go.wavind.app/book/…`. Nothing is sent until a visitor clicks it.
* **Spot search (editors only)** — when an editor searches for a spot in the block editor, your site sends the search text to `https://api.wavind.app/spots/search`. WordPress also sends its standard user agent, which includes your site's address. Results are cached on your site for a day.

Wavind terms of service: https://wavind.app/terms
Wavind privacy policy: https://wavind.app/privacy

== Installation ==

1. Install and activate the plugin.
2. Edit a page, add the **Wavind forecast** block and search for your spot.
3. For bookings, copy your booking link in Wavind (**My business → Share → Link**) and paste it into a **Book on Wavind button** block.

== Frequently Asked Questions ==

= My spot is not found =

Search by beach or town name. Spots you created privately in the Wavind app cannot be embedded; only public Wavind spots can.

= Does it slow my site down? =

No script runs on your page. The widget loads lazily and is cached at the edge for five minutes.

= Do I need a Wavind account? =

Not for the forecast. The booking button needs a business page on Wavind; the listing is free, and bookings are free through 2027.

== Screenshots ==

1. The forecast and the "Book on Wavind" button on a surf school's page.
2. The same page on a phone.
3. Both blocks in the block inserter — search "Wavind".
4. Find your spot by beach or town name, right in the editor.
5. Live preview with display options: sport, days, units, waves, theme and language.
6. The booking button: paste your Wavind booking link and pick a style.
7. Riders land on your Wavind booking page and book a session.

== Changelog ==

= 0.1.0 =
* First release: forecast block, booking button block, shortcodes.
