John Jago

Day 85: Redoing Dashify Pro update code

After a while working in a particular software domain, it becomes clear whether something was designed or whether it came to be through a process of evolution.

I’m thinking the WordPress plugin updating system is the latter.

A plugin ecosystem designed from the ground up today might make automatic updates to plugins require only a few lines of code from the plugin developer. Figma’s plugin system is a good case study.

As a WordPress plugin developer, it’s confusing where to even start. The closest thing to official documentation that I could find, that describes how as a WordPress plugin developer to provide updates to your plugin not hosted on, is this announcement.

At first, I followed this guide, which worked well when I tested it.

However, today in another test environment, I came across an error caused by something being a boolean when I wasn’t expecting it to. As is ever so common in WordPress, it crashed the test site.

Not fully understanding why it was a boolean, and not wanting to risk breaking a live site, I went in search of another solution and found one based on the announcement post I mentioned earlier. This code was easy to follow and had less going on, which meant fewer chances that something breaks. I also found a blog post, written only a couple months ago, that went into detail explaining this plugin update mechanism. I’m very grateful this person took the time to write out the explanation. It really did help solidify my understanding.

After this research, I replaced my initial Dashify Pro update code with the newer implementation, and it worked well in my testing environment.

👋 This is my work journal, a series where I write daily about trying to make a living building a bootstrapped software product.