Software Engineering in WordPress, PHP, and Backend Development

Category: Articles (Page 245 of 258)

Personal opinions and how-to’s that I’ve written both here and as contributions to other blogs.

Everything’s An App (Even If We Don’t Know It)

Ever since smartphones have become mainstream, there are apps for almost everything. Prior to this revolution (if that’s what you’d like to call it), we had phones that a had a few [weak] tools on them, but most of our work was done on a computer.

And the computer had software, or computer programs, or applications – whatever you’d like to call them – and that’s how we got work done.

This is likely going to make me sound a bit weird, but for the past few months I’ve been periodically asking people how they define an app. Of course, I don’t ask it like that. Instead, it’s goes something more like:

So, hey, what’s an app?

And nine times out of 10, I end up getting the same response:

A little program (or icon, even!) on a phone.

Some people have responded that it’s also something on their tablet. Fair enough.

I definitely attribute this change in vernacular to Apple. After all, they’re the one’s who started the App Store with the vision that people could create an app for anything.

But what is an app?

From a problem-solving standpoint – not even a computing standpoint – I have this idea that almost everything is an app.

Continue reading

A Two-Phase Production Deployment Plan

For anyone that’s been doing software development for any reasonable length of time – especially for web applications – then you’re likely familiar with Local (or Development), Staging (or Test), and the Production environments.

If not:

  • Local or Development refers to the machine on which you’re actually building the product.
  • Staging or Test refers to the server designed to represent Production, though is only accessible by developers, testers, clients, and perhaps some of the end users to evaluate features prior to the official rollout.
  • Production is the live version of the site. No development occurs on this server.

Most developers who are in the business or closely working with their client follow this particular setup.

In the past couple of months, there have been a few times when a single production rollout has fallen short and ended up either revealing bugs that were not caught in Staging or that did not hold up under Production-level loads.

As frustrating as that can be, I’ve ended up using a sort of two-phase Production deployment plan to help mitigate this.

Continue reading

On Offering WordPress Support and Documentation

WordPess Support

Ah, the stock photo of Tech Support for the entire Internet!

One of the challenges of providing solutions built on top of WordPress is handling expectations of support and documentation. I’m not talking about running a support forum or writing elaborate API documentation.

Instead, I’m talking about providing instructions for how users can manage their site, application, or plugin once you’ve completed work on the project.

Over the past couple of years, there have been a few things that I’ve tried. I’m definitely curious to hear you guys’ thoughts on what you’ve done and what you’ve found to be successful, but first, here’s how I’ve historically handled WordPress support after a project handoff.

Continue reading

Writing Clean, Maintainable Custom WordPress Queries

Recently, I was having a conversation with a fellow developer via email about maintaining a separation of concerns in custom WordPress queries and WordPress templates.

The gist of the conversation boiled down to this:

Is it a good idea to keep custom queries in the template files?

A couple of years ago, I would’ve said yes but as I’ve begun to work on more complex projects, I’ve changed my mind: I’m actually a fan of keeping custom queries in functions.php.

I think that this keeps code more maintainable, cleaner, and easier to read, though I’m not sure if this is the most common practice.

Continue reading

How To Programmatically Create a Category in WordPress

If you're an advanced developer or just want the TL;DR version of this, skip to the code.

The majority of the time that I’m working on a contract project, there’s a need to programmatically create several parts of the website that occur during theme setup. Often times, this includes creating posts, users, and/or setting templates.

Ultimately, the goal is to make the user’s experience as nice as possible: They install the theme and the site, to a degree, has bootstrapped itself.

As with the aforementioned parts of a site, it’s also common to need to create a category, or categories, during theme setup. WordPress provides two ways of doing so, one of which often results in a PHP fatal error.

Here’s how to programmatically create categories in WordPress and do so without generating any errors.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑