New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update SEO Test #18142
update SEO Test #18142
Conversation
update seo Test
feel free to merge later @peterhashair 👍 |
add ip and content for seo tests
update seo Tests
update seo tests
bing has anti crawler exception on SEO test
Did quite a lot of tests and research, I think the SEO tests randomly failed is because Bing is a dynamic system with an anti crawler, our crawler exceeds the number of trying in a period of time it will return a page like this. I Update bing |
fix the method
update error function
update Bing instead of update tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find @peterhashair 👍
btw just in case this will fail randomly again in the HTTP request we might want to set $getExtendedInfo=true
so we can check the HTTP response code. Did a quick check and bing says it would return an HTTP 429 if someone exceeds request per minute limit.
I didn't think we issue requests to bing that often but maybe other people on travis running these tests contribute to the quota too.
plugins/SEO/Metric/Bing.php
Outdated
@@ -40,6 +40,8 @@ public function getMetrics($domain) | |||
|
|||
if (preg_match('#([0-9,\.]+) results#i', $response, $p)) { | |||
$pageCount = NumberFormatter::getInstance()->formatNumber((int)str_replace(array(',', '.'), '', $p[1])); | |||
} elseif (preg_match('#There are no results#i', $response, $p)) { | |||
$pageCount = Piwik::translate('General_Error'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this be shown in the UI? If so, we would maybe need to be a bit more specific as otherwise people will creates issues and contact support about it and ask for details.
@tsteur Bing doesn't return an error status, it loads through javascript. I don't think it will change too much. Only when someone did a website that does not exist will display an error page. It seems like maybe this error needs a little bit of update on the code. Every search engine looks different, let me know if we want to update this. |
i see. Didn't realise others were already showing that simple error message. Possibly they don't error as often. We've had errors before on the cloud for bing so this happens more often. It be great to possibly use the same consistent message possibly. Even if it's just like an |
update SEO test
@tsteur Sure, that should fix the SEO test and the error page. |
Description:
Fixes: #17919
update SEO tests, It seems the print $_SERVER['REMOTE_ADDR'] doesn't give back the useful info.
bing-index expected non-zero rank, got [0], ip [127.0.0.1]
Review