Software Engineering in WordPress, PHP, and Backend Development

Tag: WordPress (Page 29 of 219)

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

What Are Source Maps (And Are They Needed)?

If you work on the front-end of a site in any capacity – be it for a plugin, a theme, or even something outside of WordPress – you’re likely working with minification tools.

The benefits are obvious, right?

  • it lessens the payload,
  • it allows us to focus on development on our local environments

But one of the features that come with working with these technologies and that’s the ability to generate source maps.

And this raises a question (or maybe two): What are source maps? And are they even needed?

You can claim it’s late to the game to talk about this, but there are always people entering the industry that may not know this material.

So why not cover it?

Continue reading

WordPress Widgets: Refactoring, Part 6

You should be well-versed in the refactoring we’re doing regarding the WordPress Widget Boilerplate. If not, I recommend catching up on the series thus far by:

As far as the code base goes, we’re in a good place right now. We’ve begun to refactor much of the code into smaller, more focused classes. And we’ve just set up a Registry so that we can begin working with instances of objects throughout the plugin without the need for too much coupling.

But there’s still a problem we’re facing and it deals with namespaces and autoloading. I’ve talked a bit about this a couple of years ago but not as it relates to Composer.

And that’s what we’re going to look at in this post.

Continue reading

WordPress Widgets: Refactoring, Part 5

In the previous post, we created a Registry that is going to be used to store all of the various classes responsible for giving our widget its functionality.

To do this, there’s going to be a variety of other classes introduced, but before going there, we need to add the Registry to the plugin’s bootstrap (let alone create a bootstrap for the plugin).

Specifically, here’s where we left off:

As mentioned earlier in the post, we need to add this to the bootstrap of the plugin. To do this, though, we need to define our own filter so that we can easily pass the registry around the rest of the plugin (when the time comes to do that).

So in this post, we’re going to focus on doing exactly that.

Continue reading

Adding a Plugin Settings Link

Whenever you’re building a plugin that introduces a submenu, and you’re using the proper APIs, you’re going to be creating an administration page (whether or not it has settings).

When doing this, though, you can also introduce a plugin settings link. These are the links that appear under the name of the plugin from in the plugin dashboard.

Plugin Settings Link

If your plugin introduces its submenu item, then it likely introduces its own settings page. And if you’re looking to associate this page with your plugin settings link, it’s really easy to do.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑