Posted on

Install Woocommerce plugin and theme with Composer from the vendors’ repositories

When managing WordPress and the plugins with Composer via Trellis, I sometimes could not find a plugin or a theme that are not available from the wpackagist repository. This is how to install plugins and themes directly from the vendors’ github repo or download site.

Open composer.json and add repositories. For example to add Woocommerce plugin and the Storefront theme, specify the zip download URL with the package name. Each custom package requires an unique package name. I specified woocommerce-theme for the Storefront as woocommerce is already used by the plugin.

and requires them also in the same composer.json.

To install the plugin and theme on the development environment, ssh to Vagrant and run composer update.

You may encounter permission error when “composer update”. In that case, remove the related folders from the local env.

Then again composer update in the Vagrant env.

The plugins will be installed automatically on the production when you next deploy.

Set up wp-coding-standards

To use WordPress coding standard, add the following repository in the composer.json.

They will be installed in the following directories.


You need to specify the relative path in the phpcs.xml

If you are using ATOM Editor, install the following packages:

  • linter
  • linter-phpcs
  • editorconfig

To install phpcs, first set up the composer in your local env, then install phpcs.

% composer global require “squizlabs/php_codesniffer=*”

Then set up the ATOM linter-phpcs preference “Executable Path” to “/Users/USERNAME/.composer/vendor/bin/phpcs”.

If you encounter “Invalid point encountered in the attached message” linter-phpcs error, follow this comment.