Turn off log masking
Last modified:
Krokedil plugins mask customer personal data in their logs by default. When you debug an issue on a store, you sometimes need to see the actual data. You can turn masking off temporarily with the krokedil_wp_api_mask_log_data filter.
Please note: Use this filter only while debugging, and remove it as soon as you’re done. Logs written while masking is off contain personal data.
Supported plugins
The filter is available in plugins that use version 1.2.0 or later of Krokedil’s shared API package. Each plugin identifies itself with a slug, which you use to target that plugin.
| Plugin | From version | Slug |
|---|---|---|
| Avarda Checkout | 1.17.11 | avarda-checkout-for-woocommerce |
| Instabox | 1.6.1 | instabox-for-woocommerce |
| Klarna | 4.13.4 | klarna_payments |
| Kustom Checkout | 2.23.1 | kustom-checkout-for-woocommerce |
| Walley Checkout | 5.1.0 | collector-checkout-for-woocommerce |
We add plugins to this list as they gain support for the filter. If your plugin isn’t listed, check its changelog – support may have been added before we updated this list.
Turn off masking for one plugin
We recommend that you turn off masking only for the plugin you’re debugging. Replace your_plugin_slug with the slug from the table above.
add_filter( 'krokedil_wp_api_mask_log_data', function ( $enabled, $slug ) {
return 'your_plugin_slug' === $slug ? false : $enabled;
}, 10, 2 );The filter passes two arguments:
$enabled(bool): whether masking is on. Defaulttrue.$slug(string): the slug of the plugin writing the log entry.
Turn off masking for all plugins
To turn off masking in every supported plugin at once:
add_filter( 'krokedil_wp_api_mask_log_data', '__return_false' );Where to add the code
Add the snippet with a plugin such as Code Snippets or in your child theme’s functions.php. Avoid adding it to the parent theme, since theme updates overwrite your changes.
Good to know
- Only
falseturns masking off. Other falsy values, such as0or an empty string, leave masking on. - Secrets are always masked. The filter reveals personal data only. API keys and credentials stay masked regardless.
- Errors leave masking on. If your callback throws an error, the plugin keeps masking the data.
Turn masking back on
Remove the snippet when you’re done debugging. Log entries written while masking was off stay unmasked, so delete them once you no longer need them.