As part of our commitment to improving WooCommerce stability and user experience, we’re excited to share updates to our error handling and introduce a new optional remote error logging system as part of the upcoming WooCommerce 9.4 release. These updates are designed to make WooCommerce more robust and simplify troubleshooting for developers and store owners.
Who is this for?
These improvements only affect stores that have tracking turned on.
To learn more about the data we track and our privacy practices, visit WooCommerce Usage Tracking. Stores can opt in or out of sharing data with us for analytics purposes, by going to WooCommerce > Settings > Advanced > WooCommerce.com and selecting or deselecting the checkbox to Enable Usage Tracking.
Coming soon in WooCommerce 9.4: Optional Remote Error Logging
In WooCommerce 9.4, we will be introducing an optional remote error logging system to further enhance stability and support, which is only available if users who have opted into usage tracking.
- Remote Error Logging Epic #49276
- Implement server-side remote error logging #49599
- Add JS remote logging package #49702
Benefits
This remote logging feature will provide several benefits:
- Faster Fixes: Detailed error data helps us resolve issues more swiftly.
- Improved Stability: Early detection of errors leads to a more stable WooCommerce experience.
- Better Insights: Aggregated error data informs our development priorities, ensuring we focus on areas that matter most to users.
Data Privacy and Security
We take user privacy seriously and have implemented several measures to protect it:
- Opt-in Only: Remote logging is only enabled for users who’ve explicitly opted into usage tracking.
- Data Sanitization: File paths in error traces and URL strings are sanitized to remove any sensitive information.
- Advanced Data Protection: We automatically redact sensitive information including:
- Email addresses
- Phone numbers
- Credit card numbers
- IP addresses
- Limited Data Collection: We only collect error diagnosis and resolution information. Query parameters in URL will also be replaced with placeholders to avoid collecting sensitive information.
To learn more about the data we track and our privacy practices, visit WooCommerce Usage Tracking.
The remote logging system captures different sets of information based on whether an error occurs server-side (PHP) or client-side (JavaScript).
Revision History
WC 9.5: Important privacy enhancement updates:
- Now only logging errors specifically caused by WooCommerce (previously logged all errors containing WooCommerce files in the trace)
- Added automatic redaction of sensitive user data including email addresses, phone numbers, credit card numbers, and IP addresses
What information are we logging?
Common Fields
All logs include:
host
: The site’s hostnamerequest_uri
: The URL of the requestmessage
: The error messagetrace
: The error stack tracewc_version
: WooCommerce versionwp_version
: WordPress versiontags
: Identifiers for the type of error (e.g., PHP, JS)
PHP-Specific Fields
Server-side logs additionally include:
php_version
: The PHP version running on the serverstore_id
: A unique identifier for the WooCommerce store
JavaScript-Specific Fields
Client-side logs additionally include:
browser_version
: The user’s browser versionbrowser_name
: The name of the user’s browser
Can I disable this feature?
The remote logging feature is disabled by default when you install WooCommerce. It is only enabled if you opt into usage tracking.
If you’ve opted in to usage tracking and want to disable remote error logging, you can do so by setting the woocommerce_feature_remote_logging_enabled
option to no
. For example, you can run wp option update woocommerce_feature_remote_logging_enabled no
via WP CLI to disable this feature. This will not impact any other tracking features.
Improved Error Handling in WC Admin
With WooCommerce 9.1, we delivered error handling enhancements in WC Admin pages, making them more stable and resilient.
We added a global error boundary at the top of the WC Admin component tree. This catches unhandled errors, preventing the entire WC Admin app from crashing.
- Add global ErrorBoundary component for handling errors in react admin #48250
- Wrap activity panels in error boundary #48415
Benefits
- Prevents full app crashes due to unhandled errors
- Displays a user-friendly error message
- Offers users the option to reload the page or seek help from the community
Fatal error without error boundaries
Fatal error occurs with error boundaries
We’ve also introduced an experimental generic error boundary component in the @woocommerce/components
package. This component isolates errors to specific parts of the UI, allowing other components to continue functioning normally.
Feedback and Contributions
We value your feedback and contributions. If you have questions, or suggestions, or want to contribute, drop a comment below or join the GitHub discussion on remote error logging. We’d love to hear from you!
Stay tuned for more updates as we continue to enhance WooCommerce for developers and users alike!
Leave a Reply