2 Must-Have Tools for WordPress Development

Share on facebook
Facebook
Share on twitter
Twitter
Share on reddit
Reddit
Share on linkedin
LinkedIn

There are some exceptional tools that can be used for WordPress development that make the process way easier than it would be otherwise. I didn’t know about some of these early on in my WordPress development days, so for those of you who might not be familiar with them, I’d like to share.

Local by Flywheel

Local by Flywheel (Mac, Windows) creates local WordPress environments with a few simple clicks, and they come up chock full of handy features to expedite development.

Creating a new local WordPress site is as simple as entering the name:

Enter a name for your local WP site

Selecting some environment options:

Choose your PHP and MySQL versions, and Apache or Nginx

And deciding whether or not it’s going to be multisite:

Create a username and password and add multisite as needed

Local by Flywheel will spin for a moment or two and soon you’ll have a brand-new local install of WordPress.

Once your site is up and running, Local by Flywheel provides a lot of neat helper tools. You can access your database via the installed-and-ready browser tool Adminer, or use the open-source Sequel Pro client. Either way, there’s no messy connection setup; just click the buttons and your in:

After starting the site, you can access the database via Adminer or Sequel Pro
The browser-based Adminer

Email is automatically configured using MailHog, which further simplifies the testing/development process:

MailHog is a browser-based tool for email testing

Local by Flywheel also supports add-ons, which brings us to our next must-have tool: PHPStorm.

PHPStorm

There are editors and there are IDEs. PHPStorm (Mac, Windows, Linux) is the latter and it has tons of features (many that I’ve yet to use!) The reason that I find it indispensable for WordPress plugin development is, in part, because of the integration with Local by Flywheel.

One of Local by Flywheel’s add-ons is “Xdebug + PHPStorm” which needs to be enabled in your installation before these next tricks will work:

Add-ons for Local by Flywheel

Once enabled, you can go to an individual Local by Flywheel site and click the “Configure PHPStorm…” button:

Enabling debug for PHPStorm

It will look almost like nothing happened until you go to PHPStorm and start a new project. You want to select “Create a New Project from Existing Files”:

Starting a new PHPStorm project

Choose “Source files are in a local directory, no Web server is yet configured.”:

Correct project option for use with Local by Flywheel

Finally, you will want to navigate to the correct directory for your Local by Flywheel installation. By default (on Mac) this is a folder called “Local Sites,” but I changed my to just “Sites” because I spend a lot of time on the command line and I don’t like spaces in my folder names!

The most important thing to note is that when you find your site’s files, you want to navigate into app/public and use that as your project folder:

Setting the project’s home folder

Click “Finish” and PHPStorm will open.

There’s so much detail about PHPStorm that I’m not planning to touch here; the main thing I want you to see is this:

PHPStorm debug configuration

Notice how, in the upper-right hand corner of your screen, you have a PHPStorm run profile already defined: “Local by Flywheel”. This means that you can click the green “bug” icon and initiate the debugger. (Local by Flywheel needs to be running, and your site should be running from Local by Flywheel first.)

You can set debugging break points just by clicking in the gutter:

Setting a breakpoint

This gives you the ability to pause your running plugin code, examine values, and step through/into code blocks.

Using Local by Flywheel and PHPStorm together can save a developer untold hours, and as you can see, the setup couldn’t be simpler.

More to explore

Photo by Kyle Broad on Unsplash

“I Know You”

I’ve a few recordings that have survived the changes in technology and the natural degradation of formats such as tape. This song,

Photo by Caspar Camille Rubin on Unsplash

Getting WP Post and Postmeta in Single Rows

WordPress uses wp_posts to store post, page, and Custom Post Type (CPT) data the wp_postmeta table for Custom Metabox data. To retrieve this data you have to read for the post plus multiple linked postmeta rows. In this post, we conquer postmeta with subqueries.

Leave a Comment

Your email address will not be published. Required fields are marked *