Tom McFarlin

Software Engineering in WordPress, PHP, and Backend Development

Page 168 of 428

Would You Be Interested in Premium Content?

Premium content is one of those things that means different things to different people whenever it comes to blogging. Sometimes, people think it refers to a pay-to-play forum; others believe that it has to do with some “I’ll give you my email address in exchange for your e-book.”

I’m not knocking any of these approaches, but that’s not what I’m trying to do. I’ll come back to this momentarily, though.

If you’ve been visiting this site in your browser for the last few days, you’ve likely seen something like this:

Would You Be Interested in Premium Content?

And back when I first launched The First Version, the pop-up worked quite well. In fact, this dialog is doing a great job generating leads, too. However, more than a few of you have expressed interested in premium content while simultaneously expressing frustrations with this approach.

So in exchange for disabling the dialog, I thought I’d write a post and share an opportunity to sign up for more information in the context of its page.

Continue reading

Installing WP-CLI with MAMP

About four years ago, I shared a post about WP-CLI. It wasn’t exactly a new project at the time, but it was far less developed than it is now.

The WP-CLI Homepage

The WP-CLI Homepage

As I mentioned in yesterday’s post, one of the things that we’re doing with is making sure that all of our work is unit tested from the initial version.

And when it comes to unit testing in PHP, many of us are familiar with PHPUnit; however, when it comes to unit testing plugins that are integrated with WordPress, it helps to have a test environment set up.

Sure, it’s possible to set aside a test database, test content, and then defined mock objects based on interfaces (and I’m not here to dissuade anyone from doing that). But WP-CLI offers a much easier way to go about doing just that in a more automated manner.

But first, it’s important to make sure that it’s correctly installed on your system.

Continue reading

MySQL Admin Can’t Connect To Localhost

I’m going to have a significantly longer post (or series of posts) that go more into detail about setting up WP-CLI, proper unit testing of WordPress plugins, and so on.

Unit Testing with WP-CLI

But for those who are already working on setting all of this up and are hitting a couple of problems with trying to set up a temporary database using some of the provided WP-CLI shell scripts, I wanted to share the solution that I used to resolve this.

Continue reading

Improve Your WordPress Skills with Hookr.io

One of the most important things you can do to improve your WordPress skills is to learn all about WordPress hooks. If you’ve spent any time looking through code, trying to write a plugin, or referencing the Codex then you likely know:

Hooks are provided by WordPress to allow your plugin to ‘hook into’ the rest of WordPress; that is, to call functions in your plugin at specific times, and thereby set your plugin in motion.

Yes, I think it’s important to understand the event-driven design pattern. And it’s one thing to have a comprehensive list of everything that’s available regardless of if it’s an action or a filter but it’s another thing to actually see it action.

Given that we all have different learning styles, sometimes I think having a reference is only one way to go about learning how to leverage the system. Another way would be to use a plugin like Hookr.

Continue reading

« Older posts Newer posts »

© 2026 Tom McFarlin

Theme by Anders NorenUp ↑