$before The snapshot. */ public function restore( ActionDescriptor $action, array $before ): WP_Error { return new WP_Error( 'adafwc_not_undoable', __( 'This change cannot be undone by Agent Firewall.', 'agentic-daisy-ai-agent-firewall-for-woocommerce' ) ); } /** * What taking it back would leave. * * @param ActionDescriptor $action The stored action. */ public function reversibility( ActionDescriptor $action ): Reversibility { if ( 'order_note' === $this->entity_type ) { return 'create' === $action->action_cat && WcRouteClassifier::truthy( $action->input['customer_note'] ?? null ) ? new Reversibility( Reversibility::IRREVERSIBLE, array( __( 'The note is emailed to the customer.', 'agentic-daisy-ai-agent-firewall-for-woocommerce' ) ) ) : new Reversibility( Reversibility::PARTIALLY_REVERSIBLE, array( __( 'A private note can be deleted by hand; undo does not.', 'agentic-daisy-ai-agent-firewall-for-woocommerce' ) ) ); } if ( 'payment_gateway' === $this->entity_type ) { return new Reversibility( Reversibility::PARTIALLY_REVERSIBLE, array( __( 'Payment gateway settings hold credentials and are not captured for undo; change them back by hand.', 'agentic-daisy-ai-agent-firewall-for-woocommerce' ) ) ); } return new Reversibility( Reversibility::PARTIALLY_REVERSIBLE, array( __( 'Shipping and tax changes are not captured for undo; change them back by hand.', 'agentic-daisy-ai-agent-firewall-for-woocommerce' ) ) ); } }