ReferenceHooks & Filters

Hooks & Filters

All public actions, filters, and scheduled events for extending Checkout Security.

Extending Checkout Security

Checkout Security exposes WordPress actions and filters for customizing fraud detection, trust management, email, permissions, and scheduled behavior.

Use only the hooks documented on this page. Hooks not listed here are not fired by the current PHP codebase and should not be relied upon.

The plugin also uses the WooCommerce core filter woocommerce_checkout_no_payment_needed_redirect in CCP_Risk_Threshold to redirect customers after a held order is approved. This is a WooCommerce filter, not a Checkout Security hook.

Actions

HookParametersDescription
ccp_before_fraud_check(none)Fires before a fraud check starts
ccp_after_fraud_check(none)Fires after a fraud check completes
ccp_cart_cleared_high_riskarray $risk_assessmentFires when a high-risk checkout cart is cleared
ccp_order_manually_approvedint $order_id, WC_Order|CCP_Platform_Order $order, string $sourceFires when an order is approved from the Risk Queue
ccp_order_manually_rejectedint $order_id, WC_Order|CCP_Platform_Order $order, string $sourceFires when an order is rejected from the Risk Queue
ccp_trust_score_updatedint $user_id, int $new_score, array $factorsFires when a customer trust score changes

Filters

HookParametersDescription
ccp_bypass_fraud_checkbool $bypass, string $contextReturn true to skip the fraud check entirely. The context value passed is fraud_detection.
ccp_fraud_risk_assessmentarray $risk_assessment, string $contextModify the risk assessment result before threshold enforcement
ccp_is_email_verifiednull|bool $verified, int $user_idOverride email verification status; leave null to use the built-in check
ccp_is_phone_verifiednull|bool $verified, int $user_idOverride phone verification status; leave null to use the built-in check
ccp_security_admin_capabilitystring $capabilityChange the capability required for security admin actions. Defaults to manage_options.

Scheduled Events

  • ccp_cleanup_logs (daily): Removes logs older than the retention period.
  • ccp_cleanup_sessions (daily): Cleans up expired sessions.
  • ccp_cleanup_expired_whitelists (hourly): Removes expired IP whitelist entries.
  • ccp_recalculate_trust_scores (daily): Recalculates customer trust scores.
  • ccp_update_threat_lists (hourly): Updates threat intelligence lists from providers.
  • ccp_send_daily_digest (daily): Sends the daily security digest email.
  • ccp_gdpr_anonymization (daily): Runs automated data anonymization.
  • ccp_gdpr_data_retention (daily): Enforces data retention policies.
  • ccp_data_cleanup (daily): Runs general data cleanup.
  • ccp_database_optimization (weekly): Runs database optimization tasks.

Usage examples

Use the following examples as starting points for integrating Checkout Security with site-specific workflows.

<?php
add_action(
    'ccp_order_manually_approved',
    function ( $order_id, $order, $source ) {
        $recipient = 'security-team@acme.test';
        $subject   = sprintf( 'Order %d approved', $order_id );
        $message   = sprintf(
            'Order %d was approved from the Risk Queue by the %s workflow.',
            $order_id,
            $source
        );

        wp_mail( $recipient, $subject, $message );
    },
    10,
    3
);

Next steps