verify_nonce_and_capability( $request->get_param( self::NONCE_NAME ), self::NONCE_NAME ); try { $client_id = Data::get_client_id(); if ( ! $client_id ) { return $this->respond_error_json( [ 'message' => esc_html__( 'Client ID not found', 'image-optimization' ), 'code' => 'bad_request', ] ); } Service::update_redirect_uri(); return $this->respond_success_json( [ 'message' => esc_html__( 'Domain updated!', 'image-optimization' ), ] ); } catch ( Throwable $t ) { return $this->respond_error_json( [ 'message' => $t->getMessage(), 'code' => 'internal_server_error', ] ); } } }