woocommerce / woocommerce-admin

(Deprecated) This plugin has been merged to woocommerce/woocommerce
https://woocommerce.github.io/woocommerce-admin/#/
Other
361 stars 145 forks source link

WooCommerce Analytics Overview page breaks with Gutenberg plugin active & Date Range set to Year to Date #5728

Closed JoshuaGoode closed 3 years ago

JoshuaGoode commented 3 years ago

Describe the bug This is a follow-up to https://github.com/woocommerce/woocommerce-admin/issues/5385 and https://github.com/woocommerce/woocommerce-admin/pull/5409

When Gutenberg is active and the Year to Date date range is selected, WooCommerce Analytics pages will break.

I've reproduced on both WPCOM and self-hosted.

Workaround We can work around this by going to wp-admin/admin.php?page=wc-admin&path=%2Fanalytics%2Fsettings directly and changing the Default Date Range to something else other than Year to Date.

If the user needs to temporarily see the Analytics pages in the Year to Date date range, they can temporarily deactivate the standalone Gutenberg plugin.

To Reproduce WooCommerce Analytics will currently break, hiding all information under the following conditions:

  1. Gutenberg plugin activated. I tested with 9.3.0 (the version currently symlinked on WPCOM) and 9.4.1 (the latest repo version).
  2. Date Range set to Year to Date (Set this directly on one of the Analytics pages or as the default date range under Analytics > Settings)

Expected behavior Opening up the Analytics Overview page should display recent WooCommerce stats

Screenshots Screens are blank with the following console errors.

image

System status report from test site ` ### WordPress Environment ### WordPress address (URL): https://goode-atomic-site-1.blog Site address (URL): https://goode-atomic-site-1.blog WC Version: 4.7.0 REST API Version: ✔ 4.7.0 WC Blocks Version: ✔ 3.6.0 Action Scheduler Version: ✔ 3.1.6 WC Admin Version: ✔ 1.6.3 Log Directory Writable: ✔ WP Version: 5.5.3 WP Multisite: – WP Memory Limit: 256 MB WP Debug Mode: ✔ WP Cron: ✔ Language: en_US External object cache: ✔ ### Server Environment ### Server Info: nginx PHP Version: 7.3.24 PHP Post Max Size: 2 GB PHP Time Limit: 1200 PHP Max Input Vars: 6144 cURL Version: 7.73.0 OpenSSL/1.1.1d SUHOSIN Installed: – MySQL Version: 5.5.5-10.3.23-MariaDB-log Max Upload Size: 2 GB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ ### Database ### WC Database Version: 4.7.0 WC Database Prefix: wp_ Total Database Size: 19.90MB Database Data Size: 15.77MB Database Index Size: 4.13MB wp_woocommerce_sessions: Data: 0.05MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_actions: Data: 0.02MB + Index: 0.11MB + Engine InnoDB wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_logs: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_arm_activity: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_arm_email_templates: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_arm_entries: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_arm_fail_attempts: Data: 0.08MB + Index: 0.00MB + Engine InnoDB wp_arm_forms: Data: 0.13MB + Index: 0.00MB + Engine InnoDB wp_arm_form_field: Data: 0.06MB + Index: 0.00MB + Engine InnoDB wp_arm_lockdown: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_arm_login_history: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_arm_members: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_arm_membership_setup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_arm_member_templates: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_arm_payment_log: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_arm_subscription_plans: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_arm_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_atbdp_review: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_bv_fw_requests: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_bv_ip_store: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_bv_lp_requests: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_comments: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_ms_snippets: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_options: Data: 3.23MB + Index: 0.08MB + Engine InnoDB wp_postmeta: Data: 0.17MB + Index: 0.03MB + Engine InnoDB wp_posts: Data: 2.03MB + Index: 0.06MB + Engine InnoDB wp_snippets: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_usermeta: Data: 0.05MB + Index: 0.03MB + Engine InnoDB wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_admin_notes: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wpforms_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wpml_mails: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wps_collections_custom: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wps_collections_smart: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wps_collects: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wps_images: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wps_options: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wps_products: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wps_settings_connection: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wps_settings_general: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wps_settings_license: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wps_settings_syncing: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wps_shop: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wps_tags: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wps_variants: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_yoast_indexable: Data: 0.06MB + Index: 0.08MB + Engine InnoDB wp_yoast_indexable_hierarchy: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_yoast_migrations: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_yoast_primary_term: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_yoast_seo_links: Data: 1.52MB + Index: 0.34MB + Engine InnoDB wp_yoast_seo_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB __wp_actionscheduler_actions: Data: 0.02MB + Index: 0.11MB + Engine InnoDB __wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB __wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB __wp_actionscheduler_logs: Data: 0.02MB + Index: 0.03MB + Engine InnoDB __wp_arm_activity: Data: 0.02MB + Index: 0.00MB + Engine InnoDB __wp_arm_email_templates: Data: 0.02MB + Index: 0.00MB + Engine InnoDB __wp_arm_entries: Data: 0.02MB + Index: 0.00MB + Engine InnoDB __wp_arm_fail_attempts: Data: 0.08MB + Index: 0.00MB + Engine InnoDB __wp_arm_forms: Data: 0.13MB + Index: 0.00MB + Engine InnoDB __wp_arm_form_field: Data: 0.06MB + Index: 0.00MB + Engine InnoDB __wp_arm_lockdown: Data: 0.02MB + Index: 0.00MB + Engine InnoDB __wp_arm_login_history: Data: 0.02MB + Index: 0.00MB + Engine InnoDB __wp_arm_members: Data: 0.02MB + Index: 0.03MB + Engine InnoDB __wp_arm_membership_setup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB __wp_arm_member_templates: Data: 0.02MB + Index: 0.00MB + Engine InnoDB __wp_arm_payment_log: Data: 0.02MB + Index: 0.00MB + Engine InnoDB __wp_arm_subscription_plans: Data: 0.02MB + Index: 0.00MB + Engine InnoDB __wp_arm_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB __wp_atbdp_review: Data: 0.02MB + Index: 0.02MB + Engine InnoDB __wp_bv_fw_requests: Data: 0.02MB + Index: 0.00MB + Engine InnoDB __wp_bv_ip_store: Data: 0.02MB + Index: 0.02MB + Engine InnoDB __wp_bv_lp_requests: Data: 0.02MB + Index: 0.00MB + Engine InnoDB __wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB __wp_comments: Data: 0.02MB + Index: 0.09MB + Engine InnoDB __wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB __wp_ms_snippets: Data: 0.02MB + Index: 0.00MB + Engine InnoDB __wp_options: Data: 1.17MB + Index: 0.08MB + Engine InnoDB __wp_postmeta: Data: 0.14MB + Index: 0.06MB + Engine InnoDB __wp_posts: Data: 2.48MB + Index: 0.06MB + Engine InnoDB __wp_snippets: Data: 0.02MB + Index: 0.00MB + Engine InnoDB __wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB __wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB __wp_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB __wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB __wp_usermeta: Data: 0.05MB + Index: 0.03MB + Engine InnoDB __wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB __wp_wc_admin_notes: Data: 0.02MB + Index: 0.00MB + Engine InnoDB __wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB __wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB __wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB __wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB __wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB __wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB __wp_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB __wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB __wp_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB __wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB __wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB __wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB __wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB __wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB __wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB __wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB __wp_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB __wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB __wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB __wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB __wp_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB __wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB __wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB __wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB __wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB __wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB __wp_wpml_mails: Data: 0.02MB + Index: 0.00MB + Engine InnoDB __wp_yoast_indexable: Data: 0.06MB + Index: 0.08MB + Engine InnoDB __wp_yoast_indexable_hierarchy: Data: 0.02MB + Index: 0.05MB + Engine InnoDB __wp_yoast_migrations: Data: 0.02MB + Index: 0.02MB + Engine InnoDB __wp_yoast_primary_term: Data: 0.02MB + Index: 0.03MB + Engine InnoDB __wp_yoast_seo_links: Data: 1.52MB + Index: 0.34MB + Engine InnoDB __wp_yoast_seo_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB ### Post Type Counts ### attachment: 22 customize_changeset: 12 custom_css: 2 elementor_library: 2 feedback: 1 jetpack-portfolio: 1 jetpack_migration: 2 jp_img_sitemap: 2 jp_pay_order: 4 jp_pay_product: 7 jp_sitemap: 2 jp_sitemap_master: 2 nav_menu_item: 4 oembed_cache: 4 page: 7 post: 21 product: 3 project: 1 revision: 16 wpforms: 1 wp_template_part: 6 ### Security ### Secure connection (HTTPS): ✔ Hide errors from visitors: ✔ ### Active Plugins (15) ### Akismet Anti-Spam: by Automattic – 4.1.7 AMP: by AMP Project Contributors – 2.0.7 Starter Templates: by Brainstorm Force – 2.3.8 CoBlocks: by GoDaddy – 2.5.2 Elementor: by Elementor.com – 3.0.13 WordPress.com Editing Toolkit: by Automattic – 2.8.8 Gutenberg: by Gutenberg Team – 9.3.0 Insert Headers and Footers: by WPBeginner – 1.4.6 Jetpack by WordPress.com: by Automattic – 9.1 Layout Grid: by Automattic – 1.3 Page Optimize: by Automattic – 0.5.1 WooCommerce: by Automattic – 4.7.0 WordPress Importer: by wordpressdotorg – 0.7 WPForms Lite: by WPForms – 1.6.3.1 WP Shopify Testing: by WP Shopify – 3.5.1 ### Inactive Plugins (23) ### Ads.txt Manager: by 10up – 1.3.0 All-in-One WP Migration: by ServMask – 7.31 ARMember Lite - Membership Plugin: by Repute InfoSystems – 2.7 Classic Editor: by WordPress Contributors – 1.6 Code Snippets: by Code Snippets Pro – 2.14.0 Creative Mail by Constant Contact: by Constant Contact – 1.2.2 – Installed version not tested with active version of WooCommerce 4.7.0 Directorist - Business Directory Plugin: by AazzTech – 6.5.5 Enable jQuery Migrate Helper: by The WordPress Team – 1.1.0 Facebook for WooCommerce: by Facebook – 2.2.0 Jetpack Beta Tester: by Automattic – 2.4.3 Migrate Guru: by Migrate Guru – 4.35 Post Grid by PickPlugins: by PickPlugins – 2.0.74 Recent Posts Widget Extended: by Satrya – 0.9.9.7 Recent Posts Widget With Thumbnails: by Martin Stehle – 7.0.1 Site Kit by Google: by Google – 1.21.0 WooCommerce Shipping & Tax: by Automattic – 1.25.2 – Installed version not tested with active version of WooCommerce 4.7.0 WooCommerce Stripe Gateway: by WooCommerce – 4.5.5 – Installed version not tested with active version of WooCommerce 4.7.0 WordPress Backup & Security Plugin - BlogVault: by Backup by BlogVault – 4.36 WP Display Header: by Konstantin Obenland – 6 WP Mail Logging: by MailPoet – 1.9.7 WP Rocket: by WP Media – 3.7.0.1 WP Shopify: by WP Shopify – 3.5.2 Yoast SEO: by Team Yoast – 15.3 ### Dropin Plugins (2) ### advanced-cache.php: advanced-cache.php object-cache.php: Memcached ### Must Use Plugins (2) ### WP.com Site Helper: by – wpshopify-compatibility.php: by – ### Settings ### API Enabled: – Force SSL: – Currency: GBP (£) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) variable (variable) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) Connected to WooCommerce.com: ✔ ### WC Pages ### Shop base: ❌ Page ID is set but the page does not exist Cart: ❌ Page ID is set but the page does not exist Checkout: ❌ Page ID is set but the page does not exist My account: ❌ Page ID is set but the page does not exist Terms and conditions: ❌ Page not set ### Theme ### Name: Morden Version: 1.5.12 Author URL: https://automattic.com/ Child Theme: ✔ Parent Theme Name: Varia Parent Theme Version: 1.5.9 Parent Theme Author URL: https://automattic.com/ WooCommerce Support: ✔ ### Templates ### Overrides: – ### Action Scheduler ### Complete: 16 Oldest: 2020-11-19 21:24:01 +0000 Newest: 2020-11-24 04:03:27 +0000 Pending: 1 Oldest: 2020-11-25 04:03:27 +0000 Newest: 2020-11-25 04:03:27 +0000 `

Additional context Previously worked on via https://github.com/woocommerce/woocommerce-admin/issues/5385 and https://github.com/woocommerce/woocommerce-admin/pull/5409

Identified via reports from WordPress.com users.

Documented internally: p9F6qB-61t-p2

cc: @samueljseay @jeffstieler

timmyc commented 3 years ago

I was able to repro using an Atomic Ephemeral site, Gutenberg 9.3 and Woo 4.7

timmyc commented 3 years ago

Interestingly enough, I'm not getting the issue on main of woocommerce-admin running alongside 4.7 with gutenberg 4.8.1. I'll test out the latest beta of Woo 4.8 to see how things look there.

timmyc commented 3 years ago

Okay few more updates here:

So since this bug is no longer present in the latest released version of wc-admin, or on the main branch, I'm going to close out the issue with the fix being: either change the default date range to something other then year to date in Analytics Settings, or install WooCommerce Admin 1.7.2

selectedselections commented 3 years ago

Hi there! @timmyc @JoshuaGoode I wanted to reopen this issue because it was reported again in hc-28209532

I was able to reproduce the issue on my test site as well.

When Gutenberg is active, then the Analytics -> Settings panel is not accessible. Everything seems to be up to date on both sites (user and test).

Its possible that I'm not understanding the solution presented here but I tested installing WooCommerce Admin and this did not resolve for me.

timmyc commented 3 years ago

@selectedselections thanks for re-opening, and I can confirm the JS exception happening again on the Analytics > Settings page when Gutenberg 10.1.1 and WooCommerce 5.0 installed:

image