Software Engineering in WordPress, PHP, and Backend Development

Author: Tom (Page 75 of 427)

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

What’s with the ERR_SPDY_PROTOCOL_ERROR?

One of the things that’s often brought to my attention is that people see the ERR_SPDY_PROTOCOL_ERROR whenever they try to access this site.

ERR_SPDY_PROTOCOL_ERROR

I’ve had people respond to links from my newsletter, from links on Twitter, from links from third-party sites, and sharing their experiences when trying to access other sites, too.

The thing is, few people – myself included – seemed to be able to diagnose the problem. (And believe me when I say that I’ve tried a ton of different things to fix it on my end.)

So to the best my ability, I researched the problem, all possible fixes, and thought I’d share what I found here along with the fixes.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑