Hi, I am new to this community and would be grateful for any guidance you can give.

I am constantly receiving a PHP warning whenever I create a post on my wordpress site. Below is a sample of the warning.

**PHP WARNING
**

html/thegeelongeditioncom/wp-content/plugins/df_social_media/df-social-media-oauth.php on line 533
[11-Dec-2019 02:16:53 UTC] PHP Warning: file_getcontents(https://plusone.google.com/u/0//+1/fastbutton?url=https%3A%2F%2Fthegeelongedition.com.au%2Ftag%2Fpeople-home%2F): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found

This is on every single post. I can see the URL is missing but it is automatically generated so unsure how to fix the problem.

Below is a snippet of the code containing line 533 as mention in the warning message.

    /**
     * Get Goolge+ ones
     * @return integer
     */
    static function df_get_google_plus_count( $url ) {
        $url = sprintf('https://plusone.google.com/u/0/_/+1/fastbutton?url=%s', urlencode($url));
        preg_match_all('/{c: (.*?),/', file_get_contents($url), $match, PREG_SET_ORDER);
        return (1 === sizeof($match) && 2 === sizeof($match[0])) ? intval($match[0][1]) : 0;
    }

    Any ideas how to rectify this problem? Much appreciated.

Recommended Answers

All 2 Replies

That function is trying to connect to Google Plus API to get the plus count of your pages, but Google Plus is dead (https://plus.google.com/about), and therefor 404 http error (page not found, so nothing to count)
Perhaps you can fix it with a plugin update if the author of the plugin made one recently, but if he abondend the plugin, then indeed better to install a more recent Social Media plugin.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.