PHPackages                             webshr/wp-update-sdk - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. webshr/wp-update-sdk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

webshr/wp-update-sdk
====================

Composer-first WordPress update SDK for the Webshr update server.

0.1.0(2w ago)018↓50%MITPHPPHP &gt;=8.1

Since May 21Pushed 2w agoCompare

[ Source](https://github.com/webshr/wp-update-sdk)[ Packagist](https://packagist.org/packages/webshr/wp-update-sdk)[ Docs](https://github.com/webshr/wp-update-sdk/)[ RSS](/packages/webshr-wp-update-sdk/feed)WikiDiscussions main Synced 1w ago

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

Webshr WordPress Update SDK
===========================

[](#webshr-wordpress-update-sdk)

Composer-first WordPress update client for the Webshr update server.

It registers plugin/theme updates, stores release channel preferences, provides an optional settings page, and supports optional license activation when your update server requires it.

Install
-------

[](#install)

```
composer require webshr/wp-update-sdk
```

Use the updater through Composer autoloading:

```
use Webshr\WpUpdateSdk\Updater;
```

Plugin Usage
------------

[](#plugin-usage)

```
/**
 * Plugin Name: My Plugin
 * Version: 1.0.0
 * Update URI: https://updates.example.com/metadata/my-plugin
 */

use Webshr\WpUpdateSdk\Updater;

require __DIR__ . '/vendor/autoload.php';

$updater = new Updater(
    'my-plugin',
    'https://updates.example.com',
    [
        'project' => 'my-plugin/my-plugin.php',
        'version' => '1.0.0',
        'type'    => 'plugin',
    ],
);

$updater->settings()->add_page( [
    'type'        => 'submenu',
    'parent_slug' => 'options-general.php',
    'page_title'  => 'My Plugin Updates',
    'menu_title'  => 'My Plugin Updates',
    'menu_slug'   => 'my-plugin-updates',
] );

$updater->run();
```

### Constructor Arguments

[](#constructor-arguments)

```
$updater = new Updater(
    'my-plugin',
    'https://updates.example.com',
    [
        'project'       => 'my-plugin/my-plugin.php', // Plugin file or theme stylesheet.
        'version'       => '1.0.0',
        'type'          => 'plugin', // plugin or theme.
        'option_prefix' => 'wp_update_sdk', // Optional.
    ],
);
```

Theme Usage
-----------

[](#theme-usage)

```
use Webshr\WpUpdateSdk\Updater;

require get_template_directory() . '/vendor/autoload.php';

$theme = wp_get_theme();

$updater = new Updater(
    get_stylesheet(),
    'https://updates.example.com',
    [
        'project' => get_stylesheet(),
        'version' => $theme->get( 'Version' ),
        'type'    => 'theme',
    ],
);

$updater->settings()->add_page( [
    'type'        => 'submenu',
    'parent_slug' => 'themes.php',
    'page_title'  => 'Theme Updates',
    'menu_title'  => 'Theme Updates',
    'menu_slug'   => get_stylesheet() . '-updates',
] );

$updater->run();
```

Optional Licensing
------------------

[](#optional-licensing)

Updates do not require a license unless your update server requires one for the package. When you need licensing, use the updater's license module:

```
$result = $updater->license()->activate( 'CUSTOMER-LICENSE-KEY' );

if ( is_wp_error( $result ) ) {
    wp_die( esc_html( $result->get_error_message() ) );
}
```

For license keys injected from constants, set the key during plugin boot. This stores the key for metadata requests and pre-fills the settings field, but it does not mark the license active until activation succeeds:

```
if ( defined( 'MY_PLUGIN_LICENSE_KEY' ) && '' !== MY_PLUGIN_LICENSE_KEY ) {
    $updater->license()->set_key( MY_PLUGIN_LICENSE_KEY );
}
```

You can also check or deactivate a stored license:

```
$updater->license()->check();
$updater->license()->deactivate();
```

Settings Page
-------------

[](#settings-page)

The SDK page includes:

- release channel selector: `stable`, `beta`, `alpha`, `rc`
- optional license key input
- save settings button
- activate/update license button
- check license button
- deactivate button

By default the page is added under Settings. You can also attach it to a top-level or submenu page:

```
$updater->settings()->add_page( [
    'type' => 'menu', // menu, submenu, or options
    'page_title' => 'Updates',
    'menu_title' => 'Updates',
    'capability' => 'manage_options',
    'menu_slug' => 'my-product-updates',
] );
```

For a submenu under an existing custom admin menu, use the parent menu slug:

```
$updater->settings()->add_page( [
    'type'        => 'submenu',
    'parent_slug' => 'my-plugin',
    'page_title'  => 'Updates',
    'menu_title'  => 'Updates',
    'menu_slug'   => 'my-plugin-updates',
] );
```

Channels
--------

[](#channels)

The release channel is stored locally and always sent to the metadata endpoint:

```
$updater->set_channel( 'beta' );
echo $updater->metadata_url();
```

Without an activated license, metadata requests include only the channel:

```
channel

```

After a license is activated, metadata requests also include:

```
license_key
activation_id
site_url

```

Package Structure
-----------------

[](#package-structure)

```
src/Activation.php  WordPress option-backed update/license state
src/Client.php      HTTP transport
src/License.php     Optional license lifecycle
src/Settings.php    Optional update settings screen
src/Updater.php     Public SDK facade and WordPress update integration
composer.json       Package metadata and autoload rules

```

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance96

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity32

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

Unknown

Total

1

Last Release

19d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11009257?v=4)[enriquo](/maintainers/enriquo)[@enriquo](https://github.com/enriquo)

---

Top Contributors

[![enriquo](https://avatars.githubusercontent.com/u/11009257?v=4)](https://github.com/enriquo "enriquo (1 commits)")

---

Tags

wordpressupdatesplugin updatestheme updates

### Embed Badge

![Health badge](/badges/webshr-wp-update-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/webshr-wp-update-sdk/health.svg)](https://phpackages.com/packages/webshr-wp-update-sdk)
```

###  Alternatives

[yahnis-elsts/plugin-update-checker

A custom update checker for WordPress plugins and themes. Useful if you can't host your plugin in the official WP repository but still want it to support automatic updates.

2.5k1.6M107](/packages/yahnis-elsts-plugin-update-checker)[aristath/kirki

Extending the WordPress customizer

1.3k73.1k4](/packages/aristath-kirki)[yahnis-elsts/wp-update-server

Custom update API server for WordPress plugins and themes.

8771.3k](/packages/yahnis-elsts-wp-update-server)[tacowordpress/tacowordpress

WordPress custom post types that feel like CRUD models

232.2k](/packages/tacowordpress-tacowordpress)

PHPackages © 2026

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