Manually activate and deactivate license
-
Hi, you have done a great job on the plugin, I have found a bug and a doubt.
The error is that from the backend in the Woocommerce plugin in license keys can not deactivate the licenses manually, as it is not reflected in the user accounts or in the JSON deactivated_at.
My question is that I have to implement licenses in a plugin itself and every day I have to validate the license and the validation json is as follows:
{
“success": true,
“data": {
“timesActivated": 1,
“timesActivatedMax": 1,
“remainingActivations": 0,
“activationData": [
{
“id": 5,
“token": ‘201591a55d8fc1646992c59ec09bcb25kr196dat’,
“license_id": 8,
“label": null,
“source": 2,
“ip_address": ‘152.76.67.147’,
“user_agent": ‘WordPress/6.7.1; https://myweb.com’,
“meta_data": null,
“created_at": ‘2025-01-02 01:31:10’,
“updated_at": null,
“deactivated_at": null
}
]
}
}
For the GET /wp-json/lmfwc/v2/licenses/activate/{$license_key} enpoint.I don’t know how you have done it, but I don’t see any status value and I don’t see how to know when the license is active or inactive, according to the backend that LMFWC generates, if in the server backend when I deactivate the license manually it is not reflected in “deactivated_at” and there is no value to check that the license is active or inactive, I don’t understand how you do it, playing with the values “timesActivated”: 1, “timesActivatedMax”: 1, “remainingActivations”: 0, can lead to error with several activations per license. The easiest way would be that “deactivated_at” works fine.
I understand that “deactivated_at” returns a date if inactive e.g. ‘2025-01-02 01:31:10’ and a null if active, I don’t see any other values that show the active and inactive field.
In the activation is the status value that returns 4 numbers corresponding to active, inactive, shipped and purchased but this is more at woocommerce level, because a purchased or shipped license can be active or inactive so I do not see it as an indicator.
I hope I have been clear in my reflection, greetings and congratulations for this great plugin and for the great work you invest in it.
- You must be logged in to reply to this topic.