wp_bksignals_product_stats
StaticStores product records and related data.
Column Definitions
| Column | Type | Nullable |
|---|---|---|
| product_id | BIGINT(20) UNSIGNED | NO |
| views_total | BIGINT(20) UNSIGNED | NO |
| views_24h | INT(10) UNSIGNED | NO |
| views_7d | INT(10) UNSIGNED | NO |
| views_30d | INT(10) UNSIGNED | NO |
| cart_total | BIGINT(20) UNSIGNED | NO |
| cart_24h | INT(10) UNSIGNED | NO |
| cart_7d | INT(10) UNSIGNED | NO |
| cart_30d | INT(10) UNSIGNED | NO |
| sales_total | BIGINT(20) UNSIGNED | NO |
| sales_24h | INT(10) UNSIGNED | NO |
| sales_7d | INT(10) UNSIGNED | NO |
| sales_30d | INT(10) UNSIGNED | NO |
| updated_at | DATETIME | NO |
| order_id | BIGINT(20) UNSIGNED | NO |
| order_item_id | BIGINT(20) UNSIGNED | NO |
| product_id | BIGINT(20) UNSIGNED | NO |
| customer_city | VARCHAR(100) | NO |
| customer_name | VARCHAR(160) | NO |
| created_at | DATETIME | NO |
| order_id | BIGINT(20) UNSIGNED | NO |
| product_id | BIGINT(20) UNSIGNED | NO |
| quantity | INT(10) UNSIGNED | NO |
| status | VARCHAR(20) | NO |
| customer_city | VARCHAR(100) | NO |
| customer_name | VARCHAR(160) | NO |
| purchased_at | DATETIME | NO |
| voided_at | DATETIME | YES |
| updated_at | DATETIME | NO |
| product_id | BIGINT(20) UNSIGNED | NO |
| last_seen | DATETIME | NO |
| product_id | BIGINT(20) UNSIGNED | NO |
| quantity | INT(10) UNSIGNED | NO |
| updated_at | DATETIME | NO |
| product_id | BIGINT(20) UNSIGNED | NO |
| views | INT(10) UNSIGNED | NO |
| add_to_cart | INT(10) UNSIGNED | NO |
| sales | INT(10) UNSIGNED | NO |
| product_id | BIGINT(20) UNSIGNED | NO |
| visitor_key | VARCHAR(64) | NO |
| viewed_at | DATETIME | NO |
CREATE TABLE Statement
CREATE TABLE IF NOT EXISTS wp_bksignals_product_stats ( product_id BIGINT(20) UNSIGNED NOT NULL, views_total BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, views_24h INT(10) UNSIGNED NOT NULL DEFAULT 0, views_7d INT(10) UNSIGNED NOT NULL DEFAULT 0, views_30d INT(10) UNSIGNED NOT NULL DEFAULT 0, cart_total BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, cart_24h INT(10) UNSIGNED NOT NULL DEFAULT 0, cart_7d INT(10) UNSIGNED NOT NULL DEFAULT 0, cart_30d INT(10) UNSIGNED NOT NULL DEFAULT 0, sales_total BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, sales_24h INT(10) UNSIGNED NOT NULL DEFAULT 0, sales_7d INT(10) UNSIGNED NOT NULL DEFAULT 0, sales_30d INT(10) UNSIGNED NOT NULL DEFAULT 0, updated_at DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (product_id) ) $charset;"; // Recent sales. $sql[] = "CREATE TABLE IF NOT EXISTS wp_bksignals_recent_sales ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, order_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, order_item_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, product_id BIGINT(20) UNSIGNED NOT NULL, customer_city VARCHAR(100) NOT NULL DEFAULT '', customer_name VARCHAR(160) NOT NULL DEFAULT '', created_at DATETIME NOT NULL, PRIMARY KEY (id), KEY order_id (order_id), KEY order_item_id (order_item_id), KEY product_id (product_id), KEY created_at (created_at) ) $charset;"; // Sales events. $sql[] = "CREATE TABLE IF NOT EXISTS wp_bksignals_sales_events ( order_item_id BIGINT(20) UNSIGNED NOT NULL, order_id BIGINT(20) UNSIGNED NOT NULL, product_id BIGINT(20) UNSIGNED NOT NULL, quantity INT(10) UNSIGNED NOT NULL DEFAULT 1, status VARCHAR(20) NOT NULL DEFAULT 'active', customer_city VARCHAR(100) NOT NULL DEFAULT '', customer_name VARCHAR(160) NOT NULL DEFAULT '', purchased_at DATETIME NOT NULL, voided_at DATETIME NULL DEFAULT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY (order_item_id), KEY order_id (order_id), KEY product_status (product_id, status), KEY purchased_at (purchased_at) ) $charset;"; // Live visitors. $sql[] = "CREATE TABLE IF NOT EXISTS wp_bksignals_live_visitors ( visitor_id VARCHAR(64) NOT NULL, product_id BIGINT(20) UNSIGNED NOT NULL, last_seen DATETIME NOT NULL, PRIMARY KEY (visitor_id, product_id), KEY product_last_seen (product_id, last_seen), KEY last_seen (last_seen) ) $charset;"; // Active carts. $sql[] = "CREATE TABLE IF NOT EXISTS wp_bksignals_active_carts ( visitor_id VARCHAR(64) NOT NULL, product_id BIGINT(20) UNSIGNED NOT NULL, quantity INT(10) UNSIGNED NOT NULL DEFAULT 1, updated_at DATETIME NOT NULL, PRIMARY KEY (visitor_id, product_id), KEY product_updated (product_id, updated_at), KEY updated_at (updated_at) ) $charset;"; // Daily stats. $sql[] = "CREATE TABLE IF NOT EXISTS wp_bksignals_daily_stats ( date DATE NOT NULL, product_id BIGINT(20) UNSIGNED NOT NULL, views INT(10) UNSIGNED NOT NULL DEFAULT 0, add_to_cart INT(10) UNSIGNED NOT NULL DEFAULT 0, sales INT(10) UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (date, product_id), KEY product_date (product_id, date) ) $charset;"; // View queue. $sql[] = "CREATE TABLE IF NOT EXISTS wp_bksignals_view_queue ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, product_id BIGINT(20) UNSIGNED NOT NULL, visitor_key VARCHAR(64) NOT NULL, viewed_at DATETIME NOT NULL, PRIMARY KEY (id), KEY product_id (product_id), KEY viewed_at (viewed_at) ) $charset;"; require_once ABSPATH . 'wp-admin/includes/upgrade.php'; foreach ( $sql as $query ) { dbDelta( $query );Safe to delete?
If you have uninstalled BK Signals for WooCommerce, this table is generally safe to remove. However, always back up your database first.
Note: Some plugins share tables or are dependencies of other plugins. Verify nothing else depends on this table before dropping it.
How to remove this table
DROP TABLE IF EXISTS `wp_bksignals_product_stats`;
Run this query using phpMyAdmin, Adminer, or your MySQL client. Back up first.
Other tables from BK Signals for WooCommerce