File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717/**
1818 * Handles GWP Licenses.
1919 *
20- * @version 2.0.1
20+ * @version 2.0.2
2121 */
2222class LicenseHandler {
2323 /**
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 22/**
33 * Custom Plugin Updater
44 *
5- * @package PaddlePress
5+ * @package gravitywp-license-handler
6+ *
67 */
78
89namespace 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 ;
You can’t perform that action at this time.
0 commit comments