Software Engineering in WordPress, PHP, and Backend Development

Tag: WordPress (Page 158 of 219)

Articles, tips, and resources for WordPress-based development.

Writing JavaScript Helpers for the WordPress Theme Customizer

I’ve talked before about how I think the addition of the WordPress Theme Customizer (well, soon to be called the Customizer) is one of the nicest additions to the core application in a long time. I’ve also talked about how I fear the direction that some developers will take it.

Regardless, if you’ve worked with the Customizer long enough – especially when it comes to the JavaScript aspect of it – then you’ve likely noticed that you can end up writing relatively repetitive code especially when you’re working with something such as a list of items or something similar.

When you end up reaching this particular point, having too much of the same code with the only variations being a few strings ends up being a bit of a code smell.

In order to prevent this, it’s often better to write helper functions that abstracts the repetitive functionality into a single, ahem, function that you can call with the strings that are unique to your use case.

Here’s what I mean.

Continue reading

Does WordPress Encourage Poor Programming?

If you hang around any group of programmers long enough, you’re bound to get into a discussion as to which language is currently the best language and why that’s the case.

Well. Then again. Maybe not.

I’d say this is true is some cases, but I’d venture to say that if you’re hanging around a group who has been at it for quite some time (read: at least a decade or so), you’re going to have discussions as to what features of what languages are nicer in contrast to features of other languages.

A more mature discussion, right? At least a little.

But then you take this one step further: You sit and chat with a group of people who have been working on the same platform or framework for a while and you may find yourself in a discussion about what features of a given framework has that are better than its alternatives..

Perhaps a better way of putting it is: You may end up discussing why one language, framework, or set of tools encourages better programming practices than any other given set of languages, frameworks or tools.

You know you’ve been there when you can quickly list off several reasons, say, Python programmers prefer white space, Rubyists prefer unit testing, Rails developers appreciate MVC, jQuery developers like method chaining, JavaScript programmers love the prototypal inheritance, and Smalltalk programmers love how few of them exist (I kid, I kid).

On a more serious note, there’s no shying away from the fact that people either love or hate PHP. Sure, there’s middle ground but there’s no fun in taking a stance there so you don’t read many articles on people simply saying “Yeah, I think PHP’s okay.” But when it’s used in the context of another framework like CakePHP or Laravel, then you’re likely to find something different.

So ultimately, I think it’s worth asking the question, does WordPress encourage strong or poor programming practices?

Continue reading

The Embarrassing Nature of Modern WordPress Products

As far as WordPress projects are concerned, I’m far more comfortable talking about projects that I’ve been working on myself regardless of if they are for fun or profit.

And yes, there are times where I’ll share code and other snippets that come from contract work, but I generally do not talk about those types of projects out of respect for the client and/or out of respect for the terms of our agreement.

Contracts, respect, professionalism, and all that fun stuff.

The Disenchanted Young Professional

The Disenchanted Young Professional

But there’s been a project that I’ve been a part of for a few months now, and I received an email last week that struck a chord with me. I asked the client if I could share the quote – keeping them anonymous of course – but use it to try to make a point.

They obliged.

I hate trying to support a theme that’s so dated and broken. I can hardly wait until I can offer support for a theme that I am proud of and is coded well and will be kept up-to-date.

And though it’s already been referenced through a number of different blogs, and the article is already over a week old (which is, you know, practically forever in Internet time), I couldn’t help but think: “We’re ruining WordPress.”

You may or may not think of it as hyperbole, but this is a very real problem.

Continue reading

All of the Options in the WordPress Theme Customizer

I’ve written a little bit about the WordPress Theme Customizer in a number of previous posts primarily because I think it’s one of the best features that has been introduced into WordPress in a long time (of course, this isn’t meant to downplay any of the work that’s been done since ;).

To be clear, I’m a fan because it takes a significant amount of guesswork away from the end user allowing them to see the results of their changes almost immediately versus, say, having to tab back and forth between the settings in the dashboard and the public-facing view of the site.

The WordPress Theme Customizer

Couple that with additional changes introduced in more recent versions such as being able to add and remove widgets from within the customizer and improvements to this particular experience in the pipeline for a future release (such as 4.0), then you’ve got a nice feature that’s only getting better.

It’s evident that the same problems that have plagued us in one part of the application are migrating elsewhere in the application.

I’m sure this is something that happens in any language, framework, foundation, library, or platform, but if you’ve specifically been with WordPress for the last few years, then you’ve seen this happen.

Continue reading

We’re Ignoring the WordPress Philosophy: The Bill of Rights

Over the last week or so, I’ve been writing about the various pillars of the WordPress Philosophy.

These include:

And today, I finally finish up with the Bill of Rights.

The WordPress Philosophy

Ultimately, I’ve been looking at how I believe that the majority of us who are involved in driving the WordPress economy in some way have been ignoring these core tenants.

This isn’t to say that we’re all doing it, and this isn’t to say that they’re all being ignored, but I do believe that there are some significant issues that are happening within the WordPress product space that need solutions.

This isn’t to say that I have it figured out – hardly so – but I do believe that one of the things that many of us need to do is to begin forcing segmentation in the market based on how we price, support, and offer our products.

The final aspect of the philosophy to cover is that of the WordPress Bill of Rights. I almost opted not to write about this particular part because it’s directly influenced by the GPL which always has been, and always will be a fire starter of sorts for the WordPress economy.

Even still, it’s part of the philosophy and should be included.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑