Software Engineering in WordPress, PHP, and Backend Development

Category: Articles (Page 156 of 258)

Personal opinions and how-to’s that I’ve written both here and as contributions to other blogs.

When You Are Subpar

One of the really neat things about working in the software development industry is that we have the ability to be as engaged with other people as much as we want or not.

That is, we have the ability to chat with people via Twitter, IRC, or Skype, and we have the ability to learn and educate other people through blogs, screencasts, meet-ups, and so on.

But all of this comes at a cost: We can get near instant feedback while in the process of giving a talk or after people have viewed a course that we spent hours preparing and editing.

Case in point, I recently received some feedback that said something along the following:

You speak in lightening speed with copy/paste codes.

Perhaps I do talk fast (though I deliberately try not to do so), and I certainly do not use “copy/paste codes.” But anyway. I digress.

Years ago, this would have been something that would have seriously bummed me out. I mean, here I am pouring my energy into trying to help other people learn something and it wasn’t well-received.

But now, years later, that’s not the case.

Continue reading

Validation and Sanitization in the WordPress Settings API

This post is part of a series on Sanitization with the WordPress Settings API. Here is Part 5.

Assuming that you’ve been following along with the majority of the posts in this series, then you know that we’ve been looking at ways to handle input sanitization and serialization in the WordPress Settings API from an object-oriented perspective.

As of now, we’ve got all of the necessary pieces for doing so, but we’ve not actually tied them all together. So in this post, I’m going to aim to do that in one of the many different ways this can be done.

I’ll talk about how to do it using the code we’ve written as well as some more advanced improvements that can be made were you to take this a few steps further.

Continue reading

Validating Input via the WordPress Settings API

This post is part of a series on Sanitization with the WordPress Settings API. Here is Part 4.

Up to this point, everything we’ve talked about regarding the WordPress Settings API and saving data to the database has been based around two ideas:

  1. We need to sanitize the input
  2. We haven’t been concerned with any particular fields being required

At this point though, we’re ready to start talking about how to tackle this particular issue. Since we’re already familiar with how to sanitize the data, we’re going to build off of the code that we already have.

An Example Settings Page

An Example Settings Page

That is, we’re going to look at how to validate the following fields:

  • Address 1
  • City
  • Postal Code

Furthermore, we’re going to see how to tackle this from an object-oriented approach, we’re going to look at what’s needed in order to add an error message if the required input is invalid, and we’re also going to look at how to prevent saving information to the database if it’s empty or invalid.

Continue reading

The Complexity of WordPress Solutions

Yesterday, I was talking with a friend of mine about WordPress and some of the annual revenue reports that have come out over the past few months (which tends to be the normal around the end of the year and on into the first quarter for our industry).

Though he’s no longer working in this particular economy, he mentioned something that I thought was interesting:

the work I’m working on right now is far more exciting and challenging BUT the opportunity to make stupid simple money is pretty large in the WP world

Before I go any further, I want to be clear that I am taking this quote out of context so it’s probably not presenting him in the best light. That isn’t my intent at all.

In fact, I actually think he makes a compelling point that I’ll talk about momentarily, but I also think that the problems that we opt to solve in and/or with WordPress are as challenging as we accept and as we allow them to be.

Continue reading

Refactoring Input Sanitization with The WordPress Settings API

This post is part of a series on Sanitization with the WordPress Settings API. Here is Part 3.

In continuing to work on sanitizing arrays of input with the WordPress Settings API, there are two things that we need to do:

  1. Refactor the existing code that we have so it’s as clean as possible
  2. Determine what fields we’re going to use to mark as required

In this particular article, we’re going to focus on both. This particular article is going to include the code necessary to tighten up our existing code and then we’ll begin laying the ground work for introducing a new class – a validation class – when we begin looking at the second step.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑