Software Engineering in WordPress, PHP, and Backend Development

Tag: WordPress (Page 38 of 219)

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

A Quick Note on Unit Testing Code in WordPress Projects

The more work I do in WordPress, the more I try to make unit testing as much a part of my development as building out the actual feature set. (It’s what all the professionals say we need to do, anyway.)

But seriously, it does improve the quality because, if for no other reason, something breaks, you’re able to see which test fails or even if you’ve missed coverage in some area.

I’m not of the mindset of some that you have to have 100% code coverage (and there are reasons for why I think this), but I do think it’s important to have as much code coverage as possible of code that is not directly to WordPress.

Continue reading

Resizing Images Programmatically in WordPress

If you’ve ever had to work with resizing images programmatically in WordPress, then you may have come across the image_resize function.

Resizing Images Programmatically: Deprecated Functions

Further, you may know it’s been deprecated (given that this appears at the top of the screen):

This function has been deprecated. Use wp_get_image_editor() instead.

And with its deprecation, as is true of all those who do a good job deprecating functionality, it’s not without its replacement.

In this case, we’re talking about the WP Image Editor. This is a class in WordPress that we can use to perform the same operations to go about resizing images programmatically that we once could with the original function.

Continue reading

The Demand for Gutenberg Is Not There. Yet.

I’ve been asked, on a few occasions, why I’ve not released anything that’s compatible with Gutenberg or why certain plugins aren’t compatible with the current version of the Gutenberg plugin.

Demand for Gutenberg Is Not There

In the WordPress economy, I’ve seen few things as divisive as this shift in WordPress (though it seems to be finally have chilled a bit). And I’m not interested in entertaining a position on it on this blog.

But when others ask why I’ve not bothered to write anything about it or make certain plugins compatible with it, I find that it’s worth talking about it at least to a certain degree.

Continue reading

Sanitizing URLs in WordPress with Its API and Built-In PHP Functions

Working with user-centric fields in WordPress – such as input elements, textarea elements, or any type of field in which a user can supply their own values is a place that should always be a target of sanitization.

Sanitizing URLs in WordPress with Its API

Fortunately, the WordPress API provides a number of functions to help with this. Depending on your use case, you may need to do one of the following:

And those are all well and good but there are also ways in which you can work to sanitize the data using functions provided by PHP.

Sure, sometimes regular expressions are the way to go but, other times, you may want to use facilities that are built into the language, easier to understand, and easier to follow.

When writing my own code (and when reviewing others) I try to keep that in mind. So with that said, here’s a process that you can use that may make your efforts easier when working with URLs in WordPress.

Continue reading

Tools, Processes, and More for The Independent WordPress Developer

One of the things that the Internet has made possible that we couldn’t have seen even a decade ago is the proliferation of self-publishing that would happen.

And in this instance, I’m not talking about blogging. I’m talking about self-publishing in the form of eBooks and the like. I mean, looking at anyone with a Kindle that has targeted advertisements (I had a previous version like this), you can see offers for books that are being published by those who have no publisher other than themselves.

I’m not here to argue whether or not that’s a good thing or a bad thing, but it is a thing, and it’s something that I think is worth looking to especially in our space.

The Independent WordPress Developer: Tonya Mork

I mean how many people do you know that have self-published material in some way? Off the top of my head, I know Tonya Mork has published material as has Chris Lema.

The Independent WordPress Developer: Chris Lema

It’s kind of neat. And I suppose this is the part where I’m supposed to say something like:

And coming in just a few weeks, I’m going to have my own eBook published!

But that’s not [exactly] where I’m going with this. Instead, I want to talk a bit about memberships on this site and what we may call the independent WordPress developer, the independent WordPress freelancer or the indie WordPress developer or whatever term you like the most.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑