PHPackages                             soderlind/wordpress-github-updater - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. soderlind/wordpress-github-updater

ActiveLibrary

soderlind/wordpress-github-updater
==================================

Reusable GitHub updater helper for WordPress plugins, built on top of yahnis-elsts/plugin-update-checker

2.0.1(2d ago)22↑2900%GPL-2.0-or-laterPHPPHP &gt;=7.4

Since Apr 5Pushed 2d agoCompare

[ Source](https://github.com/soderlind/wordpress-plugin-gitHub-updater)[ Packagist](https://packagist.org/packages/soderlind/wordpress-github-updater)[ Docs](https://github.com/soderlind/wordpress-plugin-github-updater)[ RSS](/packages/soderlind-wordpress-github-updater/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

WordPress Plugin GitHub Updater
===============================

[](#wordpress-plugin-github-updater)

Composer library for handling WordPress plugin updates from GitHub repositories. Built on `yahnis-elsts/plugin-update-checker` with built-in rate-limit mitigation.

Features
--------

[](#features)

- **Automatic updates** from GitHub releases or branch commits.
- **Rate-limit mitigation**: Configurable check intervals (default 6h) and throttling (72h when update already known).
- **GitHub token support** for private repos and higher API limits (60 → 5000 requests/hour).
- Release-asset filtering using regex.
- Branch selection (default: `main`).
- Canonical static API (`GitHubUpdater::init`) plus backward-compatible wrapper.
- Error handling with `WP_DEBUG` logging.

Installation
------------

[](#installation)

```
composer require soderlind/wordpress-github-updater
```

This automatically includes `yahnis-elsts/plugin-update-checker` as a dependency.

Requirements
------------

[](#requirements)

- PHP 7.4+
- WordPress plugin context (`ABSPATH` must be defined).
- A GitHub repository with releases or branch updates.

Quick Start
-----------

[](#quick-start)

```
use Soderlind\WordPress\GitHubUpdater;

GitHubUpdater::init(
	github_url:   'https://github.com/username/plugin-name',
	plugin_file:  __FILE__,
	plugin_slug:  'plugin-name',
	name_regex:   '/plugin-name\.zip/',
	branch:       'main',
	check_period: 6,            // Hours between checks (default: 6)
	auth_token:   '',           // Optional GitHub token
);
```

Positional equivalent:

```
\Soderlind\WordPress\GitHubUpdater::init(
	'https://github.com/username/plugin-name',
	__FILE__,
	'plugin-name',
	'/plugin-name\.zip/',
	'main',
	6,   // check_period
	''   // auth_token
);
```

### With GitHub Token (for private repos or higher rate limits)

[](#with-github-token-for-private-repos-or-higher-rate-limits)

```
GitHubUpdater::init(
	github_url:   'https://github.com/username/private-plugin',
	plugin_file:  __FILE__,
	plugin_slug:  'private-plugin',
	auth_token:   defined('MY_PLUGIN_GITHUB_TOKEN') ? MY_PLUGIN_GITHUB_TOKEN : '',
);
```

Backward Compatibility API
--------------------------

[](#backward-compatibility-api)

`GitHub_Plugin_Updater` is still available for existing integrations.

```
\Soderlind\WordPress\GitHub_Plugin_Updater::create(
	'https://github.com/username/plugin-name',
	__FILE__,
	'plugin-name',
	'main',
	6,  // check_period
	''  // auth_token
);

\Soderlind\WordPress\GitHub_Plugin_Updater::create_with_assets(
	'https://github.com/username/plugin-name',
	__FILE__,
	'plugin-name',
	'/plugin-name\.zip/',
	'main',
	6,  // check_period
	''  // auth_token
);
```

Configuration
-------------

[](#configuration)

### `GitHubUpdater::init(...)`

[](#githubupdaterinit)

ParameterRequiredDefaultDescription`github_url`Yes-Full repository URL (`https://github.com/owner/repo`)`plugin_file`Yes-Absolute path to the main plugin file`plugin_slug`Yes-Plugin slug used by WordPress`name_regex`No`''`Regex to match release asset zip filename`branch`No`'main'`Branch to track`check_period`No`6`Hours between update checks. Set to `0` to disable automatic checks.`auth_token`No`''`GitHub personal access token for private repos or higher rate limits### Rate-Limit Mitigation

[](#rate-limit-mitigation)

This library includes built-in protection against GitHub API timeouts/overload:

1. **Configurable check interval**: Default is 6 hours (vs. upstream default of 12h). Adjust via `check_period`.
2. **Throttled checks**: When an update is already known, checks are reduced to every 72 hours.
3. **Token authentication**: Provide a GitHub token to increase rate limits from 60 to 5000 requests/hour.
4. **Error logging**: API errors are logged when `WP_DEBUG` is enabled.

Recommended Integration Pattern
-------------------------------

[](#recommended-integration-pattern)

From your main plugin file:

```
// Autoloaded via Composer
use Soderlind\WordPress\GitHubUpdater;

GitHubUpdater::init(
	github_url:   'https://github.com/owner/repo',
	plugin_file:  __FILE__,
	plugin_slug:  'my-plugin',
	name_regex:   '/my-plugin\.zip/',
	branch:       'main',
	check_period: 6,
);
```

Workflow Templates
------------------

[](#workflow-templates)

This repository includes two workflow templates in `.github/workflows/`:

- `on-release-add.zip.yml` — Release-triggered build + upload
- `manually-build-zip.yml` — Manual build/upload for a provided tag

Copy them into your plugin repository at `.github/workflows/`.

### Workflow Checklist

[](#workflow-checklist)

1. Set `PLUGIN_ZIP` to your plugin zip file (example: `my-plugin.zip`).
2. Keep `composer install --no-dev --optimize-autoloader` so dependencies are packaged.
3. Keep the verification step that checks `vendor/yahnis-elsts/plugin-update-checker` exists in the zip.
4. Ensure `name_regex` in PHP matches your zip filename convention.

Troubleshooting
---------------

[](#troubleshooting)

### Updates do not appear

[](#updates-do-not-appear)

1. Confirm your plugin file, slug, repo URL, and branch are correct.
2. Publish a release with an attached zip that matches `name_regex`.
3. Trigger a manual update check in WordPress Admin (or wait for scheduled checks).

### Dependency is missing in release zip

[](#dependency-is-missing-in-release-zip)

If `plugin-update-checker` is not in `vendor/`, updater setup fails. In `WP_DEBUG`, you will see:

`GitHubUpdater (your-plugin-slug): Missing dependency yahnis-elsts/plugin-update-checker...`

### GitHub API rate limits

[](#github-api-rate-limits)

The library includes built-in rate-limit mitigation:

- **Check interval**: By default, checks only every 6 hours.
- **Throttling**: When an update is already available, checks reduce to every 72 hours.
- **Token auth**: Pass a GitHub token via `auth_token` to increase limits from 60 to 5000 requests/hour.

If you still hit rate limits, increase `check_period` or add a GitHub token.

### Private repositories

[](#private-repositories)

Pass your GitHub personal access token via the `auth_token` parameter:

```
GitHubUpdater::init(
	github_url:  'https://github.com/username/private-repo',
	plugin_file: __FILE__,
	plugin_slug: 'private-plugin',
	auth_token:  MY_GITHUB_TOKEN,
);
```

Real-World Reference
--------------------

[](#real-world-reference)

WordPress plugins at

License
-------

[](#license)

GPL-2.0-or-later.

###  Health Score

38

—

LowBetter than 84% of packages

Maintenance99

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/34a473773a63fb84f9a425991b98e373b4deb93b82945a1656631b1505c6955d?d=identicon)[soderlind](/maintainers/soderlind)

---

Top Contributors

[![soderlind](https://avatars.githubusercontent.com/u/1649452?v=4)](https://github.com/soderlind "soderlind (16 commits)")

---

Tags

updaterwordpress-pluginpluginwordpressgithubupdater

### Embed Badge

![Health badge](/badges/soderlind-wordpress-github-updater/health.svg)

```
[![Health](https://phpackages.com/badges/soderlind-wordpress-github-updater/health.svg)](https://phpackages.com/packages/soderlind-wordpress-github-updater)
```

###  Alternatives

[afragen/github-updater

A plugin to automatically update GitHub, Bitbucket, GitLab, or Gitea hosted plugins, themes, and language packs.

3.3k20.4k](/packages/afragen-github-updater)[afragen/git-updater

A plugin to automatically update GitHub, Bitbucket, GitLab, or Gitea hosted plugins, themes, and language packs.

3.3k1.6k](/packages/afragen-git-updater)[sybrew/the-seo-framework

An automated, advanced, accessible, unbranded and extremely fast SEO solution for any WordPress website.

47078.8k](/packages/sybrew-the-seo-framework)[webdevstudios/cmb2-attached-posts

Custom field for CMB2 for creating post relationships.

13565.5k](/packages/webdevstudios-cmb2-attached-posts)[alleyinteractive/pest-plugin-wordpress

WordPress Pest Integration

263.7k1](/packages/alleyinteractive-pest-plugin-wordpress)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
