You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+87-47Lines changed: 87 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,42 +1,44 @@
1
1
# WordPress Plugin GitHub Updater
2
2
3
-
Reusable GitHub updater helper for WordPress plugins, built on top of `yahnis-elsts/plugin-update-checker`.
3
+
Composer library for handling WordPress plugin updates from GitHub repositories. Built on `yahnis-elsts/plugin-update-checker` with built-in rate-limit mitigation.
4
4
5
5
## Features
6
6
7
-
- Automatic plugin updates from GitHub.
7
+
-**Automatic updates** from GitHub releases or branch commits.
8
+
-**Rate-limit mitigation**: Configurable check intervals (default 6h) and throttling (72h when update already known).
9
+
-**GitHub token support** for private repos and higher API limits (60 → 5000 requests/hour).
8
10
- Release-asset filtering using regex.
9
11
- Branch selection (default: `main`).
10
-
- Canonical static API (`GitHubUpdater::init`) plus backward-compatible wrapper (`GitHub_Plugin_Updater`).
12
+
- Canonical static API (`GitHubUpdater::init`) plus backward-compatible wrapper.
11
13
- Error handling with `WP_DEBUG` logging.
12
14
13
-
## Requirements
14
-
15
-
- WordPress plugin context (`ABSPATH` must be defined).
-`manually-build-zip.yml`— Manual build/upload for a provided tag
117
142
118
143
Copy them into your plugin repository at `.github/workflows/`.
119
144
120
145
### Workflow Checklist
121
146
122
147
1. Set `PLUGIN_ZIP` to your plugin zip file (example: `my-plugin.zip`).
123
-
2. Keep `composer install --no-dev --optimize-autoloader` so the updater dependency is packaged.
148
+
2. Keep `composer install --no-dev --optimize-autoloader` so dependencies are packaged.
124
149
3. Keep the verification step that checks `vendor/yahnis-elsts/plugin-update-checker` exists in the zip.
125
150
4. Ensure `name_regex` in PHP matches your zip filename convention.
126
151
@@ -140,11 +165,26 @@ If `plugin-update-checker` is not in `vendor/`, updater setup fails. In `WP_DEBU
140
165
141
166
### GitHub API rate limits
142
167
143
-
Unauthenticated GitHub requests are rate-limited. Keep failed lookup caching enabled in your updater flow and avoid frequent forced checks in production.
168
+
The library includes built-in rate-limit mitigation:
169
+
170
+
-**Check interval**: By default, checks only every 6 hours.
171
+
-**Throttling**: When an update is already available, checks reduce to every 72 hours.
172
+
-**Token auth**: Pass a GitHub token via `auth_token` to increase limits from 60 to 5000 requests/hour.
173
+
174
+
If you still hit rate limits, increase `check_period` or add a GitHub token.
144
175
145
176
### Private repositories
146
177
147
-
This wrapper is designed for public GitHub releases. For private repositories, instantiate plugin-update-checker directly and configure authentication with that library.
178
+
Pass your GitHub personal access token via the `auth_token` parameter:
0 commit comments