array( 'type' => 'integer', 'description' => __( 'Backup timestamp from litespeed/list-preset-backups.', 'acrossai-abilities-manager' ), ), ); } protected function required_input(): array { return array( 'timestamp', ); } protected function output_properties(): array { return array( 'timestamp' => array( 'type' => 'integer' ), ); } protected function annotations(): array { return array( 'readonly' => false, 'destructive' => false, 'idempotent' => false, ); } protected function requires_confirmation(): bool { return true; } protected function confirmation_message(): string { return __( 'Restoring a backup replaces the entire current LiteSpeed configuration. Pass confirm: true to proceed.', 'acrossai-abilities-manager' ); } protected function run( array $input ) { $timestamp = isset( $input['timestamp'] ) ? (int) $input['timestamp'] : 0; $restored = Toolbox_Repository::restore_backup( $timestamp ); if ( is_wp_error( $restored ) ) { return $restored; } return array( 'timestamp' => $timestamp, 'message' => sprintf( /* translators: %d: backup timestamp */ __( 'Configuration restored from backup %d.', 'acrossai-abilities-manager' ), $timestamp ), ); } }