> ## Documentation Index
> Fetch the complete documentation index at: https://developer.verilock.io/llms.txt
> Use this file to discover all available pages before exploring further.

# WordPress & WooCommerce

> Add identity verification to your WordPress site or WooCommerce checkout.

The Verilock WordPress plugin embeds identity verification into your WordPress site. Verify users during registration, restrict content to verified users, or require KYC at WooCommerce checkout for regulated products.

## Prerequisites

* WordPress 6.0 or later
* PHP 8.1 or later
* WooCommerce 8.0+ (for checkout verification)
* Verilock Business or Enterprise plan

## Installation

<Steps>
  <Step title="Install the Plugin">
    Download the plugin from the [Verilock dashboard](https://verilock.io/dashboard/integrations/wordpress) or search for **Verilock Identity** in the WordPress plugin directory.

    ```bash theme={null}
    # Or install via WP-CLI
    wp plugin install verilock-identity --activate
    ```
  </Step>

  <Step title="Configure API Credentials">
    In WordPress admin, navigate to **Settings > Verilock** and enter:

    * **API Key**: Your Verilock API key
    * **Webhook Secret**: Your webhook signing secret

    Click **Verify Credentials** to test the connection.
  </Step>

  <Step title="Configure Webhook Endpoint">
    The plugin automatically registers a webhook endpoint at:

    ```
    https://yoursite.com/wp-json/verilock/v1/webhook
    ```

    Copy this URL and add it as a webhook endpoint in your [Verilock dashboard](https://verilock.io/dashboard/settings/webhooks).
  </Step>

  <Step title="Choose Verification Triggers">
    Select when identity verification is required:

    * **Registration**: Verify new users after account creation
    * **WooCommerce Checkout**: Verify customers before order completion
    * **Manual**: Embed verification via shortcode
  </Step>
</Steps>

## Verification Triggers

<Tabs>
  <Tab title="Registration">
    When enabled, new users are redirected to the Verilock hosted verification flow after registration. Their account remains in a `pending_verification` state until approved.

    | Setting                | Description                              | Default      |
    | ---------------------- | ---------------------------------------- | ------------ |
    | `require_verification` | Block access until verified              | `true`       |
    | `verification_profile` | Profile to use (basic/standard/enhanced) | `standard`   |
    | `redirect_after`       | URL to redirect to after verification    | Account page |
  </Tab>

  <Tab title="WooCommerce Checkout">
    For regulated products (age-restricted, high-value), require identity verification at checkout. The plugin adds a verification step before payment.

    | Setting                | Description                                 | Default  |
    | ---------------------- | ------------------------------------------- | -------- |
    | `checkout_categories`  | Product categories requiring verification   | None     |
    | `order_threshold`      | Minimum order value to trigger verification | Disabled |
    | `verification_profile` | Profile to use                              | `basic`  |
  </Tab>

  <Tab title="Shortcode">
    Embed a verification button anywhere using the shortcode:

    ```
    [verilock_verify profile="standard" redirect="/thank-you"]
    ```

    This renders a styled button that launches the hosted verification flow in a modal or redirect.
  </Tab>
</Tabs>

## Hosted Flow Embedding

The plugin embeds the Verilock hosted verification flow using either a modal overlay or a full-page redirect:

| Mode         | Description                                                   |
| ------------ | ------------------------------------------------------------- |
| **Modal**    | Overlay on the current page. Recommended for checkout flows.  |
| **Redirect** | Full-page redirect to Verilock. Recommended for registration. |

Configure the mode in **Settings > Verilock > Display Mode**.

## User Meta Fields

After verification, the plugin stores the result in WordPress user meta:

| Meta Key               | Value                                        |
| ---------------------- | -------------------------------------------- |
| `verilock_status`      | `approved`, `declined`, `pending`, `expired` |
| `verilock_session_id`  | Session ID (e.g., `ses_a1b2c3d4e5f6`)        |
| `verilock_verified_at` | ISO 8601 timestamp                           |
| `verilock_risk_score`  | Numeric risk score (0-100)                   |

<Info>
  Use these meta fields to conditionally display content or restrict access using WordPress role/capability checks or third-party membership plugins.
</Info>

## Webhook Processing

The plugin automatically processes the following webhook events:

| Event              | Plugin Action                                          |
| ------------------ | ------------------------------------------------------ |
| `session.approved` | Set user status to `approved`, grant verified role     |
| `session.declined` | Set user status to `declined`, send notification email |
| `session.expired`  | Set user status to `expired`, prompt re-verification   |

<Warning>
  Ensure your WordPress site is accessible via HTTPS. Verilock will not deliver webhooks to HTTP endpoints.
</Warning>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Webhook not received">
    Verify the webhook URL is reachable from the internet. Check that no security plugin (Wordfence, Sucuri) is blocking the `/wp-json/verilock/v1/webhook` endpoint. Allowlist Verilock IPs if necessary.
  </Accordion>

  <Accordion title="Modal not loading">
    Ensure no JavaScript errors exist on the page. The plugin requires jQuery (bundled with WordPress). Check for conflicts with your theme or other plugins.
  </Accordion>

  <Accordion title="WooCommerce checkout not triggering">
    Verify the product categories are correctly mapped in **Settings > Verilock > WooCommerce**. Check that the order total meets the configured threshold.
  </Accordion>
</AccordionGroup>
