Skip to content
Extraits de code Groupes Projets
Valider 6e2ac9c0 rédigé par mattab's avatar mattab
Parcourir les fichiers

Fix Google Indexed Pages metric for sites with less than dozens pages listed...

Fix Google Indexed Pages metric for sites with less than dozens pages listed (where the "about" string is not displayed in search output)
parent a2d24124
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -114,8 +114,9 @@ class Piwik_SEO_RankChecker ...@@ -114,8 +114,9 @@ class Piwik_SEO_RankChecker
{ {
$url = 'http://www.google.com/search?hl=en&q=site%3A' . urlencode($this->url); $url = 'http://www.google.com/search?hl=en&q=site%3A' . urlencode($this->url);
$data = $this->getPage($url); $data = $this->getPage($url);
if (preg_match('#about ([0-9\,]+) results#i', $data, $p)) { if (preg_match('#([0-9\,]+) results#i', $data, $p)) {
return (int)str_replace(',', '', $p[1]); $indexedPages = (int)str_replace(',', '', $p[1]);
return $indexedPages;
} }
return 0; return 0;
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter