LevelNetwork Heartbeat Manager

Description

Heartbeat Manager allows you to optimize your WordPress site’s performance by limiting or completely disabling the Heartbeat API calls.

The WordPress Heartbeat API uses AJAX calls (admin-ajax.php) to provide real-time information, such as when other users are editing a post or to show real-time notifications (like in WooCommerce). While useful, on many sites, especially E-commerce stores with high traffic, these frequent calls can put a significant strain on the server’s CPU.

This plugin allows you to granularly control this behavior via a simple settings card in Settings > Heartbeat Manager.

Key Features:

  • Backend Frequency Control: Increase or manage the “beat” interval while inside the WordPress Admin Dashboard.
  • Flexible Frontend Management: Choose whether to keep the Heartbeat API active on the public site or disable it completely.
  • Integrated Testing Guide: Includes a built-in step-by-step Vademecum in the sidebar to verify your settings via browser Developer Tools.
  • Lightweight & Translation Ready: Clean, lightweight code that is fully internationalized and ready for translation using the standard levelnetwork-heartbeat-manager text-domain.

Developed by sonofgod80 (LevelNetwork.it) to maximize site fluidity.

Screenshots

Installation

  1. Upload the levelnetwork-heartbeat-manager folder to the /wp-content/plugins/ directory.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.
  3. Go to Settings > Heartbeat Manager to configure the values.

FAQ

Will disabling the Heartbeat API break my site?

No, it will not break your site’s core layout. However, completely disabling it on the frontend might affect real-time updates from third-party plugins that rely on it (e.g., live notification badges or certain real-time WooCommerce cart dynamic updates). If you notice issues, you can change the setting from “Disabled” to a higher time interval (e.g., 60 or 120 seconds).

What is the recommended setting for an E-commerce store?

For maximum performance under high traffic, we highly recommend setting the Backend interval to 60 or 120 seconds, and setting the Frontend to “Disabled”. This drastically reduces the number of background AJAX requests (admin-ajax.php) hitting your server.

Why do I get an “Uncaught ReferenceError” or “undefined” error when testing the frontend in the browser console?

This is completely normal and actually a good sign! WordPress does not load the Heartbeat script on the public frontend by default. If you see this error, it means neither your theme nor any active plugins are currently triggering the Heartbeat API on your public pages. Your frontend is already naturally optimized and completely free of these background AJAX hits. The frontend custom interval setting will only apply if an asset explicitly requests the Heartbeat script.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“LevelNetwork Heartbeat Manager” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.0.2

  • Tweak: Raised the minimum allowed interval for the Backend Frequency to 30 seconds (previously 15) to prevent accidental server CPU spikes from overly aggressive polling.
  • Docs: Updated the Plugin Vademecum & Testing Guide to clarify that frontend testing is only applicable when the theme or another plugin actively enqueues the Heartbeat API.

1.0.1

  • Enhancement: Fully internationalized (i18n ready) with default language set to English.
  • Enhancement: Added a comprehensive step-by-step “Plugin Vademecum & Testing Guide” section in the admin sidebar.
  • Fix: Completely refactored prefixing (changed short hm_ to unique lnhm_) across all constants, options, classes, and variables to ensure 100% compliance with WordPress.org guidelines and avoid collisions.
  • Fix: Greatly improved logic for handling frontend heartbeat intervals (disabling via inline script, changing frequency via standardized localization).
  • Fix: Added missing escaping (esc_attr, esc_html) and proper sanitization (intval) for better security.
  • Feature: Added “Settings” and “Donate” links directly beneath the plugin name in the plugins list.
  • Dev: Cleaned up CSS and separated layout structures to avoid class name conflicts with WordPress core.

1.0.0

  • Initial release.
  • Granular heartbeat control and dedicated UI.