CaptainCore Update #34 – Kinsta Experimental API 🧪

It’s been a little over a year since the last CaptainCore update. Personally, 2022 was the year of hitting the limits of what’s possible without an API. The two most time-consuming tasks were dealing with SSL renewals and PHP 8 upgrades. My primary host provider Kinsta doesn’t currently have an API for their platform. So with that in mind let’s dig into a few things I did to help ease some of that pain with CaptainCore.

Automating Kinsta SSL renewals, again.

CaptainCore can talk to Constellix which I use to manage DNS for the majority of my customers. Last year I wrote a robot in my email client to trigger a CaptainCore webhook which then talks to Kinsta over an experimental API and then performs the needed DNS updates. You can read more about that here: Email Robot Handing DNS Updates. With over 1800 DNS zone under my management automating the handling of these SSL verification records through automation was a requirement. Kinsta has just implemented their solution for this renewal situation which they are calling Pain-Free SSL Renewal. It looks like we’re finally getting past these manual SSL renewals. 🥳

PHP 8 upgrades and looking to the future.

The big task was upgrading all my customer WordPress sites to PHP 8. Part of my strategy was to reach out to Kinsta support and have them bulk upgrade all 1500 sites. This script ran in the middle of the night during a maintenance window. A few hours later I had downgraded 300+ sites back to PHP 7.4 due to a PHP compatibility issue that my monitoring discovered. Patching those remaining 300 sites was an adventure. There were a few sites that I decided best to keep on PHP 7.4, those I moved to Rocket.net.

What does all of this have to do with CaptainCore? The PHP updates have taught me a few things. Future updates need to be more automated. The whole process, upgrading to PHP 8.0, checking for PHP fatals, downgrading if PHP a fatal is found, and logging the errors, all needs to be automated. This isn’t something CaptainCore can currently do however something that needs to exist before PHP 9 or some new breaking change in PHP.

Here are a few other highlights from 2022

  • Expanded Hover.com domain integration to cover nameservers
  • Added outstanding payment notice, which was one of the last things WooCommerce Subscriptions used to be handling.
  • Various PHP 8 compatibility fixes, yep even my own plugin needed a few patches.
  • New Kinsta Experimental API – This allows me to create sites from CaptainCore without touching MyKinsta. When you’re creating new sites every week this is a huge timer. I’m not going fully explain how I pulled this off as it’s a bit unorthodox. Plus, you can always read my code. If Kinsta ever comes out with an official API this crude integration will quickly be replaced by the real API.
  • Added initial support for Rocket.net, which I’ve been using for a few customers since WordCamp US. I plan to expand this integration to do all of the things, right now it’s pretty limited. Rocket.net has a fully functional API which has been awesome to work with!

The last few weeks I’ve been working on several fun additions. I’ll cover them in my next update as this one is long enough. For now here are a few screenshots showing the Kinsta site creation from CaptainCore. It’s pretty wild to see it in action.

Creating a Kinsta site within CaptainCore
CaptainCore background activity while waiting for the Kinsta site to be created
A look at MyKinsta during site creation.
Site in CaptainCore after it’s been created at Kinsta. All details are pulled in automatically.