承接 oblak/wp-package-updater 相关项目开发

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

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

oblak/wp-package-updater

最新稳定版本:v3.0.1

Composer 安装命令:

composer require oblak/wp-package-updater

包简介

Simplifies the process of updating WordPress packages from custom repositories.

README 文档

README

📦 WordPress package updater

Simplifies the process of updating WordPress packages from custom repositories.

Packagist Version Packagist PHP Version semantic-release: angular

Code Climate maintainability Release

GitHub Packagist Downloads

Highlights

  • Standardizes the process of updating plugins / themes from custom repositories.
  • Fully integrates with Plugin / theme info API.
  • Easily extendable / customizable

Installation

We officially support installing via composer only

Via composer

composer require oblak/wp-package-updater

Basic Usage

Plugin_Updater and Theme_Updater are the main abstract classes of the package, and they need to be extended in order to create an updater class. The class is responsible for registering the plugin / theme update hooks, and for updating the plugin / theme.

At minimum you need to implement the get_update_url() method, which is responsible for returning the update info URL.

1. Define your updater class

<?php
namespace Vendor\My_Plugin;

use Oblak\WP\Plugin_Updater;
use Oblak\WP\Theme_Updater;



class My_Plugin_Updater extends Plugin_Updater {

    protected function get_update_url() {
        return 'https://my-plugin.com/api/update';
    }

}

class My_Theme_Updater extends Theme_Updater {

    protected function get_update_url() {
        return 'https://my-theme.com/api/update';
    }

}

2. Include the autoload file

require_once __DIR__ . 'vendor/autoload.php';

3. Instantiate the updater class

<?php

use Vendor\My_Plugin\My_Plugin_Updater;
use Vendor\My_Plugin\My_Theme_Updater;

new My_Plugin_Updater('plugin-slug');
new My_Theme_Updater('theme-slug');

Advanced Usage

Depending on your needs, you can override several methods in the updater class to customize the update process according to your repository API.

Some of the functions you can customize:

  • get_headers - Returns the headers for the update request.
  • send_request - Sends the update request to the repository API.
  • validate_response - Validates the response from the repository API.
  • get_transient_prefix - Returns the transient prefix for the plugin / theme update information.

Contributing

Contributions are welcome from everyone. We have contributing guidelines to help you get started.

Credits and special thanks

This project is maintained by Oblak Studio.

License

This project is licensed under the GNU General Public License v2.0.

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-only
  • 更新时间: 2023-07-16