| @@ -128,8 +128,9 @@ | ||
| 128 | 128 | public function permission_check( WP_REST_Request $request ) { |
| 129 | 129 | $this->request = $request; |
| 130 | 130 | $this->api_key = $this->utils('options')->get( 'api_key' ); |
| 131 | 131 | |
| 132 | + | |
| 132 | 133 | if ( ! empty( $this->api_key ) ) { |
| 133 | 134 | return true; |
| 134 | 135 | } |
| 135 | 136 | |
| @@ -163,9 +164,9 @@ | ||
| 163 | 164 | ->remove('reviews') |
| 164 | 165 | ->remove('cloud_activity') |
| 165 | 166 | ->remove('api_key'); |
| 166 | 167 | |
| 167 | - if( $this->utils('options')->whoami() === 'global' ) { | |
| 168 | + if( $this->utils('options')->who_am_i() === 'global' ) { | |
| 168 | 169 | $this->utils('options')->remove_global_login(); |
| 169 | 170 | } |
| 170 | 171 | |
| 171 | 172 | return new WP_Error( 'invalid_api_key', $message, $_additional_data ); |