Skip to content

Commit

Permalink
WIP: Added a new action hook for when it receives an activation reque…
Browse files Browse the repository at this point in the history
…st for an expired license key (slm_api_listener_slm_activate_key_expired).
  • Loading branch information
michelve committed Jun 23, 2022
1 parent 74d566f commit deef031
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions includes/slm-api-listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,16 @@ function activation_api_listener()

if ($retLic) {
if ($retLic->lic_status == 'blocked') {
//Trigger action hook
do_action('slm_api_listener_slm_activate_key_blocked', $key);


$args = (array('result' => 'error', 'message' => 'Your license key is blocked', 'error_code' => SLM_Error_Codes::LICENSE_BLOCKED));
SLM_API_Utility::output_api_response($args);
} elseif ($retLic->lic_status == 'expired') {
//Trigger action hook
do_action('slm_api_listener_slm_activate_key_expired', $key);

$args = (array('result' => 'error', 'message' => 'Your license key has expired', 'error_code' => SLM_Error_Codes::LICENSE_EXPIRED));
SLM_API_Utility::output_api_response($args);
}
Expand Down
4 changes: 2 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: Michel Velis
Donate link: http://paypal.me/mvelis
Tags: license, software license
Requires at least: 4.1
Tested up to: 5.9.2
Stable tag: 5.6.1
Tested up to: 6.1.0
Stable tag: 5.6.2
Requires PHP: 5.2.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down
6 changes: 3 additions & 3 deletions software-license-manager.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php
/*
Plugin Name: Software License Manager
Version: 5.6.1
Version: 5.6.2
Plugin URI: https://github.com/michelve/software-license-manager/
Author: Michel Velis
Author URI: http://www.epikly.com/
Description: Software license management solution for your web applications (WordPress plugins, Themes, Applications, PHP based license software script etc.). Supports WooCommerce.
Author2: <a href="https://www.tipsandtricks-hq.com/">Tips and Tricks HQ</a>
Text Domain: softwarelicensemanager
Domain Path: /i18n/languages/
WC tested up to: 5.9.2
WC tested up to: 6.1.0
*/

// If this file is called directly, abort.
Expand All @@ -19,7 +19,7 @@
global $wpdb, $slm_debug_logger;

//Short name/slug "SLM" or "slm"
define('SLM_VERSION', '5.6.1');
define('SLM_VERSION', '5.6.2');
define('SLM_DB_VERSION', '4.3.5');
define('SLM_REWRITE_VERSION', '2.4.5');
define('SLM_FOLDER', dirname(plugin_basename(__FILE__)));
Expand Down

0 comments on commit deef031

Please sign in to comment.