Spamming gravatar | WordPress.org

[ad_1]

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);

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer