Database Schema
Woo Sell Services creates two custom database tables for conversations and notifications. All other data is stored using standard WordPress and WooCommerce meta.
Custom Tables
Section titled “Custom Tables”wss_sell_messages
Section titled “wss_sell_messages”Stores conversation messages between vendors and customers.
| Column | Type | Description |
|---|---|---|
id |
bigint(20) unsigned | Auto-increment primary key |
author_id |
bigint(20) unsigned | User ID of the message sender |
user_id |
bigint(20) unsigned | User ID of the message recipient |
order_id |
bigint(20) unsigned | WooCommerce order ID |
item_id |
bigint(20) unsigned | WooCommerce order item ID |
product_id |
bigint(20) unsigned | WooCommerce product ID |
message |
text | Message content |
msg_time |
datetime | Message timestamp |
attachment |
text | Serialized attachment file paths |
msg_read |
enum(‘0’,‘1’) | Read flag (default 0) |
read_status |
int(1) | Read status used by the live-conversation poller |
created_at |
timestamp | Record creation time |
updated_at |
timestamp | Last update time |
Indexes: PRIMARY KEY (id), idx_author_id, idx_user_id, idx_order_id, idx_msg_time.
The full table name (with prefix) is stored in wp_options under woo_sell_message_table.
wss_service_notifications
Section titled “wss_service_notifications”Stores in-app notifications for service order events.
| Column | Type | Description |
|---|---|---|
notification_id |
bigint(20) unsigned | Auto-increment primary key |
vendor_id |
bigint(20) unsigned | Vendor user ID |
user_id |
bigint(20) unsigned | Customer user ID |
order_id |
bigint(20) unsigned | WooCommerce order ID |
item_id |
bigint(20) unsigned | WooCommerce order item ID |
product_id |
bigint(20) unsigned | WooCommerce product ID |
vendor_notifi |
tinyint(1) | Flag: this row is a notification for the vendor |
customer_notifi |
tinyint(1) | Flag: this row is a notification for the customer |
vendor_read |
tinyint(1) | Vendor read status |
customer_read |
tinyint(1) | Customer read status |
created |
datetime | Notification creation time |
action |
varchar(100) | Event type identifier |
Indexes: PRIMARY KEY (notification_id), idx_order_id, idx_product_id, idx_customer_notifi, idx_vendor_notifi, idx_created.
The vendor_notifi and customer_notifi columns are per-party flags, not the notification text. The displayed message is generated at render time from the action type and the notification message templates. The full table name is stored in wp_options under wss_service_notifications_table.
WordPress Meta Storage
Section titled “WordPress Meta Storage”Product Meta
Section titled “Product Meta”| Meta key | Purpose |
|---|---|
wbcom_wss_req_ques |
Serialized requirement field definitions |
Order Item Meta
Section titled “Order Item Meta”| Meta key | Purpose |
|---|---|
wbcom_wss_customer_requirement |
Customer’s submitted requirement answers |
woo_sell_final_delivery |
Final delivery submission data |
woo_sell_accept_delivery |
Delivery acceptance status |
woo_sell_user_rating |
Star rating and review data |
woo_sell_attachment |
Requirement/message file attachments |
wp_options Keys
Section titled “wp_options Keys”| Option key | Purpose |
|---|---|
wbwss_general_settings |
All general settings |
wbwss_requirement_images_settings |
Milestone images for the order flow |
wbwss_live_notification_settings |
Notification message templates |
wbwss_webhooks_settings |
Webhook URLs |
woo_sell_message_table |
Messages table name |
wss_service_notifications_table |
Notifications table name |
wss_db_version |
Schema-migration guard for the bigint/index upgrade |
edd_wbcom_wss_license_key |
EDD license key |
edd_wbcom_wss_license_status |
License status |
Table Creation and Versioning
Section titled “Table Creation and Versioning”The wss_sell_messages table is created and versioned in Woo_Sell_Services_Activator using dbDelta(). The wss_service_notifications table is created during admin bootstrap in the admin class, also with dbDelta().
An idempotent upgrade (wss_maybe_upgrade_schema(), guarded by the wss_db_version option) widens the ID columns to bigint(20) and adds the notification indexes on both fresh install and upgrade.
Direct Database Queries
Section titled “Direct Database Queries”The plugin uses $wpdb for direct queries against the custom tables, with $wpdb->prepare() and parameterized placeholders.
// Fetch messages for an order.global $wpdb;$table = get_option( 'woo_sell_message_table' );$messages = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$table} WHERE order_id = %d AND item_id = %d ORDER BY id ASC", $order_id, $item_id ));Since 5.8.7, Woo_Sell_Services_Conversation_Model provides a paginated model layer (get_messages(), count_messages(), ownership guard) over the messages table, used by the admin Order Conversations screen and the REST API.

