• Resolved briandd

    (@briandd)


    Function deprecated/wp-user-avatar/includes/class-wp-user-avatar-functions.php wpua_has_gravatar()

            $gravatar = 'https://www.gravatar.com/avatar/' . $hash . '?d=404';
    
    
    $data = wp_cache_get($hash);
    
            if (false === $data) {
    $response = wp_remote_head($gravatar);
    $data = is_wp_error($response) ? 'not200' : $response['response']['code'];
                wp_cache_set($hash, $data, "", MINUTE_IN_SECONDS);
            }

    wp_cache_* doesnt carry to the next page so this spams gravatar servers, and MINUTE_IN_SECONDS is too often, what do you think about changing to wp_transient once a day instead?

            //$data = wp_cache_get($hash);
            $data = get_transient($hash);
    [..]
            //wp_cache_set($hash, $data, "", MINUTE_IN_SECONDS);
            set_transient($hash, $data, 24 * 60 * MINUTE_IN_SECONDS);
    
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Spamming gravatar’ is closed to new replies.