Software Engineering in WordPress, PHP, and Backend Development

Category: Articles (Page 57 of 258)

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

The Basics of Action Hooks in WordPress

Anytime sometime starts to get into more advanced programming – be it in WordPress or any other framework, library, foundation, or programming language – there are times in which new concepts can often be more difficult to understand than others.

I generally have found this to be true whenever a person has learned the basics of, say, object-oriented programming but hasn’t been exposed to the nuances of certain things such as design patterns.

Case in point: I’ve written about the event-driven design pattern (or the publish-subscribe or Pub/Sub as some like to refer to it) in other posts.

Yes, there are some differences to each, but the general idea is that something happens and an event is raised and anything listening for that event, or subscribed to that event, will respond.

Action Hooks in WordPress: Pub/Sub

Photo by Claus Grünstäudl on Unsplash

This is the primary pattern that WordPress employs that allows us to quite literally hook into certain points of execution. We can generally conceptualize these as action hooks in WordPress.

Anyway, the application makes certain points available for us to add our own functionality. Once that functionality is registered, WordPress will leave its codebase, so to speak, hop into ours, then return back to ours.

It’s easy enough to understand, but what if you want to expose areas in your code that allow others to hook into your code?

Continue reading

Developer Fitness in 2018: Quarter 2

Apparently, with the exception of my previous post, this is turning out to be my week to share things related to the second quarter of this year (the first being about taking some time off of social media).

Earlier this year, I talked a bit more about why I think it’s important for we, as developers who spend so much time at a desk, to focus on our health as well. Granted, this is has been compeltely focused on my own goals.

Specifically, I said:

The purpose of this post is to go a bit further into what my goals have been first the first quarter of the year, what I’m aiming to do in the second phase of the year, and some additional thoughts on the devices I’ve been using.

But this doesn’t mean it can’t translate into your own life in some capacity, right? I’m the last to say that “what works for me will work for you” because I think our body composition plays a massive role and we’re all different.

Anyway, if you’ve not read what I’ve written thus far, check out these posts first (if you have the time):

  1. Developer Fitness: Getting & Staying in Shape
  2. Developer Fitness: More Progress, My Devices, Apps, and What’s Next
  3. Developer Fitness in 2018: Quarter 1

Even though I’m a bit later than planning for writing my second quarter retrospective, here it is, nonetheless.

Continue reading

Reading and Understanding WordPress Error Logs, Part 2

Last time, we walked through the following:

  1. configuring debug constants,
  2. locating an error log file,
  3. understanding how to read the log file,
  4. understanding stack traces
  5. understanding how to read the stack

As nice as that is, it’s still important to understand how to write data to error log from a programmatic aspect. That is to say; it’s one thing if your work throws errors, warnings, or notices.

Understanding WordPress Error Logs

It’s another thing if you want to understand how to write information to the file for research and debugging manually.

In this post, we’ll continue doing exactly that to further our understanding WordPress error logs.

[restrict paid=”true”]

Continue reading

The Second Social Media Sabbatical of 2018

As I’ve been writing this post, I’ve felt so pretentious when it comes to using the word “sabbatical” as it relates to something like social media.

I mean, I’ve always associated sabbaticals as something that professors, academic types, religious leaders, and higher-ups take. Not just an average dude who makes a living on the Internet.

Sabbatical or a sabbatical (from Hebrew: shabbat (שבת) (i.e., Sabbath), in Latin: sabbaticus, in Greek: sabbatikos (σαββατικός), literally a “ceasing”) is a rest from work, or a break, often lasting from one month to a year.

But I suppose, by that definition, it makes sense, right?

Anyway, I started the trend earlier this year, it went well, and I want to keep a consistent theme going at least for 2018, so why stop it during just the second time through?

Continue reading

Reading and Understanding WordPress Error Logs, Part 1

As we continue looking at what it means to be an independent WordPress developer, the tools needed, and the various strategies that can improve our skillset, I’ve been talking through the various constants, plugins, and tools to help us.

If you’re just stumbling across this post, then I recommend checking out my guide to native WordPress debugging tools as well as the rest of the posts in the series thus far.

After all, I find it important that we’re all working off of the same foundation – or something closely related – when going through this information.

Understanding WordPress Error Logs: Xdebug

Ultimately, using a tool like Xdebug is indispensible, but we have to work up to that (for those who are curious, I wrote a brief guide about this a little over a year ago).

For now though, let’s start with the basics. In the previous post, I left with the following statement:

In the next post, we’ll start looking at what’s necessary to examine the error log that’s generated by WordPress and how to understand the information we see.

And that’s what I want to look at today because, if nothing else, it will give you something practical off of which to work.

Continue reading

« Older posts Newer posts »

© 2026 Tom McFarlin

Theme by Anders NorenUp ↑