• Just upgraded this plugin and received the following message:

    Warning: Invalid argument supplied for foreach() in /home/xxx/public_html/wp-content/plugins/stats/stats.php on line 132

    I had to deactivate the plugin by renaming the folder via ftp in order to access my admin panel, as this error made it inaccessible. I tried a fresh install (downloaded most recent version of Stats), but the same error occurred.

    I now have it deactivated (renamed the folder via ftp).

    Hopefully this information will help you fix the upgrade.

    https://www.ads-software.com/extend/plugins/stats/

Viewing 3 replies - 1 through 3 (of 3 total)
  • I just got a similar error when I upgraded.

    Upgraded from 1.6.3 to 1.7.2

    WordPress ver: 2.9.2

    Error message:
    Warning: Invalid argument supplied for foreach() in /home/<my directory structure removed>/wp-content/plugins/stats/stats.php on line 134

    I get this error message in the header on each page of the admin section, and on the Dashboard in the WordPress Development Blog, Other WordPress news and Plugins sections.

    The Stats widget header appears on the Dashboard, but nothing displays. And there is no Site Stats menu item.

    There doesn’t appear to be any errors on the site.

    I have the same problem:

    Warning: Invalid argument supplied for foreach() in …/wp-content/plugins/stats/stats.php on line 134

    I upgraded to WP 3.0 and to the latest version of the plugin in one swoop. Not sure which of these two steps cause the problem.

    The offending line has:


    foreach ( $roles as $role ) {
    if ( current_user_can($role) ) {
    $cap = $role;
    break;
    }
    }

    So, I don’t know if WP 3.0 doesn’t define $roles = stats_get_option('roles'); any more.

    I am getting the same error, but only on the sites that are updated via SVN and manual plugin upgrades. WP 3.0, Stats 1.7.2 (rolled back to 1.6.3 because it still works)

    Another site I manage is on a hosting provider and is a “one-click” WP install, using the single-click upgrade buttons etc. On that site WP 3.0 with Stats 1.7.2 works just fine.

    Still not sure what the difference is, unless it has something to do with the hosted site having more than one user and the others being one user only.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: WordPress.com Stats] Error message after upgrade’ is closed to new replies.