Yoast\WP\SEO\Dashboard\Infrastructure\Search_Console

Site_Kit_Search_Console_Adapter::get_comparison_data()publicYoast 1.0

The wrapper method to do a comparison Site Kit API request for Search Console.

Метод класса: Site_Kit_Search_Console_Adapter{}

Хуков нет.

Возвращает

Data_Container. The Site Kit API response.

Использование

$Site_Kit_Search_Console_Adapter = new Site_Kit_Search_Console_Adapter();
$Site_Kit_Search_Console_Adapter->get_comparison_data( $parameters ): Data_Container;
$parameters(Search_Console_Parameters) (обязательный)
The parameters.

Код Site_Kit_Search_Console_Adapter::get_comparison_data() Yoast 25.0

public function get_comparison_data( Search_Console_Parameters $parameters ): Data_Container {
	$api_parameters = $this->build_parameters( $parameters );

	// Since we're doing a comparison request, we need to increase the date range to the start of the previous period. We'll later split the data into two periods.
	$api_parameters['startDate'] = $parameters->get_compare_start_date();

	$response = $this->site_kit_search_console_api_call->do_request( $api_parameters );

	$this->validate_response( $response );

	return $this->parse_comparison_response( $response->get_data(), $parameters->get_compare_end_date() );
}