Software Engineering in WordPress, PHP, and Backend Development

Author: Tom (Page 64 of 427)

Quick Tip: Optimizing Loading Assets in WordPress

Whenever I think of assets in WordPress, I generally think of JavaScript files and stylesheets; however, I know that fonts and images can also count, too.

One of the things that are all too common, though, especially as it relates to the administrative area, is loading assets in WordPress on screens where they aren’t needed.

It’s completely possible to make an argument that given the file sizes or the functionality that each present, the files are only impacting a minimal amount of load time at best, right?

But match this mentality with who-knows-how-many plugins, and you’ve got more than a heavy impact happening on a given payload.

So what can we do?

Continue reading

WordPress Widgets: Refactoring, Part 1

The last post included a lot of information on setting up code quality tools in your WordPress development environment, but they are necessary if we are going to be doing a lot of refactoring.

But as I mentioned at the start of this post, laying code quality tools first provides us with a foundation we can use as we refactor the boilerplate (which we clearly need to do given the amount of red shown by GrumPHP).

Honestly, I see these as necessary if you’re going to be doing any type of development hence the need to show how to set them up.

Regardless, the previous post shows just how much work we have cut out for us, right?

Screen Capture on 2018-11-20 at 12-50-27.gif

Now we’re going to start with refactoring the WordPress Widget Boilerplate.

This will not only improve the code quality but also walk us through some object-oriented principles that we can apply when building our widgets and we can apply in future WordPress development efforts.

Continue reading

A Helper Function for Admin Notices

If you’re in the business of building plugins, or even themes for that matter, and are incorporating object-oriented practices into your work then you’re likely faced with serialization of some type. And one of the aspects of serialization that it requires some type of feedback for the user.

This can be a success message, a failure message, or a message simply warning the user that some went wrong or perhaps something should be updated.

Whatever the case, WordPress provides all of the facilities that we need; however, we can make it even easier on ourselves by writing a helper function for admin notices. It’s simple, too.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑