{"slug":"bsx-file-exchange","name":"BSX File Exchange","description":"Private, bidirectional file exchange between paired users. Built for clinics, law firms, coaches, and any service needing secure client file sharing.","author":"bs279","active_installs":0,"version":"1.0.6","wp_org_url":"https://wordpress.org/plugins/bsx-file-exchange/","is_closed":false,"cleanup":{"has_uninstall_hook":true,"drops_tables_on_uninstall":true,"deletes_options_on_uninstall":true},"tables":[{"table_name":"bsxfe_activity","full_table_name":"wp_bsxfe_activity","description":"Stores bsxfe activity data created by this plugin.","detection_method":"static","confidence":"medium","columns":[],"create_sql":null},{"table_name":"bsxfe_files","full_table_name":"wp_bsxfe_files","description":"Stores bsxfe files data created by this plugin.","detection_method":"static","confidence":"medium","columns":[],"create_sql":null},{"table_name":"bsxfe_notifications","full_table_name":"wp_bsxfe_notifications","description":"Stores bsxfe notifications data created by this plugin.","detection_method":"static","confidence":"medium","columns":[],"create_sql":null},{"table_name":"bsxfe_pairs","full_table_name":"wp_bsxfe_pairs","description":"Stores bsxfe pairs data created by this plugin.","detection_method":"static","confidence":"medium","columns":[{"name":"id","type":"BIGINT(20) UNSIGNED","nullable":false,"primary_key":true},{"name":"host_user_id","type":"BIGINT(20) UNSIGNED","nullable":false,"primary_key":false},{"name":"guest_user_id","type":"BIGINT(20) UNSIGNED","nullable":false,"primary_key":false},{"name":"status","type":"VARCHAR(20)","nullable":false,"primary_key":false},{"name":"notes","type":"TEXT","nullable":true,"primary_key":false},{"name":"created_at","type":"DATETIME","nullable":false,"primary_key":false},{"name":"updated_at","type":"DATETIME","nullable":false,"primary_key":false},{"name":"pair_id","type":"BIGINT(20) UNSIGNED","nullable":false,"primary_key":false},{"name":"uploader_id","type":"BIGINT(20) UNSIGNED","nullable":false,"primary_key":false},{"name":"original_name","type":"VARCHAR(255)","nullable":false,"primary_key":false},{"name":"stored_name","type":"VARCHAR(255)","nullable":false,"primary_key":false},{"name":"filepath","type":"VARCHAR(500)","nullable":false,"primary_key":false},{"name":"filesize","type":"BIGINT(20) UNSIGNED","nullable":false,"primary_key":false},{"name":"filetype","type":"VARCHAR(20)","nullable":false,"primary_key":false},{"name":"mime_type","type":"VARCHAR(100)","nullable":false,"primary_key":false},{"name":"message","type":"TEXT","nullable":true,"primary_key":false},{"name":"access_token","type":"VARCHAR(64)","nullable":false,"primary_key":false},{"name":"uploaded_at","type":"DATETIME","nullable":false,"primary_key":false},{"name":"expires_at","type":"DATETIME","nullable":true,"primary_key":false},{"name":"file_id","type":"BIGINT(20) UNSIGNED","nullable":false,"primary_key":false},{"name":"recipient_id","type":"BIGINT(20) UNSIGNED","nullable":false,"primary_key":false},{"name":"type","type":"VARCHAR(50)","nullable":false,"primary_key":false},{"name":"status","type":"VARCHAR(20)","nullable":false,"primary_key":false},{"name":"sent_at","type":"DATETIME","nullable":false,"primary_key":false},{"name":"read_at","type":"DATETIME","nullable":true,"primary_key":false},{"name":"file_id","type":"BIGINT(20) UNSIGNED","nullable":false,"primary_key":false},{"name":"user_id","type":"BIGINT(20) UNSIGNED","nullable":false,"primary_key":false},{"name":"action","type":"VARCHAR(50)","nullable":false,"primary_key":false},{"name":"ip_address","type":"VARCHAR(45)","nullable":false,"primary_key":false},{"name":"user_agent","type":"VARCHAR(255)","nullable":false,"primary_key":false},{"name":"created_at","type":"DATETIME","nullable":false,"primary_key":false}],"create_sql":"CREATE TABLE IF NOT EXISTS wp_bsxfe_pairs ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, host_user_id BIGINT(20) UNSIGNED NOT NULL, guest_user_id BIGINT(20) UNSIGNED NOT NULL, status VARCHAR(20) NOT NULL DEFAULT 'active', notes TEXT DEFAULT NULL, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (id), UNIQUE KEY unique_pair (host_user_id, guest_user_id), KEY idx_host (host_user_id), KEY idx_guest (guest_user_id), KEY idx_status (status) ) $charset;\"; // ── pd_files ──────────────────────────────────────────────────────── // Every file belongs to a pair. Both sides can upload. // filepath is relative to BSXFE_UPLOAD_DIR — never a public URL. // access_token is the only way to download; it is single-use-safe via // activity logging + permission check on every request. $sql_files = \"CREATE TABLE IF NOT EXISTS wp_bsxfe_files ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, pair_id BIGINT(20) UNSIGNED NOT NULL, uploader_id BIGINT(20) UNSIGNED NOT NULL, original_name VARCHAR(255) NOT NULL, stored_name VARCHAR(255) NOT NULL, filepath VARCHAR(500) NOT NULL, filesize BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, filetype VARCHAR(20) NOT NULL DEFAULT '', mime_type VARCHAR(100) NOT NULL DEFAULT '', message TEXT DEFAULT NULL, access_token VARCHAR(64) NOT NULL, uploaded_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, expires_at DATETIME DEFAULT NULL, PRIMARY KEY (id), UNIQUE KEY idx_token (access_token), KEY idx_pair (pair_id), KEY idx_uploader (uploader_id), KEY idx_uploaded (uploaded_at) ) $charset;\"; // ── pd_notifications ──────────────────────────────────────────────── // One row per email sent. Tracks delivery and read state. $sql_notifications = \"CREATE TABLE IF NOT EXISTS wp_bsxfe_notifications ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, file_id BIGINT(20) UNSIGNED NOT NULL, recipient_id BIGINT(20) UNSIGNED NOT NULL, type VARCHAR(50) NOT NULL DEFAULT 'new_file', status VARCHAR(20) NOT NULL DEFAULT 'sent', sent_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, read_at DATETIME DEFAULT NULL, PRIMARY KEY (id), KEY idx_file (file_id), KEY idx_recipient (recipient_id), KEY idx_status (status) ) $charset;\"; // ── pd_activity ───────────────────────────────────────────────────── // Audit log: upload, download, delete, view events. $sql_activity = \"CREATE TABLE IF NOT EXISTS wp_bsxfe_activity ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, file_id BIGINT(20) UNSIGNED NOT NULL, user_id BIGINT(20) UNSIGNED NOT NULL, action VARCHAR(50) NOT NULL, ip_address VARCHAR(45) NOT NULL DEFAULT '', user_agent VARCHAR(255) NOT NULL DEFAULT '', created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id), KEY idx_file (file_id), KEY idx_user (user_id), KEY idx_action (action), KEY idx_created (created_at) ) $charset;\"; require_once ABSPATH . 'wp-admin/includes/upgrade.php'; dbDelta( $sql_pairs );"}],"table_count":4}