Skip to content

Commit

Permalink
Merge pull request #5 from gravitywpcom/develop
Browse files Browse the repository at this point in the history
small fixes
  • Loading branch information
JurriaanK authored Jul 17, 2024
2 parents 9fa2576 + a6c4a35 commit 456bd59
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/LicenseHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/**
* Handles GWP Licenses.
*
* @version 2.0.1
* @version 2.0.2
*/
class LicenseHandler {
/**
Expand Down
3 changes: 3 additions & 0 deletions src/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

= 2.0.2 =
- Fix issue with with license activation.

= 2.0.1 =
- Fix php fatal error in generate error Messages.

Expand Down
12 changes: 8 additions & 4 deletions src/pluginUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
/**
* Custom Plugin Updater
*
* @package PaddlePress
* @package gravitywp-license-handler
*
*/

namespace GravityWP\Updater;
Expand Down Expand Up @@ -202,11 +203,14 @@ public function request_is_activate( $field_setting ) {
} else {
$body = wp_remote_retrieve_body( $response );
$json_data = json_decode( $body, true );
if ( isset( $json_data['success'] ) && $json_data['success'] === true ) {
if ( isset( $json_data['success'] ) && $json_data['success'] === true && isset( $json_data['license_status'] ) && $json_data['license_status'] === 'valid' ) {
return true;
} elseif ( isset( $json_data['errors'] ) ) {
$this->error_messages = nl2br( $this->generateErrorMessage( $json_data['errors'] ) );
return false;
if ( count( $json_data['errors'] ) === 1 && ! empty( $json_data['errors']['unregistered_license_domain'] ) ) {
return true;
}
$this->error_messages = nl2br( $this->generateErrorMessage( $json_data['errors'] ) );
return false;
} elseif ( isset( $json_data['message'] ) ) {
$this->error_messages = nl2br( $this->generateErrorMessage( $json_data['message'] ) );
return false;
Expand Down

0 comments on commit 456bd59

Please sign in to comment.