wp-fleet / auto-update
PHP 包用于处理插件和主题的自动更新功能
1.0.3
2021-10-27 19:01 UTC
Requires
- php: >=7.0
This package is auto-updated.
Last update: 2024-09-27 18:56:58 UTC
README
PHP 包用于处理 WordPress 插件和主题的自动更新功能。
入门指南
最低要求和依赖项
AutoUpdate 需要
- PHP >= 7.0
- 从 https://wp-fleet.com/ 安装 WP Fleet 插件
- WordPress - 最新版本
- 需要安装 Composer
安装
通过 Composer 安装
composer require wp-fleet/auto-update
用法
基本用法
在您的插件主文件中,需要引入供应商文件并按照以下方式调用自动更新加载类
// Define update plugin info and call the function to manage it.
$update_args = [
'api_url' => 'https://your-website.tld/',
'plugin_full_path' => __FILE__,
'allowed_hosts' => [
'https://your-website.tld'
],
'plugin_name' => plugin_basename( __FILE__ ),
'license_key' => 'required',
];
( new WpFleet\AutoUpdate\Loader( $update_args ) );
参数和参数
api_url - [required] site url where WP Fleet plugin is installed.
plugin_full_path - [required] expects to receive __FILE__ value. The full path of the current plugin (that will be updated automatically)
allowed_hosts - [optional] the url of the allowed external hosts to allow plugin updated (where WP Fleet plugin is installed)
plugin_name - [optional] the name of the current plugin (that will be updated automatically)
license_key - [optional] if true|1|required, a new page will be added under WP Admin -> Plugins -> License Keys and user will have to submit a valid license key to be able to automatically update plugin. If no license key is required, set it to false.
license_page_parent_slug - [optional] set the admin parent page slug.
license_page_description - [optional] a description that will be displayed on the license page.
许可证
wp-fleet/auto-update 代码受 MIT 许可证许可。