6. Installing WPMU DEV Plugins via Composer
If you are the advanced developer type and like to manage your WP site via the Composer package manager WPMU DEV has full support for that! We are now publishing our own <a href=”https://premium.wpmudev.org/packages.json”>Composer repository</a>.
6.1 Composer Integration ExamplesLink to chapter 1
All packages are protected by basic auth with your API key as the username, you can leave password blank. All you have to do is add https://premium.wpmudev.org/ as a composer repository to your WP root Composer.json file. Here is an example of what you would need to add to your Composer.json file to install the latest version of Spirit theme and MarketPress plugin:
Package names use the url slug of the project as found in our listings https://premium.wpmudev.org/projects/category/plugins/, not necessarily the folder name.
Here is a little example of calling “composer update” after adding our repo and some packages.
After entering your API key once, Composer will prompt you to save it in a private location, which is fine. Please note that it’s highly recommended not to save your API Key into Composer.json, as that is often published and publicly accessible which is a violation of our TOS. So if you save it make sure it’s in the proper auth.json file which is excluded from public repos.
The WPMU DEV repo also has some basic dependency management, for example adding wpmudev/luke-sara theme will automatically install the required wpmudev/upfront parent theme, or a BuddyPress plugin will require buddypress/buddypress package from packagist.