'Heartbeat Control', 'perfmatters/perfmatters.php' => 'Perfmatters', 'heartbeat-control-by-developer/developer-heartbeat-control.php' => 'Developer Heartbeat Control', ); $active_plugin = null; foreach ( $heartbeat_plugins as $plugin_path => $plugin_name ) { if ( Plugin_Theme_Helper::is_plugin_active( $plugin_path ) ) { $active_plugin = $plugin_name; break; } } // Check if heartbeat is disabled. $heartbeat_disabled = has_filter( 'heartbeat_settings', '__return_empty_array' ); // Check caching plugins that include heartbeat control. $caching_with_heartbeat = array( 'wp-rocket/wp-rocket.php' => 'WP Rocket', 'sg-cachepress/sg-cachepress.php' => 'SG Optimizer', 'swift-performance-lite/performance.php' => 'Swift Performance', ); $caching_plugin = null; foreach ( $caching_with_heartbeat as $plugin_path => $plugin_name ) { if ( Plugin_Theme_Helper::is_plugin_active( $plugin_path ) ) { $caching_plugin = $plugin_name; break; } } $details = array( 'active_heartbeat_plugin' => $active_plugin, 'caching_with_heartbeat' => $caching_plugin, 'heartbeat_disabled' => $heartbeat_disabled, ); if ( $heartbeat_disabled ) { return static::info( \__( 'The WordPress Heartbeat API is disabled. This reduces AJAX requests but may affect real-time features like auto-save and post locking.', '0-day-analytics' ), $details ); } if ( $active_plugin ) { return static::pass( sprintf( /* translators: %s: plugin name */ \__( 'The Heartbeat API is being managed by %s. This helps reduce unnecessary server requests while keeping essential real-time features working.', '0-day-analytics' ), $active_plugin ), $details ); } if ( $caching_plugin ) { return static::pass( sprintf( /* translators: %s: plugin name */ \__( '%s includes Heartbeat API controls. Check its settings to optimize heartbeat frequency if needed.', '0-day-analytics' ), $caching_plugin ), $details ); } return static::info( \__( 'The WordPress Heartbeat API is running at default settings. It sends AJAX requests every 15-60 seconds in the admin area. For most sites this is fine, but high-traffic sites may benefit from reducing the frequency.', '0-day-analytics' ), $details ); } } }