self::PROBE_TIMEOUT, 'redirection' => 0, ) ); if ( is_wp_error( $response ) ) { Agents24x7_Logger::error( 'Backend unreachable: ' . $url . ' — ' . $response->get_error_message() ); return false; } if ( in_array( wp_remote_retrieve_response_code( $response ), array( 502, 503, 504 ), true ) ) { return false; } } return true; } /** * The hosts the plugin talks to: the API (server side) and the app (OAuth) * * @return string[] */ private static function endpoints() { $endpoints = array(); $api_url = Agents24x7_Config::get_api_url(); if ( $api_url ) { $endpoints[] = $api_url; } if ( defined( 'AGENTS24X7_APP_URL' ) && AGENTS24X7_APP_URL ) { $endpoints[] = AGENTS24X7_APP_URL; } return array_unique( $endpoints ); } }