=== One8 Weather Data Fields ===
Contributors: one8mediagroup
Tags: weather, noaa, nws, weather.gov, elementor
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 7.0
Stable tag: 1.0.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Display current NOAA/weather.gov observation data using Elementor widgets and shortcodes.

== Description ==

One8 Weather Data Fields is a lightweight utility plugin that fetches current observation data directly from NOAA's weather.gov API for your configured location. No personal data is sent to NOAA. Requests include a standard User-Agent identifying the plugin.

The free/core plugin displays current observation fields such as temperature, humidity, wind, pressure, visibility, station details, and current condition icons. It provides the data through Elementor widgets and the `[weather_field]` shortcode so you can style and integrate it in your own layout.

Forecasts, radar maps, alerts, marine data, tides, lunar data, and climate data are not included in the free/core plugin.

== Features ==

- Fetch and cache current weather observations from NOAA/weather.gov
- Drag-and-drop Elementor widget for current observation fields
- Use a simple shortcode, e.g.: `[weather_field key="obs_temp"]`
- WP-Cron-driven caching, with an admin option to force refresh
- Developer hooks and filters to modify API URLs, cache TTL, and output format

== Installation ==

1. Upload the `one8-weather-data-fields` folder to `/wp-content/plugins/`
2. Activate the plugin through the **Plugins** screen in WordPress
3. Go to **Settings -> One8 Weather Data Fields** and enter your **Latitude** and **Longitude**. The plugin includes a Lat/Lon Lookup function.
4. Use the `[weather_field]` shortcode or the "Weather Field" Elementor widget in your pages

== Screenshots ==

1. Settings screen for entering location and refreshing NOAA weather data.
2. Coordinates lookup by ZIP code.
3. Manual data refresh.
4. Available shortcodes documentation.
5. Elementor widget placed on page.
6. Elementor widget field key selection.
7. Elementor widget field key dropdown.
8. Elementor widget field style options.
9. Elementor widget - all fields, not styled.

== Usage ==

=== 1. Configure Your Location ===

After installing and activating One8 Weather Data Fields:

- Go to **Settings -> One8 Weather Data Fields**
- Enter your **Latitude and Longitude** (e.g. `40.6413`, `-73.7781` for JFK)
- *(Optional)* Use the ZIP code lookup on the **Coordinates Lookup** tab to auto-fill your coordinates
- Click **Save Changes**
- *(Optional)* Click **Refresh Weather Data Now** on the **Manual Refresh** tab to force a fresh fetch from NOAA

=== 2. Using the Elementor Widget ===

If you use Elementor:

- Open any page in the Elementor editor
- Look for the **One8 Weather Data Fields** category
- Drag the **Weather Field** widget onto your page
- Select your desired **Field Key**
- Use Elementor's styling options (typography, color, padding, etc.)
- You can use **multiple Weather Field widgets on the same page**
- Each widget includes Elementor's own **Before** and **After** text options

=== 3. Using Shortcodes ===

Use the `[weather_field]` shortcode in any post, page, or widget.

**Examples:**
- Current temperature: `[weather_field key="obs_temp"]`
- Current wind gust with fallback: `[weather_field key="obs_wind_gust" fallback="No gust reported"]`
- Current wind (speed + direction): `[weather_field key="obs_wind_combined"]`
- Station code: `[weather_field key="obs_station_code"]`
- Current icon as an image: `[weather_field key="obs_icon" type="icon" class="my-weather-icon"]`

By default the shortcode uses the station selected by the plugin for your configured coordinates (or your optional station override in Settings).

Supported optional shortcode attributes are `before`, `after`, `fallback`, `type`, and `class`.

== Available Shortcode Fields (Current Observations) ==

Use the `[weather_field]` shortcode with any of the following `key="..."` values:

- `obs_temp` - Observed temperature at the reporting station
- `obs_dewpoint` - Dew point temperature
- `obs_humidity` - Relative humidity (percent)
- `obs_wind_dir` - Wind direction (e.g., "NW")
- `obs_wind_speed` - Sustained wind speed
- `obs_wind_gust` - Peak wind gusts (if reported)
- `obs_wind_combined` - Combined wind direction and speed
- `obs_pressure` - Atmospheric pressure
- `obs_visibility` - Horizontal visibility
- `obs_wind_chill` - Wind chill temperature (if reported by NOAA/weather.gov)
- `obs_heat_index` - Heat index value (if reported by NOAA/weather.gov)
- `obs_desc` - Textual description (e.g., "Partly Cloudy")
- `obs_time` - Timestamp of the last observation
- `obs_icon` - URL to the icon representing current conditions
- `obs_station_code` - Official station code (e.g., "KJFK")
- `station_name` - Full name of the reporting station
- `station_elev` - Elevation of the reporting station

== Privacy ==

This plugin fetches public weather observation data from the National Weather Service (NOAA) at `api.weather.gov` to display observations for your configured location. **No personal data is sent to NOAA.** Requests include a standard User-Agent identifying the plugin.

- NOAA Privacy: https://www.weather.gov/privacy
- NOAA API Docs: https://www.weather.gov/documentation/services-web-api

== Frequently Asked Questions ==

= Do I need an API key? =
No. NOAA's weather.gov API is publicly accessible without authentication.

= Does the free/core plugin include forecasts, radar maps, alerts, marine data, tides, lunar data, or climate data? =
No. The free/core plugin displays current NOAA/weather.gov observation data through Elementor widgets and shortcodes.

= How do I clear the cache? =
Go to **Settings -> One8 Weather Data Fields -> Manual Refresh**, then click **Refresh Weather Data Now**.
You can also click **Save** on the **Settings** tab to refresh automatically.

= Can I change the output format? =
**Yes.**
With Elementor, use its styling controls (typography, spacing, borders, etc.), and the widget's **Before** / **After** text options.
With shortcodes, you can wrap output in your own HTML or combine multiple shortcodes to build a sentence.

== Changelog ==

= 1.0.0 =
* Initial release: current NOAA/weather.gov observations via shortcode and Elementor widget

== Upgrade Notice ==

= 1.0.3 =
First public release. No upgrade steps required.

== Acknowledgements ==

Built on the NOAA Weather.gov API
Inspired by the "Minimal Weather" shortcode concept

== License ==

This plugin is licensed under the GPLv2 or later.
