Under The Weather
Under The Weather is a powerful yet simple plugin that displays location-specific weather forecasts on your WordPress site. Featuring a dedicated “Under The Weather Forecast” block to add and customize weather widgets directly in the WordPress editor for a seamless workflow. With performance in mind, Under The Weather uses a server-side caching system (WordPress Transients) to minimize API calls and ensure your site remains fast. Under The Weather is completely “vanilla” on the front-end, meaning it does not rely on jQuery or any other JavaScript frameworks. Built with modern security practices, including input validation, CSRF protection, and optional rate limiting to protect your site and API quota. 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. Key Features: Easy Integration: Add weather widgets in the WordPress editor by using a dedicated weather block, an [under_the_weather] shortcode, or by placing a simple with data attributes anywhere on your site. Beautiful Display Options: Designed to look stunning on any site. Choose from 4 different visual options: The Default OpenWeather images A Crisp Weather Icons font 2 Animated SVG icon sets Styled to Match Your Site: Seamlessly fit the widget into any site design using the Light Mode for white and light backgrounds or toggle on the Dark Mode for nicely contrasted text on dark backgrounds. Apply custom hex colors to the “Weather Icons Font” with the Color Picker for a truly bespoke integration. Fully Customizable Layouts: Choose whether the widget’s main focal point highlights the live current conditions or today’s high and low temperatures. Build out the widget to meet your goals, from a compact day-of weather widget to a full weather hub, displaying: Extended forecasts (up to 6 days) “Feels like” temperatures Wind speeds and directions Active weather alerts Sunrise & Sunset Times Visual Performance Report: Monitor your site’s API usage with a bar chart that displays a 7-day history of cached requests versus new calls to the OpenWeather API – a clear look at how the caching system is working to keep your site fast and your API calls low. Smart Caching: All API calls are cached on your server, dramatically reducing calls to the OpenWeather API and speeding up page loads for all users. The plugin includes a configurable cache duration and automatically resets the forecast after midnight in the location’s timezone, ensuring your visitors always see the current day’s weather. Fast Weather Location Lookup: An easy-to-use Coordinate Finder tool located in the settings page and the Block Editor retrieves coordinates by location name worldwide. Generates ready-to-use widget code from the settings page. Automatically fill coordinates in the block editor. Imperial & Metric Units: Display weather in Fahrenheit/mph or Celsius/kph on a per-widget basis. Performance First: Built for Core Web Vitals Page Speed Optimized: Unlike other popular weather plugins that load hundreds of kilobytes of external libraries, Under The Weather is engineered specifically for speed and SEO, using native script deferral, smart font preloading, conditional asset enqueues, and optional async CSS loading. Zero Dependencies: While other weather plugins force your site to load heavy external libraries like jQuery, Vue.js, or Swiper.js just to show a simple forecast, Under The Weather requires exactly 1 script request, written in pure, vanilla JavaScript. This guarantees faster loading and zero risk of library conflicts. Ultra-Lightweight Footprint: At roughly 10 KB, the JavaScript payload is up to 25x smaller than many other weather widgets for WordPress, without sacrificing features. Zero Layout Shift (CLS): Using an intelligent, dynamic skeleton loading UI and modern CSS containment, the widget claims its vertical space immediately, preventing the page from “jumping” when the weather data arrives, and eliminating Cumulative Layout Shift (CLS) issues that can negatively impact your Core Web Vitals. Smart Server-Side Caching: API requests to OpenWeather are handled safely by your server, not the visitor’s browser. Data is securely cached using WordPress transients to serve lightning-fast results to your visitors while drastically reducing API calls and protecting your OpenWeather quota. Usage The Under The Weather plugin offers three ways to add a weather forecast: using the block editor or manually placing a or shortcode. Using the Block Editor (Recommended) Open the post or page where you want to display the weather. Click the block inserter icon (+) to add a new block. Search for “Under The Weather Forecast” and add the block. Configure your location using either: Manual entry of coordinates in the block settings sidebar The built-in coordinate finder that searches by location name and fills in the coordinates for you Choose your preferred units (Imperial/Fahrenheit or Metric/Celsius) Publish or update your post – the weather will display automatically! Manual Placement (Classic Editor & Themes) To display the weather widget on a post, page, or in a template file, add a simple element with the class weather-widget and the required data attributes. data-lat: The latitude for the forecast. data-lon: The longitude for the forecast. data-location-name: The city or location name you want to display as the title of the widget. (Beyond its display purpose, the ‘data-location-name’ is also used to create the shared cache key). data-unit (optional): The unit system for temperature and wind speed. Accepts metric or imperial. The default unit is imperial if not provided. Examples: To show the weather for a location in Celsius, you would add data-unit="metric": The plugin’s JavaScript will automatically find this element and populate it with the forecast. Using the Shortcode (Classic Editor & Widgets) You can also display the weather by using the [under_the_weather] shortcode. This is ideal for the Classic Editor, text widgets, or other page builders. Available attributes: lat: (Required) The latitude for the forecast. lon: (Required) The longitude for the forecast. location_name: (Required) The name to display for the location. unit: (Optional) The unit system. Accepts metric or imperial. Defaults to imperial. Example: [under_the_weather lat="48.8566" lon="2.3522" location_name="Paris, France" unit="metric"] Configuration Before you begin, go to openweathermap.org and sign up for an API key and register for the One Call API 3.0 subscription. Paste your API key into the Under the Weather Settings Page. API & Cache Cache Expiration Time: Use the slider to set the maximum time weather data is stored before fetching a new forecast, from 30 minutes to 8 hours. The plugin also features a smart caching system that automatically ensures the cache expires after midnight in the location’s local timezone. This prevents showing a stale forecast from the previous day, regardless of your slider setting. For displaying live conditions (using the Primary Display or Extra Details options), a shorter cache time of 1 or 2 hours is recommended. For displaying only the daily high/low, a longer cache time of 3 or 8 hours effectively reduces API calls. Widget Display & Style Tailor the widget to perfectly match your website’s aesthetic and your users’ needs: Icon & Style Set: Pick the style that suits you best. Choose between four weather icon options: * Recognizable Default images (PNGs) provided by OpenWeather. * Sharp, modern Weather Icons fonts created by Erik Flowers. * Two Animated SVG icon sets (Fill and Outline) by Bas Milius. Note: Selecting the icon font will load an additional small CSS file. Icon Font Color: Use the color picker to customize the “Weather Icons Font” set to match your theme. This setting only has a visible effect when the “Weather Icons Font” style is selected (it does not impact PNGs or SVGs). If left at the default, the icons will use the gray color specified in the plugin’s stylesheet. Widget Mode: The weather widgets are designed to look good on light or dark backgrounds. Select Light Mode when displaying weather widgets on white and light backgrounds. Switch to Dark Mode to display weather widgets on black or dark backgrounds. Primary Display: Select whether the main display of the widget shows the Current live temperature or Today’s Forecast (the high and low for the day). Number of Forecast Days: Adjust the number of days shown in the extended forecast row, from 2 to 6 days. When set to 0 days, the widget’s forecast area disappears, leaving a compact widget showing the current day’s weather. Extra Details: Selecting this option will display ‘Feels Like’ and wind (direction and speed) information beneath the primary display. This setting adds nuance to the current weather conditions display. Sunrise & Sunset: This setting displays the local sunrise and sunset times for the location, useful for planning outdoor activities. Choose to show the times in a 12-hour (e.g., 6:30 AM) or 24-hour (e.g., 18:30) format. Weather Alerts: When enabled, the widget will display any active severe weather alerts (e.g., thunderstorm warnings, flood advisories) issued by official authorities for the specified location. This provides critical, at-a-glance information for your visitors. Display Timestamp: Indicates the time elapsed since the weather data was last updated from the source. This option helps readers see how recently the weather widget obtained its information. Display Unit Symbol: Adds the unit symbol (F or C) next to the main temperature. This option lets you choose whether the widget should include the temperature unit symbol in the primary temperature display. Advanced Settings Enable Cache: You can uncheck this box if you would like to use this plugin without the benefit of caching. Enable Rate Limiting: Check this box to protect your site against excessive API requests from a single IP address. You can set the maximum number of requests per hour (default is 100). This helps prevent malicious traffic from exhausting your API quota. Asset Loading: For the plugin to function correctly, the Load Plugin CSS and Load Plugin JavaScript boxes should normally remain checked. However, you can uncheck them if you prefer to include the plugin’s CSS and JS files as part of your theme’s own optimized assets. If you uncheck Load Plugin JavaScript, you can load the Under The Weather scripts manually on select pages by adding the following template tag to your theme files (e.g., footer.php): For most users, simply leaving these boxes checked is the best way to use the weather widget. Async CSS Loading: Enable this option to reduce render-blocking resources for faster initial page loading. * It is recommended to leave this unchecked if your weather widget is located “above the fold” (near the top of the page) to prevent layout shifting or a flash of unstyled content. * If you enable async loading, please consider adding a “min-height” rule for “.weather-widget” to your theme’s custom CSS to reserve the widget’s vertical space while the stylesheet loads. Example: .weather-widget{min-height:300px} Shimmer While Loading: Enabled by default, this visual placeholder provides layout stability before the weather data arrives. Uncheck this box to instead display a clear, transparent widget area before the weather data arrives. Coordinate Finder Don’t know the latitude and longitude for your desired location? No problem. The Under The Weather plugin will find coordinates for you. In the WordPress Block Editor Add an “Under The Weather Forecast” block to your post or page. Open the Block Settings Click the “Find Coordinates by Name” button. Type in the name of your location. Press “Search.” When search results appear, click on your desired location. The location’s coordinates will be automatically entered into the latitude and longitude settings for the weather forecast. In the Plugin Settings Page Navigate to Settings > Under The Weather and click on the Coordinate Finder tab. Type a location name into the search box (e.g., “Los Angeles, CA”). Click the “Find Coordinates” button. The tool will display the generated with the correct coordinates and location name. Use the “Copy Code” button to copy the ready-to-use widget HTML and paste it into a post, page, or widget. The tool automatically saves a history of your last 5 searches, which persists between sessions. You can easily copy code from previous searches without having to look them up again. Performance Report The Under The Weather plugin includes a Performance Report tab on the settings page (Settings > Under The Weather > Performance Report) to provide clear insight into the plugin’s efficiency and API usage. Average Daily Usage: A daily average pie chart provides a snapshot of how frequently weather data is served from the cache versus making new calls to the OpenWeatherMap One Call API 3.0 (which offers a free tier of 1,000 API calls per day). Last 7 Days of Activity: A 7-day bar chart that displays a more detailed comparison of cached hits versus new calls to the OpenWeather API. This chart includes the current day’s usage, which is not calculated into the daily average. The performance report demonstrates how the caching system reduces external requests and keeps your site fast. Use this report to fine-tune your Cache Expiration Time and observe the impact on your API call rate. The report also includes a status indicator that shows whether the optional Rate Limiting feature is currently active. If rate limiting is enabled and requests are being blocked, the raw data table at the bottom of the report will log these events. This can help you identify unusual traffic patterns or potential misuse of your API key. Credits Weather Data: OpenWeather Weather Icon Font: Weather Icons by Erik Flowers Animated Weather Icons: Meteocons by Bas Milius Geocoding & Map Data: Data © OpenStreetMap contributors Block Icons: Phosphor External Services OpenWeatherMap API: This plugin connects to the OpenWeatherMap API to retrieve weather forecast data. To provide weather information, the following data is sent to the service: Location Coordinates: The latitude and longitude provided in the widget settings are sent to fetch the weather for that specific location. API Key: Your OpenWeatherMap API key is sent to authenticate the request. Here are the links to their terms of service and privacy policy: * Terms of Service: https://openweather.co.uk/storage/app/media/Terms/Openweather_terms_and_conditions_of_sale.pdf * Privacy Policy: https://openweather.co.uk/privacy-policy Nominatim (OpenStreetMap) API: The Coordinate Finder tool sends the location name entered by the administrator to the Nominatim geocoding service to retrieve latitude and longitude coordinates. Here is the link to their privacy policy: * Privacy Policy: https://osmfoundation.org/wiki/Privacy_Policy
Top keywords
- weather68×2.84%
- api27×1.13%
- display24×1.00%
- widget24×1.00%
- location22×0.92%
- forecast19×0.79%
- under18×0.75%
- under the weather18×0.75%
- data15×0.63%
- page15×0.63%
- block14×0.59%
- settings12×0.50%
WP Super Cache
This plugin generates static html files from your dynamic WordPress blog. After a html file is generated your webserver will serve that file instead of processing the comparatively heavier and more expensive WordPress PHP scripts. The static html files will be served to the vast majority of your users: Users who are not logged in. Users who have not left a comment on your blog. Or users who have not viewed a password protected post. 99% of your visitors will be served static html files. One cached file can be served thousands of times. Other visitors will be served custom cached files tailored to their visit. If they are logged in, or have left comments those details will be displayed and cached for them. The plugin serves cached files in 3 ways (ranked by speed): Expert. The fastest method is by using Apache mod_rewrite (or whatever similar module your web server supports) to serve “supercached” static html files. This completely bypasses PHP and is extremely quick. If your server is hit by a deluge of traffic it is more likely to cope as the requests are “lighter”. This does require the Apache mod_rewrite module (which is probably installed if you have custom permalinks) and a modification of your .htaccess file which is risky and may take down your site if modified incorrectly. Simple. Supercached static files can be served by PHP and this is the recommended way of using the plugin. The plugin will serve a “supercached” file if it exists and it’s almost as fast as the mod_rewrite method. It’s easier to configure as the .htaccess file doesn’t need to be changed. You still need a custom permalink. You can keep portions of your page dynamic in this caching mode. WP-Cache caching. This is mainly used to cache pages for known users, URLs with parameters and feeds. Known users are logged in users, visitors who leave comments or those who should be shown custom per-user data. It’s the most flexible caching method and slightly slower. WP-Cache caching will also cache visits by unknown users if supercaching is disabled. You can have dynamic parts to your page in this mode too. This mode is always enabled but you can disable caching for known users, URLs with parameters, or feeds separately. Set the constant “DISABLE_SUPERCACHE” to 1 in your wp-config.php if you want to only use WP-Cache caching. If you’re not comfortable with editing PHP files then use simple mode. It’s easy to set up and very fast. Recommended Settings Simple caching. Compress pages. Don’t cache pages for known users. Cache rebuild. CDN support. Extra homepage checks. Garbage collection is the act of cleaning up cache files that are out of date and stale. There’s no correct value for the expiry time but a good starting point is 1800 seconds. Consider deleting the contents of the “Rejected User Agents” text box and allow search engines to cache files for you. Preload as many posts as you can and enable “Preload Mode”. Garbage collection of old cached files will be disabled. If you don’t care about sidebar widgets updating often set the preload interval to 2880 minutes (2 days) so all your posts aren’t recached very often. When the preload occurs the cache files for the post being refreshed is deleted and then regenerated. Afterwards a garbage collection of all old files is performed to clean out stale cache files. Even with preload mode enabled cached files will still be deleted when posts are modified or comments made. Development Active development of this plugin is handled on GitHub. Translation of the plugin into different languages is on the translation page. Documentation If you need more information than the following, you can have a look at the wiki or the Developer documentation. Preloading You can generate cached files for the posts, categories and tags of your site by preloading. Preloading will visit each page of your site generating a cached page as it goes along, just like any other visitor to the site. Due to the sequential nature of this function, it can take some time to preload a complete site if there are many posts. To make preloading more effective it can be useful to disable garbage collection so that older cache files are not deleted. This is done by enabling “Preload Mode” in the settings. Be aware however, that pages will go out of date eventually but that updates by submitting comments or editing posts will clear portions of the cache. Garbage Collection Your cache directory fills up over time, which takes up space on your server. If space is limited or billed by capacity, or if you worry that the cached pages of your site will go stale then garbage collection has to be done. Garbage collection happens on a regular basis and deletes old files in the cache directory. On the advanced settings page you can specify: 1. Cache timeout. How long cache files are considered fresh for. After this time they are stale and can be deleted. 2. Scheduler. Setup how often garbage collection should be done. 3. Notification emails. You can be informed on garbage collection job progress. There’s no right or wrong settings for garbage collection. It depends on your own site. If your site gets regular updates, or comments then set the timeout to 1800 seconds, and set the timer to 600 seconds. If your site is mostly static you can disable garbage collection by entering 0 as the timeout, or use a really large timeout value. The cache directory, usually wp-content/cache/ is only for temporary files. Do not ever put important files or symlinks to important files or directories in that directory. They will be deleted if the plugin has write access to them. CDN A Content Delivery Network (CDN) is usually a network of computers situated around the world that will serve the content of your website faster by using servers close to you. Static files like images, Javascript and CSS files can be served through these networks to speed up how fast your site loads. You can also create a “poor man’s CDN” by using a sub domain of your domain to serve static files too. OSSDL CDN off-linker has been integrated into WP Super Cache to provide basic CDN support. It works by rewriting the URLs of files (excluding .php files) in wp-content and wp-includes on your server so they point at a different hostname. Many CDNs support origin pull. This means the CDN will download the file automatically from your server when it’s first requested, and will continue to serve it for a configurable length of time before downloading it again from your server. Configure this on the “CDN” tab of the plugin settings page. This is an advanced technique and requires a basic understanding of how your webserver or CDNs work. Please be sure to clear the file cache after you configure the CDN. REST API There are now REST API endpoints for accessing the settings of this plugin. You’ll need to be authenticated as an admin user with permission to view the settings page to use it. This has not been documented yet but you can find all the code that deals with this in the “rest” directory. Custom Caching It is now possible to hook into the caching process using the add_cacheaction() function. Three hooks are available: ‘wp_cache_get_cookies_values’ – modify the key used by WP Cache. ‘add_cacheaction’ – runs in phase2. Allows a plugin to add WordPress hooks. ‘cache_admin_page’ – runs in the admin page. Use it to modify that page, perhaps by adding new configuration options. There is one regular WordPress filter too. Use the “do_createsupercache” filter to customize the checks made before caching. The filter accepts one parameter. The output of WP-Cache’s wp_cache_get_cookies_values() function. WP Super Cache has its own plugin system, loaded before most of WordPress. Add your own plugin either by putting it in the wp-content/plugins/wp-super-cache-plugins directory, or by calling wpsc_add_plugin( $name ) with the full path to the plugin. The cookies used to identify “known users” can be modified with wpsc_add_cookie( $name ) and wpsc_delete_cookie( $name ). See plugins/searchengine.php as an example. Troubleshooting If things don’t work when you installed the plugin here are a few things to check: Is wp-content writable by the web server? Is there a wp-content/wp-cache-config.php ? If not, copy the file wp-super-cache/wp-cache-config-sample.php to wp-content/wp-cache-config.php and make sure WPCACHEHOME points at the right place. Is there a wp-content/advanced-cache.php ? If not, then you must copy wp-super-cache/advanced-cache.php into wp-content/. You must edit the file and change the path so it points at the wp-super-cache folder. If pages are not cached at all, remove wp-content/advanced-cache.php and recreate it, following the advice above. Make sure the following line is in wp-config.php and it is ABOVE the “require_once(ABSPATH.’wp-settings.php’);” line: define( 'WP_CACHE', true ); Try the Settings->WP Super Cache page again and enable cache. Look in wp-content/cache/supercache/. Are there directories and files there? Anything in your php error_log? If your browser keeps asking you to save the file after the super cache is installed you must disable Super Cache compression. Go to the Settings->WP Super Cache page and disable it there. File locking errors such as “failed to acquire key 0x152b: Permission denied in…” or “Page not cached by WP Super Cache. Could not get mutex lock.” are a sign that you may have to use file locking. Edit wp-content/wp-cache-config.php and uncomment “$use_flock = true” or set $sem_id to a different value. You can also disable file locking from the Admin screen as a last resort. Make sure cache/wp_cache_mutex.lock is writable by the web server if using coarse file locking. The cache folder cannot be put on an NFS or Samba or NAS share. It has to be on a local disk. File locking and deleting expired files will not work properly unless the cache folder is on the local machine. Garbage collection of old cache files won’t work if WordPress can’t find wp-cron.php. Check your access_logs for wp-cron.php entries and that your hostname resolves to the external IP address other servers on the network/Internet use. If old pages are being served to your visitors via the supercache, you may be missing Apache modules (or their equivalents if you don’t use Apache). 3 modules are required: mod_mime, mod_headers and mod_expires. The last two are especially important for making sure browsers load new versions of existing pages on your site. The error message, “WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed!” appears at the end of every page. Open the file wp-content/advanced-cache.php in your favourite editor. Is the path to wp-cache-phase1.php correct? This file will normally be in wp-content/plugins/wp-super-cache/. If it is not correct the caching engine will not load. Caching doesn’t work. The timestamp on my blog keeps changing when I reload. Check that the path in your .htaccess rules matches where the supercache directory is. You may have to hardcode it. Try disabling supercache mode. If supercache cache files are generated but not served, check the permissions on all your wp-content/cache/supercache folders (and each of wp-content cache and supercache folders) and wp-content/cache/.htaccess. If your PHP runs as a different user to Apache and permissions are strict Apache may not be able to read the PHP generated cache files. To fix you must add the following line to your wp-config.php (Add it above the WP_CACHE define.) Then clear your cache. umask( 0022 ); If you see garbage in your browser after enabling compression in the plugin, compression may already be enabled in your web server. In Apache you must disable mod_deflate, or in PHP zlib compression may be enabled. You can disable that in three ways. If you have root access, edit your php.ini and find the zlib.output_compression setting and make sure it’s “Off” or add this line to your .htaccess: php_flag zlib.output_compression off If that doesn’t work, add this line to your wp-config.php: ini_set('zlib.output_compression', 0); After uninstalling, your permalinks may break if you remove the WordPress mod_rewrite rules too. Regenerate those rules by visiting the Settings->Permalink page and saving that form again. If your blog refuses to load make sure your wp-config.php is correct. Are you missing an opening or closing PHP tag? Your front page is ok but posts and pages give a 404? Go to Settings->permalinks and click “Save” once you’ve selected a custom permalink structure. You may need to manually update your .htaccess file. If certain characters do not appear correctly on your website your server may not be configured correctly. You need to tell visitors what character set is used. Go to Settings->Reading and copy the ‘Encoding for pages and feeds’ value. Edit the .htaccess file with all your Supercache and WordPress rewrite rules and add this at the top, replacing CHARSET with the copied value. (for example, ‘UTF-8’) AddDefaultCharset CHARSET The error message, “WP Super Cache is installed but broken. The constant WPCACHEHOME must be set in the file wp-config.php and point at the WP Super Cache plugin directory.” appears at the end of every page. You can delete wp-content/advanced-cache.php and reload the plugin settings page or edit wp-config.php and look for WPCACHEHOME and make sure it points at the wp-super-cache folder. This will normally be wp-content/plugins/wp-super-cache/ but you’ll likely need the full path to that file (so it’s easier to let the settings page fix it). If it is not correct the caching engine will not load. If your server is running into trouble because of the number of semaphores used by the plugin it’s because your users are using file locking which is not recommended (but is needed by a small number of users). You can globally disable file locking by defining the constant WPSC_DISABLE_LOCKING, or defining the constant WPSC_REMOVE_SEMAPHORE so that sem_remove() is called after every page is cached but that seems to cause problems for other processes requesting the same semaphore. Best to disable it. Set the variable $htaccess_path in wp-config.php or wp-cache-config.php to the path of your global .htaccess if the plugin is looking for that file in the wrong directory. This might happen if you have WordPress installed in an unusual way.