Linux 软件免费装
Banner图

Spelhubben Weather

开发者 spelhubben
更新时间 2026年1月31日 05:06
捐献地址: 去捐款
PHP版本: 7.4 及以上
WordPress版本: 6.9

标签

widget shortcode blocks weather forecast

下载

1.9.7 1.8.5 1.8.6 1.6.1 1.9.1 1.9.2 1.7.0 1.8.3 1.8.4 1.9.0 1.9.3 1.9.4 1.8.2 1.9.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, FMI, Open-Weathermap, and Weatherapi.com) and compute a simple consensus. Works worldwide with excellent coverage in Europe and beyond. Features

安装:

  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.

升级注意事项:

1.9.5 Added moon phase support (phase + illumination) in renderer, shortcodes, block and widget. 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, and FMI (Finnish Meteorological Institute). You choose providers under Settings → Spelhubben Weather or per block/shortcode/widget via the providers attribute.

Do I need an API key?

No. Open-Meteo, SMHI, and FMI do not require keys. 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 tide support in version 1.9.7:

  • 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 Leaflet map (OpenStreetMap). Control height with map_height="240" (px). Global defaults exist in settings.

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 the new phase and illumination fields to show moon information. Example shortcode: [spelhubben_weather show="temp,icon,phase,illumination"] — available in Block inspector and Widget options as well.

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. The map (Leaflet) requires JS.

Translations?

The plugin is fully translatable. Included translations: Swedish (sv_SE), Norwegian (nb_NO). Strings are also available on translate.wordpress.org. Ship .pot/.po/.mo in /languages.

GDPR / privacy?

The plugin does not set cookies by itself. If you enable the map, Leaflet/OpenStreetMap tiles are requested client-side. 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).

更新日志:

1.8.6 1.8.5 1.8.4 1.8.3 1.8.2 1.8.1 1.8.0 1.7.5 1.7.0 1.6.2 1.6.1