Announcing Composer Support for WPMU DEV Products
Automating WordPress installs and test builds is now even easier for developers with WPMU DEV’s new Composer repository.
Composer, a command line dependency management tool for PHP, has been quickly gaining popularity. Basically, if you like to automate your builds, deploys or updates via tools like Git, Capistrano, or Roots.io/Bedrock, then Composer makes it simple to support WPMU DEV products.
It also gives you fine-grained control over plugin/theme updates, like auto-updating only to minor bug/security releases, while skipping major feature releases that might require manual configuration.
What is Composer?
I quite like how developer Josh Pollock describes dependency managers:
A dependency manager is one of those magical tools, like a smartphone, that most people (myself included) didn’t know they needed until they tried it, but once they did, they were hooked.
But what does that mean in non-developer speak?
Basically, any code you write often ends up depending on third party libraries. All of these libraries (projects, frameworks, files etc) become dependencies of your project. Composer lets you declare the dependencies for a project and it will install and manage them for you.
How to Use Composer with WPMU DEV
Let’s take a look at how it works.
All packages are protected by basic authentication with your WPMU DEV API Key as the username. You can leave the password field blank.
All you need to do is add https://premium.wpmudev.org/ as a Composer repository to your WordPress 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 our Spirit starter theme and MarketPress plugin:
Here is a little example of calling “composer update” after adding our repository and some packages:
After entering your API Key, Composer will prompt you to save it in a private location.
There is also some basic dependency management. For example, adding the
wpmudev/luke-sara theme will automatically install the required
wpmudev/upfront parent theme, or one of our buddyPress plugins will require
Note: We highly recommended that you don’t save your API Key into Composer.json as this file is often published and publicly accessible, which is a violation of our Terms of Service. So if you save it, make sure it’s in the proper auth.json file, which is excluded from public repositories.
It’s important to note that this feature is not available to members on our 14-day trial. So if you’re keen to take advantage of our Composer support but still on trial, you can either wait out your trial or upgrade to get started with Composer right away.
The full details of our Composer support is available in our Manuals (which we’ve redesigned and will be updating soon so keep an eye out!).
Helping Members Make the Most of WordPress
This new feature came about after some members requested it in our member forums. It was a no-brainer for our CTO Aaron Edwards, who put the repository together in collaboration with members who helped test the new feature.
Our forums are always buzzing with discussions on everything from code and customizations to SEO and online strategy. It’s a great place to chat to like-minded folks who are also building websites and business, as well as the friendly folks on our support team.
If you’re already a member, stop by and chat! (and accumulate hero points – we’re launching our rewards program soon!)
And if you’re not a member and want to join our community, give our 14-day free trial a go (and stick around to use our Composer repository!)