wp_bksignals_product_stats

Static

Stores product records and related data.

Column Definitions

ColumnTypeNullable
product_idBIGINT(20) UNSIGNEDNO
views_totalBIGINT(20) UNSIGNEDNO
views_24hINT(10) UNSIGNEDNO
views_7dINT(10) UNSIGNEDNO
views_30dINT(10) UNSIGNEDNO
cart_totalBIGINT(20) UNSIGNEDNO
cart_24hINT(10) UNSIGNEDNO
cart_7dINT(10) UNSIGNEDNO
cart_30dINT(10) UNSIGNEDNO
sales_totalBIGINT(20) UNSIGNEDNO
sales_24hINT(10) UNSIGNEDNO
sales_7dINT(10) UNSIGNEDNO
sales_30dINT(10) UNSIGNEDNO
updated_atDATETIMENO
order_idBIGINT(20) UNSIGNEDNO
order_item_idBIGINT(20) UNSIGNEDNO
product_idBIGINT(20) UNSIGNEDNO
customer_cityVARCHAR(100)NO
customer_nameVARCHAR(160)NO
created_atDATETIMENO
order_idBIGINT(20) UNSIGNEDNO
product_idBIGINT(20) UNSIGNEDNO
quantityINT(10) UNSIGNEDNO
statusVARCHAR(20)NO
customer_cityVARCHAR(100)NO
customer_nameVARCHAR(160)NO
purchased_atDATETIMENO
voided_atDATETIMEYES
updated_atDATETIMENO
product_idBIGINT(20) UNSIGNEDNO
last_seenDATETIMENO
product_idBIGINT(20) UNSIGNEDNO
quantityINT(10) UNSIGNEDNO
updated_atDATETIMENO
product_idBIGINT(20) UNSIGNEDNO
viewsINT(10) UNSIGNEDNO
add_to_cartINT(10) UNSIGNEDNO
salesINT(10) UNSIGNEDNO
product_idBIGINT(20) UNSIGNEDNO
visitor_keyVARCHAR(64)NO
viewed_atDATETIMENO

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