Software Engineering in WordPress, PHP, and Backend Development

Category: Notes (Page 36 of 49)

Notes on programming-related problems that I’ve encountered while working on various projects.

Resolving WordPress jQuery Errors

One of the biggest problems with writing and maintaining themes and/or plugins in WordPress is the frustration that comes with having to track down JavaScript errors.

Pippin Williamson has discussed this extensively on his blog, we’ve covered it on WP Daily, and I’ve talked about this once before here.

But since I’ve seen this issue crop up several times since, I wanted to offer some additional thoughts on this particular topic that has stemmed from the recent discussions.

Continue reading

Quick Tip: Delete a Git Tag

As much as I love GitBox, it doesn’t actually provide the ability to delete tags from within the interface:

GitBox and The WordPress Plugin Boilerplate

GitBox and The WordPress Plugin Boilerplate

Sad, right?

Occasionally, there are times in which I need to remove a tag because I need to go back and make some final adjustments to a commit prior to pushing to my current branch (which is usually just `master` anyway).

This means that I need to hop over into Terminal to issue a few git commands in order to delete a Git tag from the command line.

Continue reading

WordPress Refactoring: Refining Plugin Functions

Whenever it comes to writing code – be it starting a new project or working with an existing system – there are a lot of developers that aim to write clean, maintainable code.

It’s a challenge for sure, but it’s not impossible. Even if you’re responsible for simply introducing a new function into an existing system, there’s an opportunity to leave the place a little better than you found it.

Granted, trying to refactor a larger system too much can have serious unintended consequences, so I don’t necessarily advocate doing that, but if you have the opportunity to break a one larger function into several smaller, more focused functions, then I think the opportunity should be taken.

I recently had a chance to do a bit of WordPress refactoring in the context of a commissioned plugin I am working on, and wanted to share the process that I followed for doing so.

Continue reading

Finding Functions in WordPress (Those Not in The API)

As significant as the WordPress API is in building plugins, themes, and applications, there are often times where we may find ourselves needing to write custom functions to achieve something that we know WordPress already does.

Case in point: With Page Template Dashboard, I wanted to be able to show the name of the template rather than the filename. I knew WordPress was doing it, but I couldn’t find an actual API function for it.

So what’s the best thing to do in this particular situation?

Continue reading

The Dangers of Herd Mentality in Online Publishing

Blogging can be a really weird hobby especially in the development space. Obviously, the majority of what I personally write is geared towards developers – at least on some level.

Some articles are straight up “How To’s” (such as get a post ID by its meta value) that are meant for anyone. Others are meant for people who may be experienced in software development, but not necessarily WordPress, and others are geared towards open conversation in which anyone that works as (or for!) a developer can have an opinion.

But there’s a problem with this: Whenever you – or I – opt to write an op-ed piece about why someone should avoid using a certain plugin or practice, or we share how certain things are Doing It Wrong rather than Doing It Right, or anything of like, we run the risk of cultivating an environment that fools us into thinking our perspective is of much more significance or is much more “correct” than it really is.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑