Tom McFarlin

Software Engineering in WordPress, PHP, and Backend Development

Page 24 of 427

WP Plugin Scaffold: Easily Start a Composer-based WordPress Plugin

TL;DR: The WP Plugin Scaffold repository contains a a very basic set of files that are needed to spin up a Composer-based WordPress Plugin.


Over the years, I’ve written or contributed to a number of different projects that have been aimed at making WordPress plugin development easier. At this point, there are a variety of ways people are creating WordPress plugins such that there isn’t really a way to create a boilerplate to capture all of them.

So I’m not aiming to do that.

But over the last few months (or maybe a year?), I’ve been working with the same structure for creating plugins. It normally grows into something larger based on if I’m taking an object-oriented approach or a procedural approach. It also changes based on how large the plugin is, what its purpose is, who is going to use it, or how it’s going to be used.

To that end, I’ve ended up with a very basic set of files that every project incorporates regardless of the size.

As such, I thought I’d share it.

Continue reading

Using PHP Sniffer & Beautifier for Visual Studio Code

TL;DR: There are a few PHP Code Sniffer extensions for Visual Studio Code. The one I prefer is PHP Sniffer & Beautifier by Samuel Hilson. Here’s where to get it and how to configure it.


Though this isn’t directly related to the material I’m writing about in my series on Ray on WordPress, it’s relevant enough to share at this point because:

  • the series is only going to include more code and i use this extension for writing said code,
  • over the last few months, I’ve found this extension to be really good in comparison to others that are available.

There are some other ones out that that are really good, and I’ve used them, but this is the one I’ve settled on using.

Continue reading

Using Ray in WordPress Development: Rendering Data and Data Structures

TL;DR: We’ll see what Ray looks like when rendering data, data structures, and other information in the context of a custom WordPress plugin. We’ll also see how to leverage some of its built in functionality for making data structures much more readable from how we’ve historically been able to do so.


📝 A Note About the Ray Plugin

When it comes to actually using the Ray application within the context of WordPress, I’d like to bring some clarity to the different ways in which it can be installed.

  1. Ray can be installed as a Composer dependency which is what we did in the previous article.
  2. Ray can be be installed a plugin via the WordPress Plugin Repository.
  3. Ray can be installed as a must-use plugin by cloning the repository from GitHub, placing it into your mu-plugins directory and then updating environmental variables as per the documentation.

All of these are viable options. I prefer to use the first option because I’m a fan of Composer and managing my dependencies that way so this guide will be following that approach.

If you opt to use any of the approaches, great! This series, however, will not offer guidance on those methods.


⚠️ If you’ve not already set up your environment, please read the previous post and make sure you have the free version of Ray installed.

Continue reading
« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑