Dashboard Changelog

I recently moved my site to a new host. And I’ve also added my partner’s site to the WordPress multisite stack running this site and a number of others on this domain and chrisreynolds.io. Previously she was using WordPress.com, but was frustrated by a lack of adequate support and persistent caching bugs that even I couldn’t resolve without burning all the locally stored caching data to the ground.

As I’ve been adding things to help support her site, one thing occurred to me that might be useful: a dashboard widget that displays all the recent updates to the site.

Now, part of the migration included moving the code onto GitHub. Previously, my host was Pantheon, which uses Git out of the box for managing and version controlling code. Very little of my site is custom — just a couple plugins — but most things on the site exist as WordPress plugins or are repositories on GitHub already, so Composer was something I was already using. Using GitHub and Composer to manage the code seemed like a pretty easy solution.

I started thinking about how to manage update notifications and the idea of using GitHub releases seemed an obvious entry point. What if I could get an RSS feed for all the releases and simply create an RSS widget on the dashboard that displays what those release updates are? On reflecting on it a bit, I decided to look into the GitHub REST API because RSS is kind of old news.

Dashboard Changelog is the result of this thought experiment. It adds a setting that is configurable from your WordPress General Settings page to define what repository you want to use. By default, it uses Releases, but the specific endpoint you want to use (like Tags) can be configured using filter hooks (though there may be other code customizations required if you’re not using the Releases endpoint, because the data structure may be different). All the API data is cached for 24 hours, so you’re not making a ton of API requests, and the 3 most recent releases are displayed in a dashboard widget (a number that is also configurable in code using a filter hook).

Additionally, a global constant can be used to define the repository for the site (or multisite network) if you (like me) want to specify the repository in a wp-config file or display global notifications on all sites on a multisite network without having to configure each one individually.

Is this universally useful? Maybe not. But If you find it helpful in whatever you might be working on, or fork it and hack something similar, I’d love to hear about it!


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.