PhpStorm is the best PHP IDE available and you should use it. If you don’t agree stop reading. Did you stop reading? No? Good, then you aren’t a dumbass let’s get started.
This tutorial explains how to setup PhpStorm to work on WordPress Plugins (and Themes).
Target audience: Intermediate to advanced.
- PhpStorm is a cross-platform, IDE (Integrated Development Environment) that delivers a deep integration with WordPress. Come learn how to: Navigate WordPress core like a pro Automatically format your code according to WordPress coding standards Automatically scan your code for issues Utilize advanced debugging capabilities Integrate with tools like Git, Vagrant, Composer, PHPUnit and WP-CLI.
- Dec 09, 2020 PhpStorm comes packed with very neat WordPress support which makes using PhpStorm for WordPress theme, plugin, and site development even easier. A complete rundown of the new WordPress features can be found here. PhpStorm recognizes a WordPress related project and will ask you to point it in the direction of your installation path.
- 4 thoughts on “ Howto Setup PhpStorm to Work on WordPress Plugins (and Themes) ” Tyler Style 2013-04-23 at 7:46 AM. Always nice to see PhpStorm tutorials out there, it’s an awesome IDE. And WP being as popular as it is, I’m sure people trying to get into WP dev will find this helpful.
JetBrains PhpStorm is a commercial PHP IDE that can be configured to work with WordPress sites, allowing users to easily build and maintain custom plugins. This doc will set you up with a local environment in PhpStorm to create your custom plugins and themes. For detailed information, see WordPress Development using PhpStorm.This document focuses on integrating and showcasing the. PHPStorm: It is an IDE that is developed for PHP and Web Developers that contains several modern tools. It also offers features such as functionality, Code navigation, smart code editor for PHP, Testing and Debugging facilities. Apart from these, the presence of Database technologies is an.
UPDATE (2014-03-21): PhpStorm 8 (and up) supports WordPress development out of the box. Check it out!
This tutorial will not show you how to use PhpStorm. I assume you are already using PhpStorm or want to learn and will do so on your own. This tutorial will not show you how to develop for WordPress. Yes, WP sucks and is ass-backwards PHP. Or yes, WP is amazing and powers ~20% of the web. For whatever reasons, you are here for this info.
Benefits of this type setup:
Phpstorm Wordpress Code Style
- Automatic code completion, code navigation, PhpStorm’s kitchen sink.
- Ability to mix version control systems (Git, SVN, Perforce, CVS, …) and sources (GitHub, SourceForge, Codebase, core.svn.wordpress.org, … )
- Work on multiple plugins (and themes) at the same time for the same project.
Phpstorm Wordpress Development
I’m a developer at PressBooks.com. This is my project setup:
This structure makes up the bulk of PressBooks dot com, that is:
- WordPress 3.5.x (Subversion)
- PressBooks (GitHub)
- The front page of PressBooks dot com (a private theme, hosted at Codebase)
- Internal stats dashboard (a private plugin, hosted at Codebase)
Prerequisites
- LAMP on localhost or LAMP on VM with mapped folders. (If this doesn’t mean anything to you then stop reading and come back when it does, young padawan)
- PhpStorm -> Quick Start -> Open Directory
- PhpStorm -> File -> Settings
Directories
Under Project Settings, select Directories. Add each content root that makes up your WordPress project.
Deployment
Under Project Settings, select Deployment. Click the green +. Create a deployment profile of type “Local or Mounted Folder”. I named mine: TextoPress. Rename accordingly. Remember this renaming for the Install section that will come later. Select the Connection tab. Change “Folder” to: the root path of your WordPress site. Change “Web server root URL” to: the root URL of your WordPress site.
Select the Mappings tab.
- Map WordPress to: /
- Map Plugins to: wp-content/plugins/__PLUGIN_NAME__
- Map Themes to : wp-content/themes/__THEME_NAME__
Replace __PLUGIN_NAME__ and __THEME_NAME__ accordingly. Click on the above screenshot and squint for more details.
Under Project Settings, select Deployment -> Options. Change “Upload changed files automatically to the default server” to: Always. Change “Upload external changes” to: true.
Version Control
Under Project Settings, select Version Control. Add your VCS repositories.
Install
Phpstorm Wordpress Debug
Apply changes. Right click on your project. Select “Upload to TextoPress” (Don’t see TextoPress? Exactly. Re-read the Deployment section above…) Navigate to your web server root URL. Install WordPress using the Famous 5-Minute Install. Eventually:
Remember:
Phpstorm Wordpress Tutorial
- You are editing a copy of the code, not the deployed code. If something seems weird always start by doing “Upload to TextoPress” which from here on in will be known as “Did you plug it in?”
- You can add and remove plugins (and themes) as you feel like. Rinse and repeat the instructions above until you get the hang of it.
Code is poetry. Bad, wince-worthy poetry.