• “Uncaught ReferenceError: datelabel is not defined” this error is being shown because the javascript is expecting ‘datelabel’ to be written from getVisitsGraph. The problem is, google-analytics-summary-widget.php -> ajaxWidget() doesn’t need to be called on a custom post type. It should only run in the admin dashboard IMHO. Right now your GoogleAnalyticsSummary seems to be written on every page when the admin is signed in. And each time is making extra ajax calls that don’t need to be run at all.

    I’d suggest at the very least to add is_admin() to your GoogleAnalyticsSummary class;

    // google-analytics-summary-widget.php
    
    function GoogleAnalyticsSummary($shortcode = FALSE)
    {
          if( !is_admin() )
          {
                return; // don't need to show private info
          }

    https://wordpress.org/plugins/google-analyticator/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Until this is fixed, i suggest turning off the Dashboard Widget.

    This removes the JS erros (but also the widget in the Dashboard itself).

    Plugin Author Garrett Grimm

    (@grimmdude)

    Hi,

    An update has been pushed to temporarily disabled the [analytics] shortcode until this can be resolved.

    -Garrett

    Thread Starter Jesse Graupmann

    (@jgraup)

    Thanks for the quick response!

    FYI, I have 6.4.9.4 installed and I’m still seeing the ReferenceError: datelabel is not defined error when accessing a page with the shortcode (no user context, works fine if I’m logged in as the admin) The release notes seemed to imply this was fixed.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘6.4.9 – Uncaught ReferenceError: datelabel is not defined (possible solution)’ is closed to new replies.