WordPress with composer, how to handle updates?

Basically in “common” WordPress setup you have two things inside the folder that aren’t part of the core itself: content folder and wp-config.php configuration file. So you are on completely right path: You configure content folder to be elsewhere, outside of core folder You place wp-config.php one directory level above the core folder (WP will … Read more

Using composer for dependency management in plugindevelopment

There are still very few WP plugins/themes that are being developed Composer-first. You can take a look at Laps case study (one of mine) for practical example. Essentially if you plan for plugin to be publicly distributed you need to take care of both cases – running it as part of whole-site Composer stack and … Read more

Why include a composer.json file with my plugin?

TL;DR If you want to support Composer, adding a composer.json is better then just let WPackagist create a package for you. There are several reasons, no one is really important, but considering that to create a composer.json does not require much effort, it probably worth it. composer.json Benefits Below a non-exhaustive list of benefits of … Read more

How to prevent Composer dependency conflicts amongst WP plugins?

The answer is — you can’t because WordPress can’t. There is no dependency management concept in WP and it was the same case before Composer had even existed. The rise of autoload (Composer or otherwise) slightly helps with it, since you might just be getting different copy loaded (hopefully close enough) rather than outright fatal … Read more