Local Plugin Development: Map Plugin Folders Using Volumes Add-On

Just wanted to share a little workflow, maybe it will help some users.

What I wanted:
Currently I’m developing a new plugin locally. For testing purposes I wanted to test it in various WordPress configurations etc. at the same time. I have one Dev site in Local setup and few test sites. I wanted the test sites to always have my latest dev version of the plugin automatically. Since it didn’t work with symlinking I tried to use the Volumes Add-On for that – and this works like a charm, whoa! :slight_smile:

How to setup:
Decide which Local Site is your “Dev” site, get the full path to the plugin folder you are developing:
/Users/user-name/Dropbox/Local Websites/site-name/app/public/wp-content/plugins/plugin-name
–> use this path as your “Host Source”

Now, for all “testing” sites in Local that you want to use this path for the specific plugin, use the following as your “Container Destination”:
–> “plugin-name” needs to be itentical with “plugin-name” from the Dev site, obviously!
Note: make sure, there is no plugin folder with the same slug/name in the plugin folder. If so, deactivate and delete the plugin first!

Then in Local make sure the “Volumes Add-On” is properly installed and active.
Go to any setup site (except for your “Dev” site!) and setup the destinations - under: More > Volumes
"Add Host Source" --> use full path of your Dev site source - see above
"Add Container Destination" --> use the relative path - see above

After that click the “REMAP VOLUMES” button - site is provisioning again.

Then go in the “testing” site and you see your plugin on the plugins page - activate it. It now uses all files etc. from your Dev site source! Any changes you make on your plugin in the Dev location are automatically live on all setup testing locations.

Additional notes:

  • this should work for themes with the same principles!
  • since I work on a Mac the above paths are for Macs - I am not familiar with Windows, but should work in similar way I guess?
1 Like

What are the advantages to this over using symlinks?

With Local 5.x you do use symlinks. For Local 3.x you must use the Volumes Add-on as it needs to reach inside the Docker volume.

Ahhh… Thanks. i was never able to get 3.x running here, so I only knew from 5.x.