Transient Cleaner
Clean expired transients from your options table. The original and best! Transient housekeeping was added to the core of WordPress after version 5.8. However, I have decided to open up this plugin to all versions to allow for manual transient cleaning. Longer term I am working on a new version of the plugin, designed specifically for all WordPress releases. Tested up to PHP 8.2 Fully complies with WordPress coding standards Compliant with the stronger WordPress VIP coding standards, as well as compatibility with their platform Community plugin – visit the Github page to get involved with the latest code development, request enhancements and report issues “Transients are a simple and standardized way of storing cached data in the WordPress database temporarily by giving it a custom name and a timeframe after which it will expire and be deleted.” Unfortunately, expired transients only get deleted when you attempt to access them. If you don’t access the transient then, even though it’s expired, WordPress will not remove it. This is a known “issue” but due to reasons, which are explained in the FAQ, this has not been adequately resolved. Why is this a problem? Transients are often used by plugins to “cache” data (my own plugins included). Because of this it means that expired data can be left and build up, resulting in a bloated database table. Meantime, this plugin is the hero that you’ve been waiting for. Simply activate the plugin, sit back and enjoy a much cleaner, smaller options table. It also adds the additional recommendation that after a database upgrade all transients will be cleared down. The Settings Screen Within Administration -> Tools -> Transients an options screen exists allowing you to tweak when you’d like cleaning to happen, including the ability to perform an ad-hoc run, and when you’d like the to be automatically scheduled. You can even request an optimization of the options table to give your system a real “pep”! Running in Lite mode A “lite” mode is available. By activating this the options screen will no longer appear and default settings will be used. The advantage? Improved performance to Admin and, especially if you’re running multi-site, no chance of anybody “tinkering” with the settings. To activate, use the following… define( 'TC_LITE', true ); This should be added to your wp-config.php file. Using hooks If you’re the type of odd person who likes to code for WordPress (really?) then I’ve added a couple of hooks so you can call our rather neat cleaning functions… housekeep_transients – this will clear down any expired transients clear_all_transients – this will remove any and all transients, expired or otherwise Acknowledgements I’d like to thank WordPress Developer Andrew Nacin for his early discussion on this. Also, I’d like to acknowledge the useful article at Everybody Staze for ensuring the proposed solution made sense, and W-Shadow.com for the cleaning code. Iconography is courtesy of the very talented Janki Rathod.
Top keywords
- transients10×2.00%
- wordpress8×1.60%
- expired6×1.20%
- options5×1.00%
- cleaning4×0.80%
- table4×0.80%
- added3×0.60%
- code3×0.60%
- data3×0.60%
- database3×0.60%
- expired transients3×0.60%
- options table3×0.60%
BlinkSpeed
Boost your WordPress site speed with advanced AI optimization techniques. Improve Core Web Vitals, achieve higher scores on Google PageSpeed Insights and GTmetrix, and deliver a faster, smoother browsing experience for your visitors. Features CSS Optimization – Minification, combination, and critical CSS loading JavaScript Optimization – Minification, combination, and deferred loading HTML Caching – Page-level caching for improved performance Image Optimization – WebP conversion and lazy loading CDN Support – Content Delivery Network integration Lazy Loading – Images, iframes, and videos Asset Preloading – Preload critical assets like images and fonts for faster rendering Admin Bar Integration – Quick cache purge from admin bar Multisite Support – Network-wide and individual site management Web Vitals Monitoring – Core Web Vitals tracking and logging Change Logging – Track all settings changes Free vs Premium Features BlinkSpeed offers a powerful free version with essential performance optimizations. A premium license unlocks advanced AI-powered optimization features for the entire website. Free Version (Included with Plugin) The following features are available for free and work on all pages: HTML page caching CSS minification JavaScript minification JavaScript lazy loading Image lazy loading Browser caching GZIP compression Cache management tools Multisite compatibility Critical CSS generation (Home Page Only) Advanced image optimization and WebP conversion (Home Page Only) These optimizations help significantly improve page load speed and overall performance without requiring a license key. Premium Version (Requires License Key) The premium version unlocks advanced AI-powered optimization features for all pages: HTML page caching CSS minification JavaScript minification JavaScript lazy loading Image lazy loading Browser caching GZIP compression Cache management tools Multisite compatibility Critical CSS generation (All Pages) Advanced image optimization and WebP conversion (All Pages) Without a license key, critical CSS and advanced image optimization are available only for the homepage. Why Premium Features Require a License Some advanced optimizations rely on BlinkSpeed cloud services to process CSS, images, and performance data. These services require additional server resources, so a license key is required to enable them for the entire website. You can activate your license key from: BlinkSpeed → General Settings → License Key Requirements WordPress 5.0 or higher PHP 7.4 or higher PHP XML extension PHP GD extension Plugin Architecture The plugin follows WordPress coding standards and modular architecture. Main Files blinkspeed.php – Main plugin file with header and initialization includes/Plugin.php – Main plugin class orchestrating functionality includes/Core.php – Core functionality and settings management includes/Frontend.php – Frontend optimization handling includes/Database.php – Database operations and table management Admin Structure admin/Admin.php – Main admin class handling menu and settings admin/Admin_Bar.php – Admin bar cache purge functionality admin/admin-page.php – Admin page template Configuration General Settings Enable Optimization – Turn on/off optimization features License Key – Enter your BlinkSpeed license key CSS Optimization CSS Optimization – Enable CSS minification and combination Load Critical CSS – Inline critical CSS for above-the-fold content JavaScript Optimization JavaScript Optimization – Enable JS minification and combination Load Combined JS – Choose when to load combined JavaScript files HTML Caching HTML Caching – Enable page-level caching Cache Expiry Time – Set cache expiration time in seconds Image Optimization Convert JPG to WebP – Automatically convert JPG images to WebP Convert PNG to WebP – Automatically convert PNG images to WebP Lazy Loading – Enable lazy loading for images Usage Basic Setup Activate the plugin. Go to BlinkSpeed settings. Configure optimization preferences. Save settings. Cache Management Purge cache directly from the WordPress admin bar. CSS/JS cache can be purged globally or per page. HTML cache can be purged globally or per page. Critical CSS cache can be purged per page. Monitoring View Web Vitals logs for performance insights. Review change logs for settings updates. Monitor cache sizes and performance. Hooks Actions blinkspeed_init – Plugin initialization blinkspeed_settings_saved – Settings saved blinkspeed_cache_cleared – Cache cleared Filters blinkspeed_settings – Modify plugin settings blinkspeed_cache_path – Customize cache paths blinkspeed_exclude_urls – Exclude URLs from optimization Database Tables The plugin creates the following tables: wp_blinkspeed_core_web_vitals – Stores Web Vitals performance data wp_blinkspeed_change_logs – Stores settings change logs wp_blinkspeed_site_urls – Stores site URL management data Cache Structure wp-content/cache/ ├── critical-css/ └── bs-cache/ Performance Impact CSS/JS Optimization – Reduces file sizes by 20-40% HTML Caching – Improves page load times by 50-80% Image Optimization – Reduces image sizes by 25-50% Lazy Loading – Improves initial page load performance Common Issues Permission errors – Ensure cache directory permissions are correct. Cache not working – Verify optimization settings are enabled. Images not converting – Confirm the GD extension is installed. Admin bar missing – Check user capability settings. Security Input sanitization for all settings Nonce verification for forms Capability checks for admin actions Secure file operations Multisite Support Network-wide settings management Individual site overrides Centralized cache control Site-specific optimization rules External Services This plugin connects to the BlinkSpeed API service: https://rest.blinkspeed.ai These services provide CSS optimization, image optimization, and license verification. Data Sent CSS file URLs and content for optimization Image URLs for WebP conversion License key for verification Service Information Service Provider: https://blinkspeed.ai Support Policy: https://blinkspeed.ai/support-policy/ Terms of Service: https://blinkspeed.ai/term-of-service/ All communication happens over secure HTTPS connections. Minified Assets Some JavaScript files are distributed in minified form for performance. Third-party libraries: assets/js/web-vitals.iife.js – https://github.com/GoogleChrome/web-vitals assets/js/diff.min.js – https://github.com/kpdecker/jsdiff Plugin-specific scripts: assets/js/img-lazyload.js – https://blinkspeed.ai/resources/js/img-lazyload.js assets/js/script-load.min.js – https://blinkspeed.ai/resources/js/script-load.js