Yoast\WP\SEO\Task_List\Application\Tasks\Child_Tasks

Improve_Content_SEO_Child::get_analyzerpublicYoast 1.0

Returns the task's analyzer component.

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

Хуков нет.

Возвращает

Task_Analyzer_Interface|null.

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

$Improve_Content_SEO_Child = new Improve_Content_SEO_Child();
$Improve_Content_SEO_Child->get_analyzer(): ?Task_Analyzer_Interface;

Код Improve_Content_SEO_Child::get_analyzer() Yoast 27.7

public function get_analyzer(): ?Task_Analyzer_Interface {
	$result_labels = [
		'good' => \__( 'Good', 'wordpress-seo' ),
		'ok'   => \__( 'OK', 'wordpress-seo' ),
		'bad'  => \__( 'Needs improvement', 'wordpress-seo' ),
	];

	$result_descriptions = [
		'good' => \__( 'Your content is well optimized for search engines. This increases your chances of ranking higher in search results.', 'wordpress-seo' ),
		'ok'   => \__( 'Your content is partially optimized. Adding a few more SEO best practices will help you reach a wider audience.', 'wordpress-seo' ),
		'bad'  => \__( 'Your content is not yet optimized for search. Follow the SEO recommendations to help search engines understand and rank your page.', 'wordpress-seo' ),
	];

	$result = $this->content_item_score_data->get_score();

	return new Score_Task_Analyzer(
		\__( 'SEO analysis', 'wordpress-seo' ),
		$result,
		$result_labels[ $result ],
		$result_descriptions[ $result ],
	);
}