Delete). This does NOT run on deactivation. * * @package CleanFormMail */ // Only run when WordPress triggers uninstall. if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { exit; } // Remove the forms index. $form_ids = (array) get_option( 'ajb_cfm_forms', [] ); // Remove each individual form's settings. foreach ( $form_ids as $form_id ) { delete_option( 'ajb_cfm_form_' . sanitize_key( $form_id ) ); } // Remove the forms list option. delete_option( 'ajb_cfm_forms' ); // Remove legacy v2 single-form settings if present. delete_option( 'ajb_cfm_settings' ); // Remove any rate-limit transients (best-effort; transients expire naturally anyway). global $wpdb; // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient_ajb_cfm_rl_%' OR option_name LIKE '_transient_timeout_ajb_cfm_rl_%'" );