403 ) ); } $ai4seo_dashboard_url = ai4seo_get_subpage_url( 'dashboard' ); $ai4seo_is_dashboard_open = 'dashboard' === $ai4seo_active_plugin_page; $ai4seo_settings_page_url = ai4seo_get_subpage_url( 'settings' ); $ai4seo_media_page_url = ai4seo_get_subpage_url( 'media' ); $ai4seo_account_page_url = ai4seo_get_subpage_url( 'account' ); $ai4seo_help_page_url = ai4seo_get_subpage_url( 'help' ); $ai4seo_plugin_home_url = $ai4seo_can_use_plugin_content ? $ai4seo_dashboard_url : $ai4seo_account_page_url; $ai4seo_current_post_type = ai4seo_get_active_post_type_subpage(); $ai4seo_menu_registry = ai4seo_get_plugins_menu_registry(); $ai4seo_content_navigation = ai4seo_get_content_navigation_groups( $ai4seo_menu_registry ); $ai4seo_current_taxonomy = ''; if ( AI4SEO_TAXONOMY_PROXY_POST_TYPE === $ai4seo_current_post_type ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only, capability-gated navigation. $ai4seo_current_taxonomy = isset( $_GET['ai4seo_taxonomy'] ) && is_string( $_GET['ai4seo_taxonomy'] ) ? sanitize_key( wp_unslash( $_GET['ai4seo_taxonomy'] ) ) : ''; if ( '' === $ai4seo_current_taxonomy ) { $ai4seo_current_taxonomy = (string) array_key_first( $ai4seo_content_navigation['taxonomies']['post_types'] ); } } $ai4seo_page_heading_label = ''; if ( 'post' === $ai4seo_active_plugin_page ) { $ai4seo_page_heading_label = $ai4seo_menu_registry['post_types'][ $ai4seo_current_post_type ]['label'] ?? ''; if ( AI4SEO_TAXONOMY_PROXY_POST_TYPE === $ai4seo_current_post_type ) { $ai4seo_page_heading_label = $ai4seo_menu_registry['taxonomies'][ $ai4seo_current_taxonomy ]['label'] ?? __( 'Taxonomies', 'ai-for-seo' ); } } else { $ai4seo_page_heading_label = $ai4seo_menu_registry[ $ai4seo_active_plugin_page ]['label'] ?? ''; } $ai4seo_page_heading = AI4SEO_PLUGIN_NAME . ( '' !== $ai4seo_page_heading_label ? ': ' . $ai4seo_page_heading_label : '' ); $ai4seo_active_attachment_attributes = ai4seo_get_active_attachment_attributes(); $ai4seo_navigation_storage_scope = 'ai4seo:navigation:' . get_site_url() . ':' . get_current_user_id() . ':'; if ( $ai4seo_is_dashboard_open || ! ai4seo_get_setting( AI4SEO_SETTING_SHOW_MENU_COUNTERS ) ) { $ai4seo_unread_notifications_count = 0; } else { $ai4seo_unread_notifications_count = ai4seo_get_num_unread_notification(); } // maybe perform a performance analysis, do it here as we rely on a fully loaded WP environment. if ( $ai4seo_is_dashboard_open && $ai4seo_can_administer_plugin ) { ai4seo_check_for_performance_analysis(); // Refresh the notice after this request's analysis attempt, just as the AJAX refresh does. ai4seo_check_for_unfinished_posts_table_analysis_notification( true ); } // ___________________________________________________________________________________________ \\ // === OUTPUT: JUST PURCHASED MODAL ========================================================== \\ // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ \\ // Remove every recognized return shape, but render success only after one-time state is consumed. $ai4seo_has_purchase_return_query_parameters = $ai4seo_can_administer_plugin && ai4seo_has_purchase_return_query_parameters(); $ai4seo_did_process_purchase_return = $ai4seo_has_purchase_return_query_parameters && ai4seo_process_purchase_return_request(); if ( $ai4seo_has_purchase_return_query_parameters ) { // --- JAVASCRIPT --------------------------------------------------------- \\ ?> "; // toggle button. $ai4seo_toggle_sidebar_label = __( 'Toggle navigation', 'ai-for-seo' ); echo "'; // Main logo. echo "
"; echo ""; ai4seo_echo_wp_kses( ai4seo_get_sooz_logo_image_tag() ); echo ''; if ( ai4seo_robhub_api()->are_we_using_local_api() ) { echo ""; } echo '
'; echo ''; echo "
"; // ___________________________________________________________________________________________ \\ // === OUTPUT: SIDE BAR / NAVIGATION (DESKTOP) ======================================================= \\ // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ \\ echo "
"; // Main logo. echo "
"; echo ""; ai4seo_echo_wp_kses( ai4seo_get_sooz_logo_image_tag( 'sooz-with-ai-for-seo' ) ); echo ''; if ( ai4seo_robhub_api()->are_we_using_local_api() ) { echo ""; } echo '
'; echo "'; echo "
" . esc_html( AI4SEO_PLUGIN_VERSION_NUMBER ) . '
'; echo '
'; // ___________________________________________________________________________________________ \\ // === OUTPUT: CONTENT AREA ================================================================== \\ // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ \\ echo "
"; if ( ! in_array( $ai4seo_active_plugin_page, array( '', 'dashboard', 'help' ), true ) && $ai4seo_can_administer_plugin ) { // Other pages do not refresh stored notifications; read current diagnostics independently of optional notices. // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- The shared renderer escapes all update diagnostics. echo ai4seo_get_plugin_update_notice_html(); } // Keep one accessible page-specific heading as WordPress' notice-placement anchor. echo "

" . esc_html( $ai4seo_page_heading ) . '

'; // === CHECK FOR NEW TOS ===================================================================== \\ // set parameter to false, so we definitely don't output anything, if tos was not accepted. if ( ai4seo_does_user_need_to_accept_tos_toc_and_pp() && ! $ai4seo_can_recover_incognito ) { // show message to accept tos and offer a reload button. echo '
'; echo "
"; if ( $ai4seo_can_administer_plugin ) { echo '

' . esc_html__( 'Please accept our Terms of Service to proceed with using this plugin.', 'ai-for-seo' ) . '

'; ai4seo_echo_wp_kses( ai4seo_get_a_tag_icon_button_tag( ai4seo_get_subpage_url(), '', '', '', esc_html__( 'Show terms of service', 'ai-for-seo' ), 'ai4seo-primary-button' ) ); } else { echo '

' . esc_html__( 'A site administrator must accept the Terms of Service before content generation can continue.', 'ai-for-seo' ) . '

'; } echo '
'; echo '
'; return; } // === CONTENT PAGES =========================================================================== \\ switch ( $ai4seo_active_plugin_page ) { case '': case 'dashboard': require_once ai4seo_get_includes_pages_path( 'dashboard.php' ); break; case 'settings': require_once ai4seo_get_includes_pages_path( 'settings.php' ); break; case 'post': require_once ai4seo_get_includes_pages_content_types_path( AI4SEO_TAXONOMY_PROXY_POST_TYPE === $ai4seo_current_post_type ? 'taxonomy.php' : 'post.php' ); break; case 'media': require_once ai4seo_get_includes_pages_content_types_path( 'attachment.php' ); break; case 'help': require_once ai4seo_get_includes_pages_path( 'help.php' ); break; case 'account': require_once ai4seo_get_includes_pages_path( 'account.php' ); break; default: echo 'Unknown SOOZ - AI for SEO page. Please contact the plugin developer. #2406232005'; } // gap. echo '
 
'; echo '
'; echo ''; // ___________________________________________________________________________________________ \\ // === OUTPUT: MODAL SCHEMAS ================================================================= \\ // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ \\ // if wp_footer is not called, we need to include the modal schemas file here. ai4seo_include_modal_schemas_file();