delete( $wpdb->prefix . 'woocommerce_api_keys', array( 'truncated_key' => $agentcart_truncated_key ), array( '%s' ) ); } } // Delete all agentcart options. $agentcart_options = array( 'agentcart_consumer_key', 'agentcart_consumer_secret', 'agentcart_truncated_key', 'agentcart_connected', 'agentcart_merchant_id', 'agentcart_api_url', ); foreach ( $agentcart_options as $agentcart_option ) { delete_option( $agentcart_option ); } // Clean up transients. global $wpdb; // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- One-time removal of our own transients on uninstall; caching does not apply to a delete. $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s OR option_name LIKE %s", $wpdb->esc_like( '_transient_agentcart_' ) . '%', $wpdb->esc_like( '_transient_timeout_agentcart_' ) . '%' ) );