Skip to content

WooCommerce Analytics: better fallback when conflicting with plugins changing product data #11301

Closed
@jeherve

Description

@jeherve

Steps to reproduce the issue

  1. Some plugins change the data returned by wc_get_product.
  2. It then causes Fatal Errors on our end, like so:
PHP Fatal error:  Uncaught Error: Call to undefined method WC_Product_Package::get_title() in /plugins/jetpack/7.0/modules/woocommerce-analytics/classes/wp-woocommerce-analytics-universal.php:172
Stack trace:
#0 /plugins/jetpack/7.0/modules/woocommerce-analytics/classes/wp-woocommerce-analytics-universal.php(90): Jetpack_WooCommerce_Analytics_Universal->get_product_details(Object(WC_Product_Package))
#1 /wp-includes/class-wp-hook.php(286): Jetpack_WooCommerce_Analytics_Universal->loop_session_events('')

We should aim to have a better fallback than this fatal in get_product_details.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions