Linux 软件免费装
Banner图

Under The Weather

开发者 sethsm
更新时间 2025年8月11日 02:51
捐献地址: 去捐款
PHP版本: 7.2 及以上
WordPress版本: 6.8
版权: GPLv2 or later
版权网址: 版权信息

标签

cache widget weather forecast openweather

下载

1.7

详情介绍:

Under The Weather is a powerful yet simple plugin designed to display location-specific weather forecasts on your WordPress site. Built with performance in mind, it uses a server-side caching system (WordPress Transients) to minimize API calls and ensure your site remains fast. This plugin is ideal for travel blogs, outdoor activity sites, or any website that needs to display weather conditions for specific locations without the bloat of heavy, multi-dependency plugins. Under The Weather is completely "vanilla" on the front-end, meaning it does not rely on jQuery or any other JavaScript frameworks. Key Features:

安装:

  1. Upload the entire under-the-weather folder to the /wp-content/plugins/ directory.
  2. Activate the plugin through the 'Plugins' menu in WordPress.
  3. Navigate to Settings > Under The Weather to configure the plugin. You must enter a valid OpenWeather API key for the plugin to function. The plugin is designed to work with the One Call API 3.0. by OpenWeather.

屏幕截图:

  • The weather widget displaying "Today's Forecast" with the Weather Icons font set.
  • The weather widget displaying current conditions with default icons (in Celsius) and extra details enabled.
  • The Under The Weather Performance Report depicting seven days of information on cached hits vs calls to the OpenWeather API
  • The plugin's comprehensive settings page.

升级注意事项:

1.3 This version includes a template tag function, described in the README file, that allows you to load the plugin's JavaScript manually. 1.4 This version includes an Enable Cache setting. This setting may be helpful when debugging and can be used to turn off the plugin's caching function. 1.5 This version includes significant code quality and security updates. The template tag for manually loading scripts has been renamed from utw_load_scripts_manually() to under_the_weather_load_scripts_manually(). Please update your theme files if you are using this function.

常见问题:

What API key do I need?

This plugin works with the OpenWeather One Call API 3.0. You can get a free API key by signing up on the OpenWeather website. Make sure you have subscribed to the One Call API on your account's API page.

The weather isn't updating. Why?

The plugin caches the weather data on your server to improve performance and reduce API calls. The data will only be fetched again after the "Cache Expiration Time" you set on the settings page has passed. If you need to force an immediate update, go to Settings > Under The Weather and click the "Clear All Weather Caches" button.

I made changes to my settings. Why isn't the widget updating?

The weather widget is probably displaying a cached forecast. Since waiting around is no fun, the Under The Weather Settings has a "Clear Weather Cache" option at the bottom. If you press the "Clear All Weather Caches & Stats" button, it will force an immediate update of all weather forecasts. This will also clear the performance report data. If you're feeling patient, just wait for the weather widget to update after the current cache has expired.

Does the Weather Widget work in Fahrenheit or Celsius?

Both. By default, the weather widget will show a forecast in Fahrenheit. If you prefer to see the forecast in Celsius, set data-unit="metric" within the weather-widget div (see configuration instructions). Additionally, checking the box for "Display Unit Symbol" on the Under The Weather Settings page instructs the weather widget to display the temperature unit symbol (F or C) in the primary temperature display.

Can I load the JavaScripts myself?

Yes. By default, when "Load Plugin JavaScript" is selected, it will add scripts to every page of your website. If you only plan to display the weather widget on select pages, you could choose to only load the Under The Weather Scripts on those pages by encoding the JavaScript yourself. When Load Plugin JavaScript is unchecked, you can use this template tag o add the Under The Weather Scripts to your theme's footer.php file. For example, if you only intend to display the weather widget on events pages, you could add this targeted script to your theme's footer.php file: Adding scripts this way is purely optional. Most users can just leave the Load Plugin JavaScript box checked.

How can I monitor how many OpenWeather API calls the plugin is making?

Click on the "Performance Report" tab of the Under The Weather Settings Page to see a graph and data log for the last 7 days of plugin performance. The Performance Report shows the last seven days of information about the requests made by the weather widget. The report displays a comparison of the cached hits and calls to the OpenWeather API. Seeing how the plugin's cache system reduces the number of API calls demonstrates its effectiveness. Use the Performance Report to examine how modifying the cache expiration time affects the rate of cached requests.

Are there additional ways to customize this plugin?

Yes. You can modify the appearance of the Weather Icons Fonts by making customizations using CSS. The Weather Icons Fonts are sharp, scalable, and can be customized through CSS to match your website's color palette.

Do I need to use the plugin's caching function?

No. To retrieve fresh weather data every time a widget page loads, you can uncheck "Enable Cache" under the plugin's advanced settings. While the caching system provides a great benefit for reducing API hits, turning off this function during your initial widget setup may be useful.

更新日志:

1.7 1.6 1.5 1.4 1.3 1.2 1.1 1.0