Yoast\WP\SEO\Dashboard\User_Interface\Setup
Setup_Flow_Interceptor::is_site_kit_setup_completed_page
Checks if we are on the site kit setup completed page.
Метод класса: Setup_Flow_Interceptor{}
Хуков нет.
Возвращает
true|false.
Использование
// private - только в коде основоного (родительского) класса $result = $this->is_site_kit_setup_completed_page(): bool;
Код Setup_Flow_Interceptor::is_site_kit_setup_completed_page() Setup Flow Interceptor::is site kit setup completed page Yoast 28.0
private function is_site_kit_setup_completed_page(): bool {
$current_page = $this->current_page_helper->get_current_yoast_seo_page();
$on_search_console_setup_page = $current_page === self::GOOGLE_SITE_KIT_SEARCH_CONSOLE_SETUP_FINISHED_PAGE;
$on_analytics_setup_page = $current_page === self::GOOGLE_SITE_KIT_ANALYTICS_SETUP_FINISHED_PAGE;
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
$authentication_success_notification = isset( $_GET['notification'] ) && \sanitize_text_field( \wp_unslash( $_GET['notification'] ) ) === 'authentication_success';
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
$analytics_4_slug = isset( $_GET['slug'] ) && \sanitize_text_field( \wp_unslash( $_GET['slug'] ) ) === 'analytics-4';
/**
* This checks two scenarios
* 1. The user only wants Search Console. In this case just checking if you are on the thank-you page from Site Kit is enough.
* 2. The user also wants analytics. So we need to check another page and also check if the analytics 4 connection is finalized.
*/
return ( $on_search_console_setup_page && $authentication_success_notification ) || ( $on_analytics_setup_page && $authentication_success_notification && $analytics_4_slug && $this->site_kit_configuration->is_ga_connected() );
}