WordPress Free plugin, which “Heartbeat Control” that reduces the frequency of WordPress’s Heartbeat API (admin-ajax.php) to improve site performance by lowering server load. The plugin is designed for non-coders, with a simple settings page to configure the heartbeat interval and enable/disable it for specific areas (admin, post editor, front-end). It will modify the Heartbeat API’s default 15-60 second interval to a user-defined value, with sensible defaults. The plugin is lightweight, secure, and includes an admin page for configuration and instructions.
📥 My Awesome Plugin
This plugin helps you automate tasks and improve web performance.
⬇️ Download Plugin ZIP💌 Subscribe to Updates
Heartbeat Control free plugin
Installation and Setup Instructions
- Download the Plugin:
- Upload to WordPress:
- Zip the wp-heartbeat-control folder.
- In your WordPress admin dashboard, go to Plugins > Add New > Upload Plugin.
- Upload the zipped folder and click Install Now.
- Activate the Plugin:
- After installation, click Activate Plugin.
- Configure Heartbeat Settings:
- In the WordPress admin dashboard, go to the new menu item called Heartbeat Control.
- Configure the following:
- Admin Area Interval: Set the heartbeat interval for the admin dashboard (default: 120 seconds).
- Disable in Admin Area: Check to disable Heartbeat in the admin area (except post editor).
- Post Editor Interval: Set the heartbeat interval for the post/page editor (default: 60 seconds).
- Disable in Post Editor: Check to disable Heartbeat in the post editor (may affect autosave).
- Front-End Interval: Set the heartbeat interval for the front-end (default: 120 seconds).
- Disable on Front-End: Check to disable Heartbeat on the front-end.
- Click Save Changes. Settings take effect immediately.
- Test the Changes:
- Open the browser’s developer tools (F12) and go to the Network tab.
- Filter for admin-ajax.php and observe the frequency of Heartbeat requests in the admin area, post editor, or front-end.
- Ensure features like autosave and post locking still work as expected.
Features
- Customizable Intervals: Set different Heartbeat intervals for the admin area, post editor, and front-end (15-600 seconds).
- Disable Options: Completely disable Heartbeat in specific areas if not needed.
- Performance Optimization: Reduces server load by lowering admin-ajax.php requests.
- Simple Interface: Easy-to-use settings page for non-coders.
- Admin Instructions: Includes guidance on the settings page.
- Single File: All functionality is contained in one PHP file.
- Secure: Uses WordPress best practices for settings sanitization and hooks.
How It Works
- On activation, the plugin adds a settings page to configure Heartbeat intervals and disable options.
- It hooks into the heartbeat_settings filter to modify the Heartbeat API’s interval based on the current context (admin, post editor, or front-end).
- If disabling is enabled for a context, it prevents Heartbeat requests entirely using the heartbeat_send filter.
- The plugin checks the current page to apply the appropriate settings, ensuring the post editor isn’t affected by admin settings.
- Changes apply instantly after saving settings, with no caching issues.
Notes
- Performance Impact: Reducing Heartbeat frequency can significantly lower server load, especially on high-traffic sites or shared hosting. A 120-second interval typically halves the number of requests compared to WordPress’s default (15-60 seconds).
- Feature Trade-offs: Disabling Heartbeat may break features like:
- Post Editor: Autosave, post locking, or real-time collaboration (e.g., in Gutenberg).
- Admin Area: Session management or dashboard widget updates.
- Front-End: Real-time notifications or dynamic content (rarely used).
- Test thoroughly after disabling or setting high intervals (>120 seconds).
- Compatibility: Works with WordPress 3.6 and above (when Heartbeat was introduced).
- No Database Impact: Only modifies runtime settings; no database changes beyond storing options.
- Monitoring: Use server logs or tools like Query Monitor to verify reduced admin-ajax.php requests.
Troubleshooting
- Heartbeat Still Running: Check the Network tab in developer tools to confirm intervals. Ensure settings are saved and you’re in the correct context (admin, editor, front-end).
- Features Broken: If autosave or post locking fails, reduce the interval or uncheck “Disable” for the post editor. Start with the default settings (120s admin/frontend, 60s editor).
- No Performance Improvement: Other factors (e.g., large database, unoptimized plugins) may dominate. Use a tool like GTmetrix or New Relic to identify bottlenecks.
- Conflicts: Some plugins (e.g., page builders, real-time dashboards) may override Heartbeat settings. Identify them using Query Monitor or by deactivating other plugins temporarily.
This plugin is ready to use and provides a simple way to optimize WordPress performance by controlling the Heartbeat API. Let me know if you need additional features (e.g., user role-based settings, manual override button, or logging Heartbeat activity) or help with setup!