PluginProbe
Depicter — Popup & Slider Builder / 1.9.2
Depicter — Popup & Slider Builder v1.9.2
4.8.1 trunk 1.0.0 1.1.0 1.1.2 1.1.4 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.5 1.3.8 1.5.0 1.5.1 1.5.2 1.5.5 1.6.0 1.6.1 1.6.2 1.7.0 All 76 releases
← All changes | app/src/Services/ClientService.php +15 -4 1.5.21.9.2 View file →
@@ -23,9 +23,9 @@
23 23 public function authorize() {
24 24
25 25 if (
26 26 \Depicter::cache('base')->get( 'is_client_registered' ) &&
27 - \Depicter::options()->get( 'client_key', false )
27 + \Depicter::auth()->getClientKey()
28 28 ) {
29 29 return;
30 30 }
31 31
@@ -107,22 +107,33 @@
107 107 try {
108 108 $response = \Depicter::remote()->post( 'v1/client/validate/activation' );
109 109 $info = JSON::decode( $response->getBody(), true);
110 110
111 - if ( ! empty( $info['data'] ) ) {
111 + if( is_null( $info['success'] ) ){
112 + \Depicter::options()->set('activation_error_message', '' );
113 +
114 + } elseif ( ! empty( $info['data'] ) ) {
112 115 \Depicter::options()->set('subscription_status', $info['data']['status'] );
113 116 \Depicter::options()->set('subscription_expires_at', $info['data']['expires_at'] );
114 117 \Depicter::options()->set('user_tier', $info['data']['user_tier'] );
115 118 \Depicter::options()->set('activation_error_message', '' );
116 - } elseif( ! empty( $info['errors'] ) ) {
117 - \Depicter::options()->set('activation_error_message', $info['errors'] );
119 +
120 + if ( $info['data']['status'] == 'active' ) {
121 + return true;
122 + }
123 + } elseif( $info['success'] == 1 ){
124 + return true;
118 125 }
126 +
119 127 if( ! empty( $info['log'] ) ) {
120 128 \Depicter::options()->set('activation_log_message', $info['log'] );
121 129 }
130 +
122 131 } catch ( GuzzleException $exception ) {
123 132 \Depicter::options()->set('activation_error_message' , $exception->getMessage() );
124 133 \Depicter::options()->set('connection_error_message' , $exception->getMessage() );
125 134 }
135 +
136 + return false;
126 137 }
127 138
128 139 }