=== Leadovation Aero Weather METAR TAF ===
Contributors: wptechnology
Tags: metar, taf, aviation, weather, aeronautical
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 2.1.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

METAR and TAF of your aerodrome on the club's own site, readable without knowing the code: decoded cards, panel, station, table, blocks.

== Description ==

A student opens the club's website on Saturday morning to see whether the lesson holds. The instructor opens the same page to see what the TAF says for the afternoon slot. The webmaster who built that page has never read a METAR in his life, and should not have to.

**Aero Weather puts the field's weather on the club's own site, readable by all three.** The METAR and the TAF come from the NOAA Aviation Weather Center, are decoded into plain words, and are shown with the flight category first, in cards that follow the site's theme. The raw message stays one click away for the pilots who read the code.

It is written for a flying club or a flight school. One main aerodrome served by default, the club's own runways for the crosswind, a legal notice that points to the official sources, and a settings screen a volunteer webmaster gets through in five minutes.

= Free, and genuinely usable =

The free version runs a whole club on its own. There is no cap on the number of aerodromes, no cap on the number of displays, and no screen that switches off.

* **The raw message.** The METAR or the TAF exactly as received, in a monospaced block, for the pilots who read the code.
* **A compact bar.** One line, ICAO, category, wind, visibility, ceiling, QNH, at the top or the bottom of a page without crowding it.
* **A badge.** The category alone, colour and shape, with the observation time. Fits in a title, a menu, a sidebar.
* **A decoded card, METAR and TAF.** Wind, visibility, clouds, temperature, QNH, in words. A TAF is read as a TAF: the base forecast with its validity, then one line per change period (BECMG, TEMPO, FM, PROB) with its own time window. The badge is the category of the period in progress and says so ("now", "from 18:00 UTC"); the worst case over the whole validity, TEMPO and PROB included, is written underneath instead of colouring the head. An expired TAF is greyed and says it.
* **A compact card.** The same decoded card made dense for a column or a footer: one header line, then a grid of pairs. The `flat` skin removes its background and border so it melts into a column the theme already styles.
* **A tabbed panel.** METAR and TAF in one frame, two tabs, one footer each, so the category under the TAF tab is the TAF's.
* **Station details.** Elevation, runways, frequencies. The figures come from OurAirports, with the date of the extract shown; the club can correct any field from the back office, and a corrected field reads "verified against the VAC chart".
* **A visitor selector.** An ICAO field, a button, the result below. The visitor picks the aerodrome.
* **A multi-aerodrome table.** One line per aerodrome, category, wind, visibility, ceiling, observation time. No limit on the number of aerodromes.
* **Wind on the club's runway.** Total wind, gust and crosswind component on the runway the club actually uses, on every card that shows wind.
* **A single field.** One value to drop into a sentence: "QNH 1016 hPa" right where your page needs it.
* **A disclaimer with the official links.** The legal text, with Aéroweb, OLIVIA and SIA, under each card, once per page, or never, as the setting says. One display can opt out on its own.
* **A webcam.** The image of the club's own webcam, refreshed, time-stamped.
* **Settings that fit on one screen.** Your main aerodrome, wind unit (knots, km/h, m/s), the category profile with a plain explanation of what NOAA and metric mean and why neither is a regulation, UTC and local time or one of the two, and the disclaimer text and position.
* **An Integration tab that shows before you copy.** Pick a display, set its options (METAR or TAF, size, theme, skin, disclaimer, field), watch the real preview change, then copy the shortcode or the block. Same options, same names, whichever way you integrate.
* **Gutenberg blocks, complete.** One "Aero Weather" block in the Aero category carries every display and every option the shortcodes accept. Pages built with the six blocks of the 1.x still render.
* **Categories in colour and in shape.** VFR, MVFR, IFR and LIFR each have a colour and a distinct dot shape, and the text is always next to the dot: colour alone never carries the information.
* **Two ages, never confused.** "Observed at 17:30 UTC (19:30 local time)" on every card, next to "fetched 2 min ago". Freshness is judged on the time of the observation, and a message more than two hours old is greyed and says so.
* **A source that says when it falls.** The dashboard shows the health of the NOAA source in green only when the last request succeeded, and "unreachable since 17:52" in red otherwise, with the last known message kept and marked as such.
* **METAR AUTO read to the end.** `BKN008///`, `VV///`, `12///`, `Q////`, runway visual range and directional visibility no longer stop the decoder halfway. SPECI, AMD and COR are decoded and tagged.

= Upgrade to Aero Weather Pro =

[Aero Weather Pro](https://www.wptechnology.com/plugins/aero-weather/) is a separate plugin, installed on top of this one, for the club that wants its own rules on the page. Nothing described below is present in this plugin: what you install here is complete on its own and runs without a licence. Nothing is held back in the free version; Pro adds.

* **Conditions of the day, against the Club thresholds.** A green, orange or red light per profile, period by period, on the TAF of the day. Three profiles (student, pilot, instructor), two thresholds per criterion (a warning figure, then a stop figure) for wind, gust, crosswind, ceiling and visibility, plus the phenomena each profile rules out (fog, thunderstorm, freezing...). The club writes what it allows; the plugin compares and never says whether the day is good to fly. A compact light for a single profile fits in a sidebar.
* **A TAF timeline.** The forecast hour by hour, so the best slot can be chosen on the page.
* **A wind rose on the runways.** The wind drawn against the runway headings, the active runway at a glance.
* **A club-house screen.** Fills the whole screen and rotates on its own, for the television by the coffee machine.
* **A scrolling banner.** The conditions scroll like a news feed and take no vertical space.
* **Student mode.** Every part of the METAR and the TAF explained token by token, to learn to read the weather during training.
* **Avada elements.** The displays as native Fusion Builder elements, under "WPTechnology", with the same options as the shortcodes. Elementor widgets are coming.
* **In the colours of the club.** An Appearance card in the settings: the club's accent colour and logo in the card headers, the NWS palette for the categories (blue MVFR, magenta LIFR) as an alternative to the Aero one, the fonts of the theme instead of the range's, square or rounded corners, a dark default or the visitor's own setting, and a box of additional CSS scoped to the displays. A live preview shows the real cards while you choose. The 3 px stripe and the dot shapes never change: they carry the information.
* **Coming in 2.2.** An alert to the instructors when the day crosses a threshold, a history of the field's conditions, and a printable briefing on one A4 page.

[See what Pro adds and what it costs](https://www.wptechnology.com/plugins/aero-weather/).

= Part of the Aero range =

Aero Weather is one of the WPTechnology plugins written for flight schools and flying clubs. They share the same look and the same idea: one job each, done properly, and they talk to each other when installed side by side.

* [Aero Courses](https://wordpress.org/plugins/leadovation-aero-courses/): theory course scheduling and booking, the semester built once and published on the school's site.
* **Aero Users**: the school's roster (students, pilots, instructors, examiners) shared by the whole range. In review.
* **Aero Weight & Balance**: mass and balance for the club's aircraft, with the envelope drawn. Coming.

= Translations =

The plugin is written in English and translated into French by hand. Translations come through [translate.wordpress.org](https://translate.wordpress.org/projects/wp-plugins/leadovation-aero-weather-metar-taf/) and install themselves; to translate it into your language, or to improve the French, join the project there.

= What this plugin does not claim =

The data is provided for information only. It is not an approved source for flight preparation: for that, the pilot goes to the national weather service and the aeronautical information service (in France, Aéroweb, OLIVIA and the SIA), and the plugin's own disclaimer says so with the links. The decision to fly, and how, remains the pilot in command's.

The VFR, MVFR, IFR and LIFR categories are a display convention, NOAA's or an indicative metric transposition of it, and have no regulatory value: they are not EASA or SERA minima. The Club thresholds of the Pro version are the club's own figures, entered by the club, and the plugin claims nothing about them beyond comparing a forecast to them.

= Third-party services =

The plugin fetches the METAR, the TAF and, as a fallback for station details, aerodrome metadata from the public API of the [NOAA Aviation Weather Center](https://aviationweather.gov/). What is sent is the ICAO code of the aerodrome asked for (LFPN, say), when a display is rendered, when the dashboard is opened, or when the cache is refreshed. No personal data is sent, and no API key is needed. Terms and notices: [weather.gov/disclaimer](https://www.weather.gov/disclaimer).

Station details (elevation, runways) come first from [OurAirports](https://ourairports.com/), whose data is in the public domain (CC0). The extract is bundled with the plugin and read from disk: no network call is made to OurAirports, and the date of the extract is shown on the card.

The plugin bundles the Freemius SDK, which handles licensing for the Pro version and, if you agree to it on activation, anonymous usage statistics. You are asked, you may decline, and declining changes nothing about how the plugin works. Freemius is contacted only to check a licence or, with your consent, to send those statistics. Service: [Freemius](https://freemius.com/) · [terms](https://freemius.com/terms/) · [privacy](https://freemius.com/privacy/).

The dashboard shows the other plugins of the Aero range. That list is read from [wptechnology.com](https://www.wptechnology.com/), the publisher's own site, at most once a day and only when an administrator opens the dashboard: a plain GET on a public address, with nothing about your site in it. If the site does not answer, the last list received is shown, or the one bundled with the plugin. Whether a plugin is installed here is read locally and never sent. [Legal notice](https://www.wptechnology.com/mentions-legales/) · [privacy](https://www.wptechnology.com/confidentialite/).

The webcam image is an address the club enters in the settings; the plugin neither chooses it nor calls it. It is loaded by the visitor's browser, from wherever the club pointed it.

== Screenshots ==

1. The dashboard: the club's aerodromes with their last METAR, the category, "observed at" and "fetched" side by side, and the health of the NOAA source.
2. The Integration tab: a display picked on the left, its options set, the real preview updating, and the shortcode or the block ready to copy.
3. The decoded card, METAR and TAF, in light and dark: category first, the TAF as base forecast then periods, the worst case written underneath.
4. The tabbed panel on a page: METAR and TAF in two tabs, each with its own footer, the category of the open tab in the header.
5. Station details from OurAirports, with the fields the club verified against the VAC chart, and the multi-aerodrome table.
6. Club thresholds (Pro): three profiles, two thresholds per criterion, with the Conditions of the day preview on today's TAF.

== Installation ==

1. In your WordPress admin, go to Plugins → Add New and search for **Aero Weather**, then click "Install Now" and activate. (Or upload the zip from Plugins → Add New → Upload Plugin.)
2. Open the **Aero Weather** menu and choose your main aerodrome by its ICAO code. Every display proposed in the Integration tab and every new block starts on it.
3. Put a display on a page: the "Aero Weather" block in the block editor (Aero category), or a shortcode. The Integration tab writes either one for you, with the options you picked.

The shortcode grammar is one tag, a view, an ICAO code, then options:

`[aero_weather decoded LFPN type="taf" size="compact" theme="dark" skin="flat" disclaimer="no"]` gives the decoded TAF card, dense, dark, without background, and without the legal notice under it.

`[aero_weather table LFPN,LFPO,LFPT]` gives one line per aerodrome, as many as you list.

`[aero_weather data LFPN field="qnh"]` gives the single value, to drop into a sentence.

The views are `metar` and `taf` (raw message), `compact`, `badge`, `decoded`, `panel`, `data`, `station`, `selector` and `table`. Four displays have their own tag: `[aero_weather_station icao="LFPN"]`, `[aero_weather_selector icao="LFPN"]`, `[aero_weather_webcam icao="LFPN"]` and `[aero_weather_disclaimer]`. Only the options that differ from the defaults need writing.

== Frequently Asked Questions ==

= Is the data official? =

No. It is provided for information only. For flight preparation, always refer to approved sources (national weather service, AIS, NOTAM). The plugin's disclaimer carries the links to Aéroweb, OLIVIA and the SIA.

= Do I need an API key? =

No. The data comes from the free, public NOAA API.

= Why does the TAF card show a different category from the METAR card? =

Because they answer two different questions. The METAR card shows the category of the last observation. The TAF card shows the category of the forecast period in progress, and says which one ("now", "from 18:00 UTC"); the worst case over the whole validity, TEMPO and PROB included, is written underneath in small. A CAVOK afternoon with a PROB30 of fog at night reads VFR now, with the worst case LIFR written underneath.

= Can visitors pick the aerodrome? =

Yes. The visitor selector is an ICAO field with a button; the result appears below it. Any aerodrome the NOAA source knows can be asked for, and there is no list to maintain.

= Where do the runway and elevation figures come from? =

From OurAirports, a public-domain database whose extract is bundled with the plugin, with the date of the extract shown on the card. When an aerodrome is missing there, the NOAA airport data steps in. Either way the club has the last word: every field can be corrected from the back office, and a corrected field reads "verified against the VAC chart".

= Does it work with Gutenberg, Avada or Elementor? =

Gutenberg, yes, in full and for free: the "Aero Weather" block carries every display and every option. Avada, with the Pro version: the displays are registered as Fusion Builder elements under "WPTechnology", and each element hands its options straight to the shortcode, so what Avada renders is what the shortcode renders. Elementor widgets are coming. On any builder, the shortcode works today.

= Is anything locked behind a licence? =

No. Nothing here is closed, counted or timed: what this package carries, it carries in full, for any number of aerodromes and any number of displays. The Pro version is a separate plugin that brings its own displays with it; this package contains neither them nor anything that refuses them.

= For developers =

Two template-tag functions for theme integrators:

```
<?php echo aero_weather_metar( 'LFPN', 'decoded' ); ?>
<?php echo aero_weather_taf( 'LFPN' ); ?>
```

They are equivalent to the unified `[aero_weather]` shortcode and use the same views. An unknown view falls back to `raw`. The Gutenberg block builds the same shortcode and hands it to `do_shortcode()`, so the three ways of integrating render exactly the same markup.

== Changelog ==

= 2.1.2 =
* The Aero range card on the dashboard now reads the list of the range from wptechnology.com, once a day at most, so that a plugin published later appears without an update; the last list received, or the bundled one, serves when the site does not answer. Shared with the other plugins of the range through the Aero Core base 1.4.0.

= 2.1.1 =
* The package published on WordPress.org no longer carries translation files: the directory distributes them.

= 2.1.0 =
* Pro: an Appearance card in the settings puts the displays in the colours of the club: accent colour, logo in the card headers (tabbed panel, full decoded card, club-house screen), Aero or NWS palette for the categories, fonts of the theme, square or rounded corners with or without shadow, a default theme (light, dark, or the visitor's setting) and a box of additional CSS, with a live preview of the real cards.
* `theme="auto"` on every display, for everyone: the card follows the visitor's light or dark setting.
* The colour and logo settings of the 1.x, which had no screen since 2.0, are taken over by the Appearance card. The `club`, `ecole` and `fbo` skins are gone; `flat` stays.

= 2.0.4 =
* When a licence key has been entered and Freemius is waiting for the click in its confirmation email, the dashboard, the Club thresholds tab and the Licence tab now say so, with a link to enter the key again.

= 2.0.3 =
* The Pro displays and the Club thresholds editor run only with a licence active on the site. Without it, nothing of Pro shows on the pages; a site administrator sees a short notice in place of a Pro display, with the link to activate the licence.

= 2.0.2 =
* The upgrade to Pro goes straight to the checkout and installs the Pro version on its own once paid (the SDK now knows a Pro build exists).

= 2.0.1 =
* Freemius SDK updated to 2.13.4.
* The Pro price line shows the plan's monthly price as it is ("from €4.99 per month"); the yearly price divided by twelve is only used for plans without a monthly cycle.

= 2.0.0 =
* **The front joins the Aero range.** Every display now shares one anatomy (station and category in the head, a body, an age and a notice in the foot), the fonts and the palette of the range, a 3 px category stripe on the left edge, and a light and a dark theme that follow the site unless the shortcode says otherwise. Categories are coded in colour and in shape, with LIFR as its own colour; the text is always next to the dot.
* **The TAF is read as a TAF.** Base forecast, then one line per change period with its window and category. The badge is the category of the period in progress and says so; the worst case is written underneath. An expired TAF is greyed.
* **Two ages on every card.** "Observed at 17:30 UTC (19:30 local time)" next to "fetched 2 min ago". Freshness is judged on the observation; a message more than two hours old is marked as expired.
* **The source says when it falls.** Green only when the last request succeeded, "unreachable since HH:MM" in red otherwise, with the last known message kept and marked.
* **Station details from OurAirports.** Elevation and runways come from a bundled public-domain extract (CC0), dated on the card; the NOAA airport data remains as a fallback and for frequencies. The club can correct every field, and a corrected field reads "verified against the VAC chart".
* **Multi-aerodrome table and crosswind are free.** One line per aerodrome with no cap; total wind, gust and crosswind component on the club's runway on every card that shows wind.
* **One Gutenberg block for everything.** The "Aero Weather" block, in the Aero category, carries every display and every option; the six blocks of the 1.x remain as hidden aliases so existing pages still render.
* **The Integration tab replaces the test bench.** Two levels: the decoded card and the panel in large, then the utilities; every option per display, a real preview that never goes blank, and the output as shortcode or block. Options are declared once and offered identically in the tab, the blocks and the Avada elements.
* **Settings rewritten.** Main aerodrome, asked for when the plugin is first opened and proposed everywhere; wind unit (knots, km/h, m/s); the category profile explained in plain words with its lack of regulatory value stated; UTC and local time, or one of the two; the disclaimer shown under each card, once per page, or never, in the words the club chooses.
* **Club thresholds and Conditions of the day (Pro).** The decision module of the 1.x is renamed: Club thresholds for the setting, Conditions of the day for the display. The club says what it allows, never whether the day is good to fly. Three profiles (student, pilot, instructor), two thresholds per criterion (warning, then stop) for wind, gust, crosswind, ceiling and visibility, and the phenomena each profile rules out. The preview runs on today's TAF.
* **Avada elements from the registry (Pro).** The Fusion Builder elements are generated from the same option registry as the shortcodes and blocks, under "WPTechnology" instead of the old category name.
* **Uninstall runs through Freemius.** Cleanup hangs from the `after_uninstall` hook instead of `uninstall.php`, so Freemius no longer believes the plugin is still installed.

= 1.12.0 =
* The badge on a TAF card is the category of the period in progress, and says so ("now", "from 18:00 UTC"); the worst case over the validity, TEMPO and PROB included, is written underneath instead of colouring the head. An expired TAF is greyed and says it. Validity is shown against the present time.
* Two ages, never confused again: "observed at 17:30 UTC (19:30 local time)" on every card and in the dashboard, next to "fetched 2 min ago". Freshness is judged on the observation, not on the download.
* The source status is green only when the last request succeeded; otherwise "Source unreachable since HH:MM" in red, and the test bench shows the last known message marked stale.
* Absence messages tell apart a field with no weather station, a field that never publishes a TAF, and a TAF not issued yet today (ATS hours).
* The tabbed panel follows the site theme (light or dark) unless the shortcode says otherwise, shows the ICAO once, and its footer badge matches the open tab.
* One wind notation everywhere: "320° 17 kt, gusting 25 kt". Two raw shortcodes in a row no longer run into each other. The weather icon shows on a METAR only.
* Station card: the NOAA elevation is in metres and is now converted, "499 ft (152 m)"; QFE and density altitude use feet; runway surface reads "paved" or "unpaved" instead of a code. Crosswind (Pro) shows the gust component too.
* SPECI, AMD and COR appear as tags on the cards.
* Removed the dead setting "How do your visitors see the weather?" and the leftover MAX pill. TAF refreshed every 3 hours (short French TAFs). Every bench description is translated.

= 1.11.0 =
* METAR AUTO read to the end: `BKN008///`, `///015`, `VV///`, `VV002`, `12///`, `Q////`, runway visual range (`R25/0400N`, `R27L/P2000`) and directional visibility (`1200SW`, `9999NDV`) no longer stop the decoder halfway, which used to lose the ceiling, the temperature and the QNH and show a 800 ft ceiling as VFR. An unknown token is kept aside and the message goes on.
* SPECI reports are decoded like a METAR and flagged. The raw display keeps AMD and COR on an amended or corrected TAF.
* METAR trend (`NOSIG`, `BECMG`, `TEMPO`) decoded.
* Flight categories: the MVFR boundary is inclusive as the NWS defines it (a 3,000 ft ceiling or 5 SM is MVFR), in both profiles.
* TAF change groups inherit the base forecast: a `TEMPO 4000 RA` under `BKN008` is IFR; a wind-only `BECMG` keeps the CAVOK it was given. An unknown category stays unknown instead of being called VFR, and the worst case ignores it.
* One category profile for the whole plugin: the METAR and TAF decoders now receive the site's setting; two badges on the same page cannot disagree any more.

= 1.10.0 =
* Compact decoded card: `size="compact"` on the decoded card gives a dense version for a column or a footer, in a 280 px column about 110 px tall for a METAR. The test bench offers Full card / Compact card under the decoded card.
* `skin="flat"` on the decoded card and the panel: no background, no border, colours inherited from the column around it.
* The TAF periods now read short: "Day 15 · 11h → 13h UTC" instead of a full sentence, in the large card too.
* The Aero Weather widget lists its displays by name (compact bar, raw message, badge, decoded card, compact decoded card, tabbed panel) instead of asking for a view keyword.

= 1.9.0 =
* The decoded card now decodes a TAF as a TAF: the base forecast with its validity period, then one line per change period (BECMG, TEMPO, FM, PROB) with its own time window and category. It used to read the fields of a METAR and show dashes.
* The tabbed panel shows the base forecast too. A TAF with no change period (a CAVOK day at LFPN, say) left the TAF tab empty.
* `PROB30 TEMPO` is read as one period, with its probability.
* The raw display drops the leading METAR / TAF keyword the source writes: the page already knows what it shows.
* `disclaimer="no"` on the decoded card or the panel leaves the legal notice out for that widget only. The test bench offers it as a tick box and the Avada decoded element as a setting.
* The panel tabs answer inside content loaded after the page (the test bench preview, AJAX-loaded blocks).

= 1.8.2 =
* Test bench: the METAR/TAF switch now drives the preview too. The copied shortcode said `taf` while the preview, rebuilt server-side from the card's template, still showed the METAR. The two cards concerned are named "Raw METAR / TAF" and "Decoded card".

= 1.8.1 =
* The admin menu icon now carries the Aero range signature: the cloud, with the small aircraft profile in its notch, like Aero Courses and Aero Users.

= 1.8.0 =
* The test bench now lists only the displays this package carries. It described twenty-one, including the nine that left the free package in 1.5.0: copying one of those handed you a shortcode nothing registers, and the published package carried the named list of the paid features. The paid add-on registers its own through the `aero_weather_bench_features` filter.
* The "Max" pills are gone, along with the three usage tabs that held nothing but paid displays. An empty tab told the visitor something was missing.
* The Pro cards and this readme now say what the free package holds and what the paid one adds. Three of them still claimed every display was included.

= 1.7.0 =
* The source strings are now in English, as the directory expects, and French moved to a translation catalogue in /languages. A French site reads exactly what it read before.
* Every string that carries a placeholder now has a translators comment.

= 1.4.0 =
* WordPress.org directory compliance: no display is conditioned on a licence any more. The tier map, the two licence functions and the fifteen refusals they commanded are gone. Decoding, panel, table, timeline, screen mode, Go/No-Go thresholds, aerodrome groups, club colour and logo are open to everyone.
* The paid Pro version is now only what it actually added on its own: the six Avada / Fusion Builder elements, updates and support.
* The published package is built by a script, and a test reopens the produced archive to check what it does and does not contain.
* This readme is now in English, as the directory requires.

= 1.3.0 =
* The admin screen adopts the aero product line design.

= 1.2.0 =
* Public names (shortcodes, options, hooks, CSS classes) join the aero product line.

= 1.1.0 =
* The plugin joins the aero product line: shared core, registry, roles.

= 1.0.0 =
* First release under the WPTechnology brand (derived from WPTafMetar2).
* Unified flight category engine (NOAA and European metric profiles).
* Optional, editable "for information only" disclaimer.
