$this->slug(), 'risk' => 'none', 'summary' => 'Checks that the site is up, from the outside: fetches the home page and the ' . 'REST index as an anonymous visitor (cache-busted) and reports HTTP status, response ' . 'time, and whether a fatal-error marker is visible. Call after any risky change to ' . 'verify the site still responds. Also reports whether the Agent Toolbelt maintenance ' . 'window is active (visitors would be seeing a 503 that is not an outage). Read-only.', 'annotations' => array( 'readonly' => true, ), 'input_schema' => array( // 'null' tolerated: a parameterless REST GET run sends input=null (M6). 'type' => array( 'object', 'null' ), 'properties' => array(), ), ); } public function dry_run( $atb_input ) { return $this->output( true, true, $this->gather() ); } public function run( $atb_input ) { return $this->output( true, false, $this->gather() ); } /** * @return array details: passed, checks (per-URL), failures, * maintenance_window_active. */ protected function gather() { $atb_probe = ATB_Site_Probe::run(); $atb_maintenance = false; if ( class_exists( 'ATB_Operation_Maintenance_Mode' ) ) { $atb_stored = get_option( ATB_Operation_Maintenance_Mode::OPTION_NAME, false ); $atb_maintenance = ATB_Operation_Maintenance_Mode::seconds_remaining( $atb_stored, time() ) > 0; } return array( 'passed' => $atb_probe['passed'], 'checks' => $atb_probe['checks'], 'failures' => $atb_probe['failures'], 'maintenance_window_active' => $atb_maintenance, ); } } }