| 开发者 | wfy24 |
|---|---|
| 更新时间 | 2026年9月18日 03:09 |
| PHP版本: | 8.1 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[wfy24_weather]
Override per instance:
[wfy24_weather city="paris-fr2988507" theme="dark" variant="forecast" lang="fr"]
Or use the WFY24 Weather Widget block in the Gutenberg editor for a visual interface.
Attribution
The free version of this plugin displays a small attribution link — its visible text is wfy24.com — under each rendered widget. The activation screen says so above the "Activate now (free)" button: "By activating you agree to display a small attribution link (wfy24.com) under each widget"; clicking that button is your explicit permission to enable the link. A Pro plan that removes the attribution is in preparation; until it launches the plugin shows "Pro is coming — notify me" (wfy24.com/en/widgets/pro). Existing Pro subscriptions keep hiding the link.
External service
This plugin connects to the WFY24 weather service at https://www.wfy24.com:
/api/widget/register-from-plugin with the email you confirmed in the activation form (pre-filled from Settings → General; editable inline before activation), site name, site domain, WordPress version, plugin version and site locale, in order to automatically provision your free API key. No activation happens without your explicit click on the "Activate now (free)" button. If wfy24.com already holds a widget for that email and domain, it answers with the first characters of the existing key and a replacement-key link; the plugin then shows the "Connect an existing WFY24 widget" form instead of creating a duplicate. Pasting a key into that form sends nothing./wp-json/wfy24/v1/cities proxies your search query (e.g. "athens") to /api/places/search server-side. Your search query is sent along with a User-Agent identifying the plugin. Results (slug + label + country flag) are cached for 5 minutes per query. The admin's IP is never exposed cross-origin because the request is server-to-server.widget.js and queries /api/widget/data. The widget sends the API key, the city slug when one is set, and the language/units/theme preferences. Location: with a default city set, that city is shown and no visitor location is used. With no default city and the "Auto-detect visitor location" toggle off (the default), the widget shows the weather for the visitor's approximate location derived from the IP address of the request — no browser prompt, no coordinates. With the toggle on, the browser asks the visitor for permission; if granted, the visitor's latitude/longitude is sent, otherwise the IP-based location is used. No personal data is stored beyond standard anonymized request logs for rate limiting./api/widget/pro/status with the first characters of the key to learn whether the key is on the Pro plan (this is what hides the attribution link for Pro sites). After a failed request it waits an hour before trying again./api/widget/pro/checkout and /api/widget/pro/portal — the portal request carries the site's full key — to open a Stripe Checkout or Stripe Billing Portal session. While Pro is parked (the default in this version) the upgrade button is not shown and the checkout handler refuses to run; site owners who want the checkout can define WFY24_PRO_ENABLED as true in wp-config.php./wp-content/plugins/wfy24-weather-widget/, or install via Plugins → Add New.[wfy24_weather] anywhere.wfy24_ followed by 32 letters and digits). A value of any other shape is rejected and nothing is changed.[wfy24_weather] to any post, page, or widget area.Yes. No credit card, no trial, no ads in the widget. Fair-use rate limits apply (plenty for normal sites).
No. The plugin registers your site automatically on activation using your WordPress admin email. If you already have a key — from an earlier install, from the wfy24.com widget builder, or from another subsite — paste it into Connect an existing WFY24 widget on the same screen.
Yes — visit wfy24.com/en/widgets to manage keys (the "Lost it? request a replacement" link on the activation screen takes you to the same place). A replacement key issued there must be pasted into Connect an existing WFY24 widget in this plugin; the old key stops working within about 30 minutes.
Minimal. See the "External service" section above. The plugin only contacts wfy24.com on actions you explicitly trigger (activation click, widget rendering on visitor pages, Pro upgrade click). There is no background telemetry, no scheduled cron, and no analytics.
The widget uses Shadow DOM for style isolation, so it won't clash with your theme. Choose from 7 layouts (Classic, Compact, Minimal, Badge, Forecast, Air Quality, Air Quality + Weather wide) and 3 themes (Auto, Light, Dark).
51 languages. The site default follows your WordPress site language (choose another in Settings → WFY24 Weather); set the lang attribute on a shortcode or block to override it per widget with any of the 51 ISO 2-letter codes.
Go to wfy24.com, search for your city, and copy the slug from the URL (e.g. paris-fr2988507).
Yes. The widget loads client-side, so full-page cache has no impact on weather freshness.
Yes — we ship a "WFY24 Weather Widget" block under the Widgets category.
WFY24 combines multiple NWP models (DWD ICON-D2, ICON-EU, ICON-Global, GFS fallback) with real observations from 19,000+ weather stations (METAR, SYNOP, CWOP, DWD, etc.). Air quality comes from the Copernicus Atmosphere Monitoring Service (CAMS).
Yes. The free version of this plugin displays a small link with the text wfy24.com under each rendered widget. This is stated explicitly on the activation screen, above the "Activate now (free)" button; clicking "Activate" is your explicit consent. The link is how we keep the service free for everyone.
Not yet. A Pro plan that removes it is in preparation — the plugin shows "Pro is coming — notify me" (wfy24.com/en/widgets/pro) until it launches. Sites that already have a Pro subscription keep it, and their widgets keep rendering without the link.
name and description use the resolved place name ("Weather forecast for Paris"), never the city slug.WFY24_PRO_ENABLED as true in wp-config.php to show the checkout). Existing Pro subscriptions keep working. Checkout and portal failures are now shown as admin notices instead of failing silently, the hourly status check backs off for an hour after a failed request instead of retrying on every admin page load, and the billing-portal request identifies the site with its full key.aqi-wide, the settings-page preview now breaks out of the right-hand sidebar and renders in a full-width row above the form, so the horizontal weather + AQI bar has room to show its actual layout. On the published page nothing changes — the variant has always rendered correctly when given content-width room.variant="aqi-wide" style places the location, current weather (icon, temperature, conditions, feels-like, daily high/low) on the left and a horizontal European-AQI bar (0–100+) with category label on the right. Designed for embeds that span the full content width, where the compact AQI card looks too narrow.width attribute — [wfy24_weather variant="aqi-wide" width="800px"] or width="100%". Accepts 400, 400px, 80%, 100%; invalid values are dropped silently. Set a site-wide default in Settings → WFY24 Weather Widget → Default width or override per shortcode / Gutenberg block. Empty value keeps each variant's built-in default.overflow:hidden and white-space:nowrap, but the segments inside didn't carry data-fit-priority hints — so when the embed sat in a narrow column (e.g. the admin's live-preview sidebar) the fit observer didn't know which parts to hide and the "Powered by WFY24" link was clipped mid-letter. Now the powered-by link, the description, the "Feels like" segment, and their dividers each have priorities; the observer hides them cleanly in priority order until everything fits.?ver=2.0.0 query had been cached on the CDN with the original 2.0.0 bundle, so even after the widget.js fix landed on the origin, sites embedding the script kept loading the stale copy. ?ver=2.0.1 is a fresh cache key.variant="aqi" style renders European-AQI air quality for the configured city — the big AQI index number, category band (good through hazardous, color-coded per the EEA scale), and the four headline pollutants (PM2.5, PM10, O₃, NO₂). Data comes from the Copernicus Atmosphere Monitoring Service (CAMS) via wfy24.com. Pick it from the "Style variant" dropdown in settings, or set it inline with [wfy24_weather variant="aqi"].wfy24-welcome URL still works — it now redirects to the unified screen.cities="..."). The v1.7.x multi-city feature is removed in this major release — the implementation needed a dedicated admin picker UI to be discoverable, and the new unified layout focuses on the most common single-city flow. If you had multi-city enabled, your shortcodes without cities= now fall back to your Default City; explicit [wfy24_weather cities="..."] shortcodes will only render the first city. The wfy24_default_cities option is preserved on update so no data is lost in case the feature returns later.widget.js is unchanged, so every existing shortcode and Gutenberg block in published posts continues to render exactly as before.WebPageElement block describing the city (as Place), language, units, and provider. Helps search engines and AI agents understand that the page contains a weather forecast for a specific location — useful for semantic search, AI overviews, and future rich-result eligibility. Toggle from the settings screen (on by default).url is the real canonical (e.g. https://www.wfy24.com/el/weather/thessaloniki-gr57554537) and the Place.name uses the language-correct form pulled from the translations table (İstanbul for tr, Θεσσαλονίκη for el, etc.). Cached in a WP transient for 24h on hit, 5min on miss — first page load makes one upstream call, all subsequent renders are cache hits.wfy24_jsonld_enabled (per-widget on/off) and wfy24_jsonld_data (modify the payload before emission).widget.js is unchanged. Existing shortcodes and blocks render exactly as before with the new JSON-LD appended.display: none as the default state for the suggestion list; the JavaScript was clearing the inline override (element.style.display = '') which fell back to that CSS default — so the dropdown was always hidden, even though the REST proxy was returning matches and no console errors were thrown. Now sets display: block explicitly. Affects both the Default City picker and the Language combobox on the settings and onboarding screens./wp-json/wfy24/v1/cities now returns structured fields (slug, name, country_code, country_name, flag, region) instead of a single pre-formatted label. Cache key includes the locale so per-language responses don't collide.navigator.geolocation whenever no default city was set, which triggered a browser permission prompt on every visitor and silently broke when declined. Auto-detect is now an explicit opt-in checkbox; the default is to honour the admin-set city, which matches what 95%+ of sites actually want (e.g. a tourism site for Crete shouldn't show a Swedish visitor's local weather)./wp-json/wfy24/v1/cities) so the admin's IP is never exposed cross-origin.Cross-Origin-Resource-Policy: cross-origin, which makes the widget work in cross-origin-isolated environments (e.g. playground.wordpress.net) that ship Cross-Origin-Embedder-Policy: require-corp.wp_redirect() calls in the Pro flow (Stripe Checkout and Billing Portal) with wp_safe_redirect() plus a scoped allowed_redirect_hosts filter that whitelists checkout.stripe.com, billing.stripe.com, and pay.stripe.com. The redirect helper validates the target host against this list before issuing the redirect, falling back to a safe admin URL on mismatch.<script> tags with wp_enqueue_script. All three call sites — the [wfy24_weather] shortcode, the admin-settings live preview, and the onboarding wizard preview — now register the widget bundle through WordPress's enqueue API and emit a <div data-wfy24-widget …> placeholder where the widget should render.[data-wfy24-widget] elements and renders inside the placeholder you mark, so WordPress hosts can keep the script in the page footer (per directory guidelines) without breaking in-place rendering. The legacy inline-<script> pattern still works unchanged for non-WordPress integrations.strategy => 'async' enqueue option.Telemetry checkbox has been removed from the Settings page. Existing scheduled events are cleared on upgrade and on deactivation.data-attribution="0" or "1" to widget.js accordingly.data-attribution attribute (hardcoded to "1" in the free plugin; Pro version sends "0" to suppress the link).[wfy24_weather] with city, theme, lang, units, variant attributes