public function get_index_status($blog_id = null)
{
if (is_wp_error(ep_get_host(true))) {
return array('status' => false, 'msg' => esc_html__('Elasticsearch Host is not available.', 'elasticpress'));
} else {
if (is_multisite() && null === $blog_id && defined('EP_IS_NETWORK') && true == EP_IS_NETWORK) {
$path = ep_get_network_alias() . '/_stats/indexing/';
} else {
$path = ep_get_index_name($blog_id) . '/_stats/indexing/';
}
$request = ep_remote_request($path, array('method' => 'GET'));
}
if (!is_wp_error($request)) {
$response = json_decode(wp_remote_retrieve_body($request));
return ep_parse_api_response($response);
}
return array('status' => false, 'msg' => $request->get_error_message());
}