Skip to main content

Composer

We use Composer for managing PHP dependencies, which can include everything from internal tools/libraries to premium WordPress plugins (and even WordPress core itself).

Managing dependencies this way can take some getting used to. But it comes with numerous benefits, including:

  • Keeping plugins and themes into source control.
  • Avoids us having to use git submodules.
  • Let us manage WordPress and non-WordPress project libraries with the same tooling.

Public Packages

Most dependencies can be found on the main Composer package repo, Packagist.

Any WordPress plugin or theme available on wordpress.org can be found on a WordPress-focused package repo, WPackagist, where the package name uses the same "slug" as the wordpress.org listing of the plugin/theme.

If you wanted to use StellarWP's open-source container-contract library, for example, it's available on Packagist:

composer require stellarwp/container-contract

To add the free version of the Yoast SEO plugin, for example:

composer require wpackagist-plugin/wordpress-seo

To add the base Kadence theme:

composer require wpackagist-theme/kadence

Private Packages

We mainly use private GitHub repos for managing private packages. This is a common practice, and Composer has built-in support for this.

We have several Recipes on this topic: