Function Hook_health_check_marketing_seo_robotstxt->robots_allowed

Definitions

sources/hooks/systems/health_checks/marketing_seo_robotstxt.php

  • Find whether the robots.txt allows a URL to be indexed.
  • Visibility: protected
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: bool

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$url URLPATH No No required parameter N/A N/A The URL
$user_agent string No No required parameter N/A N/A The user-agent
$google_style boolean No No required parameter N/A N/A Whether to evaluate robots.txt like Google would (Google is slightly non-standard)

Returns

  • Whether robots access is allowed
  • Type: boolean
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Find whether the robots.txt allows a URL to be indexed.
 *
 * @param  URLPATH $url The URL
 * @param  string $user_agent The user-agent
 * @param  boolean $google_style Whether to evaluate robots.txt like Google would (Google is slightly non-standard)
 * @return boolean Whether robots access is allowed
 */

protected function robots_allowed(string $url, string $user_agent, bool $google_style) : bool