themewizz/twz-software-license-manager-library 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

themewizz/twz-software-license-manager-library

Composer 安装命令:

composer require themewizz/twz-software-license-manager-library

包简介

This class can be used in a PHP application to contact a WordPress based license server.

README 文档

README

This class can be used in a PHP application to contact a WordPress based license server using the TWZ Software License Manager Plugin.

Usage

  • Install WordPress on your license server
  • Install the TWZ Software License Manager Plugin on that server
  • Configure the plugin, e.g. setting the secret key for validation
  • Include TWZ_License class in your PHP application
  • Instantiate the class in your script, e.g. $twz_license = new TWZ_License();
  • Set the license server URL property, e.g. $twz_license->setLicenseServerURL('5766474b540');
  • Set the license server verification key property, e.g. $twz_license->setVerificationKey('5766474b540');
  • Set the license key property, e.g. $twz_license->setLicenseKey('5766474b540');
  • Load the details for that license from the license server, e.g. $LIC->load();
  • Use other methods as needed, e.g.:
    • $LIC->activate();
    • $LIC->daysToExpiry();
    • $LIC->deactivate();
    • $LIC->domainRegistered();
    • $LIC->getKey();
    • $LIC->load();
    • $LIC->readKey();
    • $LIC->saveKey();
    • $LIC->setKey('5766474b540');
    • $LIC->show();
    • $LIC->status();

$LIC->activate()

This method will sumbit the license key in $this->key to the license server for activation plus domain registration. Example:

$LIC->setKey('5766474b540');
$LIC->activate();

$LIC->daysToExpiry()

This method will count and return the number of days from 'today' to the expiry date of the license. Example:

$LIC->setKey('5766474b540');
$LIC->load();
echo $LIC->daysToExpiry();

$LIC->deactivate()

This method will sumbit the license key in $this->key to the license server for deactivation. Example:

$LIC->setKey('5766474b540');
$LIC->deactivate();

$LIC->domainRegistered()

This method will check whether the current domain is registered for the license. Example:

$LIC->setKey('5766474b540');
$LIC->load();
if ($LIC->domainRegistered()) {
   echo "Domain is registered";
else {   
   echo "Domain is not registered";
}

$LIC->getKey()

This method will retrieve the class viarable 'key' that is supposed to hold the license key. Example:

$LIC->setKey('5766474b540');
echo $LIC->getKey();

$LIC->load()

This method will load the license details from the license server. Example:

$LIC->setKey('5766474b540');
$LIC->load();

$LIC->readKey()

This method is a placeholder for code you might want to add to read the license key from your own database.

$LIC->saveKey()

This method is a placeholder for code you might want to add to save the license key to your own database.

$LIC->setKey()

This method will set the class viarable 'key' that is supposed to hold the license key. Example:

$LIC->setKey('5766474b540');

$LIC->show()

This method assumes that you use Bootstrap 4 in your PHP application. It will display the license status in a Bootstrap 4 alert box. If you set the second parameter to 'true', a table with the license details will be shown as well inside that box. Example:

$LIC->setKey('5766474b540');
$LIC->load();
$LIC->show($LIC->details, true);

$LIC->status()

The status() method returns one of these these values:

  • active (the license is active and registered for the domain the validation request came from)
  • blocked (the license is blocked)
  • expired (the license is expired)
  • invalid (an empty or invalid license key was submitted)
  • pending (the license is valid but not activated yet)
  • unregisterd (the license is active but not registered for the domain the validation request came from) Example:
$LIC->setKey('5766474b540');
$LIC->load();
echo $LIC->status();

Credits

Thanks to Tips and Tricks HQ for the Software License Manager Plugin for WordPress

themewizz/twz-software-license-manager-library 适用场景与选型建议

themewizz/twz-software-license-manager-library 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 246 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 05 月 29 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「license」 「tracking」 「plugin usage」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 themewizz/twz-software-license-manager-library 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 themewizz/twz-software-license-manager-library 我们能提供哪些服务?
定制开发 / 二次开发

基于 themewizz/twz-software-license-manager-library 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2023-05-29