Google Analytics Dashboard
Fix for PHP notice (4 posts)

  1. Simon Wheatley
    Code for the People
    Posted 2 years ago #


    When I run this plugin I see an error:

    Notice: has_cap was called with an argument that is <strong>deprecated</strong>
    since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles
    and capabilities instead. in /srv/www/wordpress-default/wp-includes/functions.php
    on line 2923

    This is caused by line 70 in gad-admin-options.php, which specifies a user level 8 when adding the options page. User level 8 is equivalent to an administrator, so replacing 8 with manage_options will work just as well.

    Here's a gist with a patch: https://gist.github.com/simonwheatley/5850804

    Hope this helps.




  2. Simon Wheatley
    Code for the People
    Posted 2 years ago #

    Here's another notice I, errr, noticed…

    When I go to authenticate, I see the following error:

    Notice: Undefined variable: gauth in
    on line 279

    This is caused by trying to pass $gauth into GADAdminOptionsUI::display_admin_handle_login_options, when that variable does not exist in that context.

    Here's a gist with some options for patching: https://gist.github.com/simonwheatley/5850989

    Hope this helps.

  3. rossanthony
    Posted 2 years ago #

    Hi Carson,

    Great plugin, appreciate your efforts in developing this! Concerning the errors mentioned above, I'm curious to know whether it is still under active development and whether you plan on releasing an update with these fixes included? I've applied both of the suggested patches above and the PHP notices are now gone. However I encountered another one, pertaining to the dashboard widget...

    Notice: Undefined index: dashboard_gad in /wp-admin/includes/dashboard.php on line 130

    Changing wp_register_sidebar_widget() to wp_add_dashboard_widget() in gad-admin-dashboard.php seems to resolve it...


  4. Justin
    Posted 2 years ago #

    Just as an FYI, you must turn on: define('WP_DEBUG', true); in wp-config.php to see these errors/notices.

    Please fix them in the plugin devs!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Google Analytics Dashboard
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic