License Key Creation fails sometimes
-
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
- The topic ‘License Key Creation fails sometimes’ is closed to new replies.