ZD License Manager

Wordpress plugin
Version
1.0.0

>> Introduction

ZD License Manager is a free WordPress plugin that allows you to easily manage license keys. You can then use the API in order to check its status from your application.

>> Manage licenses

In the manage licenses section you have access to all the information necessary to know the status of the license keys.

>> Add new license

When creating a new license key, the plugin will guide you every step of the way. This way you won’t have any problem knowing what each field on the form means.

License key: If you use third-party plugins you can add the license key they offer here, you can also create your own or let the plugin generate one.

File: You can add a file, this can be a zip, executable or any other. It is an optional field so you can leave it blank if you are not going to use it.

Username: To better identify the license key you can add the client’s username, a good option if you want to send a more specific email.

Email: Just like the username, it is good to save the customer’s email, especially if you want to send them offers or discounts.

Valid for (days): If you want the license key to only last a few days, whether for a promotion or any other event, enter the number and the license key will expire after the few days.

Expiration date: If you need an exact date on which the license key expired, you can add it in this field in the format: yyyy-m-d.

Maximum activation count: License keys can have a usage limit, this is where you must configure how many times you want the license key to be used by the client, if you need it to have no limit you just have to leave this field blank.

Status: By default the status is active, but if, for example, you are going to use third-party add-ons, you can generate license keys in a canceled status and once you receive payment, activate them.

Notes: The notes field is optional and can be used to add information about the client, if they are a good payer, if you have applied a discount, etc… Use it as best suits you.

>> Encrypt files

If you need to add files to a zip to be consumed with the API and you do not want that information to be visible to the client, you can encrypt all types of files and package them in a zip file and then manage them from your application or third-party software.

>> Settings

# API license ( verification )

Confirmation message: You can customize the license key verification message, by default it is active, but you can add the word you prefer.

End point: The end point of the verification API is detailed here, it is a GET request in JSON format with the data: license_key and client_data, example:

GET http://www.yourdomain.com/wp-json/api/v1/zd_lm/license/verify

PARAMS
- license_key
- client_data
RESPONSE (OK) {"status":"active","file":"https:\/\/www.zombidev.com\/file.zip","update":"2023-11-27"}
RESPONSE (ERROR) {"status":"error","message":"Error type"}

# API license ( verification encryption )

Status: You can enable or disable encryption of data sent by the Verification API. A good way for your client not to know what the verification message is so that they can run your application or third-party software and avoid inappropriate use by other users.

Key: It is important to generate a strong enough encryption key to avoid any problems, but you can let the plugin generate a random one for you and make that job easier for you.

Cipher algo: By default “AES-256-CBC” is used, this option is not configurable (at this time).

IV: The IV value is automatically generated when installing the plugin, it is random so don’t worry about this option.

RESPONSE (ENCRYPT) {"status":"FB5Wgn+paJxVz+OjfDniBQ==","file":"6A81lvEZKnUizabthxvd2akRw6FgLgoOKHvusFmSWjz4DL0iFLm4ylpEfbaikoLF","update":"lTJ5QpOqnl\/Qs5M\/kt0GwQ=="}

ATTENTION: The encrypted output uses the base64_encode function in order to avoid possible errors.

# API license ( manage )

Status: You can activate or deactivate license key management through the API. You can remotely create, edit and delete the generated license keys.

Key: In order to manage the license key through the APi it is necessary to have an API key, without it you will not have permission to perform any action. You can enter your own key or let the plugin generate one for you.

End point (CREATE): In order to create a license key you must make the following request:

POST http://www.yourdomain.com/wp-json/api/v1/zd_lm/license/create

PARAMS
- api_key
- license_file (Optional)
- license_username
- license_email
- license_valid_for
- license_expiration_date
- license_maximum_activation_count
- license_status
- license_notes (Optional)
RESPONSE (OK) {"status":"success","license_key":"XYXYXYXY"}
RESPONSE (ERROR) {"status":"error","message":"Error type"}

End point (UPDATE): Now, if you want to update a license you must make the following request.

POST http://www.yourdomain.com/wp-json/api/v1/zd_lm/license/update

PARAMS
- api_key
- license_key
- license_file (Optional)
- license_username
- license_email
- license_valid_for
- license_expiration_date
- license_maximum_activation_count
- license_status
- license_notes (Optional)
RESPONSE (OK) {"status":"success","message":"License key updated successfully"}
RESPONSE (ERROR) {"status":"error","message":"Error type"}

End point (DELETE): Finally, if you want to delete a license you must make the following request.

POST http://www.yourdomain.com/wp-json/api/v1/zd_lm/license/delete

PARAMS
- api_key
- license_key
RESPONSE (OK) {"status":"success","message":"License key deleted successfully"}
RESPONSE (ERROR) {"status":"error","message":"Error type"}

# Notification options

Status: Activate or deactivate the notification system, very useful if you want to create promotions or special offers for the customer so that they continue paying for the subscription or service.

Email: Here you must enter the email where you want to receive the notification. Remember to set the administration email as allowed to prevent notifications from going to the spam folder.

Days: This option is interesting since the plugin will send you a notification every 24 hours before the license expires, if you enter “3”, you will receive a notification three days before the license expires.

# Cron options

Status: Activate or deactivate the native WP-Cron function of WordPress, it is recommended to disable it with “DISABLE_WP_CRON” in wp-config.php and create a cron task that runs every hour on your server with the following command:

wget -q -O - http://www.yourdomain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

Manual (Optional): Manual mode is only visible when you disable the WP-Cron feature in the plugin settings and you need to configure two cron tasks on your server.

>> CRON TASK #1

COMMAND
wget -q -O - http://www.yourdomain.com/wp-content/plugins/zd-license-manager/cron/check_license.php?key=YOURCRONKEY

RUN EVERY HOUR

------

>> CRON TASK #2

COMMAND
wget -q -O - http://www.yourdomain.com/wp-content/plugins/zd-license-manager/cron/notification.php?key=YOURCRONKEY

RUN EVERY DAY

Note: For greater security, a cron key has been implemented (it is automatically generated when installing it) so that public requests are filtered, thus preventing any user from making improper use.

>> Changelog