Tom McFarlin

Software Engineering in WordPress, PHP, and Backend Development

Page 233 of 428

Maintainability of WordPress Theme Customizer Code

When working with the WordPress Theme Customizer, one of the things you may find yourself doing is writing out inline styles into one of the templates for your theme. Most likely, this will happen within the context of your header template since that’s where most of your styles and JavaScript sources are included.

Sure, it’s possible to handle a lot of the work via JavaScript and to use separate stylesheets to handle the general styles, but if you’re looking to set something up like, say, backgrounds that can be selected via the Theme Customizer, then you’re going to need to write out inline styles.

And if you’re in the habit of keeping your code separated such as styles reside in CSS files, behavior functionality resides in JavaScript files, and templates hold markup and PHP, then this can be a little bit annoying. It breaks the trend, you know?

There is somewhat of a solution to this, though.

Continue reading

My Perpetual State of Discomfort

You know that feeling of when you look back at code that you wrote a few months ago and kind of cringe that that’s how you wrote it and sense of “What was I thinking?” or maybe even a little embarrassment comes over you?

I’m beginning to wonder if that’s not something that stays with you as you move throughout your career in development. One thing that I’ve been noticing about myself (and I know at least a few others have this feeling to) as it relates to programming is this:

I am in a perpetual state of discomfort.

Maybe that sounds a little grandiose or maybe it sounds even a little ridiculous, but I don’t know how else to explain it. I look at stuff I’ve done and see how I would do it now, and I work on stuff now and know that, given my track record, I’ll probably look at it later and think about all the ways in which I could refactor it.

It’s kind of a vicious cycle, isn’t it?

Continue reading

The Shelf Life and Feature Creep of a WordPress Theme

With Mayer about to turn a year old (they grow up so fast), with a healthy backlog of features sitting in the queue, and with two other themes sitting in the planning stage for the first part of this year, I’ve been thinking a bit about WordPress themes as a whole.

Sounds like I have too much free time doesn’t it?

But seriously, one of the things that I do wonder about is how long a WordPress theme can actually be sold and continue to be viable for users especially since design trends change. Additionally, I think that there are times in which a theme has reached the maximum number of features it can justifiably offer before it just begins to feel a bit crowded.

Continue reading

A Guide To Merging (Based in Git)

In the previous post, I gave a working definition of branching (based on Git’s model of source control) and provided a conceptual model that I hope makes it easier to understand what’s happening whenever you branch code from the master branch of the application.

The thing about creating branches is that they’re typically merged back into the main application once a feature has been completed, a bug has been resolved, or something has been patched.

If branching is taking a copy of the code and creating an independent sandbox out of which to work on the program, then merging is the opposite – it’s taking the code from the branch and pushing it back into the main part of the application.

Continue reading

A Guide To Branching (Based in Git)

Whenever we introduce others to a new technology, service, application, or anything else, I think that we – as developers – don’t often do such a hot job of showcasing what the true “beginner-level” features are.

That is, we’re either so enamored at what we’re working with, that we’re eager to show what we’re able to do or we skip to more complicated things without explaining the foundation off of which said things have been built.

Maybe I’m off base, but one of the places I’ve seen this crop up in a few conversations is around the idea of Git branching and merging.

That is to say, I’ve had others ask specifically about understanding what a branch is and what a merge does.

For those who have worked with other source control systems, these terms are taken for granted, but for those who are just getting their feet wet and who are hopping into development (even if it’s with Subversion and its branches directory), these are concepts that seem to be glossed over in an attempt to get to more of the “exciting” parts of source control.

At least, as exciting as it can really get.

Continue reading

« Older posts Newer posts »

© 2026 Tom McFarlin

Theme by Anders NorenUp ↑