"; echo '

' . esc_html__( 'Incognito Mode recovery', 'ai-for-seo' ) . '

'; echo '

' . esc_html__( 'The saved Incognito Mode owner is missing or is no longer a site administrator. Content access remains blocked until an administrator claims ownership or disables Incognito Mode.', 'ai-for-seo' ) . '

'; echo "
"; echo "
"; echo ""; ai4seo_echo_wp_kses( ai4seo_get_submit_button_tag( esc_html__( 'Claim Incognito ownership', 'ai-for-seo' ), 'ai4seo-primary-button ai4seo-lockable', 'ai4seo_save_anything(jQuery(this), null, function() { ai4seo_safe_page_load(); });' ) ); echo '
'; echo "
"; echo ""; ai4seo_echo_wp_kses( ai4seo_get_submit_button_tag( esc_html__( 'Disable Incognito Mode', 'ai-for-seo' ), 'ai4seo-lockable', 'ai4seo_save_anything(jQuery(this), null, function() { ai4seo_safe_page_load(); });' ) ); echo '
'; echo '
'; echo ''; return; } // Defense in depth keeps direct includes behind the same route-level administrative boundary. if ( ! ai4seo_can_administer_plugin() ) { wp_die( esc_html__( 'You are not allowed to access this page.', 'ai-for-seo' ), esc_html__( 'Access denied', 'ai-for-seo' ), array( 'response' => 403 ) ); } ai4seo_render_activation_area( true ); ai4seo_echo_wp_kses( ai4seo_get_account_quality_notice( false ) ); $ai4seo_robhub_subscription = ai4seo_robhub_api()->read_environmental_variable( ai4seo_robhub_api()::ENVIRONMENTAL_VARIABLE_SUBSCRIPTION ); $ai4seo_is_robhub_account_synced = ai4seo_robhub_api()->is_account_synced(); $ai4seo_is_auth_locked = ai4seo_robhub_api()->is_auth_data_locked(); $ai4seo_has_rotation_recovery = ai4seo_robhub_api()->has_api_password_rotation_recovery_intent(); $ai4seo_rotation_recovery_notice = ai4seo_robhub_api()->get_api_password_rotation_recovery_notice_state(); // Define boolean to determine whether to read license-data. $ai4seo_show_license_details = (bool) ai4seo_read_environmental_variable( AI4SEO_ENVIRONMENTAL_VARIABLE_HAS_PURCHASED_SOMETHING ); // Allow the read-only support flag to reveal saved license details without changing account data. // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- This read-only support flag only changes local account-page display. if ( isset( $_GET['ai4seo_force_show_licence_details'] ) && sanitize_text_field( wp_unslash( $_GET['ai4seo_force_show_licence_details'] ) ) ) { $ai4seo_show_license_details = true; } // Define license variables. $ai4seo_auth_data = ai4seo_robhub_api()->read_auth_data(); $ai4seo_license_username = $ai4seo_auth_data[0] ?? ''; $ai4seo_license_key = $ai4seo_auth_data[1] ?? ''; if ( ! $ai4seo_license_username || ! $ai4seo_license_key ) { $ai4seo_show_license_details = false; } if ( ! $ai4seo_show_license_details ) { $ai4seo_license_username = ''; $ai4seo_license_key = ''; } // Prepare enhanced reporting. $ai4seo_did_user_accept_enhanced_reporting = (bool) ai4seo_read_environmental_variable( AI4SEO_ENVIRONMENTAL_VARIABLE_ENHANCED_REPORTING_ACCEPTED ); $ai4seo_enhanced_reporting_revoke_timestamp = (int) ai4seo_read_environmental_variable( AI4SEO_ENVIRONMENTAL_VARIABLE_ENHANCED_REPORTING_REVOKED_TIME ); // Define variables for the current username and email. $ai4seo_current_user = wp_get_current_user(); $ai4seo_current_user_username = ( $ai4seo_current_user->user_login ?? 'unknown' ); $ai4seo_current_user_email = ( $ai4seo_current_user->user_email ?? 'unknown' ); // Define variables for the settings. $ai4seo_setting_enable_incognito_mode = ai4seo_get_setting( AI4SEO_SETTING_ENABLE_INCOGNITO_MODE ); $ai4seo_setting_enable_white_label = ai4seo_get_setting( AI4SEO_SETTING_ENABLE_WHITE_LABEL ); $ai4seo_setting_plugin_name = ai4seo_get_setting( AI4SEO_SETTING_INSTALLED_PLUGINS_PLUGIN_NAME ); $ai4seo_setting_plugin_description = str_replace( '*' . AI4SEO_PLUGIN_NAME . '*', AI4SEO_PLUGIN_NAME, ai4seo_get_setting( AI4SEO_SETTING_INSTALLED_PLUGINS_PLUGIN_DESCRIPTION ) ); $ai4seo_setting_display_source_code_notes = ai4seo_get_setting( AI4SEO_SETTING_ADD_GENERATOR_HINTS ); $ai4seo_setting_source_code_notes_content_start = ai4seo_get_setting( AI4SEO_SETTING_META_TAGS_BLOCK_STARTING_HINT ); $ai4seo_setting_source_code_notes_content_end = ai4seo_get_setting( AI4SEO_SETTING_META_TAGS_BLOCK_ENDING_HINT ); $ai4seo_robhub_subscription_plan = ai4seo_get_account_readiness()['plan']; $ai4seo_has_purchased_something = (bool) ai4seo_read_environmental_variable( AI4SEO_ENVIRONMENTAL_VARIABLE_HAS_PURCHASED_SOMETHING ); // ___________________________________________________________________________________________ \\ // === OUTPUT ================================================================================ \\ // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ \\ echo "
"; ai4seo_echo_wp_kses( ai4seo_get_settings_form_state_tag() ); // Empty license-entry fields must not disconnect the hidden free account during an Account save. if ( ! $ai4seo_show_license_details ) { echo ''; } // A server-generated replacement is intentionally never returned to this site. // Keep the administrator on secure recovery guidance until the emailed pair verifies. if ( $ai4seo_has_rotation_recovery ) { $ai4seo_rotation_recovery_status = $ai4seo_rotation_recovery_notice['status'] ?? 'none'; $ai4seo_rotation_credential_email_state = $ai4seo_rotation_recovery_notice['credential_email_status'] ?? 'not-applicable'; echo "
"; echo '

' . esc_html__( 'License reconnection required', 'ai-for-seo' ) . '

'; echo '

'; if ( 'confirmed' === $ai4seo_rotation_recovery_status && 'sent' === $ai4seo_rotation_credential_email_state ) { echo esc_html__( 'A replacement license key was sent to the verified Stripe checkout email. Check your inbox and spam folder, then enter the emailed license owner and key below and save your changes.', 'ai-for-seo' ); } elseif ( 'confirmed' === $ai4seo_rotation_recovery_status && 'failed' === $ai4seo_rotation_credential_email_state ) { echo esc_html__( 'A replacement license key was generated, but email delivery could not be confirmed. Delivery retries automatically; use the license recovery help below if the verified Stripe checkout inbox still has no message.', 'ai-for-seo' ); } elseif ( 'confirmed' === $ai4seo_rotation_recovery_status ) { echo esc_html__( 'A replacement license key is being delivered to the verified Stripe checkout email. Check your inbox and spam folder, then enter the emailed license owner and key below and save your changes.', 'ai-for-seo' ); } elseif ( 'pending' === $ai4seo_rotation_recovery_status ) { echo esc_html__( 'Secure license recovery is awaiting confirmation. Refresh the account status, then check the verified Stripe checkout email before reconnecting below.', 'ai-for-seo' ); } else { // Malformed or unreadable local recovery bytes remain quarantined and are never rendered. echo esc_html__( 'Secure license recovery needs attention. Check the verified Stripe checkout inbox or use the recovery help below, then reconnect with the verified credentials.', 'ai-for-seo' ); } echo '

'; echo "
"; ai4seo_echo_wp_kses( ai4seo_get_icon_button_tag( 'key-slash', esc_html__( 'License recovery help', 'ai-for-seo' ), '', 'ai4seo_open_lost_key_modal();' ) ); echo '
'; echo '
'; } // ___________________________________________________________________________________________ \\ // === LICENSE =============================================================================== \\ // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ \\ echo "
"; // === HEADLINE ============================================================================== \\ echo '

'; ai4seo_echo_wp_kses( ai4seo_get_dashicon_tag( 'id-alt', 'ai4seo-menu-item-icon', true ) ); echo esc_html__( 'License', 'ai-for-seo' ); echo '

'; // === DESCRIPTION =========================================================================== \\ echo "'; // === API USERNAME / LICENSE OWNER ========================================================== \\ $ai4seo_this_prefixed_input_id = ai4seo_get_prefixed_input_name( ai4seo_robhub_api()::ENVIRONMENTAL_VARIABLE_API_USERNAME ); echo "
"; echo "'; echo "
"; echo ""; echo '
'; echo '
'; echo "
"; // === API PASSWORD / LICENSE KEY =========================================================================== \\ $ai4seo_this_prefixed_input_id = ai4seo_get_prefixed_input_name( ai4seo_robhub_api()::ENVIRONMENTAL_VARIABLE_API_PASSWORD ); $ai4seo_license_key_input_wrapper_class = 'ai4seo-form-item-input-wrapper ai4seo-license-key-input-wrapper ai4seo-license-key-input-wrapper-has-toggle' . ( $ai4seo_license_key ? '' : ' ai4seo-license-key-entry-mode' ); $ai4seo_license_key_toggle_controls = $ai4seo_license_key ? 'ai4seo-visual-license-key-holder ai4seo-actual-license-key-holder' : $ai4seo_this_prefixed_input_id; echo "
"; echo "'; echo "
"; // Mask a new license key while retaining an explicit reveal control for verification. if ( ! $ai4seo_license_key ) { echo ""; } else { // Render both saved-key states so JavaScript can swap visibility without rebuilding the field. echo "
"; echo ""; echo '
'; // Keep the masked state in the same wrapper so the floating toggle stays anchored. echo "
"; echo ""; echo '
'; } // Use one control and label pair for both saved-key and editable-key visibility. echo "'; echo '
'; echo '
'; echo "
"; // === BUTTONS =========================================================================== \\ echo "
"; echo "'; echo '
'; echo '
'; // ___________________________________________________________________________________________ \\ // === AGENCY MODE =========================================================================== \\ // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ \\ echo "
"; // === HEADLINE ============================================================================== \\ echo '

'; ai4seo_echo_wp_kses( ai4seo_get_dashicon_tag( 'megaphone', 'ai4seo-menu-item-icon', true ) ); echo esc_html__( 'For SEO and Web Agencies', 'ai-for-seo' ); echo '

'; // === ENABLE INCOGNITO MODE ================================================================= \\ $ai4seo_this_prefixed_input_id = ai4seo_get_prefixed_input_name( AI4SEO_SETTING_ENABLE_INCOGNITO_MODE ); $ai4seo_this_setting_description = sprintf( /* translators: 1: Username, 2: Email Address */ __( 'By enabling this checkbox you can hide the plugin from all other users. This means that only you (%1$s, %2$s) will be able to generate data, access and edit plugin settings and see the menu item in the header and the main menu of your website. Please note that the plugin will still be visible in the plugin list to other users. However, you may white-label the appearance using the settings below.', 'ai-for-seo' ), $ai4seo_current_user_username, $ai4seo_current_user_email ); echo "
"; echo "'; echo "
"; // Keep the native checkbox inside the label so the shared switch CSS can place it after the copy. echo "'; // Description. echo "

"; ai4seo_echo_wp_kses( $ai4seo_this_setting_description ); echo '

'; echo '
'; echo '
'; echo "
"; // === ENABLE WHITE-LABEL ==================================================================== \\ $ai4seo_this_prefixed_input_id = ai4seo_get_prefixed_input_name( AI4SEO_SETTING_ENABLE_WHITE_LABEL ); $ai4seo_this_setting_description = __( 'Enabling this option will give you access to change the display of certain plugin related information (i.e. the plugin name).', 'ai-for-seo' ); echo "
"; echo "'; echo "
"; // Keep the onchange handler on the native input while the label row handles the switch alignment. echo "'; // Description. echo "

"; ai4seo_echo_wp_kses( $ai4seo_this_setting_description ); echo '

'; echo '
'; echo '
'; // ___________________________________________________________________________________________ \\ // === HIDDEN WHITE LABEL ELEMENTS =========================================================== \\ // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ \\ echo "
"; echo "
"; // === PLUGIN NAME =========================================================================== \\ $ai4seo_this_prefixed_input_id = ai4seo_get_prefixed_input_name( AI4SEO_SETTING_INSTALLED_PLUGINS_PLUGIN_NAME ); $ai4seo_this_setting_description = sprintf( /* translators: %s: URL to the installed plugins page */ __( "Here you can define the plugin name that will be shown on the installed plugins page of your website.", 'ai-for-seo' ), esc_url( admin_url( 'plugins.php' ) ) ); echo "
"; echo "'; echo "
"; // Input. echo ""; // Description. echo "

"; ai4seo_echo_wp_kses( $ai4seo_this_setting_description ); echo '

'; echo '
'; echo '
'; echo "
"; // === PLUGIN DESCRIPTION ==================================================================== \\ $ai4seo_this_prefixed_input_id = ai4seo_get_prefixed_input_name( AI4SEO_SETTING_INSTALLED_PLUGINS_PLUGIN_DESCRIPTION ); $ai4seo_this_setting_description = sprintf( /* translators: %s: URL to the installed plugins page */ __( "Here you can define the plugin description that will be shown on the installed plugins page of your website.", 'ai-for-seo' ), esc_url( admin_url( 'plugins.php' ) ) ); echo "
"; echo "'; echo "
"; // Input. echo ""; // Description. echo "

"; ai4seo_echo_wp_kses( $ai4seo_this_setting_description ); echo '

'; echo '
'; echo '
'; echo "
"; // === ADD GENERATOR HINTS ============================================================= \\ $ai4seo_this_prefixed_input_id = ai4seo_get_prefixed_input_name( AI4SEO_SETTING_ADD_GENERATOR_HINTS ); $ai4seo_this_setting_description = __( 'With this setting you can decide whether to display a comment block before and after the meta tags block generated by the plugin in the source code of your website.', 'ai-for-seo' ); echo "
"; echo "'; echo "
"; // Keep the onchange handler on the native input while the label row handles the switch alignment. echo "'; // Description. echo "

"; ai4seo_echo_wp_kses( $ai4seo_this_setting_description ); echo '

'; echo '
'; echo '
'; // ___________________________________________________________________________________________ \\ // === HIDDEN SOURCE CODE ADJUSTMENTS ======================================================== \\ // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ \\ echo "
"; echo "
"; // === Meta Tags Block Starting Hint ======================================================= \\ $ai4seo_this_prefixed_input_id = ai4seo_get_prefixed_input_name( AI4SEO_SETTING_META_TAGS_BLOCK_STARTING_HINT ); $ai4seo_this_setting_description = __( 'Here you can define the content of the comment block that will be displayed before the meta tags generated by the plugin in the source code of your website.', 'ai-for-seo' ) . '

'; $ai4seo_this_setting_description .= esc_html__( 'Possible placeholders:', 'ai-for-seo' ) . ' {NAME} = ' . esc_html( AI4SEO_PLUGIN_NAME ) . ', {VERSION} = ' . esc_html( AI4SEO_PLUGIN_VERSION_NUMBER ) . ', {WEBSITE} = ' . esc_html( AI4SEO_OFFICIAL_WEBSITE ); echo "
"; echo "'; echo "
"; // Input. echo ""; // Description. echo "

"; ai4seo_echo_wp_kses( $ai4seo_this_setting_description ); echo '

'; echo '
'; echo '
'; echo "
"; // === Meta Tags Block Ending Hint ========================================================= \\ $ai4seo_this_prefixed_input_id = ai4seo_get_prefixed_input_name( AI4SEO_SETTING_META_TAGS_BLOCK_ENDING_HINT ); $ai4seo_this_setting_description = __( 'Here you can define the content of the comment block that will be displayed after the meta tags generated by the plugin in the source code of your website.', 'ai-for-seo' ) . '

'; $ai4seo_this_setting_description .= esc_html__( 'Possible placeholders:', 'ai-for-seo' ) . ' {NAME} = ' . esc_html( AI4SEO_PLUGIN_NAME ); echo "
"; echo "'; echo "
"; // Input. echo ""; // Description. echo "

"; ai4seo_echo_wp_kses( $ai4seo_this_setting_description ); echo '

'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; // ___________________________________________________________________________________________ \\ // === PRIVACY AND AGREEMENTS ================================================================ \\ // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ \\ echo "
"; // Headline. echo '

'; ai4seo_echo_wp_kses( ai4seo_get_dashicon_tag( 'shield', 'ai4seo-menu-item-icon', true ) ); echo esc_html__( 'Privacy, Notifications & Agreements', 'ai-for-seo' ); echo '

'; // TERMS OF SERVICE BUTTON. echo "
"; echo ""; echo esc_html__( 'Terms of Service', 'ai-for-seo' ) . ':'; echo ''; echo "
"; if ( ai4seo_does_user_need_to_accept_tos_toc_and_pp( false ) ) { ai4seo_echo_wp_kses( ai4seo_get_icon_button_tag( 'arrow-up-right-from-square', esc_html__( 'Show Terms of Service', 'ai-for-seo' ), '', 'ai4seo_open_modal_from_schema("tos", {modal_css_class: "ai4seo-tos-modal", modal_size: "auto"});' ) ); } else { ai4seo_echo_wp_kses( ai4seo_get_icon_button_tag( 'arrow-up-right-from-square', esc_html__( 'Show Terms of Service', 'ai-for-seo' ), 'ai4seo-lockable', 'ai4seo_open_ajax_modal("ai4seo_show_terms_of_service", {}, {modal_size: "small"});' ) ); } echo "

"; $ai4seo_latest_tos_and_toc_and_pp_version = ai4seo_get_latest_tos_and_toc_and_pp_version(); /* translators: %s: Latest version number */ echo esc_html( sprintf( __( 'Current version: %s', 'ai-for-seo' ), $ai4seo_latest_tos_and_toc_and_pp_version ) ) . '.

'; ai4seo_echo_wp_kses( ai4seo_get_tos_toc_and_pp_accepted_time_output() ); echo '

'; echo '
'; echo '
'; echo "
"; // ENHANCED REPORTING. echo "
"; echo ""; echo esc_html__( 'Enhanced Reporting:', 'ai-for-seo' ); echo ''; echo "
"; $ai4seo_this_prefixed_input_id = ai4seo_get_prefixed_input_name( AI4SEO_ENVIRONMENTAL_VARIABLE_ENHANCED_REPORTING_ACCEPTED ); // Enhanced reporting opt-in keeps the existing option text while the native checkbox renders as a switch. $ai4seo_extended_data_collection_tooltip_text = __( 'This data includes feature usage, performance metrics, and error logs. It will be stored for up to 30 days to assist with improving the plugin. You can opt out of data collection at any time through the plugin settings.', 'ai-for-seo' ); echo "'; echo "

"; // revoked? if ( ! $ai4seo_did_user_accept_enhanced_reporting && $ai4seo_enhanced_reporting_revoke_timestamp ) { $ai4seo_readable_revoked_time = ai4seo_format_unix_timestamp( $ai4seo_enhanced_reporting_revoke_timestamp ); ai4seo_echo_wp_kses( ai4seo_get_svg_tag( 'square-xmark', '', 'ai4seo-16x16-icon ai4seo-red-icon' ) ); echo ' '; /* translators: %s: Revoked time */ printf( esc_html__( 'Revoked on %s.', 'ai-for-seo' ), esc_html( $ai4seo_readable_revoked_time ) ); } else { ai4seo_echo_wp_kses( ai4seo_get_enhanced_reporting_accepted_time_output() ); } echo '

'; echo '
'; echo '
'; ai4seo_render_activation_preferences(); ai4seo_render_notification_preferences(); echo '
'; // Submit button. echo "
"; echo "
"; ai4seo_echo_wp_kses( ai4seo_get_submit_button_tag( esc_html__( 'Save changes', 'ai-for-seo' ), 'ai4seo-start-inactive ai4seo-big-button', 'ai4seo_save_anything(jQuery(this), ai4seo_validate_account_inputs, function() { ai4seo_safe_page_load(); });' ) ); echo '
'; echo '
'; echo '
';