DOCS

v1.3.28
 // Pro v1.2.20

 · Latest

Docs/Developer Guide/Developer Troubleshooting

Developer Troubleshooting

Common issues and debugging techniques when extending or integrating with Order Daemon.

CLI commands not found

Symptom: wp odcm commands return “command not found.”

Fix: CLI commands are Pro-only. Ensure the Pro plugin is installed and active:

wp plugin list --field=name,status | grep -E 'order-daemon|completion'

Rules not firing

  1. Check the rule is enabled: wp odcm rule list --status=active
  2. Confirm the trigger event actually occurred (e.g., payment gateway fired, status changed correctly).
  3. Inspect conditions – all must pass. Check the Insight Dashboard timeline for the order.
  4. Examine audit logs: wp odcm log list --order-id=<id> --type=rule_execution --format=json
  5. Simplify: remove conditions one by one to find which one is blocking.

Permission denied errors

Ensure the user has manage_woocommerce capability. Verify programmatically:

if (!current_user_can('manage_woocommerce')) {
    // Access denied
}

For REST 403 errors: if your rule payload includes a Pro component and Pro is not active, the API returns 403 – that’s an entitlement issue, not a permissions issue.

Custom component not appearing in the Rule Builder

  1. Confirm the hook fired: add error_log('odcm_register_conditions fired') inside your callback temporarily.
  2. Check get_id() returns a unique string with no special characters.
  3. Ensure your plugin loads before odcm_register_conditions fires (hook at init priority ≤ 10).
  4. If using namespaces, verify autoloading includes your class.

Audit log analysis

# Recent logs
wp odcm log list --limit=50 --format=json

# Filter by order and type
wp odcm log list --order-id=123 --type=error --format=json

# Webhook-specific
wp odcm log list --type=webhook --format=json

# View a specific entry
wp odcm log view --id=456 --format=json

Health checks

# Full health check
wp odcm health check --format=json

# Performance category
wp odcm health check --category=performance --format=table

# API/REST category
wp odcm health check --category=api

Rules behave differently in staging vs production

Export and compare configurations:

wp odcm config export --format=json --output=staging-config.json
# Compare with production export
wp odcm config diff --local=reference-config.json

Keep plugin versions, WP, and WooCommerce versions identical across environments.

What’s next