Journal

Focus WordPress
Theme Client Projects

So far, for Silver is Gold, I have been making all my edits to the live site behind a “coming soon” landing page. This has been quick and easy for getting my bearings and trying to learn WordPress, but probably won’t be the best approach long-term for a production site. Since I’m looking to switch our core job board plugin to WP Job Board and rework the theme, now is a great time to make a change!

I figure there are really two related but separate issues I need to research - how to implement a WordPress development lifecycle, and how to develop for WordPress locally.

WordPress Lifecycle

For a proper lifecycle, I’m thinking that there would be some kind of local environment for building, followed by testing, followed by deployment to a staging site, and finally followed by deployment to the production site. For sample data, the production site database could be cloned to the local environment and the staging site for verification against real data, or I could use dummy data meant to hit certain criteria.

For personal projects, I love using GitLab’s CI/CD pipelines to test, build, stage, and deploy my code. I’m not sure if I’ll be able to achieve this kind of workflow, but I’m very interested to see what’s possible.

As I’m writing this, I’ve poured over quite a few articles, and some of them are beyond where I am or what I’m familiar with so far, so I’ll include and organize some of the more useful links here for future reference and try to highlight my takeaways from the content in a relevant header below.

Staging Site

Plugins

  • WP Stagecoach (paid)
  • WP Staging (free stage but paid push to production)

It looks like I can manually configure the staging, but the article above states that it is messy and not recommended. I’ll have to look and see if DreamHost has good options for this natively.

Looks like I need to create it manually after all! DreamHost is pushing their premium DreamPress service, making me question if I made the right choice selecting them as the hosting provider over Bluehost. WordPress services seem to be where the money is, eh?

The article recommends creating a “dreamhosters” subdomain to use for staging. Looking through the Dreamhost portal, though, it appears like we should have up to 5 subdomains with our hosting! I went ahead and tried to add the staging site, and it looks to be in the process of being added, so I might try to use this subdomain for staging.

One concern I do have about a subdomain on the same server would be if pushing the changes live might interrupt or cause issues with users interacting with the site. I suppose this could be counteracted by having maintenance downtime, but that may be a question for a later date.

From some articles I’ve read so far, it sounds like things can get pretty messy when it comes to making everything work and talk together. For the time being, I’m more than content with manually managing the pipeline, just as long as I can implement something! I think I have some GitLab scripts to help me to deploy files via FTP servers for files hosted on Firebase, so I would imagine that I could modify and repurpose that here, as well.

Developing Locally

Developing the site locally provides a lot more stability to the live site and thus the users, so avoiding disrupting the accessibility of the live site will be a priority. Additionally, developing locally means that my site performance will not be limited by my internet connection, and should ideally make my experience more responsive, which would be great! Some of the WordPress plugins are exceptionally sluggish, and opening the page editor always lags, so the time saved going back and forth would probably add up quick.

To run WordPress, we’ll need PHP and MySQL, and some way to host the server locally, like Apache. With a quick search, it appears that XAMPP is a popular choice and includes everything we need but WordPress itself:

I am a little concerned, as I have old projects running on localhost with Apache that are already a little wonky, and I don’t want to spend more time on this than I have to. I could use VMs, but that seems like it’s over-complicating things, too, and I’m not entirely sure how that’d work with networking.

Local by Flywheel looks very interesting, but I’m a little confused by some of the wording. It seems like moving files around may have a dependency on Flywheel or WP Engine, which are paid services, but maybe not? I may grab it to play around with. If it works, then that’ll be awesome, but I should dig further as I’m sure this issue has been solved without relying on a tool that is so specific.

Honestly, until I have some more mileage on WordPress, I’m hesitant to commit to paying for services if I don’t have to. This project is volunteer work and my personal finances are tight, and similarly I don’t want to commit the client to paying for more reoccurring expenses than they have to with a business model that hasn’t been tested against the market and is not yet generating revenue.

There it is, Docker! I’m glad I ran into this. I’ve seen people mention Docker, but haven’t looked into it and now is a great time. It looks like Docker runs containers which are almost like a much lighter VM, where the OS is emulated as a process, rather than on virtual machines where the hardware is emulated and a complete OS runs within the VM.

Docker images get built into containers, and are essentially instructions on how the container gets built. Similar to how you can have a package.json file for a React app and use Node to grab and assemble everything you need to compile the app, the Docker images can be modified and built up in layers and then shared for other people to assemble into the exact same environment.

This seems great for keeping my local environment cleaner and for making the source code of this site accessible to other developers in the future. It also reduces some of the hesitation with digging into something new, as I could build up a quick container on whatever base it requires, or possibly find one that is ready-to-go in the Docker Hub community.

There’s a lot to learn, and I’ll need to revisit some of these videos a few times, so I’ll include them here:

Docker

Workflow

Bedrock

Through my search, I also encountered Bedrock, which is a boilerplate for WordPress and modifies the folder structure to better expose areas where I would be developing. This sounds helpful, and the folder structure seems much cleaner. It might be more of a tear-up to switch to using Bedrock, so this might be secondary after I get a working pipeline in place.

Reflection

Going into this, I definitely assumed that there would be a more obvious path to do what I wanted to do. I still don’t know if I’m on the right path, and I’m a little bit discouraged to have taken so much time but still not solidified a workflow.

Exposure to new options, concepts, and honestly just learning what’s out there has been good. Of my immediate technical network, no one has much experience with WordPress in general and I’m beyond everyone’s realm of expertise. Before reaching out to a wider audience, it’s on me to make sure I do my research as best as possible before I go bugging people for information. There has certainly been no shortage of information out there!

Time Breakdown

Over the past few weeks, work has been exceptionally busy with multiple projects and customers with downed systems in the field, so I ended up pulling a few late nights. We also experienced a loss in the family and have been helping and supporting where we could. Between work, family commitments, and time-sensitive plumbing issues, I have been mentally tapped out.

Not having the bandwidth to make progress is frustrating, as it forces me to to confront that while this is something that is extremely important to my goals and commitments, it is ultimately a secondary task. The landscape of my time looks completely alien to what it was like a year ago, with many more competing priorities in different areas of my life. It will be nice to get back to actually just working on the site itself, and not the production pipeline, as helpful as it will be to have in place.

We’re taking a quick trip away soon to try and decompress a little. My personal goal is to have something in place before we head out.

Same as last post, here’s a breakdown of my time:

  • 5/10
    • 2h
  • 5/16
    • 4h
  • 5/17
    • 6h
  • 5/20
    • 3h
  • 5/21
    • 1h
  • 5/23
    • 5h

Tasklist

  • Research how to stage WordPress sites
  • Research ways to develop on WordPress sites locally
  • Upgrade my computer
  • Install Docker and familiarize myself
  • Get WordPress running locally
  • Pull down a copy of Silver is Gold and host it locally
  • Push up a local copy of Silver is Gold to Staging