{"table_name":"epofw_addons","full_table_name":"wp_epofw_addons","description":"Stores epofw addons data created by this plugin.","detection_method":"static","confidence":"high","create_sql":"CREATE TABLE IF NOT EXISTS `wp_epofw_addons` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, post_id BIGINT(20) UNSIGNED NOT NULL, addon_name VARCHAR(255) DEFAULT '', addon_status VARCHAR(20) DEFAULT 'on', addon_position VARCHAR(50) DEFAULT 'before_add_to_cart', additional_rules LONGTEXT, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (id), UNIQUE KEY post_id (post_id), KEY addon_status (addon_status), KEY created_at (created_at) ) $charset_collate;\"; // Table 2: Sections (Section information). // Note: Removed foreign key constraints for better WordPress/Multisite compatibility. $sql_sections = \"CREATE TABLE IF NOT EXISTS `wp_epofw_sections` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, addon_id BIGINT(20) UNSIGNED NOT NULL, section_id VARCHAR(100) NOT NULL, section_title VARCHAR(255) DEFAULT '', section_order INT(11) DEFAULT 0, section_status VARCHAR(20) DEFAULT 'on', section_settings LONGTEXT, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (id), KEY addon_id (addon_id), KEY section_order (section_order), KEY section_status (section_status) ) $charset_collate;\"; // Table 3: Row Groups (Layout groups within sections). // Note: Removed foreign key constraints for better WordPress/Multisite compatibility. // v2.3: Removed layout_type and columns_count (moved to columns_groups table). $sql_row_groups = \"CREATE TABLE IF NOT EXISTS `wp_epofw_row_groups` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, section_id BIGINT(20) UNSIGNED NOT NULL, group_id VARCHAR(100) NOT NULL, group_order INT(11) DEFAULT 0, group_settings LONGTEXT, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (id), KEY section_id (section_id), KEY group_order (group_order) ) $charset_collate;\"; // Table 4: Columns Groups (Groups of columns within a row group). // This creates a clear hierarchy: Row Group -> Columns Group -> Columns. // v2.3: New table for better structure and performance. // v2.3: Added layout_type (moved from row_groups) - each columns group can have its own layout. $sql_columns_groups = \"CREATE TABLE IF NOT EXISTS `wp_epofw_columns_groups` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, row_group_id BIGINT(20) UNSIGNED NOT NULL, columns_id VARCHAR(100) NOT NULL, columns_order INT(11) DEFAULT 0, layout_type VARCHAR(20) DEFAULT 'single', columns_count INT(11) DEFAULT 1, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (id), KEY row_group_id (row_group_id), KEY columns_id (columns_id), KEY columns_order (columns_order), KEY layout_type (layout_type), UNIQUE KEY unique_columns_group (row_group_id, columns_id) ) $charset_collate;\"; // Table 5: Rows/Columns (Individual row/column data with settings). // Note: 'row_number' is a reserved word in MariaDB/MySQL, so we use 'row_num' instead. // Note: Removed foreign key constraints for better WordPress/Multisite compatibility. // v2.2: Added sub_row_id for sub-row support (rows within rows). // v2.3: Added columns_group_id for new structure (keeping sub_row_id for backward compatibility). $sql_rows = \"CREATE TABLE IF NOT EXISTS `wp_epofw_rows` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, row_group_id BIGINT(20) UNSIGNED NOT NULL, columns_group_id BIGINT(20) UNSIGNED DEFAULT NULL, row_id VARCHAR(100) NOT NULL, sub_row_id VARCHAR(100) DEFAULT NULL, row_num INT(11) DEFAULT 1, sub_row_order INT(11) DEFAULT 0, column_settings LONGTEXT, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (id), KEY row_group_id (row_group_id), KEY columns_group_id (columns_group_id), KEY row_num (row_num), KEY sub_row_id (sub_row_id), KEY sub_row_order (sub_row_order), UNIQUE KEY unique_row (columns_group_id, row_id) ) $charset_collate;\"; // Table 6: Fields (Individual field data - now belongs to rows). // Note: Removed foreign key constraints for better WordPress/Multisite compatibility. $sql_fields = \"CREATE TABLE IF NOT EXISTS `wp_epofw_fields` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, row_id BIGINT(20) UNSIGNED NOT NULL, field_id VARCHAR(100) NOT NULL, field_type VARCHAR(50) DEFAULT 'text', field_label VARCHAR(255) DEFAULT '', field_order INT(11) DEFAULT 0, field_status VARCHAR(20) DEFAULT 'on', field_data LONGTEXT, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (id), KEY row_id (row_id), KEY field_type (field_type), KEY field_order (field_order), KEY field_status (field_status), UNIQUE KEY unique_field (row_id, field_id) ) $charset_collate;\"; require_once ABSPATH . 'wp-admin/includes/upgrade.php'; // Create tables in order (parent tables first). dbDelta( $sql_addons );","columns":[{"name":"id","type":"BIGINT(20) UNSIGNED","nullable":false,"primary_key":true},{"name":"post_id","type":"BIGINT(20) UNSIGNED","nullable":false,"primary_key":false},{"name":"addon_name","type":"VARCHAR(255)","nullable":true,"primary_key":false},{"name":"addon_status","type":"VARCHAR(20)","nullable":true,"primary_key":false},{"name":"addon_position","type":"VARCHAR(50)","nullable":true,"primary_key":false},{"name":"additional_rules","type":"LONGTEXT","nullable":true,"primary_key":false},{"name":"created_at","type":"DATETIME","nullable":true,"primary_key":false},{"name":"updated_at","type":"DATETIME","nullable":true,"primary_key":false},{"name":"addon_id","type":"BIGINT(20) UNSIGNED","nullable":false,"primary_key":false},{"name":"section_id","type":"VARCHAR(100)","nullable":false,"primary_key":false},{"name":"section_title","type":"VARCHAR(255)","nullable":true,"primary_key":false},{"name":"section_order","type":"INT(11)","nullable":true,"primary_key":false},{"name":"section_status","type":"VARCHAR(20)","nullable":true,"primary_key":false},{"name":"section_settings","type":"LONGTEXT","nullable":true,"primary_key":false},{"name":"created_at","type":"DATETIME","nullable":true,"primary_key":false},{"name":"updated_at","type":"DATETIME","nullable":true,"primary_key":false},{"name":"section_id","type":"BIGINT(20) UNSIGNED","nullable":false,"primary_key":false},{"name":"group_id","type":"VARCHAR(100)","nullable":false,"primary_key":false},{"name":"group_order","type":"INT(11)","nullable":true,"primary_key":false},{"name":"group_settings","type":"LONGTEXT","nullable":true,"primary_key":false},{"name":"created_at","type":"DATETIME","nullable":true,"primary_key":false},{"name":"updated_at","type":"DATETIME","nullable":true,"primary_key":false},{"name":"row_group_id","type":"BIGINT(20) UNSIGNED","nullable":false,"primary_key":false},{"name":"columns_id","type":"VARCHAR(100)","nullable":false,"primary_key":false},{"name":"columns_order","type":"INT(11)","nullable":true,"primary_key":false},{"name":"layout_type","type":"VARCHAR(20)","nullable":true,"primary_key":false},{"name":"columns_count","type":"INT(11)","nullable":true,"primary_key":false},{"name":"created_at","type":"DATETIME","nullable":true,"primary_key":false},{"name":"updated_at","type":"DATETIME","nullable":true,"primary_key":false},{"name":"row_group_id","type":"BIGINT(20) UNSIGNED","nullable":false,"primary_key":false},{"name":"columns_group_id","type":"BIGINT(20) UNSIGNED","nullable":true,"primary_key":false},{"name":"row_id","type":"VARCHAR(100)","nullable":false,"primary_key":false},{"name":"sub_row_id","type":"VARCHAR(100)","nullable":true,"primary_key":false},{"name":"row_num","type":"INT(11)","nullable":true,"primary_key":false},{"name":"sub_row_order","type":"INT(11)","nullable":true,"primary_key":false},{"name":"column_settings","type":"LONGTEXT","nullable":true,"primary_key":false},{"name":"created_at","type":"DATETIME","nullable":true,"primary_key":false},{"name":"updated_at","type":"DATETIME","nullable":true,"primary_key":false},{"name":"row_id","type":"BIGINT(20) UNSIGNED","nullable":false,"primary_key":false},{"name":"field_id","type":"VARCHAR(100)","nullable":false,"primary_key":false},{"name":"field_type","type":"VARCHAR(50)","nullable":true,"primary_key":false},{"name":"field_label","type":"VARCHAR(255)","nullable":true,"primary_key":false},{"name":"field_order","type":"INT(11)","nullable":true,"primary_key":false},{"name":"field_status","type":"VARCHAR(20)","nullable":true,"primary_key":false},{"name":"field_data","type":"LONGTEXT","nullable":true,"primary_key":false},{"name":"created_at","type":"DATETIME","nullable":true,"primary_key":false},{"name":"updated_at","type":"DATETIME","nullable":true,"primary_key":false}],"plugin":{"slug":"extra-product-options-for-woocommerce","name":"Extra Product Options for WooCommerce","active_installs":600,"version":"4.4.8","wp_org_url":"https://wordpress.org/plugins/extra-product-options-for-woocommerce/"}}