Software Engineering in WordPress, PHP, and Backend Development

Category: Articles (Page 68 of 258)

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

A WordPress Development Environment (Using a Package Manager)

At this point, I’ve written about as much of the OOP Fundamentals that I believe are necessary to begin looking at more in-depth topics (such as design patterns and how to apply these topics in WordPress development).

But when planning the content, I kept coming back to a few other things that I think are also necessary to cover eventually. These are things such as Composer, Yarn, build tools, and so on.

Above that, though, I kept asking myself:

If I’m going to be writing about this material at length, should I assume we’re all using the same environment?

And that’s a tough question to answer because some of the people reading this have been writing code for quite some time. That is, they (or you) have your tools, your setup, and how you like to organize your projects.

On the other hand, there are those (or you), who are looking for a different way or looking to start from the ground-up. And to that end, I think it’s important to cover two things:

  1. How to Setup a Local Development Environment
  2. What IDE, Add-Ons, and Tools are going to be used

For some, it’s not the most exciting topics and it’s certainly putting a pause on the more advanced aspect of object-oriented programming. Since those of you who pay to read this material have access to the comments, I have to assume that – at some point – comments will come through asking about how to achieve certain things.

And to that end, I’m going to assume that we’re all working off of the same playing field. If not, there’s only so much that I can do to provide help beyond actual programming questions.

So before going any further into the depths of object-oriented programming, I’m going to spend a few posts covering the above topics in detail to make sure that we’re all on the same page.

If you’re comfortable with your tools and your setup, then please bear with me. If you’re looking for a definitive way to setup your environment, then the following posts are for you.

And with all of that said, let’s get started with talking about how to cleanly set up a local development environment that’s easy to maintain.

[restrict paid=”true”]

Continue reading

Templating and Conditional Logic with OOP in WordPress

Templating is becoming more common in WordPress, and I consider that a good thing.

But that doesn’t mean that there aren’t projects that we manage that use a more traditional approach to displaying templates or partials. Furthermore, it also doesn’t mean that we’re exempt from maintaining codebases that use code that does not use a templating engine.

Though I think templating is good, I don’t think it’s always necessary. That’s content for another post, though.

Instead, I want to walk through the process of using the conditional logic of whether or not to display a partial within a template and do so using object-oriented programming.

Continue reading

Looking At Polymorphism In-Depth

When I started this series, I talked about the four pillars of object-oriented programming. Each of these topics is listed and linked below.

  1. Abstraction
  2. Encapsulation
  3. Inheritance
  4. Polymorphism

At this point, I’d normally want to begin moving on to the next topic. Before doing so, though, I’d like to spend one more post exploring the concept of polymorphism.

In my career, thus far, I’ve seen few topics give those getting into object-oriented programming more confusion and problems than polymorphism. So I’d like to discuss it a little more in-depth within the context of object-oriented programming and outside any particular framework or application (like WordPress).

In this post, I’ll do a quick review of what we’ve discussed thus far, then hop back into polymorphism.

Continue reading

Dynamically Centering an Element in a Container Using CSS

When it comes to writing about development, I don’t often talk about things beyond PHP and JavaScript mainly because I work with those languages more than others.

I mean, yeah, CSS is part of the deal as is HTML, but it’s expected these days, right?

So if there was ever a quick tip for me to offer regarding CSS, this is it (though maybe I should write more?). It’s hard when Chris does such an awesome job running CSS Tricks, but I digress.

Anyway, here’s the problem and the solution.

Continue reading

Working with Classes, Templates, and Partials in WordPress

When I sat down to begin this post, I planned to write something far more involved that I what I’m going to share. Initially, I wanted to walk through one of two things:

  • The Complete Guide To Setting Up a Development Environment,
  • Integrating Code Quality Tools into PhpStorm

The first would be focusing on a variety of other things I’ve talked about, tying them all together, and having a definitive reference. But this is something that I want to take time to put together to make sure it’s done right.

The second is one that I think is important but I’m in a bit of a transitional phase with some of my own tools. Until that’s done, I’d rather not write about it.

Even still, there’s always something to cover, right? So today I’ve opted for something simpler: Breaking down the use of classes, templates, and partials in WordPress plugins using a simple example.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑