prefix . 'culprit_incidents'; // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter -- one-time uninstall cleanup of the plugin's own table; name from $wpdb->prefix + literal, nothing to cache. $wpdb->query( "DROP TABLE IF EXISTS {$culprit_table}" ); delete_option( 'culprit_settings' ); delete_option( 'culprit_schema_version' ); delete_option( 'culprit_recent_changes' ); delete_option( 'culprit_watcher_installed_version' ); delete_option( 'culprit_watcher_unwritable' ); delete_option( 'culprit_state_snapshots' ); delete_option( 'culprit_hook_timeline' ); delete_option( 'culprit_recovery_dismissed' ); delete_option( 'culprit_scan_allowlist' ); delete_transient( 'culprit_rest_status' ); // Remove the capture buffer (resolved path stored in an option) and the // protection files in its folder. $culprit_buffer = (string) get_option( 'culprit_buffer_path', '' ); if ( '' !== $culprit_buffer && file_exists( $culprit_buffer ) ) { wp_delete_file( $culprit_buffer ); } if ( '' !== $culprit_buffer ) { $culprit_buffer_dir = dirname( $culprit_buffer ); foreach ( array( 'index.php', '.htaccess' ) as $culprit_protect ) { if ( file_exists( $culprit_buffer_dir . '/' . $culprit_protect ) ) { wp_delete_file( $culprit_buffer_dir . '/' . $culprit_protect ); } } } delete_option( 'culprit_buffer_path' ); delete_option( 'culprit_watcher_optin' ); }