is_own_screen() ) { return; } remove_all_actions( 'admin_notices' ); remove_all_actions( 'all_admin_notices' ); } private function get_current_tab() { return ( isset( $_GET['tab'] ) && 'settings' === $_GET['tab'] ) ? 'settings' : 'scan'; } private function get_tab_url( $tab ) { return add_query_arg( array( 'page' => self::MENU_SLUG, 'tab' => $tab, ), admin_url( 'upload.php' ) ); } public function enqueue_assets( $hook ) { if ( strpos( $hook, self::MENU_SLUG ) === false ) { return; } wp_enqueue_style( 'aiatg-admin', AIATG_PLUGIN_URL . 'admin/css/admin.css', array(), AIATG_VERSION ); if ( 'scan' !== $this->get_current_tab() ) { return; } wp_enqueue_script( 'aiatg-admin', AIATG_PLUGIN_URL . 'admin/js/admin.js', array( 'jquery' ), AIATG_VERSION, true ); wp_localize_script( 'aiatg-admin', 'AIATG', array( 'ajaxUrl' => admin_url( 'admin-ajax.php' ), 'nonce' => wp_create_nonce( AIATG_Ajax::NONCE_ACTION ), 'i18n' => array( 'scanning' => __( 'Scanning site for images…', 'fix-experts-ai-image-alt-tag-generator' ), 'noResults' => __( 'No images without alt text were found. 🎉', 'fix-experts-ai-image-alt-tag-generator' ), 'generating' => __( 'Generating…', 'fix-experts-ai-image-alt-tag-generator' ), 'saving' => __( 'Saving…', 'fix-experts-ai-image-alt-tag-generator' ), 'saved' => __( 'Saved', 'fix-experts-ai-image-alt-tag-generator' ), 'failed' => __( 'Failed', 'fix-experts-ai-image-alt-tag-generator' ), 'selectAtLeastOne' => __( 'Select at least one image first.', 'fix-experts-ai-image-alt-tag-generator' ), 'confirmBulkSave' => __( 'Save all generated alt text now?', 'fix-experts-ai-image-alt-tag-generator' ), /* translators: %1$d = current item, %2$d = total items */ 'progress' => __( 'Processing %1$d of %2$d…', 'fix-experts-ai-image-alt-tag-generator' ), ), ) ); } public function render_page() { if ( ! current_user_can( 'upload_files' ) ) { wp_die( esc_html__( 'You do not have permission to access this page.', 'fix-experts-ai-image-alt-tag-generator' ) ); } $tab = $this->get_current_tab(); ?>

render_settings_tab(); } else { $this->render_scan_tab(); } ?>

wpfixexperts.com

get_tab_url( 'settings' ) ) . '">' . esc_html__( 'Settings', 'fix-experts-ai-image-alt-tag-generator' ) . '' ); ?>

get_tab_url( 'settings' ) ) . '">' . esc_html__( 'Settings', 'fix-experts-ai-image-alt-tag-generator' ) . '' ); ?>