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%
Security Headers & Caching
Security Headers & Caching is a comprehensive WordPress plugin that helps protect your website by implementing essential HTTP security headers and optimizing performance through intelligent caching mechanisms. Compatible with all hosting providers including Aruba, SiteGround, Bluehost, and more. Key Features Easy Configuration – Simple admin interface to enable/disable security headers Multiple Security Headers – Comprehensive security header support Smart Caching – Configurable cache duration for better performance Universal Compatibility – Works with all hosting providers No Conflicts – Compatible with popular security and caching plugins Translation Ready – Full internationalization support Security Headers Included X-Powered-By – Removes server technology information to prevent targeted attacks Content-Security-Policy (CSP) – Controls which resources can be loaded to prevent XSS attacks Strict-Transport-Security (HSTS) – Forces HTTPS connections for enhanced security X-XSS-Protection – Enables XSS filtering in older browsers X-Frame-Options – Prevents clickjacking attacks by controlling iframe embedding X-Content-Type-Options – Prevents MIME type sniffing Referrer-Policy – Controls how much referrer information is shared Permissions-Policy – Controls browser features and APIs Caching Features Configurable cache duration (seconds) Automatic cache headers management Compatible with CDN services No conflict with existing cache plugins Why Security Headers Matter Security headers are HTTP response headers that tell your browser how to behave when handling your website’s content. They help protect against: Cross-Site Scripting (XSS) attacks Clickjacking attempts Code injection attacks MIME type sniffing Protocol downgrade attacks And much more… Developer Friendly The plugin provides filters for developers to customize headers: shc_security_headers – Filter to modify security headers array Test Your Security After installing and configuring the plugin, test your site’s security at: * Security Headers * Mozilla Observatory Privacy This plugin does not collect, store, or transmit any user data. It only modifies HTTP response headers sent by your server. Developer Documentation Filters shc_security_headers Modify the security headers before they are sent. add_filter( 'shc_security_headers', function( $headers ) { // Add custom header $headers['X-Custom-Header'] = 'custom-value'; // Modify existing header $headers['X-Frame-Options'] = 'DENY'; return $headers; } ); Constants SHC_VERSION – Plugin version number SHC_PLUGIN_DIR – Plugin directory path SHC_PLUGIN_URL – Plugin directory URL SHC_PLUGIN_BASENAME – Plugin basename Support For support, feature requests, or bug reports, please visit: * Plugin Website Credits Developed by Studio Be4 – Web Design & Development Agency License This plugin is licensed under the GPLv2 or later.
Top keywords