It is not tested with multisite. Feel free to post your results here though.
Heartbeat Control does not work in a multisite/network installation. Installed and went through each blog on the multisite to set controls. No effect on heartbeat. I was really hoping this would help control cpu load.
+1 for multisite/network installation too 🙂
thanks
You can try using an mu-plugin (all thanks to Sybre!)
<?php
/*
* Plugin Name: Heartbeat Slowdown [Multisite module]
* Plugin URI: https://hostmijnpagina.nl/
* Description: Lower the heartbeat frequency to reduce http requests
* Author: Sybre Waaijer
* Author URI: https://cyberwire.nl/
*/
function hmpl_slow_heartbeat( $settings ) {
$settings['interval'] = 60;
return $settings;
}
add_filter( 'heartbeat_settings', 'hmpl_slow_heartbeat' );
@maxfein where you add this?
Add it to wp-content/mu-plugins. I named mine heartbeat.php.
Do I have to upload the plugin or this file too?
Also, I noticed that the code above doesn’t close with “?>”
@b_dark
PHP files don’t need to end in ?> nowadays. It’s actually viewed as bad practice.
For more reading I recommend this StackOverflow article which explains why in detail: Why you should omit closing tags
hi
any feed back is it working
so i need to activate the plugin on all the site indepensdantly and then put the php code in mu plugin?
thnaks
I’d added the suggested script to my multisite installation, but I finally realized it wasn’t working and I had to delete it.
Thanks @maxfein!
Copy/pasted the code exactly into a file I named heartbeat.php and uploaded it to /mu-plugins/ within /wp-content/ on my (absolutely massive) multisite installation.
No longer receiving connection errors. Page load has dropped by 4 seconds (it was bad) on the backend. No longer seeing massive wait on admin-ajax.php on site pingdom test.
EDIT: The relief was temporary. I’m still loading quicker, but the connection errors are back. Ouch!