| 开发者 | wfy24 |
|---|---|
| 更新时间 | 2026年5月1日 00:59 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 6.9 |
| 版权: | 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 "Weather by WFY24" link under each rendered widget. The onboarding wizard shows an explicit disclosure notice and asks for your consent before the "Activate now (free)" button; clicking that button is your explicit permission to enable the link. To remove the attribution, a Pro version is available at wfy24.com/en/widgets/pro.
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 onboarding form (pre-filled from Settings → General; editable inline before activation), site name, site domain, WordPress version, and plugin version, in order to automatically provision your free API key. No activation happens without your explicit click on the "Activate now (free)" button./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, optional city slug, language/units/theme preferences, and a data-geolocation flag (off by default — visitor location is not detected unless the admin explicitly opts in via the "Auto-detect visitor location" toggle). When the toggle is on AND the visitor grants permission, the visitor's latitude/longitude is sent; when geolocation is denied, the visitor's IP address is used for IP-based city detection (still gated by the toggle). No personal data is stored beyond standard anonymized request logs for rate limiting./api/widget/pro/status and POSTs to /api/widget/pro/checkout and /api/widget/pro/portal to provision a Stripe Checkout session and a Stripe Billing Portal session. No data is sent unless the admin clicks the relevant button./wp-content/plugins/wfy24-weather-widget/, or install via Plugins → Add New.[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. You can also enter a key manually if you already have one.
Yes — visit wfy24.com/en/widgets to manage keys. Any changes you make there apply to this plugin immediately (keys are shared).
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 5 layouts (Classic, Compact, Minimal, Badge, Forecast) and 3 themes (Auto, Light, Dark).
50 languages. Set the lang attribute to any ISO 2-letter code.
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 ML post-processing (XGBoost) and real observations from 19,000+ weather stations (METAR, SYNOP, CWOP, DWD, etc.).
Yes. The free version of this plugin displays a small "Weather by WFY24" link under each rendered widget. This is disclosed explicitly during activation — the onboarding wizard shows a notice asking you to agree before you click "Activate now (free)". Clicking "Activate" is your explicit consent. The link is how we keep the service free for everyone.
Yes — by upgrading to Pro, which removes the link, increases the request rate limit, and unlocks additional features. The free version keeps the attribution as a fair trade for unlimited free data.
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