Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/gatorworks/gwdev-management/archive/refs/heads/main.zipPrivate plugin for pushing fixes and small bits of logic to every site we host.
Every fixes/*.php file is loaded automatically on each request.
Adding a fix
- Copy
fixes/_template.phptofixes/<slug>.php(no leading underscore). - Fill in the
Fix:/Description:header and add your code. - Bump
Versionin the plugin header andGWDEV_MANAGEMENT_VERSIONingwdev-management.php. The build fails if they don't match. - To build locally: run
bin/build.sh. It writesdist/gwdev-management.zipanddist/gwdev-management.json.
Files load in filename order. Files starting with _ are skipped.
If a fix throws, including a PHP parse error, it gets logged to the PHP error log and skipped, and the other fixes keep loading.
Releasing
Commit the version bump, then tag it:
git tag v1.1.0 && git push origin v1.1.0
The GitHub Action (.github/workflows/release.yml) builds the plugin. It checks that the tag matches the plugin version, then publishes a GitHub release with the zip and the JSON manifest.
Sites check about every 12 hours and then show the update in wp-admin like any other plugin. To roll it out right away:
wp plugin update gwdev-management
To have sites install new versions on their own:
wp plugin auto-updates enable gwdev-management
First install
wp plugin install https://github.com/Gatorworks/gwdev-management/releases/latest/download/gwdev-management.zip --activate
After that, the plugin updates itself.
Private repo
If the repo is private, put a fine-grained GitHub token in each site's wp-config.php. It needs read-only Contents access to this repo only.
define( 'GWDEV_MANAGEMENT_GITHUB_TOKEN', 'github_pat_...' );
The first install can't use the URL above for a private repo. Download the zip from the release and install it from a local path instead.
Per-site control
wp gwdev-management status # version + loaded/disabled/errored counts
wp gwdev-management list # every fix and its state on this site
wp gwdev-management disable <slug> [<slug>...] # turn a fix off here (stored in wp_options)
wp gwdev-management enable <slug> [<slug>...]
You can also set these in wp-config.php:
define( 'GWDEV_DISABLED_FIXES', array( 'acf-remove-innerblocks-wrapper' ) );
define( 'GWDEV_DISABLE_ALL_FIXES', true ); // kill switch