WordPress Heartbeat API: An Introduction

If I were to mention to a casual WordPress user something about the WordPress Heartbeat API, most would have never even heard of it, much less know that it’s been in WordPress since version 3.6(!) with very little fanfare.  But, as it turns out, the Heartbeat API has gained traction in the developer community, as people are starting to utilize it to create some amazing plugins and use cases for WordPress.  With this newfound popularity, I thought it would be great for us to dive into the WordPress Heartbeat API and see exactly what makes it… tick (see what I did there?)

What is the WordPress Heartbeat API

Heartbeat (not to be confused with Heartbleed) can be described, at its easiest, as the pulse of your blog.  Like a literal heart, your blog has a steady rhythm that it keeps running in the background as users are surfing the site.  At certain point, and if certain conditions are met, you can trigger actions onto the Heartbeat.  It’s a continuous conversation between a user’s browser and the server.  Unlike a lot of these technologies, the WordPress Heartbeat API can be accessed both by PHP _and_ by Javascript (and, conversely, Ajax!).  This brings a whole slew of options that we can hook into and do some really cool things.

Plugins Utilizing the WordPress Heartbeat API

Here’s a list of the ones I’ve found that work well on the front-end that utilize the WordPress Heartbeat API:

…and that’s it.  Really.  There are quite a few that use Heartbeat on the back-end, but these are the ones that utilize it for “forward facing” items such as store stock and notifications.

To be honest, I feel like there’s a huge gap when it comes to the Heartbeat API that goes beyond lack of utilization – there seems to be a lack of understanding as to what it does.  Documentation exists, as do a few tutorials, but there’s an opportunity for someone savvy in WordPress, Javascript, and AJAX to come in and completely dominate using this technology.

Of real interest is the WP Heartbeat Notify, which is designed as a template for other plugins.

So, if you’re a developer and want to tinker with one of WordPress’ most underutilized features, I would look into the Heartbeat API.  There’s tons of potential there, but with such little integration there’s a golden opportunity for someone with the right idea to come along and crush it.

Our Specialities

Web Design & Development

From an idea and some notes to a fully functioning website, if you can dream it, Mitch can design and build it!

Twitch Marketing

We show you how to work with the most interesting content creators on the planet - Twitch streamers!

Social Media & Marketing

We give you the tools, training, and resources you need to get your story told on Twitter, Instagram, and more!

Brand Identity Design

A new logo, color palette, or even an entire style guide - we can help with a brand new brand (and the resources to keep your assets in line!)

Content Strategy & Creation

Want to start a podcast? A YouTube channel? A Twtich stream? Take it from an old pro - you've come to the right place!

eCommerce Consultation

Whether it's a digital service or a physical product, we can get you up and selling quickly and easily!

Community Management

Find your tribe and make them your rabid fans. Mitch can help with the technical ins-and-outs of it all!

Contact Greyhawk Digital