get_settings() ->get('apikey') ); return $key === $valid_apikey; } protected function check_request_apikey(wp_rest_request $request) : bool { $params = $request->get_query_params(); if (!array_key_exists('apikey', $params)) { return false; } return $this->check_apikey($params['apikey']); } protected function bad_apikey_response() : array { $response = new response_builder(); return $response ->set_code(response_code::APIKEY_FAIL) ->set_status(response_status::ERROR) ->set_message('Api Key is not valid, or not specified in the params.') ->build(); } }