Looks like this is actually being caused by the plugin “Post Tags and Categories for Pages” which is actually quite outdated. I have disabled it and things are normal. Thanks!
And for those interested in forcing cache refresh:
In td_social_api.php, on the second line of functon get_social_counter()
change:
if ($this->in_cache($service_id, $user_id) === false) {
to
if (true/*$this->in_cache($service_id, $user_id) === false*/) {
then refresh a page that has the social counter widget on it, and then change the code back.
It is important that you put it back, otherwise every visit to that page will trigger count checks.
But the more robust version also calls for a change of index. So the updated code would be:
td_social_api.php function get_social_counter
case 'pinterest':
$td_data = @$this->get_url("http://www.pinterest.com/$user_id");
$pattern = '/<meta.*(name=|property=)"pinterestapp:followers".*content="(.*)".*>/';
preg_match($pattern, $td_data, $matches);
if (!empty($matches[2])) {
$buffy_array = (int) $matches[2];
}
break;
Or perhaps something more robust:
$pattern = '/<meta.*(name=|property=)"pinterestapp:followers".*content="(.*)".*>/';
Oh interesting. In that case, just change the pattern to use “name” instead of “property”
$pattern = '/<meta.*name="pinterestapp:followers".*content="(.*)".*>/';
Also keep in mind that unless you also modify the code to refresh the cache, you won’t see the followers update for 3 hours.
Hey guys, I just added this to the plugin myself. Similar to the twitter count extraction mentioned above, it simply grabs the follower count from the meta tag on the pinterest user page itself.
This would go in td_social_api.php function get_social_counter
case 'pinterest':
$td_data = @$this->get_url("http://www.pinterest.com/$user_id");
$pattern = '/<meta.*property="pinterestapp:followers".*content="(.*)".*>/';
preg_match($pattern, $td_data, $matches);
if (!empty($matches[1])) {
$buffy_array = (int) $matches[1];
}
break;
That was the hard part. The rest is easy stuff:
td-social-counter.php function get_social_network_meta
case 'pinterest':
return array(
'button' => __td('Follow'),
'url' => "https://www.pinterest.com/$user_id",
'text' => __td('Followers'),
'api' => $td_social_api->get_social_counter($service_id, $user_id),
);
break;
td-social-counter.php function get_map
array(
"param_name" => "pinterest",
"type" => "textfield",
"value" => "",
"heading" => __("Pinterest id:", TD_THEME_NAME),
"description" => "",
"holder" => "div",
"class" => ""
),
Works for me but use at your own risk.
Deleting it causes a white screen on the entire site too.