CyberD.org
C:\ Home » Code » The WordPress Heartbeat

The WordPress Heartbeat

WordPress, the free and open-source content management system still used the most of any one CMS on the planet - still growing its userbase and monopoly on the overall Internet share of websites it powers by the year (43.2% of everything in 2022 - which is almost half a billion), has probably managed to maintain said powerstatus thanks to in part an innate simplicity of use, a constantly expanding base of developers plugins and themes, but also because it's managed to balance innovation and compatibility and tradition in an acceptable way.

Though for example you're of course recommended to always have the latest version installed you don't have to - you still have control - which is more than you can say about even as important a thing as your OS.

And when they roll out new and sometimes unconventional features like the Gutenberg template builder, they do cater to user demand and also keep the traditional post editor when not everyone is happy with their new move. Updates are flexible, and both improvements and innovation seem to go through a heavy phase of consideration pre-implementation, but as is the nature of all things that grow and evolve whilst maintaining the same foundation it does also become all the more cluttered, and not all additions are good ones, though of course good is relative...

Like for example the heartbeat. In my humble a not that good addition.

Why? Well because it increases the performance requirements for your platform greatly. It's a feature that allows the platform to speak to WP servers and trigger certain actions on certain events - basically it's an API - that lets you do useful things like autosave your posts. But it does run constantly, and it gets trigged constantly - on both front and back end - and of course this provides significant additional load to your server.

There's no built in way to control this! You'd think they'd allow some wp config options for it if not actual options via the admin panel, but no. It was introduced in 2013 and such features still do not exist, so unless you know about it runs constantly, and shared hosting providers may prompt you to upgrade your plan to allow it.

You can however disable it entirely with a function:

add_action( 'init', 'stop_heartbeat', 1 );
function stop_heartbeat() {
wp_deregister_script('heartbeat');
}

Add that to your functions.php if you wish to.

There's also a handy plugin that lets you limit certain aspects of it too - like for example just front-end triggers - which to me personally are not at all as important as say the back-end autosave functionality. Front-end triggers become all the more resource-intensive if you have lots of visitors too - they just need to keep the page open to continually consume resources.

There are some other services you could use. Paid ones, or the Litespeed Cache, that comes with other benefits. Like... caching.

I settled on the last option myself. Was introduced to it via cPanel just a while back - and it really has a bundle of other useful finesses too! I used Heartbeat Control earlier, but it's outdated, and I'm not sure it works properly for all triggers/times.

Go optimize your heartbeat y'all! Hit the gym. And the admin panel.

Like the man in mantle.

Comments

Keep track of the discussion via rss? Read about comment etiquette? Or type in something below!
  1. biterr
    Friday Feb/3/2023

    You're doing triple bypass on WordPress.

  2. Cyber
    Friday Feb/3/2023

    Ooh yeah, gotta fix that coronary artery so the heart don't bleed!



The Comment Form

Your email address will not be published. Required fields are marked *

Your email is saved only to approve your future comments automatically (assuming you really are a human). ;) It's not visible or shared with anyone. You can read about how we handle your info here.

Question   Smile  Sad   Redface  Biggrin  Surprised   Eek  Confused  Beardguy  Baka  Cool  Mad   Twisted  Rolleyes   Wink  Coin

Privacy   Copyright   Sitemap   Statistics   RSS Feed   Valid XHTML   Valid CSS   Standards

© CyberD.org 2024
Keeping the world since 2004.