google / site-kit-wp

Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.
https://sitekit.withgoogle.com
Apache License 2.0
1.23k stars 287 forks source link

The Moneytizer plugin results in dashboard error with v1.3.0 #3144

Closed mxbclang closed 3 years ago

mxbclang commented 3 years ago

Bug Description

Two users in the support forum (here and here) reported still receiving the Cannot read property 'ea' of undefined error (#3132) that resulted from the Google Charts API update earlier this week even after updating Site Kit to v1.3.0. This error occurred when going to Site Kit > Dashboard.

Ultimately both users discovered that deactivating The Moneytizer plugin fixed the issue. One user reported that they had had The Moneytizer plugin installed since June 2020 without issue until updating to v.1.3.0, so it appears that this conflict may have been introduced in our most recent release.

Steps to reproduce

  1. Use the Site Kit testing plugin set to v1.2.9
  2. Install and activate The Moneytizer plugin
  3. Go to Site Kit > Dashboard and confirm that dashboard displays successfully
  4. Change Site Kit testing plugin to v1.3.0
  5. Go to Site Kit > Dashboard and error message will display:
Cannot read property 'ea' of undefined

    in GoogleChartV2
    in div
    in Sparkline
    in div
    in div
    in DataBlock
    in div
    in LegacySearchConsoleDashboardWidgetTopLevel
    in withData(LegacySearchConsoleDashboardWidgetTopLevel)
    in Unknown
    in WithSelect(withData(LegacySearchConsoleDashboardWidgetTopLevel))
    in FilteredComponent
    in FilteredComponent
    in WithFilters(LegacyDashboardSearchFunnelInner)
    in div
    in div
    in div
    in Layout
    in div
    in LegacyDashboardSearchFunnel
    in FilteredComponent
    in FilteredComponent
    in FilteredComponent
    in WithFilters(LegacyDashboardModule)
    in div
    in Row
    in div
    in Grid
    in div
    in DashboardApp
    in GoogleSitekitDashboard
    in RestoreSnapshots
    in ErrorHandler
    in Root

Additional Context


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation Brief

Test Coverage

Visual Regression Changes

QA Brief

Changelog entry

jamesozzie commented 3 years ago

I've performed some testing on this. Reproducible as per this recording, more insights below:

image

Full console errors: ``` googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1 TypeError: Cannot read property 'apply' of undefined at gvjs_gaa (jsapi_compiled_default_module.js:55) at gvjs_q (jsapi_compiled_default_module.js:56) at jsapi_compiled_default_module.js:299 at Array.map () at gvjs_iba (jsapi_compiled_default_module.js:299) at Object.gvjs_9k [as arrayToDataTable] (jsapi_compiled_default_module.js:300) at t (googlesitekit-module.a73642b369eba51ec9de.js:19) at googlesitekit-module.a73642b369eba51ec9de.js:19 at Ui (googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1) at _a (googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1) Pi @ googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1 Oi.i.componentDidCatch.n.callback @ googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1 Lg @ googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1 Kg @ googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1 va @ googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1 t.unstable_runWithPriority @ googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1 Mr @ googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1 Yj @ googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1 Lj @ googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1 (anonymous) @ googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1 t.unstable_runWithPriority @ googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1 Mr @ googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1 Hr @ googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1 zr @ googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1 _a @ googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1 t.unstable_runWithPriority @ googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1 Mr @ googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1 Sj @ googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1 (anonymous) @ googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1 z @ googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1 O.port1.onmessage @ googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1 googlesitekit-module.a73642b369eba51ec9de.js:66 Caught an error: TypeError: Cannot read property 'apply' of undefined at gvjs_gaa (jsapi_compiled_default_module.js:55) at gvjs_q (jsapi_compiled_default_module.js:56) at jsapi_compiled_default_module.js:299 at Array.map () at gvjs_iba (jsapi_compiled_default_module.js:299) at Object.gvjs_9k [as arrayToDataTable] (jsapi_compiled_default_module.js:300) at t (googlesitekit-module.a73642b369eba51ec9de.js:19) at googlesitekit-module.a73642b369eba51ec9de.js:19 at Ui (googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1) at _a (googlesitekit-vendor.0c15cc710eaf5d89baf6.js:1) {componentStack: "↵ in GoogleChart↵ in div↵ in div↵ in s… RestoreSnapshots↵ in ErrorHandler↵ in Root"} ```
Debug Log: ``` [15-Apr-2021 22:04:59 UTC] PHP Notice: Trying to get property 'site_tags' of non-object in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-shortcode.php on line 57 [15-Apr-2021 22:05:05 UTC] PHP Notice: Undefined index: date_from in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:05:05 UTC] PHP Notice: Undefined index: date_to in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:05:05 UTC] PHP Notice: Undefined index: format in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:05:15 UTC] PHP Notice: Undefined index: code in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 348 [15-Apr-2021 22:05:20 UTC] PHP Notice: Trying to get property 'site_tags' of non-object in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-shortcode.php on line 57 [15-Apr-2021 22:05:26 UTC] PHP Notice: Undefined index: date_from in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:05:26 UTC] PHP Notice: Undefined index: date_to in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:05:26 UTC] PHP Notice: Undefined index: format in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:05:26 UTC] PHP Notice: Undefined index: code in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 348 [15-Apr-2021 22:05:41 UTC] PHP Notice: Trying to get property 'site_tags' of non-object in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-shortcode.php on line 57 [15-Apr-2021 22:05:43 UTC] PHP Notice: Undefined index: code in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 348 [15-Apr-2021 22:05:43 UTC] PHP Notice: Undefined index: code in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 348 [15-Apr-2021 22:05:44 UTC] PHP Notice: Undefined index: date_from in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:05:44 UTC] PHP Notice: Undefined index: date_to in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:05:44 UTC] PHP Notice: Undefined index: format in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:06:15 UTC] PHP Notice: Trying to get property 'site_tags' of non-object in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-shortcode.php on line 57 [15-Apr-2021 22:06:21 UTC] PHP Notice: Undefined index: date_from in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:06:21 UTC] PHP Notice: Undefined index: date_to in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:06:21 UTC] PHP Notice: Undefined index: format in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:06:50 UTC] PHP Notice: Trying to get property 'site_tags' of non-object in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-shortcode.php on line 57 [15-Apr-2021 22:06:53 UTC] PHP Notice: Undefined index: date_from in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:06:53 UTC] PHP Notice: Undefined index: date_to in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:06:53 UTC] PHP Notice: Undefined index: format in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:07:31 UTC] PHP Notice: Trying to get property 'site_tags' of non-object in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-shortcode.php on line 57 [15-Apr-2021 22:07:38 UTC] PHP Notice: Undefined index: date_from in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:07:38 UTC] PHP Notice: Undefined index: date_to in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:07:38 UTC] PHP Notice: Undefined index: format in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:07:45 UTC] PHP Notice: Trying to get property 'site_tags' of non-object in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-shortcode.php on line 57 [15-Apr-2021 22:07:49 UTC] PHP Notice: Undefined index: date_from in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:07:49 UTC] PHP Notice: Undefined index: date_to in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:07:49 UTC] PHP Notice: Undefined index: format in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:11:06 UTC] PHP Notice: Trying to get property 'site_tags' of non-object in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-shortcode.php on line 57 [15-Apr-2021 22:11:11 UTC] PHP Notice: Undefined index: date_from in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:11:11 UTC] PHP Notice: Undefined index: date_to in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:11:11 UTC] PHP Notice: Undefined index: format in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:11:26 UTC] PHP Notice: Trying to get property 'site_tags' of non-object in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-shortcode.php on line 57 [15-Apr-2021 22:11:31 UTC] PHP Notice: Undefined index: date_from in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:11:31 UTC] PHP Notice: Undefined index: date_to in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:11:31 UTC] PHP Notice: Undefined index: format in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:12:26 UTC] PHP Notice: Trying to get property 'site_tags' of non-object in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-shortcode.php on line 57 [15-Apr-2021 22:12:36 UTC] PHP Notice: Undefined index: date_from in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:12:36 UTC] PHP Notice: Undefined index: date_to in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:12:36 UTC] PHP Notice: Undefined index: format in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:17:53 UTC] PHP Notice: Trying to get property 'site_tags' of non-object in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-shortcode.php on line 57 [15-Apr-2021 22:18:01 UTC] PHP Notice: Undefined index: date_from in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:18:01 UTC] PHP Notice: Undefined index: date_to in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 [15-Apr-2021 22:18:01 UTC] PHP Notice: Undefined index: format in /var/www/vhosts/232/1147031/webspace/httpdocs/ginza.ie/wp-content/plugins/the-moneytizer/themoneytizer-config.php on line 494 ```

@bethanylang Moving to backlog for engineer review.

abdullah1908 commented 3 years ago

Another user reported the same issue & have installed The Monetizer plugin.

felixarntz commented 3 years ago

My initial intuition is that that plugin also uses the Google charts library, and maybe they are loading it unconditionally even on Site Kit-controlled screens. Basically they're still loading the version that Site Kit has had the conflict with, and the problem is they might be loading it in more places than they should.

I can have a look to verify, but if that's the case, the problem lies on their end rather than on ours.

felixarntz commented 3 years ago

Indeed, this is a problem in the "The Moneytizer" plugin, they load their CSS and JS unconditionally on all admin screens of WordPress, which causes this problem in Site Kit (see https://plugins.trac.wordpress.org/browser/the-moneytizer/trunk/themoneytizer-config.php#L3). I'm not sure what the best strategy is here, but this needs to be fixed on their end.

mxbclang commented 3 years ago

Per discussion in today's meeting, this issue needs to be fixed on The Moneytizer plugin. @jamesozzie will reach out via their support forum to request a fix. James, when you've done so, can you please close out this issue and link to your support topic? Thank you!

jamesozzie commented 3 years ago

Thanks all for reviewing.

@bethanylang I've created a WP Support topic now, you'll find it here. For impacted users feel free to keep watch of that support topic.

jamesozzie commented 3 years ago

Tested and confirmed the latest Moneytizer update has a fix in place (Version 9.0).