=== SnowSure Connect ===
Contributors: snowsure
Tags: ski, snow report, weather, structured data, ai
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Publish your daily snow report once — it updates your site and sends conditions, lifts, runs and webcams to SnowSure. Adds a verified feed, JSON-LD, AI discovery files, and widgets.

== Description ==

SnowSure Connect wires a ski resort's WordPress site to SnowSure (https://www.snowsure.ai), the verified snow-data platform used by AI answer engines. It also improves the site on its own — the structured feed, JSON-LD, and llms.txt all work whether or not you connect an account.

**A Daily Report form in your dashboard.** Ski patrol enters the morning numbers once — new snow, base/summit depth, lifts and runs open, surface condition, hours, and your webcam URL. Publishing updates your own site's feed and, if you've paired an account, sends the report to SnowSure as operator-verified data.

**A verified structured feed.** Adds a clean `/wp-json/snowsure/v1/` feed (latest report, resort profile, and an OpenAPI description) with real timestamps, so anyone reading your conditions gets structured data instead of scraping your pages.

**SkiResort structured data (JSON-LD).** Emits `SkiResort` schema.org markup in your page head from the same fields as the feed, so your markup and visible content can't disagree — the layer AI answer engines and search engines read.

**An AI Discovery Pack.** Serves `/llms.txt` and `/.well-known/ai-catalog.json` describing your site to AI assistants. When paired, it also serves your resort's MCP server card.

**Embeddable widgets.** Drop live conditions, a 14-day forecast, the SnowSure Score, a snow badge, or the AI concierge onto any page with a shortcode:

`[snowsure_widget widget="conditions"]`

Widgets available: `conditions`, `forecast`, `score`, `concierge`, `badge`, `rank`.

Connecting a SnowSure account is optional and entirely opt-in: the plugin contacts no external server until you enter a SnowSure API key on the settings screen. See **External services** below for exactly what is sent and when.

== External services ==

This plugin can connect to SnowSure, a third-party service operated by Afore, to publish your snow report and keep your resort's data current. Connecting is optional — nothing is sent to SnowSure until you enter a SnowSure API key on the plugin's settings screen (explicit opt-in). Once paired, the plugin contacts SnowSure in these cases:

* **Publishing a Daily Report** sends that report to `https://www.snowsure.ai/api/connect/report`. Data sent: the snow/operations figures you entered (snowfall, depths, lifts, runs, hours, surface condition, mountain report, webcam URL) and, for attribution, the reporting user's WordPress display name and email address.
* **Publishing or updating a public post or page** sends the changed URL to `https://www.snowsure.ai/api/connect/ping` so SnowSure can re-read that page. Data sent: your resort slug and the page URL.
* **The Settings health panel** calls `https://www.snowsure.ai/api/connect/status` to show pairing and sync status. Data sent: your API key (as an Authorization header).
* **The Discovery Pack** fetches your resort's discovery files from `https://www.snowsure.ai/api/connect/discovery`. Data sent: your resort slug and site URL. No personal data.
* **Embed widgets**, where you add a `[snowsure_widget]` shortcode, load an iframe from `https://www.snowsure.ai` on that page and include an attribution link to your SnowSure resort page.

SnowSure's terms and privacy policy:

* Terms of Use: https://www.snowsure.ai/terms
* Privacy Policy: https://www.snowsure.ai/privacy

== Installation ==

1. Upload the `snowsure-connect` folder to `/wp-content/plugins/`, or install the ZIP under **Plugins → Add New → Upload Plugin**, then activate.
2. Open the new **SnowSure** menu, go to **Settings**, and (optionally) enter your resort slug and the API key SnowSure issued you. Save.
3. Fill in your resort profile (elevation, terrain, season dates) — it feeds the JSON-LD, the profile feed, and llms.txt.
4. Publish your first **Daily Report** from the SnowSure menu.

If `/llms.txt` returns a 404 right after activation, visit **Settings → Permalinks** once to flush rewrite rules.

== Frequently Asked Questions ==

= Do I need a SnowSure account? =
No. The Daily Report form, the `/wp-json/snowsure/v1/` feed, the JSON-LD, and llms.txt all work on your own site without an account. An account (API key) is only needed to send your report to SnowSure and to serve your resort's MCP card.

= Where do I get an API key? =
From SnowSure — request one at https://www.snowsure.ai/for-resorts. The key is stored in your site options and used server-side only; it is never exposed to visitors.

= We already enter conditions in another system (UltraTrax, DOR, Inntopia). Can we avoid double entry? =
Yes. Your developer can feed the push straight from that system with the `snowsure_connect_report_payload` filter, and map your existing resort profile with `snowsure_connect_profile`.

= Does it work if my site isn't on WordPress? =
This plugin is WordPress-only. If you're on another platform, you can still send SnowSure your data by email or a JSON feed — see https://www.snowsure.ai/for-resorts.

== Screenshots ==

1. The Daily Report form in the WordPress dashboard.
2. Settings: pairing and the health panel (last report, discovery files, sync status).
3. A live conditions widget embedded on a resort page.

== Changelog ==

= 1.0.0 =
* Initial release: Daily Report form, structured feed (`/wp-json/snowsure/v1/`), change webhooks, AI Discovery Pack (llms.txt, ai-catalog.json, MCP server card), SkiResort JSON-LD, and embed widgets.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
