[WIP] Premium Analytics: port WooCommerce Analytics CSV report export (test)#50094
[WIP] Premium Analytics: port WooCommerce Analytics CSV report export (test)#50094layoutd wants to merge 3 commits into
Conversation
|
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! |
Code Coverage SummaryCoverage changed in 1 file.
19 files are newly checked for coverage. Only the first 5 are listed here.
If appropriate, add one of these labels to override the failing coverage check:
Covered by non-unit tests
|
Foundation for WOOA7S-1581
Proposed changes
jetpack-premium-analyticspackage, undersrc/Reports/Export/.woocommerce_init+Manager::is_connected()), so it is inert on a plain Jetpack site./jetpack-premium-analytics/v1/proxy/v2/analytics/{endpoint}./wc/v3/woocommerce-analytics/reports/csv-exportso the existing frontend export hook works unchanged.This is a WIP / test port, not for merge. The goal is to exercise the generation endpoints on a Premium Analytics + WooCommerce store. Known follow-ups before a real PR (all part of decoupling from WooCommerce):
WC_Email+ WC templates onto generic / Jetpack / Premium Analytics branding.class-*.php,Snake_Case,jetpack-premium-analytics); the ported files keep WA's PSR-4 names andwoocommerce-analyticsdomain for now.DebugLoggerwrappingWC_Logger) with a non-WC implementation for a Jetpack-only path.Related product discussion/links
Does this pull request change what data or activity we track or use?
No new tracking. It exposes existing WordPress.com analytics report data as a CSV (download or email) to authorized users (
manage_options/ the connected blog). The email delivery path sends report data viawp_mail; worth a privacy review before the email path is productionized.Testing instructions
Requires WooCommerce active, Jetpack connected, and the store provisioned on WordPress.com analytics.
add/pa-report-export-testand runjetpack build plugins/premium-analytics.manage_options):POST /wp-json/wc/v3/woocommerce-analytics/reports/csv-exportwithreport_type[]=orders,from,to,interval=day,delivery_method=download-> expect a CSV stream.report_type[]=productsandreport_type[]=visitors.delivery_method=email-> expect a202and an "export ready" email with the CSV attached (locally, catch it in Mailpit at http://localhost:1080).