PHP Warnings When Adding a New User with One User Avatar Plugin
-
I’ve encountered an issue with the One User Avatar plugin for WordPress, where three PHP warnings are generated each time a new user is added to the site. These warnings seem to relate to attempts to read properties on a string as if it were an object within the plugin’s codebase.
Details of the issue:
- PHP Warnings Encountered:
Attempt to read property "ID" on string
atwp-content/plugins/one-user-avatar/includes/class-wp-user-avatar.php:206
Attempt to read property "ID" on string
atwp-content/plugins/one-user-avatar/includes/class-wp-user-avatar.php:209
Attempt to read property "user_email" on string
atwp-content/plugins/one-user-avatar/includes/class-wp-user-avatar.php:218
- Call Stack for Reference:
WP_User_Avatar::wpua_core_show_user_profile()
atwp-content/plugins/one-user-avatar/includes/class-wp-user-avatar.php:349
WP_User_Avatar::wpua_action_show_user_profile()
atwp-includes/class-wp-hook.php:324
do_action('user_new_form')
atwp-admin/user-new.php:650
Expected Behavior:
Adding a new user should not trigger any warnings or errors, and the One User Avatar functionality should integrate seamlessly with the WordPress user creation process.
Actual Behavior:
The specified PHP warnings are generated, indicating a potential issue with how properties are being accessed within the plugin’s code, likely due to treating a string as an object.
Steps to Reproduce:
tested here: https://selectcalendar.s2-tastewp.com/wp-admin/index.php
admin
INEz8JJAA68
Environment:
- WordPress version: 6.4.3
- One User Avatar plugin version: 2.2.16
- PHP version: 8.0.30
Possible Solution:
It appears that there may be a misunderstanding or incorrect handling of a variable type within the plugin’s codebase, particularly in the
wpua_core_show_user_profile
andwpua_action_show_user_profile
functions. A review and adjustment of how the user object is accessed and utilized in these functions might resolve the issue.I hope this information is helpful for diagnosing and resolving the issue. Please let me know if there’s any additional information or testing I can provide to assist further.
Thank you for your attention to this matter.
- PHP Warnings Encountered:
- The topic ‘PHP Warnings When Adding a New User with One User Avatar Plugin’ is closed to new replies.