Project Onus
Centralised composer dependency management for WordPress projects.
★ 1stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/khromov/wp-onus/archive/refs/heads/master.zipDeclares an update source (khromov/wp-onus), so updates arrive through the plugin's own updater.
From the readme
Project Onus
Centralised Composer dependency management for WordPress projects.
This allows you to have one vendor directory for your entire project. No more clashing libraries between different plugins
that use Composer internally.
It works by going through every dependency of each plugin that has registered its use
of Composer with Onus using WPOnus::register(), finds a working configuration of library versions, and installs it centrally to avoid having multiple versions of the same package installed.
Onus can also alert you of incompatible versions, ie. when one plugin requires Guzzle 1.0 and another plugin requires Guzzle 2.0.
This is a incomplete proof of concept. More info coming soon. Help welcome.
Setup
Clone this plugin:
Install dependencies:
Clone the two example plugins that demonstrate how dependency management works across plugins:
Example of how the integration works in external plugins:
https://github.com/khromov/wp-onus-test-plugin-1/blob/master/wp-onus-test-plugin-1.php#L14
The steps for plugins are:
Make sure to include at least a composer.json in the plugin root.
Don't load autoload.php if this plugin is active.
Register your root folder with this p