Building an Easier Websites Testing Platform with WP Stagecoach

Sponsored by:

In this episode, we get pretty heavy into servers and server setup! Jonathan talks about how he got the idea for WP Stagecoach. We also discuss some of the difficulties with spinning up and simulating multiple server setups, how good coding can go a long way, and much much more.

Show Notes

Joe Casabona: This episode is brought to you by our great sponsors. BoldGrid works as a suite of plugins designed to help you create WordPress sites faster and easier than ever. BoldGrid will improve your workflow by providing direct access to free themes, page templates, photography, design elements, forms, galleries, and much more right from your dashboard. And the BoldGrid page builder allows you to easily drag and drop and edit the content as you see fit all with that having to use shortcodes. To learn more, head over to builtpodcast.net/boldgrid. That’s builtpodcast.net/boldgrid.

Starting a new project? Looking for a better hosting platform? Pantheon is an integrated set of tools to build, launch and run websites. Get high-performance hosting for WordPress sites plus a comprehensive toolkit to supercharge your team and help you launch faster. On Pantheon, you get expert support from real developers, best-in-class security, and the most innovative technology to host and manage your websites. Spin up a new site in minutes with a free account. You only pay when you go live. To learn more, go to built podcast.net/pantheon. That’s builtpodcast.net/pantheon. 

And now, on with the show.

Hey, everybody. Welcome to another episode of How I Built It, the podcast that asks “How did you build that?” Today, my guest is Jonathan Kay of WP Stagecoach. Jonathan, how are you doing today?

Jonathan Kay: I’m doing really well. How are you doing?

Joe Casabona: I’m fantastic. I always, this has been a trend for the last few episodes. I always forget how to pronounce names or never ask how to pronounce names. so I’m glad that you had an easy one. I hope I pronounced it correctly.

Jonathan Kay: You did just perfectly.

Joe Casabona: All right. Great. Does anybody ever say, like, call you JK? Like just kidding, or anything like that?

Jonathan Kay: No. I used to go by JPK back when I ran a computer lab, but in general, just Jonathan. Or, Hey, you.

Joe Casabona: Gotcha. That’s fine, right. Like, call me anything you want, as long as you don’t call me late for dinner. I think that’s [crosstalk 02:29.18]

Jonathan Kay: Yeah, but people don’t get that as much these days.

Joe Casabona: I know, I know that’s ‘cause like, I don’t know, text me for dinner. I don’t know. I don’t know what it’d be like.

Jonathan Kay: You don’t have the kind of sit-down dinners anymore. 

Joe Casabona: Yeah, I know which is like, that’s my wife and I have agreed that when we have kids, like, we’re definitely going to do that. No phones at the dinner table, like very traditional.

Jonathan Kay: So good luck with that.

Joe Casabona: Thanks. Yeah, we say that. We don’t have any kids yet, so we’ll see what happens. But today we’re talking about WP stagecoach, right? So, why don’t you tell us a little bit about you and your product, and how you came up with the idea?

Jonathan Kay: Well, my background is in systems administration. I’ve been doing that since the mid-nineties with Linux and Unix servers. A little over 10 years ago, I started doing this freelancing and it’s been fantastic for exposing me to lots of new environments and new problems that need solving. And it’s really been fun to have new challenges come up and I can write something that fixes this problem and I can read something that fixes this problem. And it’s really generally very rewarding to be able to do that in a very, not always timely manner because problems are complicated, but you know, it’s a very small environment and it’s fun to be able to solve a problem like that. 

Several years ago, my partner started doing WordPress theme development and because I run a whole bunch of servers, I set up hosting for her and a development environment for her.  And to put a long story short, I wrote a product called WP Stagecoach. And what it does is the plugin that you install on your WordPress site. And once you install it, you sign in, you click a button and it goes through and it makes a copy of your website and transfers it to our servers and sets up all the DNS, all of the tarring, all of the database, it does all of that for you. So you just get to click a link at the end and bam, there’s a copy of your website for you. You can go play with it, you can go break it, you can go have fun with it. You don’t have to worry about it messing with your life sites. It’s a great, great thing to have. And once you’re done editing it, and playing with it, breaking it and you’re happy with how it looks, you can go back to the plugin on your live site, click another button. It says “important”, and it brings all the changes back for you. 

Joe Casabona: That’s, I mean, that’s fantastic. So basically it’s a plugin that spins up a staging site for like a staging site in a box, right?

Jonathan Kay: Yes.

Joe Casabona: Which is,  it’s something that a lot of people, a lot of freelancers I will say, and I’m generalizing because I, when I was a freelancer, I didn’t do this very often and it wasn’t easy. When I was a freelancer either, a lot of freelancers may skip the staging part, right? Or may not do it proper like I used to have this one local install that was just whatever site I was working on at the time. That was the, it was the staging site for that.

Jonathan Kay: Yeah, I’ve seen that before. No, it’s a hard thing to do quickly, especially. And given that my partner was a freelancer and we hung out with a lot of freelancers, other freelancers, or developers, that’s what the initial target audience was for. So the basis for the idea came from 2013, where WordCamp here in Seattle, I was talking with, you know, just people as you do throughout WordCamp, then I had more than half a dozen people ask, “What do you do for staging?” And I said, “Well, you know, my…” I explained, my partner has these,  you know, does this development and I have these servers for her. And rather than, you know, spin up a new WordPress installation, every time she had a new client, I wrote a script, you know, so that it wasn’t your installed WP, the name of the WordPress site you wanted and started a whole bunch of scripts that did a whole bunch of things for her, you know, creating sites, deleting sites. 

When we moved into production, I wrote a script to handle that. If we needed to move it to a different server, you know, for a different environment, I wrote a script to do that. So I had all of these scripts that I had written to run on our personal little infrastructure. And so I explained this to other people and everyone who I talked to said, “I need that.” And you could see their eyes get big. And they started drooling and I said, “Huh! This might be something I could do.” You know, take these and change them and release them publicly.

Joe Casabona: Yeah, that’s awesome. So this actually segues perfectly into the second question I usually ask, just which is what kind of research did you do? It sounds like going to WordCamps was the kind of market research you did, right?

Jonathan Kay: That was kind of the final straw that made me say, “Okay, I really should do this.” Like I mentioned, we’ve hung out with a lot of freelance developers as well before this. And just you kind of, at that time, the WordPress world staging was a really big deal, you know, WPEngine had it, but I think they were about the only one that did. So, you know, everyone needed it and no one had it. So it seemed like a great opportunity to take these things that I had written for a very small confined environment and open them up to the world at large. And that presented a lot of problems but, I can get into that later.

Joe Casabona: Gotcha. I mean that that’s great. And I think it’s something that a lot of, you know, it’s certainly something that I don’t know anything about, right? like server administration, I really just need to push a button and have a new thing that’s exactly like the current thing. 

Jonathan Kay: Yeah.

Joe Casabona: So that’s great. And you mentioned that it spins up a new instance on your servers, Is that right?

Jonathan Kay: That’s correct.

Joe Casabona: Gotcha. Maybe we can touch on some of the challenges you would have had spinning it up on whatever hosting environment your user had, right?

Jonathan Kay: Yeah. Basically, you have, as a developer who’s written a plugin to run on someone else’s server or website, you have almost no control over anything there. You’re at the whim of the web host. You know, if a web host has really, really slow IO, it’s going to take forever in a week to spin up the site because you have to both write and read, and write the contents of the Website. You don’t have any control of how over, what goes in and out of the database server. You don’t have any control if you break something badly enough, you can destroy the live site, which is a big thing I wanted to completely get away from. It’ll take some work, but you could do it. And so I decided pretty early on that running them on my servers would give me all of the control I needed to be able to serve, you know, good quality, you know, speedy, reliable staging sites and track all of the changes that I needed to make imports possible. And that would be something that’s again, quite hard to do in a timely manner or a reliable fashion in someone’s life. You know, $3 a month shared hosting. 

Joe Casabona: Yeah. And that’s a really great point, right? You could be dealing with, I mean, 25% of the web, you could be dealing with, you’re probably actually dealing mostly with those smaller accounts, right? Because like, as a, I have like a go geek SiteGround account and they have staging servers, right? But DreamHost like a single dream host account might not.

Jonathan Kay: Right. And we actually have a fair number of customers from other hosting companies that have their own staging solution, but the flexibility of ours is generally higher than theirs. And so we have quite a few customers from those people who prefer our staging solution to the built-in hosting one.

Joe Casabona: Man, that’s great. And we’re going to get into the details of why in a few minutes, but what I want to ask you next about, kind of, you’ve talked to freelancers, you went to WordCamps and talked to some hopeful customers that are saying they need this. Do you talk to any other business folks? Are you part of a mastermind group? You know, how do you make the, who do you talk to, to help you make the business decisions?

Jonathan Kay: I didn’t actually talk to that many people about it. Like I mentioned, I’ve been running my own freelance business since 2006. And so I’ve talked to a lot of mostly small and medium-sized business owners in the course of my work with them about what their expectations are, what they need and want. And as far as translating what the, you know, small business owners need from a product, I thought it was pretty straightforward to say, “Okay, I have some reasonable assumptions I can make about what is the correct thing to do for a given situation.” You might know data integrity is very high, I know security is very high, and these were things that I built into the very basic basis of WP Stagecoach. Mostly I just thought everything out very thoroughly. I know it was very meticulous about how I am going to create this and I didn’t get a whole lot of feedback from, you know, kind of, as you say, other business people. Mostly it was, you know, what do I need out of it? And what do customers need out of it? 

Joe Casabona: Gotcha. And I mean, so that’s like the stuff you already knew, which has maybe the best kind of research, right? The things that you’ve, the experience that you’ve gained over the years of freelancing is the thing that drove you that was kind of the main driver and that’s absolutely… 

Jonathan Kay: That’s a fantastic way to succinctly wrap that up.Thank you.

Joe Casabona: Okay. Well, thank you. I mean, I appreciate that. So cool, very cool. Let’s talk about the fun bit, right? How did you build WP Stagecoach? And this could be like tools, coding methods, design decisions. Whatever you want to talk about here is fine by me.

Jonathan Kay: Well, design decisions are not my forte, so I’m really glad that I had my partner in a fantastic design agency to handle all of that. But as far as the technical stuff, that’s my forte. That’s always been my, you know, I love the nuts and bolts of how things work, not just with computers, but with the world at large. It’s just a fascinating thing to look at something and think you ponder through how exactly does that complex mechanical contraption works? And I can usually come up with a pretty good idea. It’s not always right, but a good idea of what’s what makes it work.

Joe Casabona: Nice. Have you ever been to Disneyland or Disney World?

Jonathan Kay: Yes, but I was pretty young. I don’t remember it.

Joe Casabona: You should go back as an adult because my favorite thing to do while I’m there is figure out how they make some of their rides work.

Jonathan Kay: Interesting, okay.

Joe Casabona: Yeah. So, sorry to interrupt you though.

Jonathan Kay: No, no. It would be interesting. Certainly, yeah.

So as I mentioned, we had an infrastructure with these shell scripts that I had written to make my partner and our subcontractors’ life’s easier. And after this WordCamp, I literally came home and made a copy of all of them and put them on a new server and kind of rewrote them so that they didn’t need command line input. I wrote them, read with them so that I could attach them to a web server and the webserver would take commands and run the scripts. And then I wrote just a really tiny shell of a plugin for WordPress that went and talked to the webserver setup. And that was the basis of it. That was just, you know, a really rewarding, satisfying, quick, and easy thing to do that said, “Okay, this may be complicated but it’s not impossible. This is something I can do.” So I threw all that away and started over from scratch. And, you know, again, like I thought through, Okay, what are some of the common pitfalls I’ve seen over the years of, you know, problems with security, with reliability, with extensibility. And I really put those three things, at, you know, the top of everything. I’m making every decision I made while building Stagecoach. So I, pretty much all of the aspects of how it controlled everything is written into or controlled by a single API server or you know, a group of servers if I need. Those are really locked down, you know, they don’t talk to as many people and the infrastructure that they talk to will talk to no one except the API servers. So that way, that kind of takes a big load off of worrying about, you know, script kitties and port scanning and all this sort of stuff. 

Joe Casabona: And just a quick sidebar, right. Script kitty is essentially somebody who’s writing like a malicious kind of, sort of script, right?

Jonathan Kay: Typically script kitties are not even the people that write the scripts. They’re the kids who go on, whereas sites and, you know, find, you know, leaks or hacking script number 512 and they download it and they run it. And when nothing happens, they’re like, well that wasn’t any fun or they crash a whole bunch of websites and go “weeee!”.

Joe Casabona: Gotcha. Cool, very cool.

Jonathan Kay: So throughout the, both the conductor, which is what I call the API server because it orchestrates everything in a stagecoach environment, it does a lot of air checking with both the data that’s given and the data it gives back out so that, you know, you always know, or it always knows that it’s working with reliable and good data.

And again, when it talks to the staging servers, Which is where all the staging sites are hosted. Those again, the staging servers themselves, will, you know, make sure that all the data they’re receiving is good and all of the data they’re giving back is good and reliable. And if something goes wrong, it throws up a flag and says, “here’s a problem. Here’s how I ran into it. Here’s what I was working on.” So that makes looking into problems a lot easier and it makes a lot of time I can. If it does happen, an error does come up, I can write an exception for that and say, “Okay, well that didn’t work. So let’s try this.” And I can’t write a case for every single possibility, but there tends to be again, after running this for a while, I found that there tend to be, you know, a handful of problems that we run into and I can pretty much write a script or a solution to each problem that comes up from that.

And as far as extensibility goes, I had no idea what sort of traffic we were going to get when we launched. And again, given my clients, I in the past with my freelancing, I’ve had, you know, sites that get, you know, tens of thousands of hits every hour. And so I wanted to be prepared for whatever might come. So extensibility was a really big thing on my mind. So each part of the infrastructure is ready to be, you know, extended. It’s very modular, you know, you can take out a piece, replace it with a new piece or you know, a dozen new pieces if need be. So, you know, that’s sort of non-intervention with my goal as much as possible. You know, I want my servers to do my work for me, and that’s always my goal as a freelancer and I really want that to be my goal here.

And kind of ongoing work that I have to do for all these, you know, for all the infrastructure. Like I think I mentioned we do have a bunch of staging servers and so those do require maintenance. One of the things that we do with all the different staging servers is one balance load. But two, we try to provide the best closest matching environment to the live site. So, you know, if you’re running on a patchy 2.0, with my SQL 5.6, you know, we have a staging server that has that and PHP 5.3 or whatever. So we try to make sure that there’s a staging server that matches your live site as closely as possible. And that’s one of the things that while it’s creating or while the live site is going through the process of creating the files that are then transferred to the staging server, it talks to the conductor and says, “Here’s what I’m running” and the conductor says, “Okay, I’m going to go check.” You know, this version PHP is my SQL, this Apache, and then picks a staging server based on that and routes it all through there.

Joe Casabona: Man, that is fantastic. Like that was, I was wondering about that, right? Cause I mean, if someone’s running PHP seven, obviously putting them on a, let’s say 5.4 servers is not going to work, right? So, or maybe vice versa.

Jonathan Kay: Both ways.

Joe Casabona: Definitely vice versa. Yeah. So that’s really cool. So you have like a set of staging servers, essentially that you’re at. And, so forgive my line of questioning here if it’s like not the right terminology or whatever, but I assume these aren’t physical boxes, right? Are these the virtual machines that you have running?

Jonathan Kay: They are virtual machines, yes. But again, given my background in freelancing and working with most local companies here in the Seattle area, I do have a physical rack at a fantastic data center. A bit north of town and that’s where the vast majority of this infrastructure lives.

Joe Casabona: Cool, very cool. So that man, that was a lot of really great information, especially for people who, you know, just want to click a button and it magically has a box spun up, right? That was, or at least I found it very interesting. And I kind of like the whole, the full-stack as people say. So, we talked a little bit about this but maybe you could talk about maybe the major milestones,  as far as the transformation has gone, right? Like, what is the big things that have changed between your first version of WP stagecoach and now?

Jonathan Kay: Well, it depends on what you consider the first version. You know, the alpha version was the first version I released to the public. And that was the second major rewrite or rewrite from scratch. And that was where I had a lot of the infrastructure concepts in place. You know, I had the conductor, I had the separate staging servers and, you know, I had kind of worked out how I wanted things to happen. You know, the staging server uploads directly to, or the live site directly upload the files directly to the staging server so that, you know, for example, if web hosts want to run, you know, a staging server in their own data center, it doesn’t have to transfer the files to the conductor and then back to the, their own server. So I had gotten most of that. Most of that is written out in the alpha plugin.

And the beta plugin was again, a rewrite where it was just trial and error. You know, I saw a lot of problems that stemmed from choices I made in Alpha. They tended to be around the reliability of web hosts, the alpha version. One of the things that PHP can do is a command called ‘exec’ and basically, it says “PHP,  go run this command directly on the Linux system.” So for things like Tar and your, my SQL dumping the database, that’s incredibly, incredibly fast and made for, or a much better experience rather than you relying on PHP is Tar and going through and dumping the database by hand with PHP.

Joe Casabona: Right. You might also avoid like a timeout issue as well, is that right? 

Jonathan Kay: Yeah. And that’s actually a really good one. I believe I did implement a step-based system in beta where you know, in the first step, it goes and talks to the conductor and figures it out. You know, where it’s going to go then it dumps the database. Then it finds all the files that need to back up or transfer. Then it tars them up and then it transfers them and then talks to the conductor again and says, “Everything’s there. Go make this happen.” And then kind as things have progressed, I’ve had to break up certain parts of that into multiple smaller steps.

Again, we have seen, probably some of the worst of the web hosting on the web running this service. It’s really interesting seeing, you know, Apache one, three servers still out there in the wild and it just isn’t for everyone. And Apache three went out of maintenance like hasn’t been supported in 10 or 12 or 14 years is a long time.

Joe Casabona: Yeah. Wow.

Jonathan Kay: So most of the changes have been based on issues that come up around slow or unreliable live production servers, web hosts. And there’s nothing I can do to control those. I just have to be responsive or reactive and work around the new challenges they present.

Joe Casabona: Gotcha. Cool. So, and that’s very, very interesting to me. It’s something I’m definitely not, I’m definitely glad I’m not doing it because I don’t have the mind for that. But maybe with the last or banging up against time and maybe what the last couple of minutes we can talk about, you know, big plans for the future. And then I always end with the same, the same question too, so.

Jonathan Kay: So, for the future, I’m working on a couple of new workarounds for web hosts and that’s definitely going to be a continuous process. But there’s a big one that I’ve been working on for a while. 

Joe Casabona: Gotcha.

Jonathan Kay: And also, at some point, I would like to start adding features to kind of differentiate the different customers we’re going after. We, you know, developers versus freelance developers and freelancers versus non-devs versus, you know, things like web hosts, if they all have their own unique set of packages or set of features that they, you know, help them out.

Joe Casabona: Gotcha. Gotcha.

Jonathan Kay: Now, at the risk of upsetting, maybe a couple of my sponsors, what’s the toughest web host to work with? I think for all of them, it comes down to a server-by-server basis. You know, every single web post has that one overloaded server and whether they realize it or not, you know, everyone, the web hosting industry is very, has very small margins they have to push their service to the limit.  But you know, from what I’ve seen, a lot of them do tend to neglect IO, you know,  disk input-output as one of the things they tend to skimp on.

Joe Casabona: Gotcha.

Jonathan Kay: And I would love to see that turnaround. I was hoping with SSDs becoming so commonplace. We’d see less of that, but I know a lot of them are still running on network sands, storage tech, storage area networks.

Joe Casabona: The hard drives with physical moving parts, as opposed to not so much.

Jonathan Kay: As opposed to SSDs, which are just flash memory, yeah. So I’d like to see what it says to use in production.

Joe Casabona: Gotcha. Cool. Well, that was a very diplomatic answer and I appreciate that. So the last question I like to ask is, do you have any trade secrets for us?

Jonathan Kay: Not really trade secrets per se, but just the overwhelming need for all developers everywhere to follow best practices and standards. We’ve seen so many problems, themes, and plugins that are a problem because they don’t follow the best practices. You know, storing all of your data as transience just is not a good idea. And you know, those best practices and standards are there for a reason. You know, they make your plugin or theme transferable. They make it work in a wide variety of environments and they make transferring around a lot easier. So follow those standards, follow those best practices. 

Joe Casabona: Awesome. Well, Jonathan, thank you very much for joining me today. I really appreciate you taking the time.

Jonathan Kay: It’s been an absolute pleasure.

Joe Casabona: Hey everybody. I want to tell you about a new book I wrote with my good friend, Matt Medeiros of Matt Report, called the Podcast Starter Kit. It’s a QA-style book that tells you exactly what you need to get up and running with your own podcast. 

I’ve had lots of fun over the last several months with How I Built It and I want to share what I’ve learned with anybody looking to start their own podcast.

In the book, Matt and I try our hand at answering 23 questions that you need to ask yourself before you get up and running. We also include several resources, our favorite equipment, and a checklist at the end. Head over to the podcastbook.com to check it out. It’s only $24 and it’ll save you hours of time researching the right tools, where to upload your podcast, how to run a good interview, and a lot more. That’s the podcastbook.com. 

Thanks so much for listening, and thanks to our great guests and fantastic sponsors. If you liked the show, please rate it and subscribe on iTunes in Google Play or whatever your podcast app choices. If you have any questions, be sure to reach out at streamlined.fm.

And finally, until next week, get out there and build something.

One Comment

Leave a Reply

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