WordPress.org

Ready to get started?Download WordPress

Forums

User Avatar
[resolved] PHP warnings in 1.4.1 (27 posts)

  1. Gabriel Serafini
    Member
    Posted 2 years ago #

    I just upgraded to User Avatars version 1.4.1 and noticed this error message:

    Warning: opendir(/home/snowshoe/public_html/wp-content/uploads/avatars/1/) [function.opendir]: failed to open dir: No such file or directory in /home/snowshoe/public_html/wp-content/plugins/user-avatar/user-avatar.php on line 698

    Warning: closedir() expects parameter 1 to be resource, boolean given in /home/snowshoe/public_html/wp-content/plugins/user-avatar/user-avatar.php on line 722

    I was able to fix this warning by modifying the code slightly to include is_dir() calls before the opendir() calls. I also moved the closedir() bits into the if ( $av_dir = opendir( $avatar_folder_dir ) ) { blocks so that it wouldn't try to close a dir that wasn't opened.

    Here is the diff:

    [Diff moderated as per the Forum Rules. Please use the pastebin]

    If that looks like a good change to you, please update the repository version of the plugin.

    Thanks!

    http://wordpress.org/extend/plugins/user-avatar/

  2. Sulaiman
    Member
    Posted 2 years ago #

    @gserafini I had the same issue after upgrading from User Avatar 1.4 to 1.4.1

    `
    Warning: opendir(/home/:O Boy don't see my User Name!/public_html/wp-content/uploads/avatars/20/) [function.opendir]: failed to open dir: No such file or directory in /home/:O Boy don't see my User Name!/public_html/wp-content/plugins/user-avatar/user-avatar.php on line 698

    Warning: closedir(): supplied argument is not a valid Directory resource in /home/:O Boy don't see my User Name!/public_html/wp-content/plugins/user-avatar/user-avatar.php on line 722

    [Log moderated as per the Forum Rules. Please use the pastebin]

    Any tricks to resolve this error? or there is 1.4 plugin to download?

    Thanks!

  3. Gabriel Serafini
    Member
    Posted 2 years ago #

    Here is the pastebin URL for the diff that I came up with to solve the error problem:
    http://pastebin.com/T7dUA91t

  4. Sulaiman
    Member
    Posted 2 years ago #

    @gserafini Where do i insert the code on user user-avatar.php?

  5. Petra
    Member
    Posted 2 years ago #

    Thanks Gabriel. Your solution works great.

  6. Sulaiman
    Member
    Posted 2 years ago #

    @Petra Please let me know how we do i need to insert the code on user-avatar.php?

  7. Gabriel Serafini
    Member
    Posted 2 years ago #

    @Sulaiman the line numbers are in the pastebin code (you can also do a search for opendir (it appears twice I believe). That's where I added the is_dir( $avatar_folder_dir ) to the if statement.

  8. Matthias Pabst
    Member
    Posted 2 years ago #

    @Gabriel: Thanks for the fix. Works!

  9. Gabriel Serafini
    Member
    Posted 2 years ago #

    @Sulaiman - Here is the complete new user-avatar.php file that works for me:
    http://pastebin.com/1qxAZwdJ

  10. Sulaiman
    Member
    Posted 2 years ago #

    @Gabriel Thanks for the Full user-avatar.php now i had resolved it! :) Great Tricks mate!

  11. mohsintheone
    Member
    Posted 2 years ago #

    Hello Gabriel

    I just updated my "User avator" version 1.4.1 and faced the same problem.. I have copied and replaced the whole user-avator.php file with the solution you provided.. It has fixed this "Error showing message"...

    But I am still facing a problem... Whenever I go to edit my profile.. Edit picture.. And when I upload the picture and hit "Crop"... I get the following (5) errors:

    Warning: mkdir() [function.mkdir]: Unable to access /var/www/vhosts/website-name/httpdocs/wp-content/uploads/avatars/91/ in /var/www/vhosts/website-name/httpdocs/wp-content/plugins/user-avatar/user-avatar.php on line 416

    Warning: imagejpeg() [function.imagejpeg]: Unable to access /var/www/vhosts/website-name/httpdocs/wp-content/uploads/avatars/91/1317736225-bpfull.jpg in /var/www/vhosts/website-name/httpdocs/wp-admin/includes/image.php on line 74

    Warning: imagejpeg() [function.imagejpeg]: Invalid filename in /var/www/vhosts/website-name/httpdocs/wp-admin/includes/image.php on line 74

    Warning: imagejpeg() [function.imagejpeg]: Unable to access /var/www/vhosts/website-name/httpdocs/wp-content/uploads/avatars/91/1317736225-bpthumb.jpg in /var/www/vhosts/website-name/httpdocs/wp-admin/includes/image.php on line 74

    Warning: imagejpeg() [function.imagejpeg]: Invalid filename in /var/www/vhosts/website-name/httpdocs/wp-admin/includes/image.php on line 74

    I have been receiving these errors even before I updated to version 1.4.1

    Kindly let me know; what to do, to solve this problem? Solution would be highly appreciated :)

    Thanks & looking Forward..

    Mohsin

  12. Sulaiman
    Member
    Posted 2 years ago #

    @Mohsin You may replace all the code in your user-avatar.php and here Gabriel sovled the problem and the link http://pastebin.com/1qxAZwdJ and try again... deactivate the plugin before inserting the code.

    Let me know if it works?

    Thanks!

  13. Sulaiman
    Member
    Posted 2 years ago #

    Make sure that you had updated the plugin to 1.4.1 and insert the code from this link http://pastebin.com/1qxAZwdJ

  14. mohsintheone
    Member
    Posted 2 years ago #

    Yup.. I have already updated and replaced the complete code of user-avator.php with Gabriel's link..

    When I edit the user-avator.php file through PLUGIN Editor, It gives me the following error:

    "501 Not Implemented
    The page you are looking for cannot be displayed because a header value in the request does not match certain configuration settings on the Web server.
    Web Server at website-name"

    So I did it manually; by downloading the user-avator.php file, replacing the code with Gabriel's code and then uploaded it back through http://FTP..

  15. mohsintheone
    Member
    Posted 2 years ago #

    I have re-activated the plugin but One more thing I noticed is:

    When I go to Plugin Editor and I click on "user-avator-pic.php"... It still have (Inactive)..

    Editing user-avatar/user-avatar-pic.php (inactive)

    :(

    by the way, thanks for your prompt replies Sulaiman :) much appreciated

  16. Sulaiman
    Member
    Posted 2 years ago #

    between have you sovled the following those error at your end?

    Warning: mkdir() [function.mkdir]: Unable to access /var/www/vhosts/website-name/httpdocs/wp-content/uploads/avatars/91/ in /var/www/vhosts/website-name/httpdocs/wp-content/plugins/user-avatar/user-avatar.php on line 416

    Warning: imagejpeg() [function.imagejpeg]: Unable to access /var/www/vhosts/website-name/httpdocs/wp-content/uploads/avatars/91/1317736225-bpfull.jpg in /var/www/vhosts/website-name/httpdocs/wp-admin/includes/image.php on line 74

    Warning: imagejpeg() [function.imagejpeg]: Invalid filename in /var/www/vhosts/website-name/httpdocs/wp-admin/includes/image.php on line 74

    Warning: imagejpeg() [function.imagejpeg]: Unable to access /var/www/vhosts/website-name/httpdocs/wp-content/uploads/avatars/91/1317736225-bpthumb.jpg in /var/www/vhosts/website-name/httpdocs/wp-admin/includes/image.php on line 74

    Warning: imagejpeg() [function.imagejpeg]: Invalid filename in /var/www/vhosts/website-name/httpdocs/wp-admin/includes/image.php on line 74

    Thanks
    Sulaiman

  17. mohsintheone
    Member
    Posted 2 years ago #

    Nope..

    Still the same problem...

    I have also noticed that; I have two folders "avator" and "avators" in /httpdocs/wp-content/uploads...

    I don't understand, why is that...

    User Avator plugin has not work since I installed it.. So if I delete the plugin; Is it going to delete all the folders associated with it?

    I mean; So I will re-install a fresh new copy...

  18. Sulaiman
    Member
    Posted 2 years ago #

    maybe you had installed another plugin to upload avatar or customizing avatar. and if you delete the plugin and delete the folder in /wp-content/uploads you may lost all the avatars but it's better to re-upload them once deleted and then try to insert the code by locally...

    Note: Deleting can be difficult to re-install if the problem couldn't resolve you might wait for Gabriel's reply... he maybe can help with this issue...

    Thanks!

  19. enej
    Member
    Plugin Contributor

    Posted 2 years ago #

    Hi Gabriel Serafini

    Thanks for reporting and fixing the Bug. I just pushed the updated as 1.4.1, You Rock!

    Thanks Sulaiman for helping answer questions in the forum :)

    mohsintheone User avatar will leave the avatara folder in the uploads folder.

  20. mohsintheone
    Member
    Posted 2 years ago #

    Hello enejb,

    Thanks for your notice too :)

    Well, I am still facing the same problems.. Below is a bit of explanation of the problems, I have:

    I am using Using: WordPress 3.2.1
    PHP Version 5.2.4-2ubuntu5.12

    1st problem
    See the screenshot ... This happens, when I upload the picture and click "CROP"..

    2nd problem
    When I go to plugins page > User Avator > Edit...
    On the right hand side "Plugin Files".. When I click on "user-avatar/user-avatar-pic.php" .. It has (Inactive) at the end of file name.. See the screenshot (highlighted with red) ... I don't know whether this is something odd?

    In the end:
    I have 2 folders named as "avator" and "avators" in /httpdocs/wp-content/uploads... And both of them have nothing inside them :)

    I hope that the way I tried describing my problems, would be easy for you to understand? Let me know, if you would require any further information.. Thanks

    Mohsin

  21. Sulaiman
    Member
    Posted 2 years ago #

    @Mohsin

    Please try the new update which @enejb had updated the plugin User Avatar 1.4.2 the problem will be resolved possibly... @enejb You are very welcomed! :)

    Thanks!
    Sulaiman

  22. enej
    Member
    Plugin Contributor

    Posted 2 years ago #

    Hi Mohsin

    Thanks for providing me with some info so I can get to the bottom of could you also tell me what the permission on your folders are.
    the avatar folder is not used by user avatar plugin.

    Yes it is normal that user-avatar/user-avatar-pic.php is 'Inactive'. It is a file that that is not included or required by the plugin. But is still important, because it is used to re-size the images. It is a copy of tim-thumb php library.

  23. mohsintheone
    Member
    Posted 2 years ago #

    Hello enejb

    I have just Deleted the "User Avator" Plugin.. Also deleted both of the folders "avator" and "avators" from /httpdocs/wp-content/uploads...

    Now I have downloaded and installed a fresh new copy of "User Avator 1.4.3"... It has created a folder "avators" in the /httpdocs/wp-content/uploads.. It's permission by default was 755, which I have now changed to 777..

    But again the same problem as I mentioned in my previous message.. "PROBLEM 1"..

    Thanks for your prompt reply and I look forward..

    Mohsin

  24. enej
    Member
    Plugin Contributor

    Posted 2 years ago #

    Hi Sulaiman

    Thanks for all your help in the forum! Its been a busy day, there is already a never version of 1.4.4.

  25. Gabriel Serafini
    Member
    Posted 2 years ago #

    Hi @enejb, thanks for your awesome fast response on this. It's appreciated! :)

    Gabriel

  26. mohsintheone
    Member
    Posted 2 years ago #

    Hello people :)

    Any help for me ??

    I think the following error could be the main reason:
    Warning: mkdir() [function.mkdir]: Unable to access /var/www/vhosts/website-name/httpdocs/wp-content/uploads/avatars/91/ in /var/www/vhosts/website-name/httpdocs/wp-content/plugins/user-avatar/user-avatar.php on line 416

    Just to clarify: I don't have any sub-folder in "avators" folder "/httpdocs/wp-content/uploads/avatars" ...

    Like in the above Warning message, it states:
    Unable to access /var/www/vhosts/website-name/httpdocs/wp-content/uploads/avatars/91/

    Thanks for your help..

    Mohsin

  27. enej
    Member
    Plugin Contributor

    Posted 2 years ago #

    Hi Mohsin

    Please take a look at the answer provided here.
    http://wordpress.org/support/topic/plugin-user-avatar-problem-with-access-rights-to-upload-folder

    Cheers

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic