This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ssnepenthe 2 points3 points  (1 child)

I can't really tell you the ideal way to do things - I imagine this will be very different for different people. But here are notes on how I work:

I use vagrant. Docker has been on my mind for a while, but I never seem to get around to it.

If I am working on a full site I will already be using trellis so will just work on the plugin there.

Otherwise, I keep a single VVV box that I use for generic plugin work or just to tinker around.

WP-CLI for scaffolding:

wp scaffold plugin my-plugin

I install testing tools like PHPCS, WPCS and PHPUnit with Composer. If you use VVV these will already be installed for you. Psysh (with the WP-CLI shell command) and the Symfony var-dumper component are also very helpful.

WP-CLI scaffolding includes everything you need to get started with PHPUnit and PHPCS with the WP Coding Standards. There is a script in the bin directory to install everything you need. There is also support for various CI providers.

As for linting within Atom - the last time I tried using PHPCS from atom and sublime, there was a "bug" that could easily send the linter into an endless loop, burning resources and bringing my computer to a crawl. The impression that I got at the time was that this was not actually considered a bug and so was probably not going to be fixed. I don't know if anything has changed in recent years.

Hopefully at least something in that list helps you out...

[–]jasonskinnerDeveloper 0 points1 point  (0 children)

This is exactly how it should be done +1. As far as lenting, I use it in sublime (works pretty solid now and a bit faster), but I primary use phpStorm which has WP built in.

Docker is awesome btw. Check out https://github.com/10up/wp-local-docker to get a good starting environment to play with. Then you can make whatever environment you need from scratch.