Support » Plugin: WP User Avatar » Massive Additions to WP_Options Table

  • Tyler Johnson

    (@tylerjohnsondesign)


    We got notified from our host that one of our sites wp_options table was bloated. I took a look and sure enough, overnight it had ballooned to over 4,000 rows. The queries are being generated by wp-user-avatar.

    Here’s an example of what’s being written:

    UPDATE wp_options SET option_value = ‘a:16191:{i:1419011820;a:1:{s:27:\”wpua_has_gravatar_cron_hook\”;a:1:{s:32:\”40cd750bba9870f18aada2478b24840a\”;a:3:{s:8:\”schedule\”;s:5:\”daily\”;s:4:\”args\”;a:0:{}s:8:\”interval\”;i:86400;}}}i:1419011825;a:1:{s:27:\”wpua_has_gravatar_cron_hook\”;a:1:{s:32:\”40cd750bba9870f18aada2478b24840a\”;a:3:{s:8:\”schedule\”;s:5:\”daily\”;s:4:\”args\”;a:0:{}s:8:\”interval\”;i:86400;}}}i:1419011832;a:1:{s:27:\”wpua_has_gravatar_cron_hook\”;a:1:{s:32:\

    Any ideas on what’s going on?

    https://wordpress.org/plugins/wp-user-avatar/

Viewing 15 replies - 1 through 15 (of 45 total)
  • Tyler Johnson

    (@tylerjohnsondesign)

    After looking around a little bit, these are processes on the backend…

    UPDATEwp_optionsSEToption_value= 'a:16191:{i:1419011820;a:1:{s:27:\"wpua_has_gravatar_cron_hook\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:5:\"daily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:86400;}}}i:1419011825;a:1:{s:27:\"wpua_has_gravatar_cron_hook\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:5:\"daily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:86400;}}}i:1419011832;a:1:{s:27:\"wpua_has_gravatar_cron_hook\";a:1:{s:32:\

    These cron jobs are inserting 3MB sized binary logs into the wp_options table were adding up to a Gig within 5-7 minutes.

    Here’s the portion of the plugins code that’s responsible for the large updates:

    /**
       * Checks whether registered user has Grvatar-hosted image or not.
       * Set the flag in database according to existence of Gravatr image.
       * @uses object $wpua_functions
       * @uses int $blog_id
       * @param int $user_id
       * @uses wpua_has_gravatar()
      */
      public function set_wpua_has_gravatar($user_id=""){
            global $blog_id, $wpua_functions;
            if(!empty($user_id)){
                    $flag = $wpua_functions->wpua_has_gravatar($user_id);
                            // Update usermeta
                            update_user_meta( $user_id, 'wpua_has_gravatar', $flag);
            }
            else{
                    $blogusers = get_users( 'blog_id='.$blog_id );
                    // Array of WP_User objects.
                    foreach ( $blogusers as $user ) {
                            $flag = $wpua_functions->wpua_has_gravatar($user->ID);
                            // Update usermeta
                            update_user_meta( $user->ID, 'wpua_has_gravatar', $flag);
                    }
            }
      }

    For a quick remedy, my host applied max_binlog_files to cap how much in binary log can be written, which takes care of the load for the time being, but it isn’t a permanent solution.

    Any idea how we can optimize this code so that it doesn’t attempt to write Gigs worth of data to the wp_options table?

    I’m having precisely the same problem. I’d really appreciate suggestions.

    Plugin Author Flipper Code

    (@flippercode)

    Hello,

    Yeah, we’re checking this right now and getting back to you.

    Thanks

    Same problem here. Has seriously slowed down my site. Have disabled the plugin for now. Will wait to hear about a fix.

    Plugin Author Flipper Code

    (@flippercode)

    Hello @kevin, @jinty and @tyler,

    We have solved the problem so please upgrade your copy with latest one and please let us know if still something wrong for you.

    Thanks

    upgraded, but wpua_has_gravatar_cron_hook is still active. How do we fix that?

    I’ve disabled the plugin too, but wpua_has_gravatar_cron_hook is still going crazy.

    your plugin created like 100,000 cron jobs. clear it up with a cron manager in wordpress guys.

    same problem of clammy77 please solve it

    Yup this is a problem. Cleared out cron option from database directly. Even have cron Disabled globally as well as gravatar disabled in the plugin settings. But when you visit a page that calls gravatar, it adds hundreds of cron entries.

    Man…this plugin really fucked us over (we’re a site that generates over 3M PV/day)

    Automatic solution: After apply 1.9.16 update, if you simply disable de plugin (takes a while) all loads of crons are deleted, and after that you enable the plugin and only one cron are created, it seem works fine now, but you must disable an enable the plugin to clean crons.

    yeah…awesome
    this plugin it’s really broken at the moment i can’t deactivate it

    When i try to deactivated the plugin i get this message and my website it’s broken:
    Fatal error: Maximum execution time of 30 seconds exceeded in /home/content/31/9599131/html/wp-includes/cron.php on line 0

    what can i do right now? we can’t deactivated the plugin. So how can we upgrade it?

    we need an urgent solution

Viewing 15 replies - 1 through 15 (of 45 total)
  • The topic ‘Massive Additions to WP_Options Table’ is closed to new replies.