Support » Plugin: Add Local Avatar » [Plugin: Add Local Avatar] Fatal Error on upgrade to version 9

  • wadams92101


    On updating to version 9, i received the following error message on my wp 3.01 multi-site network:

    Fatal error: Cannot redeclare class add_local_avatars in /var/www/vhosts/ on line 59

    Is it an error in the plugin?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Mike


    Sounds like it’s trying to load it more than once? How did you upgrade it?

    What version of PHP are you running?



    I upgraded via WP’s built-in automatic upgrade. It hasn’t caused any issues on the other upgrades. I think PHP is version 5.2. Its definitely in the 5s.



    The class is only declared once so you shouldn’t be getting that error. Some possibilities: it may have been corrupted as part of the upgrade process, or some other plugin is using the same class name, or you may have it in there more than once…

    Version 9 adds better WPMU/Network support by storing the options network wide rather than on a per blog basis. To make full use of it, you should move the add-local-avatar folder into your mu-plugins folder, then copy or move add-local-avatar/avatars.php into mu-plugins (eg up a folder). Your options are now located under Site Admin > Avatars

    What I’m getting at is you may need to do some moving around so you may want to try uninstall the plugin, delete it, download the latest and install.

    If it still doesn’t work, try doing the following to avatars.php:

    add to line 58:
    if (!class_exists('add_local_avatars')) {

    add to line 871:
    } // end if



    I’m afraid I had the same problem. I recovered my blog by renaming the add-local-avatar folder (to add-local-avatar-old). This allowed me to delete the plugin using the plugin dashboard.

    I then downloaded the latest version. However, I then got the error message:

    “Plugin could not be activated because it triggered a fatal error.

    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in …/wp-content/plugins/add-local-avatar/avatars.php on line 61″

    So, for now, I’m deleting the plugin.



    Dear Michael: Thank you for your help. (Are you one of the plugin developers?) I use the plugin in combination with Author List Plugin to display author avatars by widget in a sidebar. Each blog in the network has its own unique combination of authors. If I move this plugin into MU-Plugins, do I lose the ability to have different authors for different network blogs? Do I lose the menu in Users>Avatars? Its ironic that the upgrade was done for use in a multi-site network since mine is a WPMU installation converted to a 3.01 multi-site network, in which the old Avatars plugin worked fine both in MU and in 3.01.



    @obhi: When making a backup of your plugin folder, you should make sure you take it out of your wp-plugins (or mu-plugins) folder as well! WordPress will read everything found in those folders. Also, make sure you are running PHP5 for version 9 as it has been converted to a class.

    @wadams92101: I supplied the changes to version 9, mostly around WPMU/Network tweaks. In larger WPMU/Network environments where you can have many different blog administrators (think, you don’t want to allow them to change options like which directory the avatars are stored in. Instead, you should set these ‘global’ options once to apply across the entire network. The options now require a site/network admin and appear under Super Admin > Avatars. It still operates in the same manner as before so I don’t expect any issues with the other plugins you use.

    When installed under mu-plugins, it is activated across the entire network. It will still work the same if it is in the plugins folder but you’ll need to enable it on each site/blog.

    I’m a WPMU to 301 Network convert too 🙂

    I am having the same error as obhi and am running in PHP 5.2.8
    I updated the plug-in through the WP automatic update and received this error:

    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /home/…/public_html/../../wp-content/plugins/add-local-avatar/avatars.php on line 61

    With that, I currently have the plug-in deactivated.

    Those getting

    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’…

    Make sure you’re running PHP5! Your cpanel may report PHP5 but that may not be the case for where WordPress is installed.

    Others have reported the same too.

    Thank you, I changed my PHP configuration and everything is working fine now.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: Add Local Avatar] Fatal Error on upgrade to version 9’ is closed to new replies.