WordPress development has come a very long way in recent years when it comes to tooling. In the past, developing a WordPress website required some sort of MAMP/WAMP localhost setup and almost always, a rather painful headache. Maybe you're even one of those developers who developed their website on a live environment – I was.
Luckily, times have changed and there are now tools that help take the headache and repetitiveness out of building WordPress sites on your computer.
In December last year, after 3 years of being almost completely devoid of any WordPress development, I became a full time WordPress developer again. Before that 3 year stint in the payments industry, I was a full time WordPress contractor.
Being out of an industry for 3 years, gave me a unique perspective on how fast things change in computing and more specifically, web development. WordPress development is no exception.
You see, when I returned to WordPress development in December last year, I decided to look at setting up the perfect WordPress development environment. I was pleasantly surprised to see that the tooling around WordPress had advanced so much that it was much like trading in a Ford for a Ferrari.
I was excited, and still am of course, to explore all the tools and in today's article I'm going to share with you a summary of what I have learned. Hopefully it will help you tweak your current environment and implement some of the tools that are available to you.
It Starts with the ServerTo begin with, the most important piece in the WordPress development environment puzzle is the server. Without a server, we can't do anything.
There are so many different options available today to host WordPress websites on your local environment that it gets tricky to know which one to use.
I'm going to suggest that you drop MAMP/WAMP/XAMP and start using a virtualized development environment.
Why? There are so many reasons:
Now that you're sold on a virtualized environment. What should you use?
I'm using VVV. For me it was extremely straight-forward to get up and running, has a good support system around and it is used by many of the big WordPress development agencies, including the one I work for, XWP.
Some of the other options for a virtualized WordPress development environment include: HGV, Wocker, VIP Quickstart.
If you decide to go with VVV, then I definitely recommend the following plugins and tools to take VVV to the next level of awesome.
Aleksander Koko has previously written about VVV, and I've also recently recorded a video on how to setup VVV on your own computer.
The Power of the Command LineWho doesn't like a bit of command line fu, right? WP-CLI is the answer to your inner command line desire.
WP-CLI let's you manage a WordPress installation from the command line (it ships with VVV by the way).
Let's look at some practical examples of how you can use WP-CLI in your local development environment.
That's all quite handy stuff that you can do from the command line. Best yet, in the next section we'll talk about an IDE and you can run all these commands directly from that IDE.
If you're interested in learning more, check out this article on WP-CLI by Ahsan Parwez.
An IDE That Makes a DifferenceOut of all the tools I am talking about today, I have a feeling that this is going to be the most contentious. When it comes to IDEs and editors it's almost as if you're invading personal space, and a lot of people don't like that.
I'm not going to try and tell you an IDE is better than a text editor or vice versa. What I'm going to do is tell you my experience of switching to an IDE and how it worked for me.
I have always been someone who has disliked IDEs. Dislike is probably being kind, I hated them. I felt they were bloated, slow and cluttered.
I was a big Sublime Text fan (and still am by the way, I use it daily).
So in December, as I was getting back into WordPress development, I checked out what editors were available to write WordPress code. I was quite surprised when an IDE by the name of PhpStorm kept getting a mention.
Reluctantly, I took a look and boy am I glad that I did!
PhpStorm is the best IDE for PHP and WordPress development, in my opinion. It offers everything you need to build WordPress websites, plugins and themes all in one place and it has incredible WordPress integration (you really need to check it out).
Here are three reasons why you should consider PhpStorm this year for WordPress development:
If you're interested in getting started with PhpStorm, then check out a series of 7 PhpStorm videos that I recorded to get your started with the IDE.
Making Sure Your Code Is Silky CleanThe last tool that I am going to write about today is a doozy! I'm particularly pedantic when it comes to writing code. I like it to be silky clean and follow the WordPress coding standards to a tee.
But even being that pedantic, we're all humans. And very often I find myself going through the code that I have written and cringing about a missed space or extra new line.
Being in the open source world, it's extremely important that developers stick to coding standards that are defined by the projects otherwise a codebase degrades extremely quickly, especially on a popular open source project like WordPress.
In fact, the WordPress core team is particularly strict about coding standards and that they're followed.
So how can we make sure that our code follows the WordPress coding standards? The answer is simple and it is a tool called PHP CodeSniffer with the WordPress coding standards ruleset.
These two utilities will scan your code, find any discrepancies between your code and how it is expected to be written by the WordPress project and inform you of what is wrong. Magic!
Best of all, they will also notify you of any high level security issues that it encounters. Now it won't catch every single security issue so make sure you're always thinking about security when you're writing your code but it is a good first line of defense.
Of course, I wouldn't be able to complete this section without mentioning that PhpStorm has baked in support for PHP CodeSniffer. I've released a video on how to tie PhpStorm, PHPCS and the WordPress coding standards ruleset together.
In ClosingThere are many alternatives to the tools above and my hope is that at the very least everything I have spoken about today gets you interested in exploring some of the awesome tooling around WordPress development.
The above tools, should you chose to use them, will give you a great foundation for getting started with a more streamlined and automated approached to WordPress development.
If you have other tools that you use, I would love to hear about them in the comments below!
Source: The Ultimate WordPress Development Environment
No comments:
Post a Comment