get_id() ?? 16031; $fs = freemius($fs_plugin_id); $user = $fs->get_user(); $site = $fs->get_site(); $license = $fs->_get_license(); if (is_object($license)) { $license_expiration = $license->expiration; $secret_key = $license->secret_key; $obsfucated_key = '**************************' . substr($secret_key, -5); } else { $license_expiration = null; $secret_key = null; $obsfucated_key = null; } $upgrade_url = affl_fs()->get_upgrade_url(); $name = ucfirst(esc_html(wp_get_current_user()->display_name ?? wp_get_current_user()->user_nicename)) ?? esc_html__('Visitor', 'affililabs'); if (is_object($user)) { $name = $user->get_name() ?? $name; $fs->_account_page_load(); } affl_import(AFFILILABS_NAVBAR_COMPONENT_FILE); affl_import(AFFILILABS_SERVICE_SETTINGS_FILE); affl_import(AFFILILABS_MODAL_COMPONENT_FILE); affl_import(AFFILILABS_SPINNER_COMPONENT_FILE); $navbar = new AffiliLabs_Navbar(); $navbar->load_scripts(); $modal_component = new Affililabs_Modal(); $modal_component->load_scripts(); $modal_component->init(); $spinner_component = new Affililabs_Spinner(); $spinner_component->load_scripts(); $spinner_component->init(); wp_enqueue_style('affililabs-settings', AFFILILABS_SETTINGS_CSS_URL, array(), AFFILILABS_VERSION); wp_enqueue_script('affililabs-settings', AFFILILABS_SETTINGS_JS_URL, array('jquery'), AFFILILABS_VERSION, true); wp_localize_script('affililabs-settings', 'affl_settings_data', array( 'nonce' => wp_create_nonce('affl_admin_nonce') , 'i18n' => array( 'save_success_title' => esc_html__('API Key Saved', 'affililabs'), 'save_error_title' => esc_html__('Error Saving Key', 'affililabs'), 'delete_success_title' => esc_html__('API Key Deleted', 'affililabs'), 'delete_error_title' => esc_html__('Error Deleting Key', 'affililabs'), 'ajax_error' => esc_html__('An unexpected error occurred while communicating with the server. Please try again.', 'affililabs'), 'current_key_ends_with' => esc_html__('Current key ends with:', 'affililabs'), 'confirm_delete_title' => esc_html__('Confirm Delete', 'affililabs'), 'confirm_delete' => esc_html__('Are you sure you want to delete the API key?', 'affililabs'), 'product_slug_save_success' => esc_html__('Product Slug Saved', 'affililabs'), 'product_slug_save_error' => esc_html__('Error Saving Product Slug', 'affililabs'), 'saving_product_slug' => esc_html__('Saving Product Slug...', 'affililabs'), 'product_slug_save_success_message' => esc_html__('Product slug saved successfully. Please re-save your permalinks in WordPress settings if changes are not immediately visible.', 'affililabs'), 'category_page_slug_save_success' => esc_html__('Category Page Slug Saved', 'affililabs'), 'category_page_slug_save_error' => esc_html__('Error Saving Category Page Slug', 'affililabs'), 'saving_category_page_slug' => esc_html__('Saving Category Page Slug...', 'affililabs'), 'category_page_slug_save_success_message' => esc_html__('Category page slug saved successfully. Please re-save your permalinks in WordPress settings if changes are not immediately visible.', 'affililabs'), 'saving_api_key' => esc_html__('Saving API Key...', 'affililabs'), 'api_key_saved_success_message' => esc_html__('API Key saved successfully.', 'affililabs'), 'deleting_api_key' => esc_html__('Deleting API Key...', 'affililabs'), 'api_key_deleted_success_message' => esc_html__('API Key deleted successfully.', 'affililabs'), 'saving_debug_settings' => esc_html__('Saving Debug Settings...', 'affililabs'), 'debug_settings_saved_success_message' => esc_html__('Debug settings saved successfully.', 'affililabs'), 'saving_ai_language' => esc_html__('Saving AI Language Settings...', 'affililabs'), 'ai_language_saved_success_message' => esc_html__('AI language settings saved successfully.', 'affililabs'), 'saving_formatting_settings_loading' => esc_html__('Saving Formatting Settings...', 'affililabs'), 'saving_archive_page_loading' => esc_html__('Saving Archive Page Settings...', 'affililabs'), 'archive_page_settings_saved_message' => esc_html__('Archive page settings saved successfully.', 'affililabs'), 'saving_op_elements_loading' => esc_html__('Saving Optimizepress Elements Settings...', 'affililabs'), 'op_elements_saved_message' => esc_html__('Optimizepress Elements settings saved successfully.', 'affililabs'), 'resetting_op_elements_loading' => esc_html__('Resetting Optimizepress Elements...', 'affililabs'), 'reset_op_elements_success_message' => esc_html__('Optimizepress Global Elements reset successfully and integration disabled.', 'affililabs'), 'confirm_reset_op_elements_title' => esc_html__('Confirm Reset', 'affililabs'), 'confirm_reset_op_elements' => esc_html__('Are you sure you want to reset all AffiliLabs Optimizepress Global Elements? This will delete them and disable the integration.', 'affililabs'), 'ajax_error_alert' => esc_html__('AJAX Error!', 'affililabs'), 'saving_template_settings_loading' => esc_html__('Saving Template Settings...', 'affililabs'), 'template_settings_saved_message' => esc_html__('Template settings saved successfully.', 'affililabs'), 'saving_danger_zone_settings_loading' => esc_html__('Saving Danger Zone Settings...', 'affililabs'), 'danger_zone_settings_saved_message' => esc_html__('Danger Zone settings saved successfully.', 'affililabs'), ) )); $current_api_key = AFFLSettingsService::get_internal_api_key(); $obfuscated_api_key = ''; if (!empty($current_api_key)) { $len = strlen($current_api_key); $obfuscated_api_key = str_repeat('*', max(0, $len - 5)) . substr($current_api_key, -5); } ?>