Software Engineering in WordPress, PHP, and Backend Development

Tag: WordPress (Page 83 of 219)

Articles, tips, and resources for WordPress-based development.

Pragmatic Development in WordPress

Pragmatic development in WordPress is not a phrase or a term that I’ve found, read, or that exists (to my knowledge) outside this particular post. The idea has come from two sources:

  1. The Pragmatic Programmer by Dave Thomas and Andy Hunt,
  2. And a couple of projects that I’ve been working on recently.

I want to use the standard definition of “pragmatic” before I get into the rest of this post:

dealing with things sensibly and realistically in a way that is based on practical rather than theoretical considerations.

With that said, I think there are a few things we can learn from this as it relates to applying pragmatic development in WordPress projects.

Of course, this raises the question of what type of situations calls for this?

Continue reading

Improving WordPress Resource Requests

A couple of weeks ago, I talked about WordPress resource requests and how there’s a level of performance with which we have to comfortable when we’re building solutions on top of the application.

In the post, I shared a comment by a friend (who no longer works within WordPress, but did for several years):

And the fact that it doesn’t min / cat files instead of [25] network requests is just plain dumb. And when a person has 23 plugins, that’s 26 files not even including the theme and core.

And now, just as I did then, I don’t disagree with him. But after sharing the post, several different utilities were shared with me each of which aiming to improve this problem.

JJJ‘s WP Enqueue Masher – a fork of an Automattic project – does exactly this.

Continue reading

Using a PHP Autoloader in WordPress

If you’re using namespaces when working on your WordPress plugins (or whatever project you have going on), then you’re likely also taking advantage of a PHP autoloader.

PHP Autoloader in WordPress

Though this post isn’t really meant to be a tutorial on how to use them (I have another one of those coming up later), here’s the gist of what an autoloader is (or does):

One of the biggest annoyances is having to write a long list of needed includes at the beginning of each script (one for each class) … By registering autoloaders, PHP is given a last chance to load the class or interface before it fails with an error.

It’s a feature that, if your environment supports it, should be used. But I digress.

The point of this post is how to combat the potential problem you may encounter when using a PHP autoloader in your code and alongside other plugins.

Continue reading

Debugging WordPress (The Right Way)

Debugging WordPress projects is one of those things that WordPress developers seem to approach differently.

Though there are certainly different ways to do it, I’m of the mind that using a debugger is the most effective way to, ahem, debug a project. I’m not saying that to try to be a purist, but the benefits of using an actual debugger far outweigh the alternatives.

But in WordPress, it seems that using facilities built into PHP are far more prevalent than using software specifically designed for debugging.

Sometimes, I think this comes with the nature of looking at other peoples code, and sometimes I think comes from not knowing where else to start.

But if there’s one thing that can not only help you become better at debugging projects and understanding source code, nothing can top debugging WordPress projects with an actual debugger.

Continue reading

Ajax in WordPress: The Client-Side Ajax Protocol

A client-side Ajax protocol is arguably more about parsing the response from the server than it is implementing actual functionality.

This isn’t to say that as the server-side protocol mature, the client-side won’t as well. But, often, what changes on the server is what will dictate change on the client.

By that, I mean that if we’re to introduce a new message in the protocol, then it will be first added to the server-side protocol and then the client-side protocol will need to support it. Rarely will it happen the other way around (at least in the types of projects that are built on WordPress.

With all of that said, how do we support the protocol in JavaScript (or on the client-side)?

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑