Support » Plugin: User Photo » Plugin management screen times out when site has > ~ 7000 users

  • Hi,

    Great plugin, thanks so much.

    One issue. On a wpmu site with over 7k users, the plugin management screen times out with a fatal error due to the block near line 777 (ymmv, as we have hacked a few snippets of this plugin). Regardless, you’re looping through every single user in the db which is not realistic for us.

Viewing 1 replies (of 1 total)
  • I’m seeing this too, though I have 33K users, it isn’t timing out (I have the script timeout set really high), but the page takes forever (90 seconds?) to load.

    If you replace the for loop with this:

    global $wpdb;
    $users = $wpdb->get_results("SELECT u.ID, u.user_login FROM ".$wpdb->prefix."users u,".
      $wpdb->prefix."usermeta um WHERE u.ID = um.user_id ".
      "AND um.meta_key = 'capabilities' ".
      "AND um.meta_value LIKE '%administrator%' ORDER BY u.user_login");
    foreach($users as $user){
      print "<option value='" . $user->ID . "'";
      if($userphoto_admin_notified == $user->ID)
        print " selected='selected'";
      print ">" . $user->user_login . "</option>";

    It will go a lot faster.

    I don’t know if WP has a function that does this for you – seems like it should, but I couldn’t find it.

    (Note, my code is for a non-WPMU site, I don’t know if the query has to be fancier to be MU compatible…)

Viewing 1 replies (of 1 total)
  • The topic ‘Plugin management screen times out when site has > ~ 7000 users’ is closed to new replies.