Software Engineering in WordPress, PHP, and Backend Development

Tag: WordPress (Page 62 of 219)

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

WordPress Plugin Constructors Shouldn’t Define Hooks

WordPress plugin constructors seem to be more and more a topic of debate when it comes to what they should define. I’ve talked about it before but it’s okay to revisit a topic like this from time-to-time, right?

After all, there are things we learn and things that we change as we gain more experience.

It’s not at all uncommon to see plugins defining hooks and other behavior, but I’m not a fan of this approach. Instead, I think handling hook registration should be done in its own function or, even more drastically, handled by a set of classes.

But before getting into that, I want to explain what should go in a WordPress plugin constructor, why it should go in a constructor, and how this can be handled when working on your plugins.

Continue reading

Writing WordPress Plugins For Existing Features

In a previous post, I’ve talked about the WordPress design philosophy of decisions, not options. And I’m working towards getting to a point, but I’ve got to set the foundation a bit about the whole thing first.

You can read the entire set of philosophies on this page, but here’s the gist about the one I’ve just mentioned:

When making decisions these are the users we consider first. A great example of this consideration is software options. Every time you give a user an option, you are asking them to make a decision. When a user doesn’t care or understand the option this ultimately leads to frustration.

 

As developers we sometimes feel that providing options for everything is a good thing, you can never have too many choices, right? Ultimately these choices end up being technical ones, choices that the average end user has no interest in.

 

It’s our duty as developers to make smart design decisions and avoid putting the weight of technical choices on our end users.

This is arguably my favorite philosophy that defines what should go into WordPress core and how; though I’d be remiss if I didn’t say I think there are areas for improvement.

(I know this is where the discussion can take a turn into left field but I don’t know to do that, nor am I trying to start armchair quarterbacking.)

But here’s the question:

If there’s an area of the WordPress UI that can be improved by a plugin that does the same set of functionality that already exists in the plugin, is it worth creating the plugin if the feature already exists?

Does it make sense to create WordPress plugins for existing features if the plugin adheres to the “designs, not options” philosophy more so than the core feature?
Continue reading

WordPress Developer Bootcamp via Know The Code

Some time ago, I talked a bit about the WordPress Developer’s Club (which is still alive and kicking). But since that post, Tonya Mork and others have been working on something called Know The Code for the last few months.

There’s an active community, a ton of educational content, assignments, labs, explanations, examples, and so on. If you’re a budding WordPress developer or someone who’s looking to get into professional WordPress development, I recommend it.

But in an attempt to go to 11, Tonya and Know the Code is looking at offering a WordPress developer bootcamp specifically for those who are looking to take it a step beyond the code itself.

Continue reading

How to Exclude Files From PHP CodeSniffer

When you’re working with PHP CodeSniffer, and you’re doing so in the terminal, you’re likely looking to output errors into something other than your IDE.

I mean, if that were the case, you’d just have it running in your editor, right?

But there are times where you may be interested in finding the problems in other people’s code. Perhaps it’s a dependency, perhaps it’s a third-party piece of software, or perhaps it’s a favor.

Whatever the case, if you’ve set up the project directory in a way that uses Composer to include PHP CodeSniffer and you’re using the WordPress Coding Standards, then you’re likely going to need to exclude files from PHP CodeSniffer when running the program.

And this is how you can do that.

Continue reading

WordPress Admin Columns Made Easy via Admin Columns Pro

When working with WordPress plugins, the software should aim to solve a problem that a given type of user is experiencing. Granted, some plugins are more nuanced than others.

Take, for example, the idea of the various tables, lists, and columns available in the admin area of the WordPress dashboard. When working with WordPress admin columns, a good solution should expand the core functionality of WordPress and do so in an unintrusive way.

That’s what Admin Columns aims to do.

WordPress Admin Columns: WordPress Admin Columns: Admin Columns Pro

To elaborate, Admin Columns allows you to manage columns in your WordPress admin area. You can create, edit, and remove columns from the overview pages of blog posts, pages, users, comments, categories, and more. All custom post types and taxonomies are supported by the plugin.

Since 2011, the free version of the plugin has been available and installed on 80,000 WordPress-based sites; however, the latest release of Admin Columns Pro introduces many additional features.

Some of these include:

  • sorting,
  • filtering,
  • inline editing,
  • import and exporting columns.

But there’s much more to it than that. I’ve had the pleasure of speaking with David on behalf of the development team and am stoked to share what they’ve built for the lastest version of this project.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑