yeswedev / auto-composer-update
A plugin that automatically updates the composer when a WordPress plugin is updated.
Installs: 966
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 1
Open Issues: 0
Type:wordpress-plugin
Requires
- composer/installers: >=2.0
- guzzlehttp/guzzle: ^7.8
- vlucas/phpdotenv: ^5.6
README
A plugin that uses WordPress Automatic Updater to send data to an API that updates the "composer.json", add changes and commit. It works for plugins and core.
Installation and usage
- Install the plugin with composer :
{
"type": "package",
"package": {
"name": "yeswedev-team/auto-composer-update",
"version": "3.0.0",
"type": "wordpress-plugin",
"dist": {
"type": "zip",
"url": "https://github.com/yeswedev-team/auto-composer-update/archive/refs/tags/{%VERSION}.zip"
},
"require": {
"guzzlehttp/guzzle": "^7.8"
}
}
}
- Add the
WP_CURRENT_PATH
,GIT_REPOSITORY
,GIT_BRANCH
,UPDATE_REPOSITORY (true or false)
andAPI_UPDATE_WORDPRESS
environment variable, which points to the path of the WordPress project - In your WordPress configuration, check the presence of these lines on the environment you want
Config::define('AUTOMATIC_UPDATER_DISABLED', false);
Config::define('FS_METHOD', 'direct');
Config::define('WP_AUTO_UPDATE_CORE', true);
Config::define('DISALLOW_FILE_MODS', false);
- Ensure that all maintainers can push on the branch concerned.
- Go to back-office and enable the plugin.
- Wait for WordPress Automatic Updater or use CLI to trigger it :
wp eval 'do_action("wp_maybe_auto_update");'
Help
When the update fail, WordPress may add a '.lock' into the wp_options table, normally it will expire before the next trigger of the WordPress Automatic Updater, but you can also remove it manually : DELETE FROM 'wp_options' WHERE 'option_name' LIKE '%.lock%';
to be sure.