=== WeatherBot === Contributors: roxxistudios Tags: weather, current weather, weather widget, block, shortcode Requires at least: 6.0 Tested up to: 6.8 Requires PHP: 7.4 Stable tag: 1.0.2 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Blocks: roxxistudios/weatherbot WeatherBot adds fast, accessible, location-based weather with the Google Weather API. Use a Gutenberg block or shortcodes in any theme. == Description == WeatherBot displays real-time current weather from Google’s Weather API with geocoding via Google Maps Platform. It outputs a clean, accessible UI you can drop anywhere via **Gutenberg block** or **shortcode**. ### Gutenberg Block Insert the **WeatherBot** block from the Inserter (search “WeatherBot”). The block renders a live server preview and includes these controls: - **Title** (`pre_text`) — optional heading above the widget - **Position** (`align`) — `left`, `center`, `right` - **Theme** (`font_color`) — `light`, `dark` contrast - **Unit** (`unit`) — `IMPERIAL` (°F), `METRIC` (°C), or inherit from Settings - **Type** (`type`) — `badge`, `compact`, `inline` - **City** (`city`) — type a city and press **Enter** to preview The block supports **Dimensions → Margin** for per-instance spacing. Theme alignment (e.g., wide/full) is supported where available. ### Shortcode Use `[weatherbot]` (or `[weather_bot]`). Examples below are code-formatted so they render correctly. **Basic:** [weatherbot city="Lake Arrowhead, CA"] **Badge type with °F:** [weatherbot city="Lake Arrowhead, CA" unit="IMPERIAL" type="badge"] **Title + right aligned:** [weatherbot city="Lake Arrowhead, CA" type="badge" pre_text="Current Weather" align="right"] **High-contrast for dark backgrounds:** [weatherbot city="Lake Arrowhead, CA" type="badge" font_color="light"] **Compact layout (°C):** [weatherbot city="Lake Arrowhead, CA" type="compact" unit="METRIC"] **Inline layout (flows with text; omit align):** [weatherbot city="Lake Arrowhead, CA" type="inline" pre_text="Now:"] **All options:** [weatherbot city="Lake Arrowhead, CA" unit="IMPERIAL" type="badge" pre_text="Current Weather" align="center" font_color="dark"] == Features == * Real-time current weather via Google’s Weather API * Google Maps geocoding/places lookups for cities and places * Multiple display types: `badge` (card), `compact` (mini), `inline` (text-flow) * Gutenberg block with live preview and full controls (Title, Position, Theme, Unit, Type, City) * Shortcode support for use anywhere shortcodes are allowed * Widget for classic sidebars/footers * Accessibility-minded markup and focus styles * Builder-friendly output (guards against unwanted `
` wrappers) * Caching tuned for freshness and efficiency (weather ~2 minutes; geocoding up to 1 year) == Installation == 1. Upload the `weatherbot` folder to `/wp-content/plugins/`. 2. Activate the plugin in **Plugins**. 3. Go to **Settings → WeatherBot**, add your Google Maps API key (Weather + Geocoding/Places). 4. **Block:** insert **WeatherBot**, choose options, type a city and press **Enter** to preview. **— or —** **Shortcode:** paste one of the examples above. == Frequently Asked Questions == = Where do I get a Google API key? = From the Google Cloud Console. Enable the **Weather** and **Geocoding/Places** APIs and create a restricted key. = How often is the weather updated? = Weather responses are cached for a short period (about 2 minutes per location/unit). Geocoding results can be cached up to 1 year. = How do I keep the widget inline with text? = Use `type="inline"` and omit `align` so it flows with surrounding text. = Does it work with page builders? = Yes. The shortcode renders cleanly in rich text fields. The plugin includes a guard to avoid unwanted paragraph wrappers. == Attributes == - `city` — string (e.g., `"Lake Arrowhead, CA"`) - `unit` — `IMPERIAL` | `METRIC` | empty to inherit - `type` — `badge` | `compact` | `inline` | empty to inherit - `pre_text` — string (optional title) - `align` — `left` | `center` | `right` - `font_color` — `light` | `dark` == Screenshots == 1. Settings page with API key field and connection test 2. Badge type with title 3. Compact type 4. Inline type in body text 5. Block with live preview and controls == Changelog == = 1.0.2 = * Improved badge layout styles = 1.0.1 = * Added uninstall.php for cleanup on plugin deletion. * Added user setting to control data deletion. * Updated assets (icons, screenshots, logos). * Improved settings page layout. = 1.0.0 = Initial release. == External services == This plugin connects to third-party services to fetch weather and/or geocoding data. = Google Weather / Google Maps Platform = - Usage: retrieves current conditions and converts place names to coordinates. - Data sent: the query you provide (e.g., “Lake Arrowhead, CA”) or latitude/longitude. - Provider terms: https://cloud.google.com/maps-platform/terms - Google APIs Terms: https://developers.google.com/terms - Privacy policy: https://policies.google.com/privacy - Notes: Site owners provide their own API keys. No data is sent to RoxxiStudios servers. Geolocation is not used. = Caching = The plugin may cache API responses (weather lookups and reverse-geocoded place names) in your WordPress database to reduce network calls and improve performance. Cache lifetimes are limited and can be cleared by site admins at any time.