=== Live Sea Temperature Widget by SeaTempMap ===
Contributors: fen0m
Tags: sea temperature, water temperature, beach, weather, uv index
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Show the live sea temperature, weather and UV index for any beach. The official WordPress add-on for the SeaTempMap.com sea temperature map.

== Description ==

**SeaTempMap is a website: a live sea temperature map of the world's coasts.** It shows today's water temperature anywhere in the ocean, a 10-day sea forecast, the UV index and long-term monthly averages – free, in 30 languages, at [seatempmap.com](https://seatempmap.com) and in its Android and iOS apps.

**This plugin is the official WordPress add-on to that map.** It brings one piece of it – a live sea temperature card for a beach you choose – onto your own pages, with a block or a shortcode.

Guests want to know one thing before they book a beach holiday: how warm is the water. This plugin puts that number on your site, updated through the day.

The card shows the current sea temperature at the beach you choose, plus air temperature, weather and the UV index. Sea temperatures come from NASA satellite data, sampled at the swimming area rather than out at sea.

**Any beach, and 174 of them already in the picker.** The block and the shortcode choose from a curated list of 174 beaches and coastal cities, and that list keeps growing – new ones appear in the picker on their own, with no plugin update needed. If yours is missing, email **hello@seatempmap.com** with the name and we will look at adding it. For a coast that is not on the list, build the same card for any point on Earth at [seatempmap.com/embed](https://seatempmap.com/embed) and paste the code it gives you into a Custom HTML block – it is free too, and the card is identical.

**How it looks**

The card renders in an isolated shadow root, so your theme's CSS cannot break it and its styling cannot leak into your page. It reads your page's background and picks a light or dark card to match, or you can force either one.

**Features**

* 174 beaches and coastal cities in the picker – and any other coast in the world with the code from [seatempmap.com/embed](https://seatempmap.com/embed)
* Celsius or Fahrenheit
* Light, dark, or automatic to match the visitor's system
* Speaks 30 languages, following your page's `lang` attribute by default
* Full card (sea, air, weather, UV) or a compact sea-only card
* Drop shadow on or off, so the card suits a flat design as well as a layered one
* Block editor block, and a `[seatempmap]` shortcode for classic themes and page builders
* Updates itself while the page is open. Nothing to maintain
* No account, no API key, no cost for the free card

**Widget Pro (optional)**

Everything above is free and always will be. Hotels and holiday-rental sites that want the card to be theirs can add a Widget Pro licence from [seatempmap.com/embed](https://seatempmap.com/embed) under Settings → Sea Temp Map, which unlocks, per card:

* Your own name on the card instead of the beach's
* A ten-day sea forecast strip, wide or folded into a grid for a sidebar
* An off-season face: below 18 °C the card becomes a weather card instead of showing water nobody will swim in
* The colour scale hidden, for a plainer card
* Our name and the link off the card entirely

The licence key is a site setting, not a per-post one: enter it once and every block on the site can use it. Without a key the Pro controls stay switched off and every card renders exactly as it does today – free, and carrying the credit link that pays for it.

**Shortcode**

`[seatempmap dest="hvar"]`

Attributes: `dest` (required, the beach id), `units` (`c` or `f`), `theme` (`auto`, `light`, `dark`), `show` (`both` or `sea`), `shadow` (`on` or `off`), `lang` (a language code, or leave empty to follow your page).

Top line, free: `topline` (`auto`, `custom`, `off`), `eyebrow` (your text, with `topline="custom"`), `clock` (`on` to show the beach's local time).

With a Widget Pro licence saved in the settings: `name` (your own card name), `forecast` (`wide` or `grid`), `bar` (`off` hides the colour scale), `offseason` (`on`). Without a licence these are ignored and the card stays free rather than breaking.

Preview every option and find beach ids at [seatempmap.com/embed](https://seatempmap.com/embed).

== External services ==

This plugin relies on seatempmap.com, a third-party service, to provide the temperature data and to draw the card.

The plugin itself only outputs a placeholder element. The card is drawn by `widget/v1.js`, which is the service's own renderer rather than a copy of a general-purpose library hosted on a CDN. It is loaded from the service because it must stay in step with the data format the service returns; bundling a copy would break every site the moment the format changed.

**What is sent and when**

1. On a page containing the widget, the visitor's browser loads the card script from `https://seatempmap.com/widget/v1.js` and then requests `https://seatempmap.com/api/widget` with the beach id, unit and language you configured. As with any request to a third-party server, the visitor's IP address and user agent are visible to it. No cookies are set, no identifiers are stored, and nothing about the visitor or your site's content is sent.
2. In the admin, your server requests `https://seatempmap.com/api/widget/destinations` to list the available beaches. This is cached for a day and sends nothing about your site.
3. In the block editor, your own browser loads the same card script and requests the same `https://seatempmap.com/api/widget` endpoint, so the block shows you the real card rather than a mock-up of it. This happens only while you are editing a post that contains the block, and nothing about your site or the post is sent. The same happens on the plugin's settings screen when you draw a test card there.
4. If you have saved a Widget Pro licence key, cards on your site send that key and your site's domain with the request above, so the service can tell whether this site is licensed. A licence is bound to one domain, which is why both are needed. Sites with no key send neither.

Service provided by Sea Temp Map: [terms of service](https://seatempmap.com/legal/terms), [privacy policy](https://seatempmap.com/legal/privacy).

== Installation ==

1. Install and activate the plugin.
2. Edit a page or post and add the **Live Sea Temperature** block, or place the `[seatempmap dest="..."]` shortcode.
3. Pick your beach. That is all.

If you have a Widget Pro licence, put the key in **Settings → Sea Temp Map** once and the Pro options unlock in every block on the site.

== Frequently Asked Questions ==

= Is SeaTempMap a plugin or a website? =

SeaTempMap is a website: a live sea temperature map covering every coast on Earth, at seatempmap.com, with apps for Android and iOS. This plugin is one of the ways to use it – it places a live card from that map on your own WordPress site. The map, its destination pages and the apps exist on their own, with or without WordPress.

= My beach is not in the list. =

The list covers 174 beaches and coastal cities. If yours is missing, write to hello@seatempmap.com and say which one.

= Does it slow my site down? =

The script loads asynchronously and only on pages that actually contain a widget. It has no dependencies and does not load jQuery, fonts or a framework.

= Will it match my theme? =

By default it reads the background behind it and picks a light or dark card to fit. You can force light or dark instead.

= Can I use it more than once on a page? =

Yes. Each card is independent, and the script is loaded once regardless of how many you place.

= Does it work with page builders and classic themes? =

Yes, through the shortcode. Any builder with a shortcode or raw HTML element can host it.

= Where does the data come from? =

Sea temperature comes from NASA satellite measurements; weather and UV come from forecast models. The reading is taken at the swimming area near each beach rather than in open water, which is usually a degree or two different.

= Does the widget link to your site? =

The free card does, and only from inside the card itself. It shows "SeaTempMap.com" and links to the beach page it is showing, the same way an embedded map or video links back to its source. That link is the attribution for the data, and it is what the free card is exchanged for.

Nothing is added anywhere else on your site. There is no footer credit, no "powered by" line, and no link outside the widget you placed. Remove the widget and every trace of it is gone.

A card using a Widget Pro licence carries no link and no mention of us at all – not a visible one and not a hidden one in the markup. That is what the licence buys.

For the curious: on a free card the markup contains that link as a plain `<a>` before the card renders over it. It is the fallback a visitor sees if JavaScript is off or the service is unreachable, so the card never collapses into an empty box.

= What is Widget Pro and do I need it? =

You do not need it. The whole plugin works without it and always will.

Widget Pro is a yearly licence for sites that want the card to look like theirs rather than ours: your own name on it, a ten-day forecast strip, an off-season weather face below 18 °C, the colour scale hidden, and our name and link off the card. It is bought at [seatempmap.com/embed](https://seatempmap.com/embed) and entered once under Settings → Sea Temp Map.

= I entered my licence key and the card still shows your name. =

Go to Settings → Sea Temp Map, pick your beach under "Check your licence" and read the line it prints. It asks the service the same question your visitors' browsers ask, from your own domain, and tells you plainly whether the licence was accepted.

A licence is bound to one domain and to the beach it was bought for, so a key that works on your live site will not work on a staging domain or for a different beach. A key that is not accepted is not an error: the card simply renders as the free card, so your page keeps working while you sort it out. If the line says the key was refused and you think it should not be, write to hello@seatempmap.com.

= What happens to my Pro cards if the licence lapses? =

Every card falls back to the free card, with our name on it again. Nothing breaks, no page goes blank and no visitor sees a warning – a lapsed licence is your business, not theirs.

Because it is quiet, it is worth checking on the settings screen if you are unsure: pick your beach under "Check your licence" and it will tell you.

= Does it collect anything about my visitors? =

No. There are no cookies, no tracking pixel and no analytics. The card requests a temperature and draws it.

== Screenshots ==

1. The card reads your page's background and matches it, light or dark.
2. The block editor shows the real card, live, with every setting beside it.
3. Sea, air and UV in one card – this one is in our own footer on seatempmap.com.

== Changelog ==

= 1.2.0 =
* Widget Pro licences now work in WordPress. Put the key in Settings → Sea Temp Map once and the block unlocks your own name on the card, a ten-day forecast strip, the off-season weather face and a plainer card with the colour scale hidden – and takes our name and link off the card, which is what the licence buys. Until now a licence could only be used by pasting raw HTML, so the plugin was the one place a paying customer could not use what they had paid for.
* The settings screen checks your licence for you: pick a beach and it asks the service the same question a visitor's browser asks, from your own domain, and says whether the key was accepted. An unlicensed card is quietly the free card, by design – so until now nothing told the customer their key was not working.
* New free options in the block and the shortcode: the card's top line can carry your own text or be removed, and it can show the beach's local time.
* Fixed: `shadow` never worked as a shortcode attribute. It was documented from 1.1.0 but missing from the shortcode's attribute list, so `[seatempmap shadow="off"]` silently kept the shadow. The block was unaffected.
* The temperature scale under the card was re-graded on seatempmap.com – the warm end now darkens through bordeaux and wine into violet above 30 °C instead of stopping at red. Live cards already showed it; the block editor's offline stand-in was still drawing the old one.
* Cards already on your pages are unchanged. Every new option is off by default and emits no markup until you switch it on.

= 1.1.6 =
* Renamed to "Live Sea Temperature Widget by SeaTempMap" so the title reads as the widget it is, published by SeaTempMap. The plugin's slug, settings, shortcode and markup are untouched, and no site needs any change.
* The listing now says plainly what SeaTempMap is – a live sea temperature map at seatempmap.com, with apps for Android and iOS – and that this plugin is the WordPress add-on to it. Search engines and AI answers were reading the plugin as if it were the whole thing. Text only – the plugin itself is unchanged.

= 1.1.5 =
* The listing now says what the plugin actually covers: any beach in the world, with 174 beaches and coastal cities ready to pick in the block. For a coast that is not on that list, the card can be built for any coordinates at seatempmap.com/embed. Text only – the plugin itself is unchanged.

= 1.1.4 =
* The credit under the card now reads simply "SeaTempMap.com". It used to say "Sea temperature in {beach} · SeaTempMap.com", which was written when the link sat hidden in the markup; the card now shows that text to your visitors, and a short credit reads better under it. The link still points at the same beach page, and nothing else about the card changes.

= 1.1.3 =
* The block now shows the real, live card in the editor – the same one your visitors get, with the current temperature in it – instead of a stand-in. Change a setting and it repaints as you watch. If the card script cannot be reached, the stand-in still appears. Editor only; published pages are unchanged.

= 1.1.2 =
* The block now stands in for the card at the size it will render, instead of drawing a large empty box once a beach was chosen. Editor only; published pages are unchanged.

= 1.1.1 =
* Fixed: the block did not appear in the inserter. Its editor script was registered without its WordPress dependencies, so it ran before the editor was ready and stopped. The shortcode was unaffected.

= 1.1.0 =
* New `shadow` option (block setting and shortcode attribute) turns the card's drop shadow off for flat page designs. The glass surface and its edge are unchanged.
* Cards placed before this release are unaffected: without the attribute the markup is identical to 1.0.0.

= 1.0.0 =
* First release.
