Repository navigation
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryCoverage changed in 1 file.
Full summary · PHP report · JS report Coverage check overridden by
I don't care about code coverage for this PR
|
Part of WOOA7S-2265
Proposed changes
Orders\Stats\DataStore::get_order_stats_row_data()(Expose the order stats row calculation as a public method woocommerce/woocommerce#69399), the WooCommerce Analytics module builds theorder_statspayload from WooCommerce's own row and adds the hosted-only fee and discount columns on top. Older WooCommerce versions keep the current code.woocommerce_analytics_update_order_stats_datanow change the synced row too.wc-prefix as WooCommerce's row, including unregistered statuses.wc_order_statsrow, so the checksum matches with or without the standalone WooCommerce Analytics plugin.date_created_gmtandpayment_method, which the deleted-order path already sends.Resending refunds when their parent changes and the
FulfillmentUtilsnamespace on WooCommerce 11.0+ are not covered here. With the opt-in immediate sync in #53176, refunds synced before their row is stored and orders trashed before import still need a decision there.Related product discussion/links
Does this pull request change what data or activity we track or use?
No. It sends the same actions, plus two columns the deleted-order path already sends.
Testing instructions
Setup: a connected site with WooCommerce built from woocommerce/woocommerce#69399, Premium Analytics (or Jetpack) built from this branch, and Analytics enabled. Do not activate the standalone WooCommerce Analytics plugin. Add an mu-plugin that logs the payload:
Refund status
wp action-scheduler run --group=wc-admin-data.statusiswc-processing, the same asSELECT status FROM wp_wc_order_stats WHERE order_id = <refund id>. On trunk it logswc-completed.Filter
add_filter( 'woocommerce_analytics_update_order_stats_data', function ( $d ) { $d['num_items_sold'] = 99; return $d; } );to the mu-plugin.num_items_soldis99.Order WooCommerce no longer tracks
_wcpay_modemeta with the valuetestto the order (for example$order->update_meta_data( '_wcpay_mode', 'test' ); $order->save_meta_data();inwp shell), then callget_object_by_id( 'order', <id> )on the module.order_stats, matching the stored row.Older WooCommerce
wc-completed, and there is nodate_created_gmtkey.