Avatars plugin - enhancements

Hi all!

We made major enhancements to the Avatars plugin and released version 3.5.0.
https://premium.wpmudev.org/project/avatars

1- The installation procedure is now very easy. Just upload the plugin files to your mu-plugins folder and that's it (no more files to upload to several locations, no more editing of the .htacces file, etc.).
2- The avatars upload folder has changed: now 'wp-content/uploads/avatars' instead of 'wp-content/avatars'.
3- The users avatar is now on the user profile page.
4- The plugin is now translation ready.
5- Various enhancements and bug fixes.

Note: The plugin will not work with BuddyPress since the latter has its own avatar system. You will get an admin notice when you try to use both and the Avatars plugin functions will be disabled.

Upgrade from old versions
To upgrade from old versions, remove all the old plugin files from the folders 'mu-plugins' and 'wp-content', and the line you added to the .htaccess when you installed the previous version. Then, upload the new files to the 'mu-plugins' folder.

Don't hesitate to use it and let us know what you think.

Thanks,
Ulrich

  • rpawly
    • The Incredible Code Injector

    tried to upgrade

    getting error

    Fatal error: Cannot redeclare avatar_display_posts() (previously declared in /home/philippi/public_html/wp-content/mu-plugins/avatar-posts.php:47) in /home/philippi/public_html/wp-content/mu-plugins/avatars.php on line 1437

    uploads is 755

  • Mason
    • DEV MAN’s Sidekick

    Hiya rpawly,

    You need to delete all files from the original avatars plugin.

    Here's the list:
    avatars.php - goes in /wp-content/mu-plugins
    widget-avatar.php - goes in /wp-content/mu-plugins
    avatar-comments.php - goes in /wp-content/mu-plugins
    avatar-posts.php - goes in /wp-content/mu-plugins
    avatar.php - goes in /wp-content
    default-avatar-128.png - goes in /wp-content
    default-avatar-96.png - goes in /wp-content
    default-avatar-48.png - goes in /wp-content
    default-avatar-32.png - goes in /wp-content
    default-avatar-16.png - goes in /wp-content

    Then make sure you add in the new avatars.php file and avatar-files directory.

    You should be back up at that point! Thanks!

  • Ovidiu
    • Code Wrangler

    ok, moved them manually and set the proper permissions.
    could you have a look here and give me your bvest guess about what is wrong here?
    http://zice.ro/informatii/zice-ro-se-extinde/

    some avatars appear, some do not appear and some are mystery man...

    I deleted my previous files (those of the plugin as listed by mason above) deleted the .htaccess line and deleted the rewrite I used in my nginx proxy config.

    How does this current version of the plugin handle the avatars if not via .htaccess fileß

  • drmike
    • DEV MAN’s Mascot

    mystery man

    That was a fun movie. Soundtrack was even better...

    The broken ones appear to be yours:

    http://zice.ro/avatar/user-1-48.png

    That redirects back to the home page. (An aside: I for one would rather see 404s handled within the blog that it's coming from. Not sure how you handle yours or if this is a true 404. Had to see folks get off of the blog that they're on. Just an opinion.)

    deleted the .htaccess line

    Can you check to see if the edit took place? With some setups with the htaccess being owned by the webserver, you may have to make the edit as root. (I;m sure you;re aware of that but wanted to mention it.)

  • Ulrich
    • The Crimson Coder

    could you have a look here and give me your bvest guess about what is wrong here?

    E.g. http://zice.ro/avatar/user-1-48.png: the server returns "HTTP/1.1 301 Moved Permanently, Location: http://zice.ro/". There should be a rewrite rule or something which redirect the avatar urls to the main blog homepage.

    How does this current version of the plugin handle the avatars if not via .htaccess fileß

    It uses the WordPress Rewrite API with internal rewrite rules.

  • Ovidiu
    • Code Wrangler

    :slight_frown:

    its nginx. somehow. if I try to sniff (via: http://web-sniffer.net/) the headers for: http://zice.ro:82/avatar/user-1-48.png which is the back end apache2 server it gives me status 200...

    formerly nginx conf had this config (concerning rewriting and avatar handling):

    location ~*  \.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf|flv|html|htm|mp3)$ {
                    rewrite ^.*/files/(.*) /wp-includes/ms-files.php?file=$1;
                    rewrite ^.*/avatar/(.*) /wp-content/avatar.php?file=$1;
                           if (!-e $request_filename) {
                                    rewrite ^.+?(/wp-.*) $1 last;
                                    rewrite ^.+?(/.*\.php)$ $1 last;
                                    rewrite ^ /index.php last;
    }

    after upgrading to this new avatars edition I deleted this line: rewrite ^.*/avatar/(.*) /wp-content/avatar.php?file=$1;

    and the line inside apache's .htaccess file. @drmike: yes, its deleted.
    after looking again at the line I deleted, I am quite sure I was supposed to alter not delete it. anyone can help out here?

  • jcnjr
    • HummingBird

    Let's just say I'm happy I tried the Avatars 3.5 upgrade on our dev install first, but I digress... :wink:

    After the upgrade all avatars sitewide were replaced by the default because the files were not moved automatically. The install.txt file had no mention of needing to move the avatars directoy. I also suggest updating the install instructions regarding the deletion of ALL old files and the .htaccess rewrite rule required in the previous version. The omission of widget-avatar.php was especially confusing without explanation.

    After confirming all old files were removed, moving the avatars directory, double-checking write permissions, and deleting the rewrite rule, avatars are now appearing as expected again, but I am unable to upload a user avatar using either method. See attached screenshot.

    I was, however, able to upload a blog avatar. The only difference I noticed being that when attempting to move the avatars directory, the avatars/blogs/ directory did not copy over. In fact it got deleted. :-\ So when that avatar was uploaded its folder and files were created properly. But avatar upload fails for the existing user avatar directory.

    Any suggestions are greatly appreciated. Thanks for all the hard work!

  • Ulrich
    • The Crimson Coder

    @jcnjr:

    The install.txt file had no mention of needing to move the avatars directoy.

    For most installs, the plugin will do it automatically. We did not include it because we wanted to simplify the install instructions. An admin notice is displayed when the plugin is unable to move the directory. Did you get the notice?

    But avatar upload fails for the existing user avatar directory.
    Any suggestions are greatly appreciated.

    Maybe the web server user is unable to write in that directory? Try changing the folder permission to 777 and see if it works. Then try a more restrictive permission.

    Thanks for all the hard work!

    You are welcome. :slight_smile:
    We will improve the support for files and folders permissions in the next release.

  • drmike
    • DEV MAN’s Mascot

    The floating crop has come up before. You're using IE as a browser and I believe you;re loading two different versions of jquery. Can you please check to see if this is occurring? The links will be in your head for the outputted html.

  • jcnjr
    • HummingBird

    @Ulrich I did get the admin notice, but the issue occurs with permissions set to 777.

    @drmike I don't use IE, the issue occurs with both Firefox and Safari. I don't notice jquery loading twice, the only scripts making any reference to jquery are as follows, the first is in the header, the latter in the footer...

    /wp-includes/js/jquery/jquery.js?ver=1.4.2
    /wp-includes/js/jquery/jquery.color.js?ver=2.0-4561m

  • jcnjr
    • HummingBird

    Absolutely nothing in the error logs, for once! Error Console reports the following...

    Upon clicking Change Avatar:
    Error: document.getElementById(this.divName) is null
    Source File: http://tripawds.net/wp-includes/js/colorpicker.js?ver=3517m
    Line: 1

    Upon clicking Browse:
    Error: Permission denied to access property 'parentNode' from a non-chrome context
    Source File: http://tripawds.net/wp-includes/js/colorpicker.js?ver=3517m
    Line: 1

    Upon clicking Upload:
    Error: document.getElementById(this.divName) is null
    Source File: http://tripawds.net/wp-includes/js/colorpicker.js?ver=3517m
    Line: 1

    Thanks for the feedback.

  • shuin
    • New Recruit

    Hey guys,
    I'm also having trouble seeing any of my avatars, the old plugin worked for me and I have upgraded and now neither upload function displays any image (its a blank box not mystery man).
    The site is in development so loss of avatars wasn't an issue. I deleted and replaced the whole avatar plugin with the new one and have set all the relevant folders to 777 permissions to make sure it wasn't an access issue.

    Earlier I had some file size issues which seem strange but I increased the respective files php limits to fix this error, no other errors are displaying.

    as an example a few of the avatars should be displaying in the recent global posts widget located on http://www.thehappychildren.com.au

    I just hired a dev guy who has been great and the site was nearly good to go, I wish I had made a backup of my old avatars plugin! Thanks for all the great plugins guys once I can balance them all so my site is functional they are key to making my little network work

  • jcnjr
    • HummingBird

    Thanks for the update! Any feedback regarding the following screenshot and error I received upon attempted upload is greatly appreciated. Permissions for Uploads, Avatars, Blog and User are all set to 777, public_html is 750, wp-content and individual user directories (ie; c4c) are 755 ...

    Warning: move_uploaded_file(/home/triblogs/public_html/wp-content/uploads/avatars/user/c4c/mobarneys.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/triblogs/public_html/wp-content/mu-plugins/avatars.php on line 838

    Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpadYCmk' to '/home/triblogs/public_html/wp-content/uploads/avatars/user/c4c/mobarneys.jpg' in /home/triblogs/public_html/wp-content/mu-plugins/avatars.php on line 838
    There was an error uploading the file, please try again.

    Warning: getimagesize(/home/triblogs/public_html/wp-content/uploads/avatars/user/c4c/mobarneys.jpg) [function.getimagesize]: failed to open stream: No such file or directory in /home/triblogs/public_html/wp-content/mu-plugins/avatars.php on line 844

  • jcnjr
    • HummingBird

    FYI: Using the Alternative Upload generated even more errors but I had to dig them out of the error log since the screen just flashed quickly and returned to the upload page ...

    PHP Warning: unlink(/home/triblogs/public_html/wp-content/uploads/avatars/user/c4c/mobarneys.jpg) [function.unlink]: No such file or directory in /home/triblogs/public_html/wp-content/mu-plugins/avatars.php on line 1340, referer: http://tripawds.net/wp-admin/profile.php?page=user-avatar
    PHP Warning: chmod() [function.chmod]: No such file or directory in /home/triblogs/public_html/wp-content/mu-plugins/avatars.php on line 1339, referer: http://tripawds.net/wp-admin/profile.php?page=user-avatar
    PHP Warning: imagepng() [function.imagepng]: Unable to open '/home/triblogs/public_html/wp-content/uploads/avatars/user/c4c/user-1-16.png' for writing: Permission denied in /home/triblogs/public_html/wp-content/mu-plugins/avatars.php on line 915, referer: http://tripawds.net/wp-admin/profile.php?page=user-avatar
    PHP Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/triblogs/public_html/wp-content/mu-plugins/avatars.php on line 911, referer: http://tripawds.net/wp-admin/profile.php?page=user-avatar
    PHP Warning: imagepng() [function.imagepng]: Unable to open '/home/triblogs/public_html/wp-content/uploads/avatars/user/c4c/user-1-32.png' for writing: Permission denied in /home/triblogs/public_html/wp-content/mu-plugins/avatars.php on line 907, referer: http://tripawds.net/wp-admin/profile.php?page=user-avatar
    PHP Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/triblogs/public_html/wp-content/mu-plugins/avatars.php on line 903, referer: http://tripawds.net/wp-admin/profile.php?page=user-avatar
    PHP Warning: imagepng() [function.imagepng]: Unable to open '/home/triblogs/public_html/wp-content/uploads/avatars/user/c4c/user-1-48.png' for writing: Permission denied in /home/triblogs/public_html/wp-content/mu-plugins/avatars.php on line 899, referer: http://tripawds.net/wp-admin/profile.php?page=user-avatar
    PHP Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/triblogs/public_html/wp-content/mu-plugins/avatars.php on line 895, referer: http://tripawds.net/wp-admin/profile.php?page=user-avatar
    PHP Warning: imagepng() [function.imagepng]: Unable to open '/home/triblogs/public_html/wp-content/uploads/avatars/user/c4c/user-1-96.png' for writing: Permission denied in /home/triblogs/public_html/wp-content/mu-plugins/avatars.php on line 891, referer: http://tripawds.net/wp-admin/profile.php?page=user-avatar
    PHP Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/triblogs/public_html/wp-content/mu-plugins/avatars.php on line 887, referer: http://tripawds.net/wp-admin/profile.php?page=user-avatar
    PHP Warning: imagepng() [function.imagepng]: Unable to open '/home/triblogs/public_html/wp-content/uploads/avatars/user/c4c/user-1-128.png' for writing: Permission denied in /home/triblogs/public_html/wp-content/mu-plugins/avatars.php on line 883, referer: http://tripawds.net/wp-admin/profile.php?page=user-avatar
    PHP Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/triblogs/public_html/wp-content/mu-plugins/avatars.php on line 879, referer: http://tripawds.net/wp-admin/profile.php?page=user-avatar
    PHP Warning: imagecreatefromjpeg(/home/triblogs/public_html/wp-content/uploads/avatars/user/c4c/mobarneys.jpg) [function.imagecreatefromjpeg]: failed to open stream: No such file or directory in /home/triblogs/public_html/wp-content/mu-plugins/avatars.php on line 867, referer: http://tripawds.net/wp-admin/profile.php?page=user-avatar

  • jcnjr
    • HummingBird

    "Try setting the folder 'c4c' permissions to 777..."

    Well, doing that allowed me to get as far as the crop page, but upon clicking the crop button i still get the errors below. I had actually set permissions to 777 for all these directories: wp-content/uploads/avatars/user/c4c

    PHP Warning: imagepng() [function.imagepng]: Unable to open '/home/triblogs/public_html/wp-content/uploads/avatars/user/c4c/user-1-16.png' for writing: Permission denied in /home/triblogs/public_html/wp-content/mu-plugins/avatars.php on line 1043, referer: http://tripawds.net/wp-admin/users.php?page=user-avatar&action=upload_process
    PHP Warning: imagepng() [function.imagepng]: Unable to open '/home/triblogs/public_html/wp-content/uploads/avatars/user/c4c/user-1-32.png' for writing: Permission denied in /home/triblogs/public_html/wp-content/mu-plugins/avatars.php on line 1033, referer: http://tripawds.net/wp-admin/users.php?page=user-avatar&action=upload_process
    PHP Warning: imagepng() [function.imagepng]: Unable to open '/home/triblogs/public_html/wp-content/uploads/avatars/user/c4c/user-1-48.png' for writing: Permission denied in /home/triblogs/public_html/wp-content/mu-plugins/avatars.php on line 1023, referer: http://tripawds.net/wp-admin/users.php?page=user-avatar&action=upload_process
    PHP Warning: imagepng() [function.imagepng]: Unable to open '/home/triblogs/public_html/wp-content/uploads/avatars/user/c4c/user-1-96.png' for writing: Permission denied in /home/triblogs/public_html/wp-content/mu-plugins/avatars.php on line 1013, referer: http://tripawds.net/wp-admin/users.php?page=user-avatar&action=upload_process
    PHP Warning: imagepng() [function.imagepng]: Unable to open '/home/triblogs/public_html/wp-content/uploads/avatars/user/c4c/user-1-128.png' for writing: Permission denied in /home/triblogs/public_html/wp-content/mu-plugins/avatars.php on line 1003, referer: http://tripawds.net/wp-admin/users.php?page=user-avatar&action=upload_process

    Sorry to keep filling up this topic with these, just hoping they might prove helpful. Alternative upload throws the errors without ever reaching the crop page.

  • jcnjr
    • HummingBird

    Thanks for your help troubleshooting this! The directory "c4c" is for the user "Admin" – the primary Super Admin of the main site. The folder contains the following files:
    user-1-128.png
    user-1-16.png
    user-1-32.png
    user-1-48.png
    user-1-96.png

    Errors persist when attempting upload of new avatar for other test user accounts too.

  • jcnjr
    • HummingBird

    A bit more info that may be helpful, or not...

    Within our wp-content directory there is an avatars folder that cannot be deleted. Assuming this may have been a remnant of the previous plugin version, I deleted the folder only to have it regenerated when reloading the wp-content directory. It contains a user directory which contains a folder for c4c with the same files above.

    Is this expected behavior? :disappointed:

  • Ulrich
    • The Crimson Coder

    What is the name of the owner of the c4c folder and the files in that folder?

    Sorry if I have not been very detailed. When you look at the folder and files via ftp, what is the name of their owner?

    I deleted the folder only to have it regenerated when reloading the wp-content directory.

    Maybe that folder was not actually deleted? Please look at the logs in your ftp client and see if the delete was successful.

  • jcnjr
    • HummingBird

    Thanks again for your help with this.

    ...what is the name of their owner?

    The owner of all the directories and the files within is the primary username for the hosting account: triblogs

    Maybe that folder was not actually deleted?

    Yeah, interesting... I was finally able to successfully delete the old wp-content/avatars directory but the same errors I listed last still persist upon crop attempt.

    So... I manually changed the permissions of the avatar files themselves from 644 to 777, and was able to upload and crop the new avatar without any errors! Hopefully this little tidbit might help you determine what's going on. With over 2000 users, changing perms for all the files on our live site is not an option.

  • Ulrich
    • The Crimson Coder

    Please try following:
    1- set the permissions back to their default (644 for files and 755 for directories)
    2- move the avatars directory back to the wp-content directory
    3- visit the website admin page for the plugin
    4- verify if the avatars directory has been move or copied to the uploads directory (don't move it manually this time)
    5- try uploading avatars again

  • jcnjr
    • HummingBird

    1. OK
    2. OK
    3. The Admin dashboard page reported: "The Avatars plugin now store files in /home/triblogs/public_html/wp-content/uploads/avatars/. Please move your old folder."
    4. wp-content/uploads/avatars directory was created but empty with no user or blog subdirectories.
    5. Uploaded new user avatar without error.

    At this point, the avatars/user directory was created, and within that "c4c" was created with the new avatars. No other user directories were moved, nor was the blog directory. And the old avatars directory was not deleted. (A good thing I suppose!) So, all avatars sitewide reverted to the default.

    I then attempted to manually move remaining user avatar directories, but after doing so I get the following errors upon attempted upload of new avatar for test user account:

    Warning: move_uploaded_file(/home/triblogs/public_html/wp-content/uploads/avatars/user/c0f/jerrytar-toungue.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/triblogs/public_html/wp-content/mu-plugins/avatars.php on line 838

    Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpnwct1y' to '/home/triblogs/public_html/wp-content/uploads/avatars/user/c0f/jerrytar-toungue.jpg' in /home/triblogs/public_html/wp-content/mu-plugins/avatars.php on line 838
    There was an error uploading the file, please try again.

    Warning: getimagesize(/home/triblogs/public_html/wp-content/uploads/avatars/user/c0f/jerrytar-toungue.jpg) [function.getimagesize]: failed to open stream: No such file or directory in /home/triblogs/public_html/wp-content/mu-plugins/avatars.php on line 844

    Current avatars do display properly, but new ones cannot be uploaded for any existing user (or blog).

    <sigh>

    Any advice for how to make this go more smoothly on our live site is greatly appreciated. Thanks again.

    Am I the only one experiencing such issues? Anyone else?

  • Ulrich
    • The Crimson Coder

    OK. I think this is an issue with the owner of the files. It should have been the webserver user instead of the username of your hosting account (I think your host does not have suPHP or alike installed so the script run under a different user than your hosting/ftp user and it cannot modify/copy/move these files). I am wondering why the owner changed, perhaps while moving the folder to the new destination. So, I will not recommend moving the folder manually anymore, since this can cause permission issues (I will remove that recommendation from the next version of the plugin).

    The following steps should fix the issue you have:
    1- move the avatars directory back to the wp-content directory (if it was still there, that's fine, just remove wp-content/uploads/avatars)
    2- change the permissions of the avatars directory and its content to 777 so that the script can copy them
    3- visit the admin page of the plugin
    4- verify if the avatars directory and its content has been moved or copied to the uploads directory
    5- try uploading avatars again

    Any advice for how to make this go more smoothly on our live site is greatly appreciated. Thanks again.

    With the latest version of the plugin, there should be no issue on your live site.

  • jcnjr
    • HummingBird

    4- verify if the avatars directory and its content has been moved or copied to the uploads directory

    Followed all your directions, but again the uploads/avatars directory was created but no blog or user folders and files were moved to it.

    This time, I checked the error log and found the following:

    [Mon Dec 13 20:02:04 2010] [error] PHP Warning: copy() [function.copy]: The first argument to copy() function cannot be a directory in /home/triblogs/public_html/wp-admin/includes/class-wp-filesystem-direct.php on line 200, referer: http://tripawds.net/wp-admin/

    At this point I (admin, user c4c) was able to upload a new user avatar without error. The c4c directory and my avatars were created, but all other avatars sitewide have reverted to the default since I did not manually move the files.

    Since the above error is different from previous ones, I'm hoping it sheds a brighter light on this issue. I'm not quite ready to attempt this on our live site. Thanks again!

  • jcnjr
    • HummingBird

    Update: I've been working with our server manager on this and here is his latest reply...

    "What's going on here is that Apache runs as the user nobody for security reasons. This is the default cpanel setup. When files get written via php script, they end up being owned by nobody. Users triblogs and tripawds each have a number of files and directories owned by nobody. How we normally approach this is to chown all of the nobody files back to the original user, which I've done for triblogs. Before I did that I took a list of all of the files owned by nobody in the file nobody-files-12-13.out in case we need to switch back. Your script should work fine now."

    Alas, the script does not work fine. I followed your instructions again after reviewing this, and the results were the same. uploads/avatars dir. got created, but no files were moved. After manually moving the files the error ocurrs upon upload.

  • Ulrich
    • The Crimson Coder

    How we normally approach this is to chown all of the nobody files back to the original user, which I've done for triblogs.

    I don't understand very well. You wrote the following in a previous message: "The owner of all the directories and the files within is the primary username for the hosting account: triblogs"
    Please can you explain? It is a little confusing for me since you told me the owner of the files was triblogs, not nobody.

    Please replace your avatars.php by the attached one and do the testing again.

  • jcnjr
    • HummingBird

    you told me the owner of the files was triblogs...

    It was, but I just learned that moving directories or files will change their ownership so that's probably what happened.

    Please replace your avatars.php by the attached one...

    The files were not moved at first, but the plugins messages worked perfectly and I got no other errors, after changing permissions of uploads/ the avatars folder and all its contents were successfully moved when I reloaded profile.php. I then successfully uploaded a new avatar without any errors!

    Is this avatars.php something specific you did to address my issue, or is it a new version to be released soon? I notice the version still states 3.5.1.

    Thank you very much for your work on this!

  • Ulrich
    • The Crimson Coder

    Version 3.5.2 of the plugin has been released.

    Changelog:
    - Enhancement: no avatar for pingbacks and trackbacks
    - Enhancement: added 'alt' parameter to get_avatar
    - Enhancement: better filesystem handling
    - Bug fix: images missing on admin page "Settings > Discussion"

  • drmike
    • DEV MAN’s Mascot

    I'd like to throw out a suggestion or two if I may:

    - Multiple avatars for users. Keep the old ones and have a page to see which ones are there.

    - The ability to switch between the different avatars. Occasionally I like to display one of my older ones for a bit. Like a holiday avatar.

  • jcnjr
    • HummingBird

    aargh...

    Well, I attempted the upgrade for our live site and all hell broke loose. :-\

    First, I got the following fatal error immediately after the update and the whole site was down.

    Fatal error: Cannot redeclare avatar_display_posts() in /home/tripawds/public_html/wp-content/mu-plugins/avatars.php on line 1461

    Then I remembered to edit the avatars rewrite rule out of .htaccess and remove the stray files from the previous plugin version.

    The site s now back up, and I receive no error messages when attempting to upload an avatar. But no avatars display anywhere. Not even on the Profile page. A newly uploaded avatar will show on the crop page, but once cropped, no avatar shows there, or anywhere else where they should throughout the site.

    I've confirmed all the avatars directories and files were moved to uploads/ and made sure all old plugin files are gone. I'm receiving no more errors in the logs, and have cleared my cache, but still no avatars show anywhere. Any thoughts?

  • jcnjr
    • HummingBird

    Update: I deleted the old avatars/ folder, re-uploaded the plugin and confirmed all directory and file locations and permissions. Here's the interesting thing now...

    Avatars display as they should here:
    Friends Widget
    Blog Comments
    Supporter Blogs Widget
    Recent Blogs Widget

    Avatars do NOT display here:
    User Profile Page
    Blog Avatar Widget
    Recent Global Posts
    Recent Global Comments
    SimplePress Discussion Forums

    Avatars are working properly everywhere listed above on our test install.

    Question
    When right clicking any avatar, I notice the image location shows avatars/ as located in the root directory.
    Example: tripawds.com/avatar/blog-179-32.png
    Is that normal?

    Thanks again for your help!

  • jcnjr
    • HummingBird

    Some recent errors, in case they help:

    [Fri Dec 17 15:14:42 2010] [error] File does not exist: /home/tripawds/public_html/wp-content/uploads/avatars/user/c4c/user-1-128.png, referer: http://tripawds.com/wp-admin/users.php?page=user-avatar&action=upload_process

    [Fri Dec 17 12:22:32 2010] [error] [client 66.249.68.21] PHP Fatal error: Cannot redeclare avatar_display_posts() in /home/tripawds/public_html/wp-content/mu-plugins/avatars.php on line 1461

    There's plenty more like that...

  • Ulrich
    • The Crimson Coder

    @drmike:
    Thanks for the suggestions.

    @jcnjr:

    Example: tripawds.com/avatar/blog-179-32.png
    Is that normal?

    Yes. The plugin uses a rewrite rule to find the avatars.

    [Fri Dec 17 15:14:42 2010] [error] File does not exist: /home/tripawds/public_html/wp-content/uploads/avatars/user/c4c/user-1-128.png, referer: http://tripawds.com/wp-admin/users.php?page=user-avatar&action=upload_process

    Can you manually check if that file exists?

    [Fri Dec 17 12:22:32 2010] [error] [client 66.249.68.21] PHP Fatal error: Cannot redeclare avatar_display_posts() in /home/tripawds/public_html/wp-content/mu-plugins/avatars.php on line 1461

    Did this error appear after you removed the old files? The only thing which can be cause this is the existence of another file which contains the function 'avatar_display_posts'.

  • jcnjr
    • HummingBird

    The plugin uses a rewrite rule to find the avatars.

    I thought so, thanks for confirming that. I did remove the rewrite rule (required in the previous plugin version) from .htaccess, but didn't remember to do so until after the attempted update. Could that have caused a problem?

    ...check if that file exists?

    Yes, all the files exist where specified in the errors and can be viewed via cPanel.

    Did this error appear after you removed the old files?

    Looks like we haven't seen this error since removing the files.

    Now, get this!

    I just replaced avatars.php from the new plugin v.3.5.2 you posted with the attachment you provided above and everything appears to be working fine again. Not sure what the difference is, but that edited 3.5.1 version above works for us while the new one doesn't. I'd like to stay current, so I'm more than happy to help troubleshoot.

  • Ulrich
    • The Crimson Coder

    @jcnjr: Please can you put the new version back again and check the html code source of your page to see if the img tag are rendered at the places where the avatars should be displayed? and if there are img tags, please check their src attributes. And if src attributes are not empty post one of them here.

    @johnnymestizo: Thank you very much for the feedback. It is much appreciated. :slight_smile:

  • jcnjr
    • HummingBird

    FYI: Decided to troubleshoot using our test install ...

    1. Confirmed everything works as expected using avatars.php v3.5.1 (attached above)
    2. Uploaded avatars.php v.3.5.2 - avatars malfunction sitewide as indicate above (#post-69571)
    3. Viewed source code - No image tags where avatars should display on various pages.
    4. No image tags render on Profile page.
    5. Correct user avatar shows on blog post comments with tag rendered properly as such: img alt='' src='http//tripawds.net/avatar/user-775-48.png' class='avatar avatar-48 photo' height='48' width='48' /
    6. Correct blog avatar shows in Recent Blogs widget with tag rendered properly: img alt='' src='http://tripawds.net/avatar/blog-678-32.png' class='avatar avatar-32' height='32' width='32' /
    7. Friends Widget – Correct user avatars show with img tags rendered: img src="http://tripawds.net/avatar/user-1-32.png" alt="admin" title="admin" /
    8. Blog Avatar Widget – Correct blog avatar shows with img tags rendered: img alt='' src='http://tripawds.net/avatar/blog-678-128.png' class='avatar avatar-128' height='128' width='128' / (contradictory to above, but I was likely mistaken then.)
    9. No tags where they should be, so no src attributes to share...
    10. No errors in log during this time.
    11. Uploaded avatars.php v.3.5.1
    12. All Avatars functioning properly.

    Perhaps more info than you need, but hopefully something will help.

  • Heydar
    • Flash Drive

    Hi, have issues with this plugin on a new 3.0.3 multi-site install. Seems the rewrite rules does not work.
    I'm using nginx.
    The folders and images are created ok under /wp-content/uploads/avatars/ but when looking at the html src code it looks for an image as:
    http://domain.tld/avatar/user-1-96.png

    I have tried Ulrich's suggestion to add the following to the nginx conf:

    rewrite ^.*/avatar/(.*) /index.php?avatar=$1;

    Still no picture is shown and the src is still looking at http://domain.tld/avatar/user-1-96.png

    What have I done wrong?

  • Heydar
    • Flash Drive

    Think I solved it with the following nginx conf

    location /
    {
    root /path/to/wordpress;
    index index.html index.php;
    gzip on;
    gzip_http_version 1.0;
    gzip_vary on;
    gzip_comp_level 3;
    gzip_proxied any;
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
    gzip_buffers 16 8k;</p>
    <p> if (!-e $request_filename) {
    rewrite ^.+/?(/ms-.*) $1 last;
    rewrite ^/files/(.+) /wp-includes/ms-files.php?file=$1 last;
    rewrite ^.+/?(/wp-.*) $1 last;
    rewrite ^.+/?(/.*\.php)$ $1 last;
    rewrite ^(.+)$ /index.php?q=$1 last;
    expires 10d;
    break;
    }</p>
    <p> # if the request starts with our frontcontroller, pass it on to fastcgi
    location ~ \.php
    {
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME /path/to/wordpress$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_script_name;
    include /etc/nginx/fastcgi_params;
    }
    }
    location ~* ^.+.(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$
    {
    root /path/to/wordpress;
    rewrite ^/.*(/wp-.*/.*.(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js))$ $1 last;
    rewrite ^.*/files/(.*(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js))$ /wp-includes/ms-files.php?file=$1 last;
    if (!-e $request_filename) {
    rewrite ^.+/?(/wp-.*) $1 last;
    rewrite ^.+/?(/.*.php)$ $1 last;
    rewrite ^(.+)$ /index.php?q=$1 last;
    }</p>
    <p> expires 30d;
    break;
    }
    }

    Thanks to this post

  • drmike
    • DEV MAN’s Mascot

    gzip on;

    Just curious. Are you using any sort of caching and, if so, do you have gzip on there? I know the two gzips when folks have done that have caused conflicts in the past. Not saying it so in this case but I noticed that and wanted to point it out.

  • jcnjr
    • HummingBird

    UPDATE: I just noticed an interesting new anomaly when attempting to directly view user avatars in the browser. While avatars are displaying site wide and in the backend, when attempting to view an avatar image file directly, the browser loads a bunch of garbage code.

    Look at this:
    http://tripawds.com/avatar/user-1-96.png

    But default avatars load just fine:
    http://tripawds.com/wp-content/mu-plugins/avatars-files/images/default-avatar-96.png

    Could this be an issue with the rewrite rule? Or the fact that I neglected to remove the previously required (3.4.x) avatars rewrite rule before attempting the update? If so the install text really should address plugin upgrades, and any suggestions for resolving my issue are greatly appreciated.

    I'm hoping this might help determine what's going on with the issues we've been discussing here. Perhaps it might also have something to do with why avatar images are taking so long to load on our site. In our discussion forums and many blogs with the Friends widget, avatars follow the loaded page by up to a few seconds. For an example, see the Friends widget here.

    FYI: We are still running v. 3.5.1

  • drmike
    • DEV MAN’s Mascot

    Does it only do that for *.png's? What happens if the avatar is a *.jpg?

    May be a server issue. In the first url, the file is loading directly. In the second example, it's wordpress that's serving the file.

    Can you check to see if your webserver has support for *.png please?

  • jcnjr
    • HummingBird

    In the first url, the file is loading directly. In the second example, it's wordpress that's serving the file.

    But the first url involves some sort of re-write rule since there is no avatars directory in the root, where as the second url is a direct path to an actual image file location... ?

    check to see if your webserver has support for *.png

    Server does support png files – jpegs, gifs and pngs all load directly:
    http://www.tripawds.com/~holding_tank/1232309942.jpg
    http://www.tripawds.com/~holding_tank/1243383785.gif
    http://www.tripawds.com/~holding_tank/barneycon1.png

    FYI: This is a new issue since our attempted avatars plugin upgrade. I had previously been able to directly view and download avatar image files.

  • jcnjr
    • HummingBird

    Definitely some sort of rewrite issue going on here. After removing all Avatars plugin files, I confirmed our server would display the avatar images at their direct path:
    http://tripawds.net/wp-content/uploads/avatars/user/013/user-138-96.png

    I then reinstalled the plugin (v.3.5.1) and attempted to load the avatar via the rewrite location:
    http://tripawds.net/avatar/user-138-96.png

    The image will still load at the former url, but you can see, the latter url renders garbage. And as illustrated at the following url, Wordpress will render the avatar, but it takes its sweet time.
    http://tripawds.net/forums/profile/Smokey/

    I then tested all of the above with avatars.php v.3.5.2 and got the same results via direct image paths, while Wordpress failed to render the image tags. (v.3.5.1 has since been replaced)

    Hopefully we can help get this resolved after the new year. Have a good one!

  • jcnjr
    • HummingBird

    Hmmm... replaced avatars.php and avatar.php with the files you posted (in their proper locations) and am still having the same symptoms:

    No user or blog avatars displaying site-wide (in posts, or comments, etc.) or in the backend. No image tags are being rendered.

    Avatar upload and crop works without error, but the avatar does not show on the profile page. Viewing via ftp confirms file did upload and all avatar thumbnails produced.

    Avatars DO Show in:
    - Avatars widget
    - Friends widget

    Avatars DO NOT Show in:
    - Recent Global Posts widget
    - Recent Global Comments widget

    Thanks again.

  • jcnjr
    • HummingBird

    verify if "Show Avatars" is checked

    :-\ I feel like the guy that just spent an hour on the phone with tech support, only for them to say, "Sir, is your computer plugged in?" Yeah, I'm that guy.

    After showing avatars via Discussion settings, they seem to be showing where they should on our test site. I'm pretty sure I've got your 3.5.3 alpha files from above, but the version in the file still reads 3.5.2.

    Got some more testing to do before updating our live site... after removing all Avatars plugin files there a few days ago, members are reporting a noticeable improvement in site performance. Still troubleshooting other issues to confirm if this is a coincidence or related issue.

    Thanks again for all your hard work. Looking forward to the 3.5.3 release.

  • jcnjr
    • HummingBird

    <sigh> I attempted updating the plugin with the latest files 3.5.2 posted on the Plugins page, and now the entire site fails to load. I was updating Anti-Splog around the same time, so i can't tell what caused the problem, but it persists even after removing ALL files for both plugins. See this new topic for details.

    FYI: The header loads but the page stops loading where the first avatar usually displays.

    Sorry for all this, and thanks again for any help you can provide.

  • jcnjr
    • HummingBird

    I was updating Anti-Splog around the same time...

    You can breathe a sigh of relief Ulrich! That problem appears to have been related to the Anti-Splog update. Everything appears to be working fine with the latest Avatars.

    Can't thank you enough for all you efforts here. But I'll try: Thank You!

  • kingdomtools
    • Design Lord, Child of Thor

    I installed Avatars (including the avatar_BBpress.php) and get the following error:

    "BuddyPress has it's own avatar system. The Avatars plugin functions have been deactivated. Please remove the files"

    I have been having issues with the avatars from day 1, and would appreciate an assist to figure this out.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.