ideologix/dlm-wp-updater
Composer 安装命令:
composer require ideologix/dlm-wp-updater
包简介
PHP WordPress updater for your plugins and themes that utilizes the Digital License Manager PRO REST APIs
README 文档
README
Updater package for WordPress that utilizes the Digital License Manager PRO REST API for update checks and update downloads. It can be integrated in every plugin that you want to provide updates through Digital License Manager PRO.
Requirements
- WordPress 4.0+
- Digital License Manager PRO (on your plugin update server site)
Configuration
- Login to your Digital License Manager store.
- Go to "License Manager" > "Software" > "Add New" and create software item.
- Obtain the software ID and then proceed with the next step Installation.
Installation
The PHP package can be imported either with Composer or manually with including the autoload.php file:
composer install ideologix/dlm-wp-updater
or manually, first download the package and save it to your plugin, then include it as follows:
require_once 'path/to/dlm-wordpress-updater/autoload.php';
Integration
The following example explains how to use the library within your PRO/Premium plugin.
use \IdeoLogix\DigitalLicenseManagerUpdaterWP\Main; try { $instance = new Main( array( 'id' => 'The software ID', 'name' => 'The software Name', 'file' => '/path/to/wp-content/plugins/your-plugin/your-plugin.php', // Tip: use __FILE__ to define it in your-plugin.php 'basename' => 'your-plugin/your-plugin.php', // Tip: use plugin_basename( __FILE__ ) in your-plugin.php 'version' => YOUR_PLUGIN_VERSION, // Tip: Define this in your-plugin.php file and increment with every release. 'url_settings' => 'https://url-to-your-plugin/settings-page', 'url_purchase' => 'https://url-to-your-website/purchase-page', 'consumer_key' => 'ck_XXXXXXXXXXXXXXXXX', 'consumer_secret' => 'cs_XXXXXXXXXXXXXXXXX', 'api_url' => 'https://yourwoocommercesite.com/wp-json/dlm/v1/', 'prefix' => 'dlm', ) ); } catch (\Exception $e) { error_log('Error: ' . $e->getMessage()); } // Important: To display the activation form in your settings page (url_settings), use the renderActivationForm() method like bellow. // Note: If you want to override the activation form, you can extend the Activator class with your own class and override the renderActivationForm() method. $instance->getActivator()->renderActivationForm();
统计信息
- 总下载量: 1.77k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2021-11-14