6.4.9 – Uncaught ReferenceError: datelabel is not defined (possible solution)
-
“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 }
Viewing 4 replies - 1 through 4 (of 4 total)
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.