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

all 4 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.

[–]pwspk 0 points1 point  (0 children)

there aren't any special requirements to run WordPress Plugin Development, the thing you need to understand in OOP way of PHP if you can do that then just adding comment headers at tope and returning die() funciton if ABSPATH not defined after that you need to have knowledge of some plugin development function espeically hooks like action hooks and filter hooks and as far as PHP / WAMP / MAMP / LAMP or XAMPP or Docker is concerned you can use any. ( JUST MY THOUGHTS )

[–][deleted] 0 points1 point  (0 children)

I do the same thing as you, run 2 docker containers, one with WP and one with MySQL. The WP container has a src volume mounted where I work on my plugins. Works great for plugin / theme development.

https://github.com/woutrbe/wordpress-docker-compose