{"slug":"attic-safe-database-audit","name":"Attic — Safe Database Cleanup (Undo-Friendly)","description":"Fix Site Health's \"autoloaded options\" warning and clear out junk left by deleted plugins. Quarantined first, undoable for 30 days.","author":"Bishal Shrestha","active_installs":0,"version":"2.1.1","wp_org_url":"https://wordpress.org/plugins/attic-safe-database-audit/","is_closed":false,"cleanup":{"has_uninstall_hook":true,"drops_tables_on_uninstall":true,"deletes_options_on_uninstall":false},"tables":[{"table_name":"attic_findings","full_table_name":"wp_attic_findings","description":"Stores attic findings data created by this plugin.","detection_method":"static","confidence":"medium","columns":[],"create_sql":null},{"table_name":"attic_quarantine","full_table_name":"wp_attic_quarantine","description":"Stores attic quarantine data created by this plugin.","detection_method":"static","confidence":"medium","columns":[],"create_sql":null},{"table_name":"attic_quarantine_batches","full_table_name":"wp_attic_quarantine_batches","description":"Stores attic quarantine batches data created by this plugin.","detection_method":"static","confidence":"medium","columns":[],"create_sql":null},{"table_name":"attic_scans","full_table_name":"wp_attic_scans","description":"Stores attic scans data created by this plugin.","detection_method":"static","confidence":"medium","columns":[{"name":"id","type":"bigint unsigned","nullable":false,"primary_key":true},{"name":"started_at","type":"datetime","nullable":false,"primary_key":false},{"name":"finished_at","type":"datetime","nullable":true,"primary_key":false},{"name":"status","type":"varchar(20)","nullable":false,"primary_key":false},{"name":"ruleset_version","type":"varchar(20)","nullable":false,"primary_key":false},{"name":"wp_version","type":"varchar(20)","nullable":false,"primary_key":false},{"name":"stats","type":"longtext","nullable":true,"primary_key":false},{"name":"scan_id","type":"bigint unsigned","nullable":false,"primary_key":false},{"name":"rule","type":"varchar(64)","nullable":false,"primary_key":false},{"name":"target_type","type":"varchar(20)","nullable":false,"primary_key":false},{"name":"target_key","type":"varchar(191)","nullable":false,"primary_key":false},{"name":"size_bytes","type":"bigint unsigned","nullable":false,"primary_key":false},{"name":"confidence","type":"varchar(10)","nullable":false,"primary_key":false},{"name":"attributed_slug","type":"varchar(191)","nullable":true,"primary_key":false},{"name":"attributed_state","type":"varchar(20)","nullable":false,"primary_key":false},{"name":"code_refs","type":"smallint unsigned","nullable":false,"primary_key":false},{"name":"prefix_refs","type":"smallint unsigned","nullable":false,"primary_key":false},{"name":"evidence","type":"longtext","nullable":true,"primary_key":false},{"name":"state","type":"varchar(20)","nullable":false,"primary_key":false},{"name":"fingerprint","type":"char(40)","nullable":false,"primary_key":false},{"name":"first_seen_scan","type":"bigint unsigned","nullable":false,"primary_key":false},{"name":"last_seen_scan","type":"bigint unsigned","nullable":false,"primary_key":false},{"name":"created_at","type":"datetime","nullable":false,"primary_key":false},{"name":"created_by","type":"bigint unsigned","nullable":false,"primary_key":false},{"name":"note","type":"varchar(255)","nullable":true,"primary_key":false},{"name":"item_count","type":"int unsigned","nullable":false,"primary_key":false},{"name":"restored_at","type":"datetime","nullable":true,"primary_key":false},{"name":"purge_after","type":"datetime","nullable":true,"primary_key":false},{"name":"batch_id","type":"bigint unsigned","nullable":false,"primary_key":false},{"name":"target_type","type":"varchar(20)","nullable":false,"primary_key":false},{"name":"target_key","type":"varchar(191)","nullable":false,"primary_key":false},{"name":"payload","type":"longtext","nullable":true,"primary_key":false},{"name":"restore_hint","type":"longtext","nullable":true,"primary_key":false},{"name":"restored_at","type":"datetime","nullable":true,"primary_key":false},{"name":"last_seen_at","type":"datetime","nullable":true,"primary_key":false},{"name":"seen_count","type":"bigint unsigned","nullable":false,"primary_key":false}],"create_sql":"CREATE TABLE wp_attic_scans ( id bigint unsigned NOT NULL AUTO_INCREMENT, started_at datetime NOT NULL, finished_at datetime NULL, status varchar(20) NOT NULL DEFAULT 'running', ruleset_version varchar(20) NOT NULL, wp_version varchar(20) NOT NULL, stats longtext NULL, PRIMARY KEY (id), KEY status (status) ) $cs\", \"CREATE TABLE wp_attic_findings ( id bigint unsigned NOT NULL AUTO_INCREMENT, scan_id bigint unsigned NOT NULL, rule varchar(64) NOT NULL, target_type varchar(20) NOT NULL, target_key varchar(191) NOT NULL, size_bytes bigint unsigned NOT NULL DEFAULT 0, confidence varchar(10) NOT NULL DEFAULT 'review', attributed_slug varchar(191) NULL, attributed_state varchar(20) NOT NULL DEFAULT 'unknown', code_refs smallint unsigned NOT NULL DEFAULT 0, prefix_refs smallint unsigned NOT NULL DEFAULT 0, evidence longtext NULL, state varchar(20) NOT NULL DEFAULT 'open', fingerprint char(40) NOT NULL, first_seen_scan bigint unsigned NOT NULL DEFAULT 0, last_seen_scan bigint unsigned NOT NULL DEFAULT 0, PRIMARY KEY (id), UNIQUE KEY scan_fingerprint (scan_id, fingerprint), KEY rule (rule), KEY state_confidence (state, confidence) ) $cs\", \"CREATE TABLE wp_attic_quarantine_batches ( id bigint unsigned NOT NULL AUTO_INCREMENT, created_at datetime NOT NULL, created_by bigint unsigned NOT NULL, note varchar(255) NULL, item_count int unsigned NOT NULL DEFAULT 0, restored_at datetime NULL, purge_after datetime NULL, PRIMARY KEY (id) ) $cs\", \"CREATE TABLE wp_attic_quarantine ( id bigint unsigned NOT NULL AUTO_INCREMENT, batch_id bigint unsigned NOT NULL, target_type varchar(20) NOT NULL, target_key varchar(191) NOT NULL, payload longtext NULL, restore_hint longtext NULL, restored_at datetime NULL, PRIMARY KEY (id), KEY batch_id (batch_id) ) $cs\", \"CREATE TABLE wp_attic_usage ( option_name varchar(191) NOT NULL, last_seen_at datetime NULL, seen_count bigint unsigned NOT NULL DEFAULT 0, PRIMARY KEY (option_name) ) $cs\", ]; } private static function migrate(): void { require_once ABSPATH . 'wp-admin/includes/upgrade.php'; global $wpdb; foreach ( self::tables() as $sql ) { dbDelta( $sql );"},{"table_name":"attic_usage","full_table_name":"wp_attic_usage","description":"Stores attic usage data created by this plugin.","detection_method":"static","confidence":"medium","columns":[],"create_sql":null}],"table_count":5}