• Resolved Gabriel Serafini

    (@gserafini)


    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!

    https://www.ads-software.com/extend/plugins/user-avatar/

Viewing 15 replies - 1 through 15 (of 26 total)
  • @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!

    Thread Starter Gabriel Serafini

    (@gserafini)

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

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

    Thanks Gabriel. Your solution works great.

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

    Thread Starter Gabriel Serafini

    (@gserafini)

    @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.

    @gabriel: Thanks for the fix. Works!

    Thread Starter Gabriel Serafini

    (@gserafini)

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

    @gabriel Thanks for the Full user-avatar.php now i had resolved it! ?? Great Tricks mate!

    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

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

    Let me know if it works?

    Thanks!

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

    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 https://FTP..

    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

    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

Viewing 15 replies - 1 through 15 (of 26 total)
  • The topic ‘[Plugin: User Avatar] PHP warnings in 1.4.1’ is closed to new replies.