Skip to content

Commit a6c4a35

Browse files
committed
small fixes
1 parent 9fa2576 commit a6c4a35

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

src/LicenseHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/**
1818
* Handles GWP Licenses.
1919
*
20-
* @version 2.0.1
20+
* @version 2.0.2
2121
*/
2222
class LicenseHandler {
2323
/**

src/changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11

2+
= 2.0.2 =
3+
- Fix issue with with license activation.
4+
25
= 2.0.1 =
36
- Fix php fatal error in generate error Messages.
47

src/pluginUpdater.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
/**
33
* Custom Plugin Updater
44
*
5-
* @package PaddlePress
5+
* @package gravitywp-license-handler
6+
*
67
*/
78

89
namespace GravityWP\Updater;
@@ -202,11 +203,14 @@ public function request_is_activate( $field_setting ) {
202203
} else {
203204
$body = wp_remote_retrieve_body( $response );
204205
$json_data = json_decode( $body, true );
205-
if ( isset( $json_data['success'] ) && $json_data['success'] === true ) {
206+
if ( isset( $json_data['success'] ) && $json_data['success'] === true && isset( $json_data['license_status'] ) && $json_data['license_status'] === 'valid' ) {
206207
return true;
207208
} elseif ( isset( $json_data['errors'] ) ) {
208-
$this->error_messages = nl2br( $this->generateErrorMessage( $json_data['errors'] ) );
209-
return false;
209+
if ( count( $json_data['errors'] ) === 1 && ! empty( $json_data['errors']['unregistered_license_domain'] ) ) {
210+
return true;
211+
}
212+
$this->error_messages = nl2br( $this->generateErrorMessage( $json_data['errors'] ) );
213+
return false;
210214
} elseif ( isset( $json_data['message'] ) ) {
211215
$this->error_messages = nl2br( $this->generateErrorMessage( $json_data['message'] ) );
212216
return false;

0 commit comments

Comments
 (0)