Debugging with Verbose Logging

June 5, 2026

When prices for tax-exempt / VAT-free locations don’t come out as expected, the plugin can trace its tax-exemption decision to the log. This is gated behind a constant and is off by default. Use it to diagnose, then turn it off.

What it traces

Verbose logging covers the VAT-exempt / tax-inclusive logic specifically (it is not a general request log). When on, you’ll see, per page load:

  • The resolved customer tax location and how it was derived (the WooCommerce “tax based on” setting, billing/shipping address, geolocation).
  • The store base country/state, and whether the customer matches it.
  • The tax rates found for the customer’s location and tax class, and the base-tax rates for comparison.
  • The final exemption decision, and — for the first few variations on the page — the price adjustment maths (input price, tax stripped, output price).

This is exactly the information needed to answer “why did (or didn’t) this product get its base VAT stripped?” See VAT-Exempt / Tax-Inclusive Pricing for what the decision should be.

Enabling it

Two switches are needed: turn on the plugin’s verbose flag, and make sure WordPress is actually writing a log.

1. Enable the plugin constant (e.g. in wp-config.php, above the “stop editing” line):

define( 'WC_AJAX_PRICING_VERBOSE_LOGGING', true );

2. Make sure PHP/WordPress logging is on. The trace is written via error_log(), so it lands in whatever your PHP error log is. The simplest way to capture it is WordPress debug logging:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );      // writes to wp-content/debug.log
define( 'WP_DEBUG_DISPLAY', false ); // don't show errors on the page

Entries are prefixed [SuperSpeedy Tax Debug] so you can grep for them:

tail -f wp-content/debug.log | grep 'SuperSpeedy Tax Debug'

Reading the trace

A typical sequence for one product looks like:

  1. customer_is_tax_exempt_for_class() START with the tax class.
  2. The customer object dump (addresses, VAT-exempt flag) and the WooCommerce tax settings.
  3. The resolved tax location, and either “matches base store → not exempt” or a rate lookup.
  4. RESULT: customer_is_tax_exempt_for_class => true/false.
  5. If exempt and prices include tax: the adjust_variation_price_for_tax_exempt() block showing input price, tax amount, and adjusted price.

To keep the log readable, the per-variation price maths is logged only for the first few variations on a page — the exemption decision itself is logged each time.

Turning it off

Verbose logging writes customer location detail (country/state/postcode/city) to the log, so don’t leave it on in production. When you’re done:

// remove or set to false
define( 'WC_AJAX_PRICING_VERBOSE_LOGGING', false );

…and disable WP_DEBUG_LOG if you only turned it on for this. Delete or rotate wp-content/debug.log afterwards so the captured addresses aren’t left lying around.

Privacy note

Because the trace includes the resolved customer address fields, treat the log as containing personal data while it’s enabled. Capture only what you need, on staging where possible, and clear it when finished. (The related constant WC_AJAX_PRICING_TRUST_VAT_EXEMPT is documented in Developer Reference → Constants.)

×
1/1