Software Engineering in WordPress, PHP, and Backend Development

Author: Tom (Page 268 of 428)

The Best Developer Tools (According to You)

One of the things that developers love to discuss is the tools that we use. And why not, right? It’s fun to talk about what IDEs, minifiers, compressors, build tools, deployment utilities, and so on that we incorporate into our daily workflow.

It’s also fun to see what other people use to see if there isn’t something to be learned and gained from the way that other people do work.

But sometimes I think that we do cross a line: I think that many of us have a disposition such that we think “if they aren’t using what I’m using then they aren’t being as productive (read: they are as proficient) as I am.”

Overly Manly Man: Breathmints

And this mentality is lame primarily because there are a number of factors that contribute to the tools that a developer opts to use when he or she is getting his or her work done.

Continue reading

How to Display Error Messages in WordPress

Regardless of your level of experience with WordPress, everyone is familiar with seeing the messages that display whenever an action has completed within the dashboard:

  • We have success messages for when something has completed, ahem, successfully,
  • We have notification messages which are neutral pieces of information that give a heads up something has happened,
  • And we have error messages that let us know that something has gone wrong.

For anyone that’s read past articles, you know that when it comes to introducing functionality into the WordPress dashboard, I firmly believe that the work we do should look as native as possible. That is to say that I am not a fan of custom styles, custom controls, or extraordinary styles to give your theme or plugin that “extra edge.”

And for those who are familiar with the Settings API and/or the Options API, then you’re likely familiar with introducing new sections, settings, controls, and options, but what about error messages?

Display Error Messages in WordPress

Generally speaking, success messages and notification messages are reasonably easy to come by, but let’s say that you need to validate some piece of information that’s coming into the server and return an error if it fails.

Continue reading

Don’t Just Get It Working

Maybe it’s just me, but one of the things about programming is that many of us pre-occupy ourselves with is the need to find the right way to do something. Contrast this with the mindset of “I just want to get it working” and you’ll know what I’m talking about.

Basically, it’s never good enough just to get something working.

Of course, there are exceptions: creating prototypes, working on a small demo to show someone how something may work, and so on.

But when you’re working on a professional grade product, there’s a number of things that go into getting things to work – anything from the design of the product architecture through how the various functions, modules, or pieces of code are going to interact with one another.

Continue reading

Simplifying Code in WordPress: Option Arrays

Let’s say that you’re working on a plugin that has its own plugin settings page, and on that page there are options to determine what type of posts will support part of the functionality of the plugin.

For example, let’s say this plugin will be introducing a meta box for each post type that extends the type of information that the user can add to a post. The settings page allows you to control which post types will offer this information.

To give a concrete example, take a look at the following screenshot:

Simplifying Code: Options Arrays

Granted, it’s a small example but it makes the point: We have a plugin settings page that displays all of the post types that are in the current theme installation. If selected, we’ll save the values to an options array.

When it comes time to read the values, there are a couple of ways to go about doing it, but one that’s arguably simpler than all of the rest.

Continue reading

A Software Test Plan for WordPress Work

I think that one of the biggest things that developers – myself included – could be better at doing is testing. I’m not necessarily talking about just writing unit tests, or just doing usability tests, but just the general act of testing.

That is to say that perhaps it includes all of the above, perhaps it includes just providing automated and manual testing for part of an application, or perhaps it includes something else that hasn’t been mentioned.

Whatever the case is, testing is important. I’m not afraid to admit that it’s arguably my weakest aspect when it comes to working on projects for myself or for others. To be clear, this isn’t to say that I don’t test (because I do), but that I have room to improve (because I do), and I think we all do.

In fact, I think that there’s something psychological about developers and testing; otherwise, why would there be so many books, articles, and tools on the topic?

But here’s what I think: Developers get into a weird mind set when they’re working on a project and think that a minimal level of testing is enough not because we’re malicious or because we’re lazy, but because I think we think we know how the the users and the context of where our code is running will respond.

But we don’t and this has been demonstrated time and time again.

Software Test Plan

To that end, there are a number of ways to improve the way in which we test our work. And if you’re not testing at all, then one of the easiest (and even one of the most complete) ways to go about testing your work is through the use of a software test plan.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑