Software Engineering in WordPress, PHP, and Backend Development

Category: Articles (Page 77 of 258)

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

Why Bother With Autoloading in WordPress, Part 2

In the previous post, I covered a few points as to why I think that include_once, require_once, and other similar statements result in poor development practices (at least when it comes to the work we’re doing with our WordPress projects).

If you haven’t read it, no big deal. The gist of the post is that these statements make:

  1. debugging more difficult,
  2. tracing code harder to do.

Ultimately, they are things we can avoid. I ended the post with the following:

This still leaves the question of why autoloading (or any inclusion of third-party files) is needed at all.

And though I’d love to cover all the details in this post, it’s going to take this and one more post as its important to understand some foundational topics on languages, interpreters, and compilers before getting too far ahead.

Continue reading

Why Bother With Autoloading in WordPress, Part 1

One of the easiest things that we can do when working on WordPress plugins is to drop require_once or include_once statements throughout our code.

And why not? It’s an easy way to bring in all of the necessary files or dependencies for a given class, have it easily readable, and not have to worry about creating huge files of code. That is, it helps us simplify what we’re writing so that we’re able to have our classes [mostly or ideally] do what they are doing well.

If you’ve read this site for the past year or so, though, you know that I’m a fan of autoloading and it’s something that I think anyone working with PHP – regardless of if you’re using WordPress or another platform – should use.

But it raises two questions especially if you’re just starting out:

  1. Why bother with autoloading when there are other ways to handle loading dependencies?
  2. How does autoloading stack up against compiled languages?

So I thought it would be worth answering this in the next couple of posts.

Continue reading

Writing Personal Tools (And the Process Behind It)

I recently shared a post about the idea of understanding what we’re doing to code before we code it. This is something that I think it imperative to solving problems correctly (assuming they are correctly defined).

It’s one of those things that come more easily with working on building things with other people. But what about when it comes to building something ourselves?

Continue reading

Plans For Membership Content (OOP, WordPress, and More)

Earlier this week, Tony Crockford sent the following tweet about the whole membership site thing:

Given that this is new territory and that it’s something I know requires a bit of decision-making when trying to determine if it’s worth the money, I thought it at least worth sharing some of the topics that are in the process of being drafted.

Continue reading

Adding WordPress Modal Dialogs (With Built in Libraries)

Whenever it comes to developing solutions for clients, there are going to be times when you’re likely tasked with displaying information in WordPress modal dialogs.

There are a lot of solutions available for doing this and the more familiar you are with JavaScript, various libraries, and the libraries that they have available, the harder (or maybe it’s even easier) it is to choose which one to use.

But WordPress has infrastructure built-in that makes it trivial to incorporate functionality into WordPress. So in three upcoming posts, I’ll cover the following:

  1. How to incorporate WordPress modal dialogs using built-in libraries,
  2. Populating the modal dialogs with data,
  3. Populating the modal dialog with dynamic data via Ajax.

Because of the nature of the series, the posts won’t be back-to-back, but they’ll all use a unique tag that you can use to bookmark and refer to as a series once the posts are complete.

With that said, let’s talk about easily incorporating WordPress modal dialogs with built-in libraries.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑