Skip to content

Commit

Permalink
Merge from Michelve - v 5.5.3
Browse files Browse the repository at this point in the history
Merge from Michelve - v 5.5.3
  • Loading branch information
MechComp committed Jun 18, 2020
2 parents 7e34229 + 5249021 commit f00990b
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 18 deletions.
63 changes: 62 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,60 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

## [5.5.2](https://github.com/michelve/software-license-manager/compare/5.5.1...5.5.2) - 2020-05-03

### Commits

- 5.5.2 release [`0d18684`](https://github.com/michelve/software-license-manager/commit/0d18684196b051e19f7e3577f10fdf590768e43c)
- Set theme jekyll-theme-cayman [`5cf1d53`](https://github.com/michelve/software-license-manager/commit/5cf1d532dff312f910d1eea94659a22cf2b776e7)

## [5.5.1](https://github.com/michelve/software-license-manager/compare/5.5.0...5.5.1) - 2020-04-30

### Commits

- added: validation when creating a new license using the admin dashboard [`7b9fde3`](https://github.com/michelve/software-license-manager/commit/7b9fde3021ce4cd521b605312864abe2ac1c1f0f)
- updated wp readme [`85e02c1`](https://github.com/michelve/software-license-manager/commit/85e02c119281112c10389c4af648b1f38e4996df)

## [5.5.0](https://github.com/michelve/software-license-manager/compare/5.4.2...5.5.0) - 2020-04-28

### Commits

- Added: auto updater support [`7da3e7d`](https://github.com/michelve/software-license-manager/commit/7da3e7da87b7bc5ca450a8bca3c5adbe043f275c)
- SML now support auto updates. [`5c8161e`](https://github.com/michelve/software-license-manager/commit/5c8161e80565b800deefd78655d31f17d5a6e277)

## [5.4.2](https://github.com/michelve/software-license-manager/compare/5.4.1...5.4.2) - 2020-04-28

### Commits

- added: support for item reference (now you can tag a license under plugins, themes, code, etc), for previous version, a default tag will be set, it is recommended to update the items in your store/or licenses and change the item-reference to match your scenario. [`a2cc6ec`](https://github.com/michelve/software-license-manager/commit/a2cc6ec9e1b7d79351bcb75fc4691dd1adb4c3e9)

## [5.4.1](https://github.com/michelve/software-license-manager/compare/5.3.3...5.4.1) - 2020-04-27

### Commits

- Added: new icons to manage license interface. [`1f672fc`](https://github.com/michelve/software-license-manager/commit/1f672fc6f1b4670be11d566235a489ade999e37b)
- pot language file added [`073b735`](https://github.com/michelve/software-license-manager/commit/073b735cbf0411508be8f6132363f703e0416709)

## [5.3.3](https://github.com/michelve/software-license-manager/compare/5.3.2...5.3.3) - 2020-03-31

### Commits

- IMPROVED: removed unnecessary code [`da00a42`](https://github.com/michelve/software-license-manager/commit/da00a42479b0a783faa9890d1cd44d7cd4cd0f44)

## [5.3.2](https://github.com/michelve/software-license-manager/compare/5.3.1...5.3.2) - 2020-03-31

### Commits

- no message [`16faff4`](https://github.com/michelve/software-license-manager/commit/16faff4cf9acb9f91be1365f24e1048d57a31988)
- 5.3.2 - make lifetime license work better with woocommerce download functionality [`07efc0c`](https://github.com/michelve/software-license-manager/commit/07efc0c02361622bc16dc8cba31e4f526d3cc604)

## [5.3.1](https://github.com/michelve/software-license-manager/compare/5.2.1...5.3.1) - 2020-03-31

### Commits

- Fixed: License type was not showing correctly when editing a license [`25b5e19`](https://github.com/michelve/software-license-manager/commit/25b5e19d01eeb0268566577252cc3c0fc8dba620)
- 5.2.1 changelog [`3c50ec3`](https://github.com/michelve/software-license-manager/commit/3c50ec3f063f8e03d1f52af8e8ddf9304b2dd90b)

## [5.2.1](https://github.com/michelve/software-license-manager/compare/5.2.0...5.2.1) - 2020-03-25

### Merged
Expand Down Expand Up @@ -164,6 +218,13 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

- upgraded jQuery ui version [`27fe73f`](https://github.com/michelve/software-license-manager/commit/27fe73fe555c4a9b5b3044042be7c8b66cd0f2bd)

## [4.10.4](https://github.com/michelve/software-license-manager/compare/5.5.2...4.10.4) - 2020-05-08

### Commits

- updated image preview [`5626421`](https://github.com/michelve/software-license-manager/commit/56264212e6bfb33fb826e9c841d78dbad02243f2)
- updated image preview [`1bf014b`](https://github.com/michelve/software-license-manager/commit/1bf014b84300ba58e7ce614c25f9976c7fab6cb1)

## [4.10.3](https://github.com/michelve/software-license-manager/compare/3.1.0...4.10.3) - 2019-05-14

### Commits
Expand Down Expand Up @@ -207,7 +268,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- Updated Read me file [`fb1bf07`](https://github.com/michelve/software-license-manager/commit/fb1bf0763af6f6feed425db1affcf157162ca85e)
- Update slm-api-listener.php [`9737d0e`](https://github.com/michelve/software-license-manager/commit/9737d0ed46fc66b96b933f0fbf87b77d95a3384b)
- Update TODO.md [`a85b107`](https://github.com/michelve/software-license-manager/commit/a85b107e51824e89ae950b8ab1c2f53b7ddda32f)
- added support for $this->update_api_listener(); and $this->deletion_api_listener(); [`fb06711`](https://github.com/michelve/software-license-manager/commit/fb06711cf17a74ddd4ba3b8296bdf1f2d1cd73b8)
- added support for $this->update_api_listener(); and $this->deletion_api_listener(); [`fb06711`](https://github.com/michelve/software-license-manager/commit/fb06711cf17a74ddd4ba3b8296bdf1f2d1cd73b8)
- fixed typo [`1a8e999`](https://github.com/michelve/software-license-manager/commit/1a8e999e711749d1a51fda6296f2f707ab5d7469)
- fixed typo [`8013168`](https://github.com/michelve/software-license-manager/commit/8013168a071e1d71c1b97dae1881de9deaf3ad79)
- updated features list [`3a8c797`](https://github.com/michelve/software-license-manager/commit/3a8c7979530b614828943f8d2b197caffec97d02)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Welcome to software license manager 👋
![Version](https://img.shields.io/badge/version-5.5.2-blue.svg?cacheSeconds=2592000)
![Version](https://img.shields.io/badge/version-5.5.3-blue.svg?cacheSeconds=2592000)
[![Documentation](https://img.shields.io/badge/documentation-yes-brightgreen.svg)](https://documenter.getpostman.com/view/307939/6tjU1FL?version=latest)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/michelve/software-license-manager/blob/master/LICENSE.md)

Expand Down
3 changes: 2 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
- [x] Add Ajax Validation to Forms
- [x] Fix single product meta boxes
- [ ] Combine single and variation products functionality
- [ ] Make Expiry and Renewal dates optional (V4.5)
- [x] Make Expiry and Renewal dates optional (V4.5)
- [ ] Subscription support


Feedback and ideas are welcome. :)s
23 changes: 12 additions & 11 deletions admin/includes/wpestores/slm-wpestores.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function slm_estore_check_and_generate_key($retrieved_product, $payment_data, $c
if ($retrieved_product->create_license == 1) {
$slm_debug_logger->log_debug('Need to create a license key for this product (' . $retrieved_product->id . ')');
$slm_key = slm_estore_create_license($retrieved_product, $payment_data, $cart_items, $item_name);
$license_data = "\n" . __('Item Name: ', 'softwarelicensemanager') . $retrieved_product->name . " - " . __('License Key: ', 'softwarelicensemanager') . $slm_key;
$license_data = "\n" . __('Item Name: ', 'slm') . $retrieved_product->name . " - " . __('License Key: ', 'slm') . $slm_key;
$slm_debug_logger->log_debug('Liense data: ' . $license_data);
$license_data = apply_filters('slm_estore_item_license_data', $license_data);
}
Expand Down Expand Up @@ -107,7 +107,7 @@ function slm_estore_create_license($retrieved_product, $payment_data, $cart_item


$fields = array();
$fields['license_key'] = $license_key = strtoupper($lic_key_prefix . hyphenate(md5(uniqid(rand(4,8), true) . time() )));;
$fields['license_key'] = uniqid($lic_key_prefix);
$fields['lic_status'] = 'pending';
$fields['first_name'] = $payment_data['first_name'];
$fields['last_name'] = $payment_data['last_name'];
Expand All @@ -119,7 +119,6 @@ function slm_estore_create_license($retrieved_product, $payment_data, $cart_item
$fields['date_expiry'] = $slm_date_of_expiry;
$fields['product_ref'] = $prod_id;//WP eStore product ID
$fields['subscr_id'] = isset($payment_data['subscr_id']) ? $payment_data['subscr_id'] : '';
$fields['lic_type'] = isset($payment_data['lic_type']) ? $payment_data['lic_type'] : '';

$slm_debug_logger->log_debug('Inserting license data into the license manager DB table.');
$fields = array_filter($fields); //Remove any null values.
Expand Down Expand Up @@ -236,10 +235,11 @@ function slm_estore_product_updated($prod_dat_array, $prod_id) {
$product_meta = $wpdb->get_row("SELECT * FROM $product_meta_table_name WHERE prod_id = '$prod_id' AND meta_key='slm_max_allowed_domains'", OBJECT);
if ($product_meta) {
//Found existing value so lets update it
$fields = array();
$fields['meta_key'] = 'slm_max_allowed_domains';
$fields['meta_value'] = $prod_dat_array['slm_max_allowed_domains'];
$result = $wpdb->update($product_meta_table_name, $fields, array('prod_id' => $prod_id));
//Better to do specific update (so the other meta values for example "download_limit_count" doesn't get set to empty).
$meta_key_name = "slm_max_allowed_domains";
$meta_value = $prod_dat_array['slm_max_allowed_domains'];
$update_db_qry = "UPDATE $product_meta_table_name SET meta_value='$meta_value' WHERE prod_id='$prod_id' AND meta_key='$meta_key_name'";
$results = $wpdb->query($update_db_qry);

} else {
//No value for this field was there so lets insert one.
Expand All @@ -254,10 +254,11 @@ function slm_estore_product_updated($prod_dat_array, $prod_id) {
$product_meta = $wpdb->get_row("SELECT * FROM $product_meta_table_name WHERE prod_id = '$prod_id' AND meta_key='slm_date_of_expiry'", OBJECT);
if ($product_meta) {
//Found existing value so lets update it
$fields = array();
$fields['meta_key'] = 'slm_date_of_expiry';
$fields['meta_value'] = $prod_dat_array['slm_date_of_expiry'];
$result = $wpdb->update($product_meta_table_name, $fields, array('prod_id' => $prod_id));
//Better to do specific update (so the other meta values for example "download_limit_count" doesn't get set to empty).
$meta_key_name = "slm_date_of_expiry";
$meta_value = $prod_dat_array['slm_date_of_expiry'];
$update_db_qry = "UPDATE $product_meta_table_name SET meta_value='$meta_value' WHERE prod_id='$prod_id' AND meta_key='$meta_key_name'";
$results = $wpdb->query($update_db_qry);

} else {
//No value for this field was there so lets insert one.
Expand Down
2 changes: 1 addition & 1 deletion includes/slm-plugin-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,4 @@ function wc_log($msg) {
$log = ABSPATH . DIRECTORY_SEPARATOR . 'slm_log.txt';
file_put_contents($log, $msg . '
', FILE_APPEND);
}
}
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: http://paypal.me/mvelis
Tags: license, software license
Requires at least: 4.1
Tested up to: 5.6
Stable tag: 5.5.2
Stable tag: 5.5.3
Requires PHP: 5.2.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down
4 changes: 2 additions & 2 deletions software-license-manager.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/*
Plugin Name: Software License Manager
Version: 5.5.2
Version: 5.5.3
Plugin URI: https://github.com/michelve/software-license-manager/
Author: Michel Velis
Author URI: https://www.epikly.com/
Expand All @@ -18,7 +18,7 @@
global $wpdb, $slm_debug_logger;

//Short name/slug "SLM" or "slm"
define('SLM_VERSION', '5.5.2');
define('SLM_VERSION', '5.5.3');
define('SLM_DB_VERSION', '4.2.6');
define('SLM_REWRITE_VERSION', '2.3.8');
define('SLM_FOLDER', dirname(plugin_basename(__FILE__)));
Expand Down

0 comments on commit f00990b

Please sign in to comment.