承接 contexis/wp-github-updater 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

contexis/wp-github-updater

最新稳定版本:0.2.0

Composer 安装命令:

composer require contexis/wp-github-updater

包简介

GitHub release based WordPress plugin updater

README 文档

README

Small Composer package for WordPress plugin update checks based on GitHub releases.

Installation

{
  "require": {
    "contexis/wp-github-updater": "^0.2"
  }
}

Quick Start

use Contexis\WpGitHubUpdater\WordPressPluginUpdater;

WordPressPluginUpdater::fromPluginFile(
    pluginFile: __FILE__,
    owner: 'vendor',
    repositoryName: 'plugin-repo',
)->registerHooks();

This is the intended default API. In the common case you only need:

  • the main plugin file path
  • the GitHub owner
  • the GitHub repository name

Release Conventions

The updater checks the latest GitHub release by following the /releases/latest redirect.

If you are also looking for reusable GitHub Actions, see:

  • https://github.com/gollenia/github-actions

Your repository should use release tags like:

  • v1.2.3
  • 1.2.3

The download URL for updates is built as:

https://github.com/<owner>/<repo>/releases/download/v<version>/<repo>.zip

So your release asset should usually be named <repo>.zip.

What fallbackVersion Means

fallbackVersion is only a defensive fallback. It is used when GitHub cannot be reached or the latest release tag cannot be determined.

It is not a separate "target version" and usually should be the currently installed plugin version. That prevents the updater from reporting a fake update when GitHub is temporarily unavailable.

If you use the recommended WordPressPluginUpdater::fromPluginFile(...) entry point, you do not need to provide it manually. It is derived from the plugin header version automatically.

Lower-Level API

If you want to wire the objects manually, you still can:

use Contexis\WpGitHubUpdater\GitHubReleaseProvider;
use Contexis\WpGitHubUpdater\GitHubRepository;
use Contexis\WpGitHubUpdater\PluginMetadata;
use Contexis\WpGitHubUpdater\WordPressPluginUpdater;

$plugin = PluginMetadata::fromPluginFile(__FILE__);
$repository = GitHubRepository::from('vendor', 'plugin-repo');
$releaseProvider = GitHubReleaseProvider::forPlugin($repository, $plugin);

$updater = new WordPressPluginUpdater(
    plugin: $plugin,
    repository: $repository,
    releaseProvider: $releaseProvider,
);

$updater->registerHooks();

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2026-04-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固