DEV Community

Vigilmon
Vigilmon

Posted on

How to Monitor Your WooCommerce Store with Vigilmon

How to Monitor Your WooCommerce Store with Vigilmon

WooCommerce is the e-commerce engine behind 6.6 million active stores — and when it goes down, it doesn't just cost you traffic, it costs you revenue in real-time. A 5-minute checkout outage during peak hours can mean hundreds of abandoned carts.

This guide shows how to monitor your WooCommerce store with Vigilmon — from checkout flow validation to database health and order processing confirmation.


WooCommerce-Specific Failure Modes

WooCommerce fails differently than a typical WordPress site:

  • Checkout breaks independently — a payment gateway plugin update breaks the checkout flow while the homepage stays up
  • Cart session failures — Redis or database session issues cause empty carts without visible errors
  • Order processing silently fails — orders are placed but not created in the database due to a gateway webhook timeout
  • Stock sync failures — inventory integration breaks; products oversell
  • Database connection exhaustion — WooCommerce runs more DB queries per page than stock WordPress; shared hosting exhausts connections faster

Step 1: Monitor Your Homepage and Shop Page

  1. Log in to vigilmon.online
  2. Add HTTP(S) monitor → https://yourstore.com
  3. Add HTTP(S) monitor → https://yourstore.com/shop
  4. Alert if: status != 200, or response time > 5000ms

Shop page alerts are important — a plugin conflict might only affect the product grid, not the homepage.


Step 2: Monitor the Checkout Page

This is the most revenue-critical page:

  1. Add HTTP(S) monitor → https://yourstore.com/checkout
  2. Alert threshold: status != 200 or response time > 8000ms (WooCommerce checkout is slow; 8s means something is wrong)

Step 3: Add a WooCommerce Health Check Endpoint

Add this to a custom plugin or functions.php to expose a health endpoint that validates your database and WooCommerce tables:

<?php
/**
 * Plugin Name: Vigilmon WooCommerce Health Check
 * Description: Health check endpoint for Vigilmon monitoring
 */

add_action('rest_api_init', function () {
    register_rest_route('vigilmon/v1', '/health', [
        'methods' => 'GET',
        'callback' => 'vigilmon_health_check',
        'permission_callback' => function () {
            // Require a secret token for security
            $token = $_SERVER['HTTP_X_HEALTH_TOKEN'] ?? '';
            return hash_equals($token, get_option('vigilmon_health_token', 'change-me'));
        },
    ]);
});

function vigilmon_health_check() {
    global $wpdb;

    $checks = [];

    // Database connectivity
    $db_ok = ($wpdb->get_var('SELECT 1') === '1');
    $checks['database'] = $db_ok;

    // WooCommerce tables exist
    $wc_tables = ['woocommerce_order_items', 'woocommerce_sessions'];
    $checks['woocommerce_tables'] = true;
    foreach ($wc_tables as $table) {
        if ($wpdb->get_var("SHOW TABLES LIKE '{$wpdb->prefix}{$table}'") === null) {
            $checks['woocommerce_tables'] = false;
        }
    }

    // Recent orders (sanity check - should always have some)
    $recent_orders = wc_get_orders(['limit' => 1, 'status' => 'any']);
    $checks['orders_accessible'] = !is_wp_error($recent_orders);

    $all_ok = !in_array(false, $checks, true);

    return new WP_REST_Response([
        'status' => $all_ok ? 'ok' : 'degraded',
        'checks' => $checks,
        'timestamp' => current_time('timestamp'),
    ], $all_ok ? 200 : 503);
}
Enter fullscreen mode Exit fullscreen mode

Monitor https://yourstore.com/wp-json/vigilmon/v1/health with a custom header:

In Vigilmon, add this HTTP(S) monitor with a custom header:

  • Header name: X-Health-Token
  • Header value: your secret token

Step 4: Monitor SSL Certificate

  1. Add SSL Certificate monitor for yourstore.com
  2. Alert if: expires in < 14 days

An expired SSL cert kills e-commerce conversions instantly — browsers show full-page warnings.


Step 5: Monitor Order Confirmation Webhook (Advanced)

If you use WooCommerce webhooks for order fulfillment, monitor the receiver endpoint:

// Your fulfillment service health endpoint
app.get('/health', (req, res) => {
  res.json({ status: 'ok', webhooks: 'ready' });
});
Enter fullscreen mode Exit fullscreen mode

Monitor https://your-fulfillment-service.com/health.


WooCommerce Monitoring Coverage Table

Monitor Type URL Alert Condition
HTTP(S) Store homepage Status != 200
HTTP(S) /shop product grid Status != 200
HTTP(S) /checkout Status != 200 or > 8s
HTTP(S) WooCommerce health endpoint Status != 200
SSL Certificate Your domain Expires in < 14 days
HTTP(S) Fulfillment webhook receiver Status != 200

Conclusion

Every minute of WooCommerce checkout downtime costs real revenue. Vigilmon monitors all the critical paths — homepage, shop, checkout, and your custom health endpoint — giving you < 60-second alerts when any of them fail.

Set up WooCommerce monitoring free at vigilmon.online

Top comments (0)