PHPackages                             themewizz/twz-software-license-manager-library - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. themewizz/twz-software-license-manager-library

ActiveLibrary

themewizz/twz-software-license-manager-library
==============================================

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

5.0.3(2y ago)0246Apache-2.0PHPPHP &gt;=8.1

Since Dec 22Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ThemeWizz/twz-software-license-manager-library)[ Packagist](https://packagist.org/packages/themewizz/twz-software-license-manager-library)[ Docs](https://github.com/themewizz/twz-software-license-manager-library)[ RSS](/packages/themewizz-twz-software-license-manager-library/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

TWZ Software License Manager PHP Class
======================================

[](#twz-software-license-manager-php-class)

This class can be used in a PHP application to contact a WordPress based license server using the [TWZ Software License Manager Plugin](https://wordpress.org/plugins/twz-software-license-manager/).

Usage
-----

[](#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-&gt;activate()
-------------------

[](#lic-activate)

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

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

$LIC-&gt;daysToExpiry()
-----------------------

[](#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-&gt;deactivate()
---------------------

[](#lic-deactivate)

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

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

$LIC-&gt;domainRegistered()
---------------------------

[](#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-&gt;getKey()
-----------------

[](#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-&gt;load()
---------------

[](#lic-load)

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

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

$LIC-&gt;readKey()
------------------

[](#lic-readkey)

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

$LIC-&gt;saveKey()
------------------

[](#lic-savekey)

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

$LIC-&gt;setKey()
-----------------

[](#lic-setkey)

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

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

$LIC-&gt;show()
---------------

[](#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-&gt;status()
-----------------

[](#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
-------

[](#credits)

Thanks to [Tips and Tricks HQ](https://www.tipsandtricks-hq.com/software-license-manager-plugin-for-wordpress) for the Software License Manager Plugin for WordPress

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

872d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/91fcbd6606e4ce74c66c3a494d5638a1102eefebbe4d34e7b9d1768097046a03?d=identicon)[themewizz](/maintainers/themewizz)

---

Top Contributors

[![sersart](https://avatars.githubusercontent.com/u/2663716?v=4)](https://github.com/sersart "sersart (4 commits)")

---

Tags

licensetrackingplugin usage

### Embed Badge

![Health badge](/badges/themewizz-twz-software-license-manager-library/health.svg)

```
[![Health](https://phpackages.com/badges/themewizz-twz-software-license-manager-library/health.svg)](https://phpackages.com/packages/themewizz-twz-software-license-manager-library)
```

###  Alternatives

[owen-it/laravel-auditing

Audit changes of your Eloquent models in Laravel

3.4k33.0M95](/packages/owen-it-laravel-auditing)[composer/spdx-licenses

SPDX licenses list and validation library.

1.4k184.2M25](/packages/composer-spdx-licenses)[bugsnag/bugsnag-laravel

Official Bugsnag notifier for Laravel applications.

90234.6M36](/packages/bugsnag-bugsnag-laravel)[bugsnag/bugsnag

Official Bugsnag notifier for PHP applications.

56347.0M78](/packages/bugsnag-bugsnag)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[gabrielbull/ups-api

PHP UPS API

4642.4M10](/packages/gabrielbull-ups-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
