ReferenceArchitecture

Architecture

Core-plus-adapter architecture, platform registry, boot sequence, adapter health gate, and interface contracts.

Architecture

Checkout Security uses a core-plus-adapter architecture. The platform-agnostic core provides fraud detection, security controls, administration, storage, privacy, and logging. Lightweight connector adapters bridge the core to specific e-commerce platforms by implementing shared interfaces.

Boot sequence

Connector plugins initialize before the core so each platform can register its adapter before enforcement begins.

  1. Each connector hooks plugins_loaded at priority 20 and registers its platform adapter with CCP_Core.
  2. The core hooks plugins_loaded at priority 30 and initializes after connector registration completes.
  3. The core checks the registered adapters and enables enforcement for healthy platforms.

The priority-based ordering ensures that the core knows about available platforms before it starts applying fraud and security logic. The core entry point defines these constants before registering its lifecycle hooks:

  • CCP_PLUGIN_FILE
  • CCP_PLUGIN_DIR
  • CCP_PLUGIN_URL
  • CCP_VERSION

The separately installable connector plugins use the same registration sequence:

  • WooCommerce: checkout-security-woocommerce-adapter
  • Easy Digital Downloads: checkout-security-edd
  • FluentCart: checkout-security-fluentcart-adapter

Platform registry

CCP_Core maintains a registry of platform adapters. Each adapter identifies its platform and supplies the platform-specific behavior required by the core.

Adapters register during plugins_loaded at priority 20. After initialization, the core iterates over the registered adapters to apply fraud checks and related security behavior across connected platforms.

The registry identifies platforms by slug:

  • woocommerce
  • edd
  • fluentcart

The registry separates platform-independent security decisions from platform-specific operations. For example, the core can calculate risk and select an action while the active adapter supplies the cart, checkout, order, and session operations for that platform.

Adapter health gate

Before enabling enforcement, the core checks the health of each registered adapter. The health check verifies that the adapter is registered correctly and that the target platform plugin is active.

If an adapter fails the health check, the core disables enforcement for that platform. Healthy adapters continue to enforce protection, which allows a site to receive partial protection while an individual connector is unavailable or misconfigured.

The core reports adapter health problems through the administration experience. When WordPress debugging is enabled, adapter registration and health issues are also logged for diagnosis.

Interface contracts

The shared contracts live in checkout-security/includes/interfaces/. Adapters implement all applicable interfaces for their platform.

InterfaceFilePurpose
CCP_Platform_Adapter_Interfaceinterfaces/interface-ccp-platform-adapter.phpBase adapter registration and platform identification
CCP_Cart_Adapter_Interfaceinterfaces/interface-ccp-cart-adapter.phpCart operations, including clearing, validation, and inspection
CCP_Checkout_Adapter_Interfaceinterfaces/interface-ccp-checkout-adapter.phpCheckout process hooks and fraud-check integration points
CCP_Order_Adapter_Interfaceinterfaces/interface-ccp-order-adapter.phpOrder creation, retrieval, and status changes
CCP_Session_Adapter_Interfaceinterfaces/interface-ccp-session-adapter.phpSession handling and customer identification

The core consumes these contracts instead of calling platform APIs directly. This keeps fraud, risk, trust, logging, and review workflows shared while allowing each connector to translate platform-specific concepts into the core model.

Order operations use CCP_Platform_Order to normalize platform orders across supported integrations. Session selection uses the registered platform session adapter when one is available, with the shared session manager handling platform-aware selection.

Partial protection

The core evaluates each connected platform independently. If WooCommerce has a healthy adapter but EDD does not, WooCommerce checkouts remain protected while EDD checkout enforcement stays disabled.

This behavior prevents one missing connector from disabling protection for every platform on the site. The dashboard reports the missing or unhealthy adapter so you can install, activate, or troubleshoot the affected connector without interrupting healthy integrations.

Core module organization

The checkout-security/includes/ directory groups shared functionality by responsibility.

  • Architecture: class-ccp-core.php maintains the platform registry and capability logic. class-ccp-loader.php loads classes. class-ccp-platform-order.php normalizes orders. Session managers select and manage platform-aware sessions.
  • Fraud and risk: Fraud detection, enhanced fraud detection, risk thresholds, decision storage, trust scores, behavioral analysis, device fingerprinting, and IP whitelisting evaluate requests and determine responses.
  • Request security: API security, input and IP validation, frontend and administrator rate limiters, security headers, cache-friendly endpoints, error handling, and secure file management protect requests and infrastructure.
  • Threat intelligence and CAPTCHA: Threat intelligence, provider management, provider interfaces, and CAPTCHA components add reputation and challenge signals to risk decisions.
  • Sessions and caching: Session persistence, cache management, database optimization, and database migrations support stateful checkout flows and recurring maintenance.
  • Data and privacy: Logging, authenticated encryption, keyed anonymization, data export, GDPR integration, personal-data handling, email templates, and retention controls govern stored security data.

Next steps