Software Engineering in WordPress, PHP, and Backend Development

Author: Tom (Page 155 of 428)

Single Responsibility Principle: WordPress Menus

The single responsibility principle, as mentioned in the previous post, should be thought of as nothing more than asking the following question:

A class should have only one reason to change.

The question is far simpler than the answer, though. And through this post and the next, I’m hoping to demonstrate exactly that.

But first, I want to mention that the context for this particular question is with a relatively simple API. This doesn’t mean that the result isn’t as beneficial. It does, however, make for quicker reading and more time to talk about the application of the principle.

Continue reading

The Single Responsibility Principle in WordPress

Every time I work on a project for a client (or a side project for myself), I try to keep in mind each of the five SOLID principles.

These are often talked about by developers on numerous blogs (and I’ve done so myself on this site), so I’m not about to teach of them in this post.

Single Responsibility: One Reason to Change

Instead, I’ve been looking at how the Single Responsible Principle applies with working with various aspects of the WordPress API. And what I’ve found is that, in my experience, using this principle consistently results is far smaller classes.

My most recent experience has been in a very simple use case: Working with the WordPress API to create a submenu item and a corresponding submenu page.

Continue reading

A Pressmatic Image for WordPress Trunk

As a follow-up to yesterday’s post with using Pressmatic and a copy of WordPress from the Subversion repository, Kiko Doran asked me a good question via Twitter dealing with one of Pressmatic’s nicest features:

First, you can think of Pressmatic templates as preconfigured images that can be used to re-create a development environment. This is useful if you need to create a second or third or ninth install on your machine.

Or, better yet, it’s really convenient to have it available for your team so that you can make sure you’re all running the same image across all development machines.

Still, the question remains: Can you create an image that has trunk installed by default?

Continue reading

Using Pressmatic with WordPress Trunk

Pressmatic 1.0 was released a few days ago (with 1.0.1 made available today).

Pressmatic with WordPress Trunk

There is no shortage of options when it comes to setting up local WordPress development environments. And as with anything, there are pros and cons to each of the available products. Ultimately, this gives us a choice when it comes to setting up our machines for what works best for us.

Since the product entered beta, I’ve been reading tweets and blog posts all about it and ultimately decided to purchase it and give it a try for myself.

Continue reading

Internationalizing WordPress Plugins

Earlier this week, I shared a link to the introduction of a series of articles I’m writing on internationalizing WordPress plugins. The gist of the series is straightforward:

  1. I introduce the concept of internationalization,
  2. I demonstrate how to create a plugin that’s ready for translation,
  3. I then create the translations for a particular locale.

The second part of the series has is available via Envato. As is the case with other articles I’ve written, this post serves as a short description of the article to help determine if the tutorial covers more information you’d like to read.

And as mentioned above, this particular article covers how to write a localization-ready plugin.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑