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
  • Hooks and Filters Reference

Hooks and Filters Reference

4 min read

TrustLens exposes WordPress action and filter hooks for developers building integrations or extending the plugin. This page is the verified reference — every hook listed here is present in the shipped codebase. Use it to drive integrations rather than guessing names from convention.


Actions — Customer Lifecycle #

trustlens/score_updated #

Fires after a customer’s trust score is recalculated and persisted.

do_action( 'trustlens/score_updated', $email_hash, $new_score, $new_segment );

trustlens/segment_changed #

Fires only when the segment actually transitions.

do_action( 'trustlens/segment_changed', $email_hash, $new_segment, $old_segment, $score );

trustlens/customer_blocked #

Fires when a customer is marked as blocked.

do_action( 'trustlens/customer_blocked', $email_hash, $reason );

trustlens/customer_unblocked #

do_action( 'trustlens/customer_unblocked', $email_hash );

trustlens/customer_allowlisted #

do_action( 'trustlens/customer_allowlisted', $email_hash );

trustlens/customer_allowlist_removed #

do_action( 'trustlens/customer_allowlist_removed', $email_hash );

trustlens/customer_deleted #

Fires after a customer’s TrustLens data has been removed.

do_action( 'trustlens/customer_deleted', $email_hash );

Actions — Scoring & Events #

trustlens/calculate_score #

Triggered to enqueue / perform a score recalculation. Both the queueing layer and the worker fire on this.

do_action( 'trustlens/calculate_score', $email_hash );

trustlens/event_logged #

Fires after a new row is written to the events table.

do_action( 'trustlens/event_logged', $email_hash, $event_type, $event_data );

Actions — Detection #

trustlens/linked_accounts_detected #

Fires when a new account link is recorded.

do_action( 'trustlens/linked_accounts_detected', $email_hash, $linked_hashes, $fingerprint_types );

trustlens/shipping_anomaly #

Fires when the Shipping Anomalies module records a new anomaly.

do_action( 'trustlens/shipping_anomaly', $email_hash, $anomaly_type, $details );

trustlens/chargeback_filed #

Fires when a chargeback is recorded — Stripe / WooPayments ingestion or manual entry.

do_action( 'trustlens/chargeback_filed', $dispute_id, $email_hash, $data );

trustlens/dispute_recorded #

Companion event for dispute persistence; fires alongside chargeback_filed.

do_action( 'trustlens/dispute_recorded', $dispute_id, $email_hash, $data );

Actions — Checkout #

trustlens/checkout_blocked #

Fires when the Request Gate rejects a checkout request (Card-Testing lockout, customer block, Panic Freeze).

do_action( 'trustlens/checkout_blocked', $email_hash, $reason, $context );

trustlens/panic_button_activated #

Fires when Panic Freeze is activated (manual or auto).

do_action( 'trustlens/panic_button_activated', $source, $admin_user_id );

trustlens/payment_gateways_restricted #

Pro. Fires when Payment Method Risk Controls hide one or more gateways at checkout.

do_action( 'trustlens/payment_gateways_restricted', $email_hash, $hidden_gateways, $rule_id );

Actions — Automation & Plugin Lifecycle #

trustlens/register_modules #

Fires during init for detection-module registration.

do_action( 'trustlens/register_modules', $module_manager );

trustlens/automation_triggered #

Pro. Fires when an automation rule successfully evaluates and dispatches actions.

do_action( 'trustlens/automation_triggered', $rule_id, $trigger_type, $context );

trustlens/bulk_action_completed #

Fires after a Customers-list bulk action finishes processing.

do_action( 'trustlens/bulk_action_completed', $action, $affected_count );

trustlens/order_metabox_actions #

Fires while rendering the TrustLens meta box on the order edit screen. Lets extensions add custom action buttons.

do_action( 'trustlens/order_metabox_actions', $order, $customer );

Filters — Scoring #

trustlens/trust_score #

Modify the final trust score after clamping.

$score = apply_filters( 'trustlens/trust_score', $score, $email_hash, $signals );

trustlens/score_signals #

Modify the signals array before summing.

$signals = apply_filters( 'trustlens/score_signals', $signals, $email_hash );

trustlens/segment_thresholds #

Customize score-to-segment mapping.

$thresholds = apply_filters( 'trustlens/segment_thresholds', array(
    'vip' => 90, 'trusted' => 70, 'normal' => 50,
    'caution' => 30, 'risk' => 10, 'critical' => 0,
) );

Filters — Pro & Integration #

trustlens/is_pro_active #

Determines whether Pro features are unlocked. Useful for testing Pro behavior on a Free instance.

$is_pro = apply_filters( 'trustlens/is_pro_active', $is_pro );

trustlens/trust_proxy_headers #

Controls whether proxy-forwarded headers (e.g. X-Forwarded-For) are trusted for client IP resolution. Off by default; enable only when behind a known proxy/CDN.

$trust = apply_filters( 'trustlens/trust_proxy_headers', false );

trustlens/automation/rule_cooldown #

Pro. Override per-rule cooldown duration.

$seconds = apply_filters( 'trustlens/automation/rule_cooldown', $seconds, $rule_id, $email_hash );

trustlens/automation/webhook_secret #

Pro. Override the HMAC signing secret for an outgoing webhook.

$secret = apply_filters( 'trustlens/automation/webhook_secret', $secret, $rule_id );

trustlens/automation/retention_days #

Pro. Customize how long automation log entries are retained.

$days = apply_filters( 'trustlens/automation/retention_days', 90 );

trustlens/card_testing/panic_max_duration #

Override Panic Freeze maximum duration (default 900 seconds = 15 minutes).

$seconds = apply_filters( 'trustlens/card_testing/panic_max_duration', 900 );

Hook Priority Conventions #

TrustLens registers its own hooks at default priority 10. To run code before TrustLens:

add_action( 'woocommerce_order_refunded', 'my_handler', 5, 2 );

To run after:

add_action( 'trustlens/score_updated', 'my_post_processing', 20, 3 );

Example: Custom Trust Score Override #

add_filter( 'trustlens/trust_score', function( $score, $email_hash, $signals ) {
    $customer = wstl_get_customer( $email_hash );
    if ( $customer && my_loyalty_is_gold_member( $customer->customer_email ) ) {
        return min( 100, $score + 10 );
    }
    return $score;
}, 10, 3 );

Example: Adding a Custom Signal #

add_filter( 'trustlens/score_signals', function( $signals, $email_hash ) {
    $external_risk = my_fraud_api_get_risk( $email_hash );
    if ( $external_risk > 0.8 ) {
        $signals[] = array(
            'module' => 'external_fraud_api',
            'score'  => -20,
            'reason' => 'External fraud API risk score > 0.8',
        );
    }
    return $signals;
}, 10, 2 );

Example: Reacting to Score Updates #

add_action( 'trustlens/score_updated', function( $email_hash, $score, $segment ) {
    if ( $segment === 'vip' ) {
        my_crm_update_customer_tier( $email_hash, 'vip' );
    }
}, 10, 3 );

Helper Functions #

Public functions defined in includes/functions.php — safe for use in custom code.

Function Description
wstl_get_email_hash( $email ) Compute keyed HMAC-SHA256 hash of an email
wstl_get_customer( $email_hash ) Get the customer record object
wstl_get_segment_from_score( $score ) Map score to segment string
wstl_log_event( $email_hash, $event_type, $event_data ) Append to event log
wstl_queue_score_update( $email_hash ) Queue async score recalculation (deduplicated)
wstl_block_customer( $email_hash, $reason = '' ) Mark a customer as blocked
wstl_unblock_customer( $email_hash ) Remove block
wstl_is_blocked( $email_hash ) Check block state
wstl_allowlist_customer( $email_hash ) Add to allowlist

The scoring engine itself is the TrustLens_Score_Calculator class — instantiate it directly for low-level scoring operations rather than calling a procedural helper.


Stability and Versioning #

Documented hooks are part of TrustLens’s public API. Breaking changes are documented in the changelog and happen only on major version bumps. Newly-added hooks ship in minor releases.

Internal hooks not listed on this page may exist in the codebase but are not part of the public contract and can change without notice. If you need a hook that isn’t documented here, file a feature request rather than relying on an internal one.

Updated on June 4, 2026

What are your Feelings

  • Happy
  • Normal
  • Sad

Share This Article :

  • Facebook
  • X
  • LinkedIn
  • Pinterest
REST API ReferenceExtending with Custom Modules
Table of Contents
  • Actions — Customer Lifecycle
    • trustlens/score_updated
    • trustlens/segment_changed
    • trustlens/customer_blocked
    • trustlens/customer_unblocked
    • trustlens/customer_allowlisted
    • trustlens/customer_allowlist_removed
    • trustlens/customer_deleted
  • Actions — Scoring & Events
    • trustlens/calculate_score
    • trustlens/event_logged
  • Actions — Detection
    • trustlens/linked_accounts_detected
    • trustlens/shipping_anomaly
    • trustlens/chargeback_filed
    • trustlens/dispute_recorded
  • Actions — Checkout
    • trustlens/checkout_blocked
    • trustlens/panic_button_activated
    • trustlens/payment_gateways_restricted
  • Actions — Automation & Plugin Lifecycle
    • trustlens/register_modules
    • trustlens/automation_triggered
    • trustlens/bulk_action_completed
    • trustlens/order_metabox_actions
  • Filters — Scoring
    • trustlens/trust_score
    • trustlens/score_signals
    • trustlens/segment_thresholds
  • Filters — Pro & Integration
    • trustlens/is_pro_active
    • trustlens/trust_proxy_headers
    • trustlens/automation/rule_cooldown
    • trustlens/automation/webhook_secret
    • trustlens/automation/retention_days
    • trustlens/card_testing/panic_max_duration
  • Hook Priority Conventions
  • Example: Custom Trust Score Override
  • Example: Adding a Custom Signal
  • Example: Reacting to Score Updates
  • Helper Functions
  • Stability and Versioning
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