前言介紹
- 這款 WordPress 外掛「WooCommerce Software License Manager」是 2015-08-18 上架。
- 目前有 70 個安裝啟用數。
- 上一次更新是 2021-04-05,距離現在已有 1488 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.5.1 以上版本才可以安裝。
- 有 10 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
wc | wc license | software license | wc software license | software license manager |
內容簡介
WooCommerce 與 Software License Manager Plugin 之間的無縫整合,最初採用自 EDD Software License Manager,感謝 flowdee ([email protected])。
Github 儲存庫
https://github.com/shamloo/wc-software-license-manager
功能
自動為每次銷售創建授權密鑰與 WC
授權是可選擇的,可單獨啟動/停用
將生成的授權密鑰連同現有的電子郵件通知一起發送給客戶
範例代碼
/*
Plugin Name: License Checker
Version: v1.0
Plugin URI: http://wp-master.ir
Author: Omid Shamloo
Author URI: http://wp-master.ir
Description: Sample plugin to show you how you can interact with the software license manager API from your WordPress plugin or theme
*/
// This is the secret key for API authentication. You configured it in the settings menu of the license manager plugin.
define('YOUR_SPECIAL_SECRET_KEY', 'YOUR_SPECIAL_SECRET_KEY'); //Rename this constant name so it is specific to your plugin or theme.
// This is the URL where API query request will be sent to. This should be the URL of the site where you have installed the main license manager plugin. Get this value from the integration help page.
define('YOUR_LICENSE_SERVER_URL', 'http://wp-master.ir'); //Rename this constant name so it is specific to your plugin or theme.
// This is a value that will be recorded in the license manager data so you can identify licenses for this item/product.
define('YOUR_ITEM_REFERENCE', 'YOUR_ITEM_REFERENCE'); //Rename this constant name so it is specific to your plugin or theme.
add_action('admin_menu', 'slm_sample_license_menu');
function slm_sample_license_menu() {
add_options_page('Sample License Activation Menu', 'Sample License', 'manage_options', 'youlice_classesence', 'sample_license_management_page');
}
function sample_license_management_page() {
echo '
echo '
Sample License Management
'; /*** License activate button was clicked ***/
if (isset($_REQUEST['activate_license'])) {
$license_key = $_REQUEST['sample_license_key'];
// Send query to the license manager server
$lic = new youlice_class($license_key , YOUR_LICENSE_SERVER_URL , YOUR_SPECIAL_SECRET_KEY );
if($lic->active()){
echo 'You license Activated successfuly';
}else{
echo $lic->err;
}
}
$lic = new youlice_class($license_key , YOUR_LICENSE_SERVER_URL , YOUR_SPECIAL_SECRET_KEY );
if($lic->is_licensed()){
echo 'Thank You Phurchasing!';
}else{
?>
}
echo '
原文外掛簡介
Seamless integration between WooCommerce and the Software License Manager Plugin. Originally adopted from EDD Software License Manager, thanks to flowdee ([email protected]).
Github repository
https://github.com/shamloo/wc-software-license-manager
Features
Automatically creates license keys for each sale with WC
Licensing is optional and can be activated/deactivated individually
Send generated license keys to your customers within your existing email notifications
Sample code
';
echo '
Sample License Management
';
/*** License activate button was clicked ***/
if (isset($_REQUEST['activate_license'])) {
$license_key = $_REQUEST['sample_license_key'];
// Send query to the license manager server
$lic = new youlice_class($license_key , YOUR_LICENSE_SERVER_URL , YOUR_SPECIAL_SECRET_KEY );
if($lic->active()){
echo 'You license Activated successfuly';
}else{
echo $lic->err;
}
}
$lic = new youlice_class($license_key , YOUR_LICENSE_SERVER_URL , YOUR_SPECIAL_SECRET_KEY );
if($lic->is_licensed()){
echo 'Thank You Phurchasing!';
}else{
?>
';
}
class youlice_class{
public $lic;
public $server;
public $api_key;
private $wp_option = 'product_1450';
private $product_id = 'My_product_name_OR_ID';
public $err;
public function __construct($lic=false , $server , $api_key){
if($this->is_licensed())
$this->lic = get_option($this->wp_option);
else
$this->lic = $lic;
$this->server = $server;
$this->api_key = $api_key;
}
/**
* check for current product if licensed
* @return boolean
*/
public function is_licensed(){
$lic = get_option($this->wp_option);
if(!empty( $lic ))
return true;
return false;
}
/**
* send query to server and try to active lisence
* @return boolean
*/
public function active(){
$url = YOUR_LICENSE_SERVER_URL . '/?secret_key=' . YOUR_SPECIAL_SECRET_KEY . '&slm_action=slm_activate&license_key=' . $this->lic . '®istered_domain=' . get_bloginfo('siteurl').'&item_reference='.$this->product_id;
$response = wp_remote_get($url, array('timeout' => 20, 'sslverify' => false));
if(is_array($response)){
$json = $response['body']; // use the content
$json = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', utf8_encode($json));
$license_data = json_decode($json);
}
if($license_data->result == 'success'){
update_option( $this->wp_option, $this->lic );
return true;
}else{
$this->err = $license_data->message;
return false;
}
}
/**
* send query to server and try to deactive lisence
* @return boolean
*/
public function deactive(){
}
}
Theme & Plugin Integration
Please Note: The license validation part for your distributed plugins and themes is not part of this plugin. More on this can be found in the Software License Manager documentation.
To implement License Key validation in your plugin or theme, please check out the sample code in Maddison Designs’ Github repo.
Attention
Known incompatibility issue with iThemes Security
If you have installed “iThemes Security”, uncheck Long URL Strings where the Software License Manager plugin is installed
Credits
Woocommerce
Software License Manager
EDD Software License Manager
WP 4.8.2 and WC 3.2.0 Compatibility
Translates
Persian
Spanish (Spain) Art Project Group
Configuration
The plugin is really simple and well structured so you don’t have to prepare a lot in order to get it working.
After the successful installation you will find a prepared options page here: “WooCommerce” > “Settings” > “Products” > “License Manager”
Enter your Software License Manager API credentials
Go to your Products and activate licensing where it’s required
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「WooCommerce Software License Manager」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.0.7 | 2.0.1 | 2.0.2 | trunk |
延伸相關外掛(你可能也想知道)
License Keys for WooCommerce 》/p>, , 「License Keys for WooCommerce」是一個簡單而強大的許可證管理外掛程式,它將新增產品類型到你的WordPress和WooCommerce設定中,讓你建立並管理許可...。
EDD Software License Manager 》Easy Digital Downloads 和 Software License Manager 之間的無縫集成。, 功能特色, , 自動為每筆 Easy Digital Downloads 銷售創建授權證書, 授權是可選的,...。