Hi!
I want the USER to cancel the domain. So user can use it on other site too once disabling it from one site. Can you provide the code for that?
How can i extend the license expiry date programmatically?
Hi, what is the purpose of admin functions, specifically this input: “Enter the URL where the license deactivation message will be sent to“. And how it is supposed to be used?
Also, is it possible to send an activation request from the admin area via API?
Just notice that Software License Manager Loads, it’s jQuery on the front end, Is there a need for the jQuery to be loaded on the front end for the plugin to work? or is it a mini bug?
(noticed it because it was render blocking the rendering of the website until jQuery loads)
/// Currently it's
function loadscripts() {
// Load all common scripts and styles only
wp_enqueue_script('jquery'); // Loads jQuery on the front end
// Load all admin side scripts and styles only
if (is_admin()) {
wp_enqueue_script('jquery-ui-datepicker');
wp_enqueue_script('wplm-custom-admin-js'...);
...
...
}
}
/// Shouldn't it be?
function loadscripts() {
if (is_admin()) {
wp_enqueue_script('jquery');
wp_enqueue_script('jquery-ui-datepicker');
wp_enqueue_script('wplm-custom-admin-js'...);
...
...
}
}
]]>
Hi!
Just wanted to report:
The ASE settings page will generate many script errors (check DevTools) when SLM is active, leading to you being unable to change settings there (the actual functions still appear to be working). You only need to install SLM for it to happen. Disabling SLM fixes the issue. There appear to be no other conditions necessary to reproduce this.
Thank you for your plugin! It’s extremely useful ??
]]>Wanted to know if the plugging is compatible with PHP 8+, what’s its maximum compatible version?
]]>The PHP version supported is listed in the change log (8.3) but not in the plugin description on WordPress
]]>In the “Manage licenses” area, there is a table with pagination, There seems to be an issue with the way it calculates the amount of items available to paginate through
For example, if the table shows 50 pages, But when you’re going through the pagination after page 21, it’s just an empty table, So, when moving from 21 to 22, 23, 24, etc. there are all empty table after a certain page.
When check license using this code
// Send query to the license manager server $response = wp_remote_get(add_query_arg($api_params, YOUR_LICENSE_SERVER_URL), array(‘timeout’ => 20, ‘sslverify’ => false));
I have facing this error – success response get but with this error so json not decode properly
Deprecated: Directive ‘allow_url_include’ is deprecated in?Unknown?on line?0
Hello Friends.
As the topic title states: License key can only be used once on a domain/install.
Example: person has two (or more) products from us, they attempt to install a second version on same domain, they cannot.
We have the max installs set to 4 (Number of domains/installs in which this license can be used.), but the license key can only be used 1 time. In the past the license key could be used up to 4 times.
Something has changed in plugin past updates. Please have devs investigate this, really causing some major issues.
Thank you for your time.
]]>Hi!
Can you tell me the code to update the license expiry date programmatically
Hi, what is the purpose of admin functions, specifically this input: “Enter the URL where the license deactivation message will be sent to“. And how it is supposed to be used?
]]>Hi,
I’m seeing multiple of these in my logs:
Constant FILTER_SANITIZE_STRING is deprecated in /public_html/wp-content/plugins/software-license-manager/menu/slm-manage-licenses.php on line 30
Hello, these days my local installation started showing an error in the license.
license.php line erro
<div class="growth-wrapper">
? ? ? ? ? ? LINE ERROR <?php if ($license_data->result != 'success') { ?>
? ? ? ? ? ? ? ? <button type="submit" name="activate_license" class="button-primary" /><span><i class="gg-arrow-up"></i></span>Ativar Licen?a</button>
? ? ? ? ? ? <?php } else { ?>
? ? ? ? ? ? ? ? <button type="submit" name="deactivate_license" class="button-primary" /><span><i class="gg-arrow-up"></i></span>Desativar Licen?a</button>
? ? ? ? ? ? <?php } ?>
? ? ? ? </div>
welcome.php line erro
<?php
$license_data = json_decode(wp_remote_retrieve_body($response));
What could have happened? Thank you!
]]>Hello, i have gone through your documentation… I couldn’t find any endpoint to CREATE, UPDATE and DELETE a license. How can i perform these actions via the WP Rest API route please?
]]>Hey!
Sometimes license key creation fails.
I use error_log to output data to my debug.log file in case it fails like this inside function creation_api_listener() {:
$result = $wpdb->insert( $tbl_name, $fields );
if ( $result === false ) {
//error inserting
$args = ( array(
'result' => 'error',
'message' => 'License creation failed',
'error_code' => SLM_Error_Codes::CREATE_FAILED,
) );
error_log(print_r('License creation failed!', true));
error_log(print_r($tbl_name, true));
error_log(print_r($fields, true));
SLM_API_Utility::output_api_response( $args );
} else {
These are the outputs to my debug.log file when the license key creation has failed:
1.:
[14-Aug-2023 15:41:30 UTC] License creation failed!
[14-Aug-2023 15:41:30 UTC] wp_57ussc_lic_key_tbl
[14-Aug-2023 15:41:30 UTC] Array
(
[license_key] => 64da4b2a4dc36
[lic_status] => pending
[first_name] => Zahlbach Gbr A Pfurtscheller, L & J Nixdorff
[last_name] => none
[email] => [email protected]
[company_name] =>
[txn_id] =>
[max_allowed_domains] => 3
[date_created] => 2023-08-14
[date_expiry] => 3000-01-01
[product_ref] => Lay Theme Pro License
[subscr_id] => cus_ORwnEaMOYvjsmV
[user_ref] =>
)
2. :
[04-Sep-2023 17:08:40 UTC] License creation failed!
[04-Sep-2023 17:08:40 UTC] wp_57ussc_lic_key_tbl
[04-Sep-2023 17:08:40 UTC] Array
(
[license_key] => 64f60f1847f1c
[lic_status] => pending
[first_name] => Dipl. Ing. Archtitektur (FH) Lilli Steinbrenner
[last_name] => none
[email] => [email protected]
[company_name] =>
[txn_id] =>
[max_allowed_domains] => 1
[date_created] => 2023-09-04
[date_expiry] => 3000-01-01
[product_ref] => Lay Theme Single License with Carousel Addon
[subscr_id] => cus_OZpw1WFcstfJAb
[user_ref] =>
)
3.:
[13-Jun-2023 10:08:57 UTC] License creation failed!
[13-Jun-2023 10:08:57 UTC] wp_57ussc_lic_key_tbl
[13-Jun-2023 10:08:57 UTC] Array
(
[license_key] => 64884039d2253
[lic_status] => pending
[first_name] => DRID Kommunikation und Design GmbH
[last_name] => none
[email] => [email protected]
[company_name] =>
[txn_id] =>
[max_allowed_domains] => 3
[date_created] => 2023-06-13
[date_expiry] => 3000-01-01
[product_ref] => Lay Theme Pro License
[subscr_id] => cus_O4dQA9HAw26OHf
[user_ref] =>
)
4.:
[16-Jun-2023 14:22:04 UTC] License creation failed!
[16-Jun-2023 14:22:04 UTC] wp_57ussc_lic_key_tbl
[16-Jun-2023 14:22:04 UTC] Array
(
[license_key] => 648c700cd7387
[lic_status] => pending
[first_name] => Production associées asbl/ activité 27579 Fanny Godefroid
[last_name] => none
[email] => [email protected]
[company_name] =>
[txn_id] =>
[max_allowed_domains] => 1
[date_created] => 2023-06-16
[date_expiry] => 3000-01-01
[product_ref] => Lay Theme Single License with Carousel Addon
[subscr_id] => cus_O5p6u3f9vLOjzj
[user_ref] =>
)
5.:
[05-Jul-2023 11:32:20 UTC] License creation failed!
[05-Jul-2023 11:32:20 UTC] wp_57ussc_lic_key_tbl
[05-Jul-2023 11:32:20 UTC] Array
(
[license_key] => 64a554c48911c
[lic_status] => pending
[first_name] => OBERBAUM GASTST?TTENBETRIEBS GMBH
[last_name] => none
[email] => [email protected]
[company_name] =>
[txn_id] =>
[max_allowed_domains] => 3
[date_created] => 2023-07-05
[date_expiry] => 3000-01-01
[product_ref] => Lay Theme Pro License
[subscr_id] => cus_OCtjcfpZiPwpN5
[user_ref] =>
)
6.:
[14-Jul-2023 13:07:04 UTC] License creation failed!
[14-Jul-2023 13:07:04 UTC] wp_57ussc_lic_key_tbl
[14-Jul-2023 13:07:04 UTC] Array
(
[license_key] => 64b148783fcd2
[lic_status] => pending
[first_name] => Verein zur familienerg?nzen Kleinkindern Kindergruppe Omnibus e.V.
[last_name] => none
[email] => [email protected]
[company_name] =>
[txn_id] =>
[max_allowed_domains] => 1
[date_created] => 2023-07-14
[date_expiry] => 3000-01-01
[product_ref] => Lay Theme Single License with Fullscreen Slider Addon
[subscr_id] => cus_OGIIh4DqYiHFki
[user_ref] =>
)
7.:
[08-Aug-2023 10:12:48 UTC] License creation failed!
[08-Aug-2023 10:12:48 UTC] wp_57ussc_lic_key_tbl
[08-Aug-2023 10:12:48 UTC] Array
(
[license_key] => 64d21520474b1
[lic_status] => pending
[first_name] => hohundmann – visuelle kommunikation
[last_name] => none
[email] => [email protected]
[company_name] =>
[txn_id] =>
[max_allowed_domains] => 2
[date_created] => 2023-08-08
[date_expiry] => 3000-01-01
[product_ref] => Lay Theme Single License to Pro License Upgrade
[subscr_id] => cus_OPc7pQLxeQt4M7
[user_ref] =>
)
8.:
[09-Aug-2023 12:45:31 UTC] License creation failed!
[09-Aug-2023 12:45:31 UTC] wp_57ussc_lic_key_tbl
[09-Aug-2023 12:45:31 UTC] Array
(
[license_key] => 64d38a6b3d6cf
[lic_status] => pending
[first_name] => Caldeira & Nascimento – Design, Lda
[last_name] => none
[email] => [email protected]
[company_name] =>
[txn_id] =>
[max_allowed_domains] => 2
[date_created] => 2023-08-09
[date_expiry] => 3000-01-01
[product_ref] => Lay Theme Single License to Pro License Upgrade
[subscr_id] => cus_OQ1oMw120dadYG
[user_ref] =>
)
9.:
[14-Aug-2023 15:41:30 UTC] License creation failed!
[14-Aug-2023 15:41:30 UTC] wp_57ussc_lic_key_tbl
[14-Aug-2023 15:41:30 UTC] Array
(
[license_key] => 64da4b2a4dc36
[lic_status] => pending
[first_name] => Zahlbach Gbr A Pfurtscheller, L & J Nixdorff
[last_name] => none
[email] => [email protected]
[company_name] =>
[txn_id] =>
[max_allowed_domains] => 3
[date_created] => 2023-08-14
[date_expiry] => 3000-01-01
[product_ref] => Lay Theme Pro License
[subscr_id] => cus_ORwnEaMOYvjsmV
[user_ref] =>
)
My best guess is keys cant be created if the first name contains special characters or is too long.
I see you sanitize the first name though:
$fields[‘first_name’] = isset( $_REQUEST[‘first_name’] ) ? wp_unslash( SLM_Utility::sanitize_strip_trim_slm_text( $_REQUEST[‘first_name’] ) ) : ”;
I’m using version 4.5.4
Thanks for the plugin! Been using it since many years!
Let me know if you need any further information
]]>Helpful features would be:
In the meantime, is there a simple hack to allow#2? EDIT: figured this out with code hack.
]]>Hello friends!
I have searched the docs site, GitHub and some online but cannot find a list of error_codes. For example, here are a couple:
{"result":"error","message":"Invalid license key","error_code":60}
{"result":"error","message":"Your License key is blocked","error_code":20}
Have a project working on and would like to use the error_code numbers. Is there a location to find a list of error_code or could you provide a list?
Thank you.
]]>Hello,
I’m looking for an extension compatible with WooCommerce HPOS. Extensions like WooCommerce Software License Manager have not been updated for a long time and it seems that it is not compatible with HPOS. Is there any solution?
Thank you!
]]>Hello,
I am new to Software License Manager and wanted to ask is there a support for custom generators? I mean we need to alter the procedure how license keys are generated.
Best Regards,
Tony
Hi, in the recent week I have had 2 occurrences when a customer places an WooCommerce order, but after that the license does not get created.
When checking our log file we have this error:
Unexpected Error in the Licence Creation process!
Do you know what could be causing such issues? Before we have never had such issues with license creation.
Thank you,
Nauris
I have insalled plugin, but in admin page for creating license I got an error.
Warning: Undefined array key “lic_prefix” in /data/4/a/4ae37e2a-c89b-430e-ba81-f9a93bbbd234/legallicense.sk/web/wp-content/plugins/software-license-manager/menu/slm-add-licenses.php on line 209
On settings page I have two PHP warnings:
Warning: Undefined array key “lic_creation_secret” in /data/4/a/4ae37e2a-c89b-430e-ba81-f9a93bbbd234/legallicense.sk/web/wp-content/plugins/software-license-manager/menu/slm-lic-settings.php on line 65
Warning: Undefined array key “lic_verification_secret” in /data/4/a/4ae37e2a-c89b-430e-ba81-f9a93bbbd234/legallicense.sk/web/wp-content/plugins/software-license-manager/menu/slm-lic-settings.php on line 69
How can I fix this warning messages?
]]>Hello
I am looking for a monthly code license sale with the possibility of renewal
Preferably with the possibility of renewing exactly the same license code that the customer purchased from the beginning
And if not, at least inform the customer about the expiration of the one-month code and the need to buy a new code
But now, even after the license expires, a reminder or invoice is not issued to the customer!
Can you guide me in implementing this?
It is a good plugin. I hope you add these features to it:
Can you add the current date to api responses? That way I can use the date returned by the api to perform some actions based on the the other dates returned.
An example for anybody who wants this functionality:
Add to software-license-manager/includes/slm-api-listener.php:
Line 297: 'date' => date("Y-m-d"),
Hi,
This is a really GREAT plugin, but there seem to be problems with incompatibilities on PHP v8+. Is there a time-frame to bring the plugin up-to-date and make it compatible?
The change log says the last PHP update was PHP 7.2.x compatibility
in plugin version 4.5.2.
Thanks ??
]]>it would be great to have a way to deactivate all domains under a specific key either through the API (slm_deactivate) or through the interface above the registered domain. for the cases where you have multiple domains and you don’t want to remove them one by one
something like this for the API (note that the code could be completely off my understanding of PHP is limited)
global $wpdb; $registered_dom_table = SLM_TBL_LIC_DOMAIN; if ($registered_domain === “all”) { $sql_prep = $wpdb->prepare(“DELETE FROM $registered_dom_table WHERE lic_key=%s”, $license_key); } else { $sql_prep = $wpdb->prepare(“DELETE FROM $registered_dom_table WHERE lic_key=%s AND registered_domain=%s”, $license_key, $registered_domain); } $delete = $wpdb->query($sql_prep); if ($delete === false) { $slm_debug_logger->log_debug(‘Error – failed to delete the registered domain from the database.’); } elseif ($delete == 0) { $args = (array( ‘result’ => ‘error’, ‘message’ => ‘The license key on this domain is already inactive’, ‘error_code’ => SLM_Error_Codes::DOMAIN_ALREADY_INACTIVE, )); SLM_API_Utility::output_api_response($args); } else { $args = (array( ‘result’ => ‘success’, ‘message’ => ‘The license key has been deactivated for this domain’, )); SLM_API_Utility::output_api_response($args); }
Hi, first of all thank you very much for this great plugin. I extended it with my custom columns as described (works great).
Can you tell me, how i would have to include the screen_options for WP_List_Table, where i can choose how many records should be showned and select/deselect columns from the Manage Licenses Screen
Thank you very much.
regards, dragonfly67
]]>I have get this error
WP_Error Object ( [errors] => Array ( [http_request_failed] => Array ( [0] => cURL error 28: Failed to connect to www.******.com port 443: Connection timed out ) ) [error_data] => Array ( ) [additional_data:protected] => Array ( ) )
]]>Hi!
For the previous domain i was creating the licenses automatically and it was working perfectly!
And now i’ve changed to new domain and updated your plugin now the license is creating but it’s not activating. I mean it is activating but it’s only allowed for one domain but it’s working for every domain and it’s not showing in registered domains on which the license is being used on admin side
Please assist!
I installed the sample plugin, and like in the tutorial, I simply changed the YOUR_SPECIAL_SECRET_KEY and YOUR_LICENSE_SERVER_URL values to my SLM’s values. When I enter my key, I have the following message: The following message was returned from the server: Verification API secret key is invalid.
What am I doing wrong?
<?php
/*
Plugin Name: Sample Plugin
Version: v1.0
Plugin URI: https://www.tipsandtricks-hq.com
Author: Tips and Tricks HQ
Author URI: https://www.tipsandtricks-hq.com/
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', '633e0caa8abeb5xxxxxxxx'); //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', 'https://www.wpmoliere.com'); //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', 'Moliere'); //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', __FILE__, 'sample_license_management_page');
}
function sample_license_management_page() {
echo '<div class="wrap">';
echo '<h2>Sample License Management</h2>';
/*** License activate button was clicked ***/
if (isset($_REQUEST['activate_license'])) {
$license_key = sanitize_text_field( $_REQUEST['sample_license_key'] );
// API query parameters
$api_params = array(
'slm_action' => 'slm_activate',
'secret_key' => YOUR_SPECIAL_SECRET_KEY,
'license_key' => $license_key,
'registered_domain' => $_SERVER['SERVER_NAME'],
'item_reference' => urlencode(YOUR_ITEM_REFERENCE),
);
// Send query to the license manager server
$query = esc_url_raw(add_query_arg($api_params, YOUR_LICENSE_SERVER_URL));
$response = wp_remote_get($query, array('timeout' => 20, 'sslverify' => false));
// Check for error in the response
if (is_wp_error($response)){
echo "Unexpected Error! The query returned with an error.";
}
//var_dump($response);//uncomment it if you want to look at the full response
// License data.
$license_data = json_decode(wp_remote_retrieve_body($response));
// TODO - Do something with it.
//var_dump($license_data);//uncomment it to look at the data
if($license_data->result == 'success'){//Success was returned for the license activation
//Uncomment the followng line to see the message that returned from the license server
echo '<br />The following message was returned from the server: '.$license_data->message;
//Save the license key in the options table
update_option('sample_license_key', $license_key);
}
else{
//Show error to the user. Probably entered incorrect license key.
//Uncomment the followng line to see the message that returned from the license server
echo '<br />The following message was returned from the server: '.$license_data->message;
}
}
/*** End of license activation ***/
/*** License activate button was clicked ***/
if (isset($_REQUEST['deactivate_license'])) {
$license_key = sanitize_text_field( $_REQUEST['sample_license_key'] );
// API query parameters
$api_params = array(
'slm_action' => 'slm_deactivate',
'secret_key' => YOUR_SPECIAL_SECRET_KEY,
'license_key' => $license_key,
'registered_domain' => $_SERVER['SERVER_NAME'],
'item_reference' => urlencode(YOUR_ITEM_REFERENCE),
);
// Send query to the license manager server
$query = esc_url_raw(add_query_arg($api_params, YOUR_LICENSE_SERVER_URL));
$response = wp_remote_get($query, array('timeout' => 20, 'sslverify' => false));
// Check for error in the response
if (is_wp_error($response)){
echo "Unexpected Error! The query returned with an error.";
}
//var_dump($response);//uncomment it if you want to look at the full response
// License data.
$license_data = json_decode(wp_remote_retrieve_body($response));
// TODO - Do something with it.
//var_dump($license_data);//uncomment it to look at the data
if($license_data->result == 'success'){//Success was returned for the license activation
//Uncomment the followng line to see the message that returned from the license server
echo '<br />The following message was returned from the server: '.$license_data->message;
//Remove the licensse key from the options table. It will need to be activated again.
update_option('sample_license_key', '');
}
else{
//Show error to the user. Probably entered incorrect license key.
//Uncomment the followng line to see the message that returned from the license server
echo '<br />The following message was returned from the server: '.$license_data->message;
}
}
/*** End of sample license deactivation ***/
?>
<p>Please enter the license key for this product to activate it. You were given a license key when you purchased this item.</p>
<form action="" method="post">
<table class="form-table">
<tr>
<th style="width:100px;"><label for="sample_license_key">License Key</label></th>
<td ><input class="regular-text" type="text" id="sample_license_key" name="sample_license_key" value="<?php echo get_option('sample_license_key'); ?>" ></td>
</tr>
</table>
<p class="submit">
<input type="submit" name="activate_license" value="Activate" class="button-primary" />
<input type="submit" name="deactivate_license" value="Deactivate" class="button" />
</p>
</form>
<?php
echo '</div>';
}
]]>