Software Engineering in WordPress, PHP, and Backend Development

Category: Articles (Page 180 of 258)

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

Testing in WordPress: Scenarios and Spreadsheets

Testing software is one of those topics that people often talk about, write about (books even), and evangelize during conferences, meet ups, and so on. And rightly so – testing is one of the most important aspects of building something that’s going to be used by others.

Sometimes though, I wonder if we don’t do more talking about testing than actual testing.

By that, I mean we all understand its importance and I’d venture to say that we’re relatively familiar with the tools that are available for testing, but the act of testing in and of itself is kind of a beast:

  • It requires that you install additional software on to your computer
  • It requires that you learn how to write tests using the above software
  • It introduces more code thus more time into a project which doesn’t always translate well for stake holders
  • …and more

In short, there’s a lot working against it. I get it. Even more so, we talk about all kinds of testing – anything from unit tests to beta tests to release candidates and so on. All of these are important and they all have their place, and testing in WordPress is no different.

That said, there’s at least one method of testing that I think is applicable but rarely employed when it comes to creating themes or plugins. It’s an intermediate step of testing that I would say fits between user testing and beta testing: Use case testing (perhaps there’s a better title for it, but that’s what I have for this post).

Continue reading

Writing Maintainable WordPress Code: Plugins

The comments on this post are closed. Please leave your feedback on each of the respective articles.

Regardless of the type of software that you build either for a living, for a hobby, or for both, one of the most challenging aspects of the field is trying to write maintainable code.

That is, code that’s organized, follows a standard, is easily read, and adapts to change over time as the environment and requirements of the overall software changes.

It’s not an easy task and people far, far more experienced than I am are still talking about how to do it.

Still, that doesn’t mean that those of us who have been working in WordPress for some time haven’t learned some strategies for works, what doesn’t, and what’s proved to be maintainable WordPress code throughout the years of development.

Continue reading

Pragmatism in WordPress: On Agility

Dave Thomas, for those who aren’t familiar, is a notable programmer for both co-authoring The Pragmatic Programmer and for running the The Pragmatic Bookshelf company. In my opinion, he’s a fantastic person to follow if you’re into programming of any kind.

A few months ago, I stumbled across an article that he had written (that many of you have read) entitled Agile is Dead (Long Live Agility). It’s a great read for anyone who’s interested, and though I’m not particularly interested in talking about all of the things his article hits on, there are two specific things that I found relevant to anyone who is just getting started writing WordPress code, or who has been writing WordPress code for sometime and may need a refresher.

Continue reading

Using Ajax in WordPress: Loading Pages

About a month ago, I wrote a post about single page tabbed navigation in WordPress. In the post, I made the following statement:

In some cases, it may be best to load pages via Ajax, in some cases, it’s better to load things up all in the first page load. This particular post is about the best strategies for that (that’s a debate for another post).

And I then I received the following comment:

I am also very interested and awaiting post regarding your take on when to use ajax and when to load it all.

Without context, this is a really broad question and it’s that I don’t think can be answered in a prescriptive way. When you’re trying to paint a solution for web development with broad strokes when each problem is a bit more unique, it’s not easy to provide advice that’s applicable across the board.

But this comment was about a very specific example and a very specific use case.

Continue reading

A Dilemma of the WordPress Customizer

In the past, I’ve talked quite a bit about the WordPress Customizer. I think it’s one of the best features for both developers, designers, and users because of how quickly it shows the user the result of changes s/he is making to their site by changing a few options.

On top of that, the Customizer has two ways in which the preview pane can load the content:

  1. Ajax
  2. Refresh

That is to say that once the user changes an option, the entire preview pane can be refreshed (or reloaded), or the changes can be performed via Ajax and the page never refreshes.

Generally speaking, I think Ajax is preferable to performing a refresh, but I’ve recently found myself working on a project where I’ve had to mix the two, and I’m not really liking it. Chalk it up to a personality quirk, but I have this “all or nothing” mentality when it comes to how the preview pane displays its changes.

Either all of the options should work via Ajax, or all of the options should trigger a refresh but mixing the two feels off.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑