Skip to content
Permalink
Browse files

Skip some robots.txt tests if there's no file to check

  • Loading branch information...
chrisgraham committed Jul 3, 2019
1 parent 9feb114 commit ed051fdd08979e07183e9280152fe4016e8e5036
Showing with 11 additions and 1 deletion.
  1. +11 −1 sources_custom/hooks/systems/health_checks/marketing_seo_robotstxt.php
@@ -60,7 +60,7 @@ public function testRobotsTxtValidity($check_context, $manual_checks = false, $a
$rules = $this->robots_parse(null, true);
$this->assert_true($rules !== null, '[tt]robots.txt[/tt] not found on domain root');
$this->assert_true($rules !== null, '[tt]robots.txt[/tt] not found on domain root or not web accessible');
}
/**
@@ -77,6 +77,11 @@ public function testRobotsTxtCorrectness($check_context, $manual_checks = false,
return;
}
$rules = $this->robots_parse(null, true);
if ($rules === null) {
$this->state_check_skipped('No robots.txt file');
}
$url = $this->get_page_url();
$google_allowed = $this->robots_allowed($url, 'Googlebot', true);
@@ -139,6 +144,11 @@ public function testRobotsTxtCompleteness($check_context, $manual_checks = false
return;
}
$rules = $this->robots_parse(null, true);
if ($rules === null) {
$this->state_check_skipped('No robots.txt file');
}
$scripts = array( // Really bad if these get indexed on Google
'adminzone/',
'code_editor.php',

0 comments on commit ed051fd

Please sign in to comment.
You can’t perform that action at this time.