Linux 软件免费装
Banner图

Spelhubben Weather

开发者 spelhubben
更新时间 2025年10月26日 21:20
捐献地址: 去捐款
PHP版本: 7.4 及以上
WordPress版本: 6.8
版权: GPLv2 or later
版权网址: 版权信息

标签

widget shortcode blocks weather forecast

下载

1.6.1 1.7.0

详情介绍:

This plugin displays current weather and an optional forecast. It can aggregate data from northern-Europe friendly providers (Open-Meteo, SMHI, and Yr/MET Norway) and compute a simple consensus. 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

屏幕截图:

  • Settings page: defaults, providers, cache, units & format.
  • **Shortcodes page (new in 1.7.0):** searchable examples, copy buttons, and admin live preview.

升级注意事项:

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]. Translations: Swedish, Norwegian, English. Donate link: https://paypalme/spelhubben

常见问题:

Where does the data come from?

From public APIs such as Open-Meteo, SMHI and Yr/MET Norway. You choose providers under Settings → Spelhubben Weather or per block/shortcode/widget via the providers attribute.

Do I need an API key?

No. 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.

Where is the Shortcodes page? (new in 1.7.0)

Go to Settings → Spelhubben Weather → Shortcodes. You’ll find searchable examples, one-click copy (and “copy all”), plus a live preview that renders the shortcode inside WP-admin.

How do place and coordinates work?

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.

How do layouts work?

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

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.

How do I get a daily forecast?

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

Can I mix providers and get a consensus?

Yes. Set providers="smhi,yr,openmeteo" (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 settings page 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), English (en_US). 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.

Legacy shortcode?

[sv_vader …] is still accepted for compatibility, but deprecated and will be removed soon. Please switch to [spelhubben_weather …].

更新日志:

1.7.0 1.6.2 1.6.1