' => $total, ] ); } /** * Clear log. * * @param WP_REST_Request $request Full details about the request. * * @return WP_REST_Response|WP_Error */ public function clear_log( WP_REST_Request $request ) { Api::get()->clear_log(); return new WP_REST_Response( [ 'status' => 'ok' ] ); } /** * Reset key. * * @param WP_REST_Request $request Full details about the request. * * @return WP_REST_Response|WP_Error */ public function reset_key( WP_REST_Request $request ) { $api = Api::get(); $api->reset_key(); $key = $api->get_key(); $location = $api->get_key_location( 'reset_key' ); return new WP_REST_Response( [ 'status' => 'ok', 'key' => $key, 'location' => $location, ] ); } }