This is an issue for us too. It’s bigger than just error logs… we’ve been getting random 404s on some of our websites wp-admin/plugins.php pages. There is no log trail anywhere other than this error that you reported. Then when I disable the user-photo plugin, we don’t get the 404s anymore on our wp-admin/plugins.php page. Really weird and I am not sure if this is even the real culprit but it’s something I need to get resolved so I can rule it out.
Any idea on when developers can get this resolved? We love this plugin.
Arg! Same here. I started with a new client a few months ago and have been going through their debug logs to address errors in their custom themes & plugins. It is maddening how much this error fills up my debug logs and obscures real issues.
In my opinion, the add_options_page() call should be changed to this:
add_options_page('User Photo', 'User Photo', 'edit_users', __FILE__, 'userphoto_options_page');
If you can edit users, you should probably also have the ability to set the parameters of the user photos. This definitely seems like Administrator role territory.
I tried looking up what User level 8 means and couldn’t really make heads or tails of it, nor do I want to waste any more of my time with this.
I agree with the change to edit_users, and that works for me.
In addition, I had to fix around line 780 of user-photo.php to not grab all users and then foreach() to look for admins, but simply changed:
global $wpdb;
$users = $wpdb->get_results("SELECT ID FROM $wpdb->users ORDER BY user_login");
to:
$users = get_users(array("role" => "Administrator"));
which runs a ton faster (my site has a LOT of users, so this code was crashing due to using too much memory or cpu)
Hi JonDaley,
Good catch there. I would recommend you open up a new discussion thread for the issue you discovered and your solution. It will
- make it easier for others to discover and
- make it less likely for the plugin author to not address it because they didn’t completely read this thread. ( Of course, there’s no telling when/if this plugin will ever get updated again.)
Cheers!
Both the deprecated issue and the admin user optimisation has been fixed in version 0.9.8