Linux 软件免费装
Banner图

Spelhubben Weather

开发者 spelhubben
更新时间 2026年9月7日 21:57
捐献地址: 去捐款
PHP版本: 7.4 及以上
WordPress版本: 7.1

标签

widget shortcode blocks weather forecast

下载

1.8.6 1.7.0 1.9.1 1.6.1 2.0.0 2.0.1 2.0.2 1.9.2 1.8.4 1.9.0 1.9.3 1.8.2 1.9.5 1.9.4 1.9.8 1.9.9 1.8.3 1.9.7 2.0.3 2.1.0 2.0.4 2.1.2 2.1.4 1.8.5 2.1.5

详情介绍:

This plugin displays current weather and an optional forecast. It can aggregate data from free global weather providers (Open-Meteo, SMHI, Yr/MET Norway, MET Norway Nowcast, FMI, OpenWeatherMap, and WeatherAPI.com) and compute a simple consensus. Works worldwide with excellent coverage in Europe and beyond.

安装:

  1. Upload/activate the plugin.
  2. Go to Settings → Spelhubben Weather and set defaults (place, shown fields, layout, providers, cache time, units/format).
  3. Add weather to your site in any of these ways:
Block (Gutenberg) Shortcode Classic Widget

屏幕截图:

  • Frontend example: New look and wind direction
  • Settings page: defaults, providers, cache, units & format.
  • Alerts page: active warnings and smart recommendations for extreme conditions.
  • Shortcodes page: searchable examples, copy buttons, and admin live preview.
  • Performance page: cache statistics, API usage and "Clear cache" action.

升级注意事项:

2.1.5 Fixes incomplete translations and language-variant caching. Adds support for new translation locales and translatable map messages. Clear any page cache after updating. 1.9.5 Added moon phase support via extras="moon" and daily moon information via extras="moon_daily". 1.8.5 Performance optimization release with conditional asset loading. Fixes 404 errors and MIME type warnings for Leaflet on non-weather pages. Recommended for all users. 1.8.4 Maintenance release with centralized configuration constants and performance optimizations. Recommended for all users. 1.8.0 BREAKING CHANGE: Legacy [sv_vader …] shortcode has been removed. Please migrate all shortcodes to use [spelhubben_weather …] format. Performance update with security fixes, geocoding caching, and new plugin showcase feature. Strongly recommended. 1.7.5 Adds FMI as an optional free provider. Enable it under Settings → Spelhubben Weather → Providers, or pass providers="smhi,yr,openmeteo,fmi" in blocks/shortcodes/widgets. 1.7.0 Admin UX overhaul: new Shortcodes page with live preview, units/format settings, and cache clear. Legacy [sv_vader] is deprecated—please migrate to [spelhubben_weather]. Donate link: https://www.paypal.com/donate/?hosted_button_id=CV74CEXY5XEAU

常见问题:

Where does the data come from?

From public APIs such as Open-Meteo, SMHI, Yr/MET Norway, MET Norway Nowcast, FMI (Finnish Meteorological Institute), OpenWeatherMap, and WeatherAPI.com. You choose providers under Settings → Spelhubben Weather or per block/shortcode/widget via the providers attribute.

Do I need an API key?

Usually no. Open-Meteo, SMHI, Yr/MET Norway, MET Norway Nowcast, and FMI do not require keys. OpenWeatherMap and WeatherAPI.com do require API keys, and for Yr/MET Norway it’s recommended to include contact info (email/URL) in Settings → Spelhubben Weather → Yr contact/UA so your User-Agent is compliant.

Block, shortcode or widget — what’s the difference?

All three render the same UI. Use the block in the block editor, the shortcode in classic content areas, and the widget in sidebars (Appearance → Widgets). Each lets you override global defaults.

How do place and coordinates work?

Tide (experimental)

If you're testing experimental tide support:

  • Enabling: Turn on Tides in Settings → Spelhubben Weather and select a provider (WorldTides, NOAA or Custom endpoint). WorldTides typically requires an API key.
  • Shortcode: Use extras="tides" or tides="1" to show tide events, e.g. [spelhubben_weather place="Gothenburg" extras="tides"].
  • Providers: WorldTides (global, commercial), NOAA Tides & Currents (US only), or supply a custom endpoint that returns JSON with events/extremes/data arrays (items should include time, and optionally type and height).
  • Troubleshooting: Use tests/tide_test.php to validate provider responses and caching. Ensure provider settings and API key are correct; tide results are cached according to the configured TTL.
If lat and lon are provided they take precedence. Otherwise the plugin geocodes the place string (e.g. place="Umeå"). Set a global default place in settings.

What fields can I show/hide?

Use show="temp,wind,icon" (comma separated). Defaults are set in settings. Add wind_dir to show wind direction arrow and label.

How do layouts work?

Choose layout="inline|compact|card|detailed". “Detailed” supports the multi-day forecast row.

Can I see individual provider data (for comparison)?

Yes! Use comparison="1" to show all enabled providers' data side-by-side. Useful for debugging or comparing which providers are available in your location. Example: [spelhubben_weather place="Stockholm" comparison="1" providers="openmeteo,smhi,yr,fmi,openweathermap,weatherapi"]

What icon themes are available?

The plugin offers multiple themes: Classic (traditional), Modern Flat (clean, minimalist), Modern Gradient (contemporary with subtle gradients), Modern 2026 (duotone/stroke modern style), and Modern 3D (subtle gradients + drop-shadows). Choose in Settings → Spelhubben Weather → Icon style. All themes include icons for sun, partly-cloudy (including alternate), cloud, fog, rain, sleet, snow, storm/thunder, and hail where applicable.

How do I enable the map and set its size?

map="1" shows a smart OpenStreetMap-powered map. By default map_engine="auto" tries OpenLayers first, then Leaflet legacy, then a static fallback with coordinates and an OSM link. You can force map_engine="openlayers|leaflet|static". Control height with map_height="240" (px). Global defaults exist in settings.

How do I get an hourly forecast?

Set hourly="1" and optionally hours="3–24". Example: hourly="1" hours="24". Hour labels follow the active site locale, such as 24-hour time for Swedish/Norwegian sites.

How do I enable animations?

animate="1" adds subtle UI animation. Global default is in settings. The renderer also accepts true, yes, or on as truthy values for convenience.

How do I get a daily forecast?

Set forecast="daily" and days="3–10". Example: forecast="daily" days="5".

How do I use moon phase?

Use extras="moon" to show moon phase in the weather meta area. Use extras="moon_daily" together with forecast="daily" to show moon information in the daily forecast. Example: [spelhubben_weather extras="moon"].

Can I mix providers and get a consensus?

Yes. Set providers="smhi,yr,openmeteo,fmi" (order doesn’t matter). The plugin calculates a simple consensus across available providers for the displayed fields.

Units & format?

Pick a preset with units="metric|metric_kmh|imperial". You can override parts via temp_unit="C|F", wind_unit="ms|kmh|mph", precip_unit="mm|in", and date_format for forecast labels. All have global defaults in settings (Units & format section).

Caching — how long is data stored?

Responses are cached with WordPress transients. Change TTL (minutes) in settings. Clear via the Clear cache button on the Performance page (Settings → Performance) or by changing attributes (which creates a new cache key).

Does it work without JavaScript?

Yes, rendering is server-side. Interactive maps require JS, but the map area can fall back to a static status with coordinates and an OpenStreetMap link.

Translations?

The plugin is fully translatable. Included translations: Swedish (sv_SE), Norwegian Bokmål (nb_NO). Strings are also available on translate.wordpress.org. Bundled translation files live in /languages and include .pot, .po, .mo, .l10n.php, and block editor JSON files.

GDPR / privacy?

The plugin does not set cookies by itself. If you enable the map, OpenStreetMap tiles are requested client-side by the local OpenLayers/Leaflet runtime. Mention OSM in your privacy notice if needed.

Troubleshooting tips

  • Nothing shows: check that at least one provider is selected in settings.
  • Wrong location: provide exact lat/lon or a more specific place (e.g. “Uddevalla, SE”).
  • Map not visible: ensure map="1" and that your theme/container is wide/tall enough; increase map_height.
  • Rate limiting: reduce refreshes or increase cache TTL.

Translations

The plugin is fully translatable and includes built-in translations for Swedish (sv_SE) and Norwegian Bokmål (nb_NO).

更新日志:

2.1.5 2.1.4 2.1.3 2.1.2 2.1.0 2.0.4 2.0.3 2.0.2 2.0.1