Skip to navigation Skip to main content

Free Grow sales & stop fraud — Smart Cycle Discounts + TrustLens, free on WordPress.org Two free WooCommerce plugins

Explore both

Free Grow sales & stop fraud — Smart Cycle Discounts + TrustLens, free on WordPress.org Two free WooCommerce plugins

Explore both
  • WordPress
    WordPress Plugins
    View all
    Smart Cycle Discounts logo

    Smart Cycle Discounts

    Automate discount campaigns with scheduling, analytics, and smart product targeting.

    7 Discount Types Cycle AI
    Free Pro from $59
    TrustLens logo

    TrustLens

    Customer trust intelligence for WooCommerce. Score customers, spot abuse, protect revenue.

    Trust Scores Abuse Detection
    Free Pro from $79

    New Plugin

    Coming Soon

    Something exciting is in the works. Join the waitlist to be first to know.

    Get Notified
    Notify Me
    Secure Checkout
    WordPress.org
    14-Day Refund
    Resources
    Documentation Guides & tutorials
    Discount Calculator Plan your strategy
    Support Get help
    SCD Changelog Discount plugin updates
    TrustLens Changelog Trust intelligence updates
    Get notified on new releases
  • Affiliate
    Program
    Overview How the program works
    How It Works 4 steps from apply to earn
    Commission Details 30% · 60-day cookie · recurring
    Get Started
    Apply Now Open
    Takes ~2 minutes
    Earnings Calculator Estimate your monthly income
    FAQ Payouts, cookies, renewals
    Resources
    Brand Kit Logos, banners, copy, social
    Playbook Tactics that actually convert
    FTC Disclosure How to disclose properly
    Affiliate Terms Full program agreement
    Contact Team Open the contact form
    Earn 30% recurring on every sale Free to join · 60-day cookie · monthly PayPal payouts
    Apply Now
  • Blog
  • DOCS
    Docs & Resources

    Guides, references, and answers for every Webstepper plugin.

    Smart Cycle Discounts Automated WooCommerce discount campaigns
    Getting started › Discount types › Cycle AI ›
    TrustLens Customer trust & fraud intelligence
    Trust scoring › Detection modules › Card-testing defense ›
    Docs Home Guides FAQ Pricing Support
    WordPress tools that solve real problems
  • Contact Us
  • About
    Company

    Our Story

    Founded 2020

    Built by store owners, for store owners. We create WordPress tools that solve real problems.

    Learn more
    Built from Experience Real solutions we use ourselves
    Time is Precious Simple, intuitive tools
    Real Support Talk to the founders
    Legal & Contact
    Contact Us Privacy Policy Terms of Service Refund Policy
    14-Day Money-Back Guarantee No questions asked
Popular requests
  • smart cycle discounts
  • trustlens
  • chargeback protection
GET STARTED

Glossary

1
  • TrustLens Glossary

Detection Modules

9
  • Card Testing Defense
  • Chargeback Tracking
  • Shipping Anomalies
  • Linked Accounts Detection
  • Category Aware Risk
  • Coupon Abuse Detection
  • Order Pattern Analysis
  • Return Abuse Detection
  • Modules Overview

Card Testing Defense

9
  • Attack History
  • Allowlists
  • Geo Diversity
  • Auto Escalation
  • Fingerprinting
  • VIP Bypass
  • Panic Button
  • Velocity Thresholds
  • Overview

Chargeback Monitor

7
  • Ratio Email Alerts
  • Dispute Evidence Report
  • Chargeback Monitor
  • Manual Dispute Entry
  • Stripe WooPayments Ingestion
  • Card Network Thresholds
  • Chargeback Ratio Speedometer

Customer Management

7
  • Admin Notes
  • Checkout Enforcement
  • Order Trust Column
  • Bulk Actions
  • Blocking and Allowlisting
  • Customer Detail Profile
  • Customer List

Automation

7
  • Async Dispatch Retries
  • Webhooks and HMAC
  • Rule Inspector
  • Actions Reference
  • Conditions Reference
  • Triggers Reference
  • Automation Overview

Trust Scoring

5
  • Account Age Loyalty Bonus
  • Signals Explained
  • Six Customer Segments
  • The 0–100 Score
  • How Trust Scoring Works
View Categories
  • Home
  • Docs
  • Trustlens
  • Developer Documentation
  • Database Schema

Database Schema

5 min read

TrustLens uses eight custom database tables. This page documents the schema for developers who need to query data directly, build custom reports, or troubleshoot at the database level. Schema creation lives in includes/class-install.php.

All tables use the WordPress database prefix (typically wp_) followed by trustlens_.


The Authoritative Table List #

Eight tables, as enumerated in all_expected_tables_exist() in class-install.php:

  1. trustlens_customers
  2. trustlens_events
  3. trustlens_signals
  4. trustlens_category_stats
  5. trustlens_fingerprints
  6. trustlens_webhook_logs
  7. trustlens_automation_logs
  8. trustlens_velocity_events

That is the complete set. There are no separate tables for disputes, linked accounts, admin notes, automation rules, or customer meta — those concepts are represented as columns on trustlens_customers, as rows in the existing tables, or in WordPress options.


trustlens_customers #

The primary customer trust profile table. One row per scored customer. Columns:

Column Notes
id auto-increment
email_hash keyed HMAC-SHA256 of email, unique
customer_id WP user ID if available
customer_email plaintext (NULL after GDPR erasure)
customer_type enum: user, guest
trust_score 0–100, default 50
segment enum: vip / trusted / normal / caution / risk / critical
Order stats
total_orders completed order count
total_order_value decimal
cancelled_orders count
order_edits count of edits — used by Orders module
Refund stats
total_refunds count
total_refund_value decimal
full_refunds refunds where amount equals order total
partial_refunds refunds smaller than order total
return_rate computed: refunds / orders × 100
last_refund_date datetime
Coupon stats
total_coupons_used count
first_order_coupons count of first-order-type coupons used
coupon_then_refund count of coupon-then-refund cycles
Chargeback stats
total_disputes count
disputes_won count
disputes_lost count
Other module stats
reviews_before_refund used by review-manipulation detection
linked_accounts integer count
linked_count migration-added secondary count
shipping_address_hash for linked-accounts matching
last_ip hashed
Status / metadata
is_blocked boolean
is_allowlisted boolean
admin_notes TEXT — free-form admin notes
tags text — comma-separated or serialized tags
Timestamps
first_order_date, last_order_date, score_updated_at datetime
created_at, updated_at datetime, auto-managed

Indexes include email_hash (unique), segment, trust_score, customer_id, is_blocked, return_rate.


trustlens_events #

Append-only event log. One row per significant event in a customer’s history.

  • id
  • email_hash
  • event_type — varchar; e.g. order_placed, refund_issued, coupon_applied, dispute_filed, linked_account_detected, shipping_anomaly, score_updated, blocked, etc.
  • event_data — longtext column holding JSON-encoded payload (not a strict JSON column type)
  • order_id
  • created_at

Indexed on email_hash, event_type, order_id, created_at.


trustlens_signals #

Current signal breakdown per customer. Rewritten on every recalculation — this table holds only the latest signal state, not history.

  • id
  • email_hash
  • module_id — e.g. returns, coupons, account_age
  • signal_score — SMALLINT, positive or negative
  • signal_reason — varchar
  • created_at

Sum of signal_score values plus 50 (base) should equal the customer’s trust_score.


trustlens_category_stats #

Per-customer per-category return statistics for the Categories module.

  • id
  • email_hash
  • category_slug
  • orders_count
  • refunds_count
  • refund_value
  • last_updated

trustlens_fingerprints #

Device, address, IP, phone, and payment-method fingerprint storage. Linked-account detection works by matching hashes here.

  • id
  • email_hash
  • fingerprint_type — e.g. shipping_address, ip, device, phone, payment
  • fingerprint_hash — keyed HMAC-SHA256 hash
  • first_seen, last_seen

Linked-account detection runs by joining this table against itself on fingerprint_hash for rows with different email_hash values. The per-customer linked_accounts / linked_count columns on trustlens_customers store the precomputed aggregate.


trustlens_velocity_events #

Card-Testing Defense event log — decline attempts, lockouts, Panic Freeze activations.

  • id
  • fingerprint_hash
  • event_type
  • decline_code
  • email_hash (when associated with a customer)
  • created_at

trustlens_automation_logs #

Pro. Per-firing log of automation rule evaluations and action results. Note the plural logs.

  • id
  • rule_id
  • rule_name
  • email_hash
  • trigger_type
  • action_type
  • order_id
  • status — fired / skipped / failed
  • duration_ms
  • error_message
  • created_at

trustlens_webhook_logs #

Pro. Outgoing webhook delivery log.

  • id
  • url
  • payload
  • response_status
  • response_body (truncated)
  • attempt — retry counter
  • created_at

Where Other Concepts Live #

Concept Storage
Disputes Counter columns on trustlens_customers: total_disputes, disputes_won, disputes_lost. Individual dispute events are written to trustlens_events as event_type = 'dispute_filed' / dispute_status_changed.
Linked accounts Aggregate count in linked_accounts / linked_count columns. Underlying matching uses trustlens_fingerprints.
Admin notes admin_notes TEXT column on trustlens_customers. Notes additions are also logged to trustlens_events.
Tags tags column on trustlens_customers
Automation rules Stored serialized in the trustlens_automation_rules WordPress option (not a custom table).
Settings Standard WordPress options — trustlens_* prefix.
HMAC secrets WordPress options — never in tables.

Schema Versioning #

The schema version is tracked in the trustlens_db_version option. On plugin activation, class-install.php runs dbDelta() and any registered migrations. Migrations are additive — existing data is preserved across upgrades.

Current schema version is visible in TrustLens → Settings → Data.


Direct SQL Examples #

Top Risk Customers #

SELECT customer_email, trust_score, segment, total_refunds, return_rate
FROM wp_trustlens_customers
WHERE segment IN ('risk', 'critical')
ORDER BY trust_score ASC
LIMIT 50;

Customers With Multiple Disputes #

SELECT customer_email, total_disputes, disputes_lost, trust_score
FROM wp_trustlens_customers
WHERE total_disputes >= 2
ORDER BY disputes_lost DESC;

Recent Events for a Customer #

SELECT event_type, event_data, created_at
FROM wp_trustlens_events
WHERE email_hash = '...'
ORDER BY created_at DESC
LIMIT 50;

Linked-Account Candidates by Shared Shipping Address #

SELECT a.email_hash AS hash_a, b.email_hash AS hash_b, a.fingerprint_hash
FROM wp_trustlens_fingerprints a
JOIN wp_trustlens_fingerprints b
  ON a.fingerprint_hash = b.fingerprint_hash
 AND a.fingerprint_type = 'shipping_address'
 AND b.fingerprint_type = 'shipping_address'
 AND a.email_hash < b.email_hash;

Direct Database Modifications #

Read queries are safe. Do not modify TrustLens tables directly except in maintenance contexts — direct writes bypass:

  • Score recalculation
  • Event logging
  • Cache invalidation
  • Action hooks (downstream automation)

Use the REST API or PHP helper functions (wstl_block_customer(), etc.) for state changes.

Updated on June 4, 2026

What are your Feelings

  • Happy
  • Normal
  • Sad

Share This Article :

  • Facebook
  • X
  • LinkedIn
  • Pinterest
Webhook PayloadsREST API Reference
Table of Contents
  • The Authoritative Table List
  • trustlens_customers
  • trustlens_events
  • trustlens_signals
  • trustlens_category_stats
  • trustlens_fingerprints
  • trustlens_velocity_events
  • trustlens_automation_logs
  • trustlens_webhook_logs
  • Where Other Concepts Live
  • Schema Versioning
  • Direct SQL Examples
    • Top Risk Customers
    • Customers With Multiple Disputes
    • Recent Events for a Customer
    • Linked-Account Candidates by Shared Shipping Address
  • Direct Database Modifications
Newsletter

Insights that grow your business

Join thousands of WooCommerce store owners who get actionable tips, plugin updates, and industry news every week.

We respect your privacy. Unsubscribe at any time.

Weekly updates — Fresh content every Tuesday
Exclusive content — Tips you won't find on our blog
Early access — Be first to know about new plugins
Webstepper
Weekly WooCommerce Tips
Just now
This week: 5 proven strategies to boost your average order value using smart discount campaigns...
New issue!
Webstepper

Tools for store owners who'd rather grow than grind.

Simple, powerful plugins that help WooCommerce store owners sell more — without the learning curve.

500+ happy stores

Products

  • Smart Cycle Discounts
  • TrustLens
  • Discount Calculator
  • Sale Calendar

Company

  • About Us
  • Blog
  • Contact
  • Affiliates

Resources

  • Help Center
  • Guides
  • Affiliate Program
  • Become a Partner

Questions? We actually answer.

Real humans, real help. No bots, no runaround. Usually within a few hours.

Get in touch
Operated by Setmood LLC · 7901 4th St N, St Petersburg, FL 33702 · United States

© 2026 Webstepper. All rights reserved.

Privacy Terms Refunds
Visa Mastercard PayPal Apple Pay Google Pay & more
Limited Time Offer

Save 15% on
SCD, TrustLens & the Bundle

Smart Cycle Discounts and TrustLens — buy either plugin or grab both in the bundle. Use code at checkout.

WELCOME15
23 hours
:
59 minutes
:
59 seconds
Claim My Discount

Just want one? Smart Cycle Discounts · TrustLens

  • WordPress
    Back
    WordPress Plugins
    View all
    Smart Cycle Discounts logo

    Smart Cycle Discounts

    Automate discount campaigns with scheduling, analytics, and smart product targeting.

    7 Discount Types Cycle AI
    Free Pro from $59
    TrustLens logo

    TrustLens

    Customer trust intelligence for WooCommerce. Score customers, spot abuse, protect revenue.

    Trust Scores Abuse Detection
    Free Pro from $79

    New Plugin

    Coming Soon

    Something exciting is in the works. Join the waitlist to be first to know.

    Get Notified
    Notify Me
    Secure Checkout
    WordPress.org
    14-Day Refund
    Resources
    Documentation Guides & tutorials
    Discount Calculator Plan your strategy
    Support Get help
    SCD Changelog Discount plugin updates
    TrustLens Changelog Trust intelligence updates
    Get notified on new releases
  • Affiliate
    Back
    Program
    Overview How the program works
    How It Works 4 steps from apply to earn
    Commission Details 30% · 60-day cookie · recurring
    Get Started
    Apply Now Open
    Takes ~2 minutes
    Earnings Calculator Estimate your monthly income
    FAQ Payouts, cookies, renewals
    Resources
    Brand Kit Logos, banners, copy, social
    Playbook Tactics that actually convert
    FTC Disclosure How to disclose properly
    Affiliate Terms Full program agreement
    Contact Team Open the contact form
    Earn 30% recurring on every sale Free to join · 60-day cookie · monthly PayPal payouts
    Apply Now
  • Blog
  • DOCS
    Back
    Docs & Resources

    Guides, references, and answers for every Webstepper plugin.

    Smart Cycle Discounts Automated WooCommerce discount campaigns
    Getting started › Discount types › Cycle AI ›
    TrustLens Customer trust & fraud intelligence
    Trust scoring › Detection modules › Card-testing defense ›
    Docs Home Guides FAQ Pricing Support
    WordPress tools that solve real problems
  • Contact Us
  • About
    Back
    Company

    Our Story

    Founded 2020

    Built by store owners, for store owners. We create WordPress tools that solve real problems.

    Learn more
    Built from Experience Real solutions we use ourselves
    Time is Precious Simple, intuitive tools
    Real Support Talk to the founders
    Legal & Contact
    Contact Us Privacy Policy Terms of Service Refund Policy
    14-Day Money-Back Guarantee No questions asked
We use cookies to improve your experience on our website. By browsing this website, you agree to our use of cookies.
More info More info Accept