Skip to content

Commit

Permalink
v1.7 released
Browse files Browse the repository at this point in the history
  • Loading branch information
amin0_000 committed Jun 17, 2015
1 parent cbe2075 commit 502f350
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
8 changes: 6 additions & 2 deletions software-license-manager/includes/slm-api-listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ function creation_api_listener() {
$slm_debug_logger->log_debug("API - license creation request received.");

$fields = array();
$fields['license_key'] = uniqid($lic_key_prefix);
if (isset($_REQUEST['license_key']) && !empty($_REQUEST['license_key'])){
$fields['license_key'] = strip_tags($_REQUEST['license_key']);//Use the key you pass via the request
}else{
$fields['license_key'] = uniqid($lic_key_prefix);//Use random generated key
}
$fields['lic_status'] = 'pending';
$fields['first_name'] = strip_tags($_REQUEST['first_name']);
$fields['last_name'] = strip_tags($_REQUEST['last_name']);
Expand All @@ -58,7 +62,7 @@ function creation_api_listener() {
$args = (array('result' => 'error', 'message' => 'License creation failed'));
SLM_API_Utility::output_api_response($args);
} else {
$args = (array('result' => 'success', 'message' => 'License successfully created'));
$args = (array('result' => 'success', 'message' => 'License successfully created', 'key' => $fields['license_key']));
SLM_API_Utility::output_api_response($args);
}
}
Expand Down
8 changes: 7 additions & 1 deletion software-license-manager/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://www.tipsandtricks-hq.com/software-license-manager-plugin-fo
Tags: license key, serial key, manager, license, serial, key, selling, sell, license activation, manage license, software license, software license manager
Requires at least: 3.0
Tested up to: 4.2
Stable tag: 1.6
Stable tag: 1.7
License: GPLv2 or later

Create and manage license keys for your software applications easily
Expand Down Expand Up @@ -45,6 +45,12 @@ See the following page:
https://www.tipsandtricks-hq.com/software-license-manager-plugin-for-wordpress

== Changelog ==
= 1.7 =
* The license key is also included with the response sent to the new license creation request. Below is an example response:
{"result":"success","message":"License successfully created","key":"5580effe188d3"}

* You can now pass a pre-generated license key to the license creation API using the "license_key" parameter in the request.

= 1.6 =
* Updated the sample plugin code so the query works better.
* Added the ability to reset the debug log file from the plugin settings interface.
Expand Down
4 changes: 2 additions & 2 deletions software-license-manager/slm_bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/*
Plugin Name: Software License Manager
Version: v1.6
Version: v1.7
Plugin URI: https://www.tipsandtricks-hq.com/software-license-manager-plugin-for-wordpress
Author: Tips and Tricks HQ
Author URI: https://www.tipsandtricks-hq.com/
Expand All @@ -14,7 +14,7 @@

//Short name/slug "SLM" or "slm"

define('WP_LICENSE_MANAGER_VERSION', "1.6");
define('WP_LICENSE_MANAGER_VERSION', "1.7");
define('WP_LICENSE_MANAGER_DB_VERSION', '1.2');
define('WP_LICENSE_MANAGER_FOLDER', dirname(plugin_basename(__FILE__)));
define('WP_LICENSE_MANAGER_URL', plugins_url('',__FILE__));
Expand Down

0 comments on commit 502f350

Please sign in to comment.