false, 'post_types' => [ 'post', 'page' ], 'analysis_trigger' => 'on_save', // on_save | on_update | manual 'needs_improvement_threshold' => 70, // 0..100 'analyze_only_with_keyword' => false, //OpenAI API Setting 'openai_api_key' => '', 'openai_model' => 'gpt-4o', 'request_timeout' => 45, 'force_model_override' => '', 'default_language' => 'en', // SEO Analysis 'target_keyword_limit' => 2, // Lite cap (Pro removes limit) 'analyze_only_with_keyword' => false, 'needs_improvement_threshold' => 70, 'weight_title' => 25, // scoring weights (%) 'weight_meta' => 20, 'weight_headings' => 20, 'weight_readability' => 15, 'weight_links' => 10, 'weight_images' => 10, // Keywords 'keywords_variant_count' => 12, 'keywords_longtail_count' => 8, 'tone' => 'neutral', 'language' => 'site', 'audience' => '', 'temperature' => 0.5, 'top_p' => 1.0, 'presence_penalty' => 0.0, 'frequency_penalty' => 0.0, 'max_tokens' => 320, 'safety_filter' => 1, // Meta 'meta_generate_variants' => 5, 'brand_terms' => '', 'meta_force_focus_terms' => 1, 'meta_title_len_min' => 35, 'meta_title_len_max' => 60, 'meta_desc_len_min' => 110, 'meta_desc_len_max' => 155, // Schema 'schema_mode' => 'auto_insert', 'schema_overwrite_existing' => false, 'schema_minify' => true, 'schema_default_types' => [ 'article' ], // Reports 'reports_keep_days' => 365, // WooCommerce 'woo_enable' => false, 'woo_product_schema_type' => 'Product', 'woo_attribute_keywords' => 1, 'woo_use_short_desc_for_meta' => true, // Meta Titles & Descriptions (Lite = manual helpers) 'manual_meta_disabled' => false, 'meta_length_pref' => 'standard', // short | standard | long (shown in Lite; AI uses in Pro) // Editor Integration 'hide_gutenberg' => false, 'hide_classic' => false, 'visible_roles' => [ 'administrator', 'editor' ], // who sees the SEO UI // Compatibility (read/write to popular SEO plugins’ fields) 'compat_integrations' => [ 'aio_seo', 'yoast', 'rankmath', 'seopress' ], ]; public function __construct() { add_action( 'init', [ $this, 'register_settings_page' ], 11 ); } public static function get_options() { $saved = get_option('ait-aipseo-settings', []); return array_merge(self::$defaults, (array) $saved); } public static function get($key) { $options = self::get_options(); if ( ! empty( $options[ $key ] ) ) { return apply_filters( 'ait-aipseo-settings-' . $key, $options[ $key ] ); } if ( ! empty( self::$defaults[ $key ] ) ) { return apply_filters( 'ait-aipseo-settings-' . $key, self::$defaults[ $key ] ); } return apply_filters( 'ait-aipseo-settings-' . $key, null ); } public static function update($key, $value) { $options = self::get_options(); $options[$key] = $value; update_option('ait-aipseo-settings', $options); } public static function reset() { update_option('ait-aipseo-settings', self::$defaults); } /** * Initialize: register settings and build SAP page/tabs/sections/fields. */ public function register_settings_page() { require_once AIT_AIPSEO_PATH . 'lib/simple-admin-pages/simple-admin-pages.php'; // Build SAP UI $sap = sap_initialize_library( $args = array( 'version' => '2.7.4', 'theme' => 'ait', 'lib_url' => AIT_AIPSEO_URL . '/lib/simple-admin-pages/', ) ); // Settings page $sap->add_page( 'submenu', [ 'id' => 'ait-aipseo-settings', 'title' => __( 'Settings', 'ai-powered-seo-suggestions' ), 'menu_title' => __( 'Settings', 'ai-powered-seo-suggestions' ), 'description' => '', 'capability' => 'manage_options', 'parent_menu' => 'ai-powered-seo-suggestions', 'default_tab' => 'ait-aipseo-license-tab', ] ); $sap->add_section( 'ait-aipseo-settings', array( 'id' => 'ait-aipseo-license-tab', 'title' => __('License', 'ai-powered-seo-suggestions'), 'is_tab' => true, 'icon' => 'admin-network', 'rank' => 0, ) ); $sap->add_section( 'ait-aipseo-settings', array( 'id' => 'ait-aipseo-dashboard', 'title' => __( 'Dashboard', 'ai-powered-seo-suggestions' ), 'tab' => 'ait-aipseo-license-tab', ) ); $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-dashboard', 'html', array( 'id' => 'ait_aipseo_license_grid', 'title' => __('License', 'ai-powered-seo-suggestions' ), 'html' => [ 'AIT_AIPSEO_Dashboard', 'display_dashboard_license' ], ) ); $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-dashboard', 'html', array( 'id' => 'ait_aipseo_usage_grid', 'title' => __('SEO Status', 'ai-powered-seo-suggestions' ), 'html' => [ 'AIT_AIPSEO_Dashboard', 'display_dashboard_seo_status' ], ) ); $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-dashboard', 'html', array( 'id' => 'ait_aipseo_quick_actions_grid', 'title' => __('Quick Actions', 'ai-powered-seo-suggestions' ), 'html' => [ 'AIT_AIPSEO_Dashboard', 'display_dashboard_seo_shortcuts' ], ) ); /** * GENERAL */ $sap->add_section( 'ait-aipseo-settings', array( 'id' => 'ait-aipseo-general-tab', 'title' => __('General', 'ai-powered-seo-suggestions'), 'is_tab' => true, 'icon' => 'text', 'rank' => 1, ) ); $sap->add_section( 'ait-aipseo-settings', [ 'id' => 'ait-aipseo-general', 'title' => __( 'General', 'ai-powered-seo-suggestions' ), 'description' => __( 'Disable analysis and choose where and when it runs.', 'ai-powered-seo-suggestions' ), 'tab' => 'ait-aipseo-general-tab' ] ); $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-general', 'toggle', [ 'id' => 'disabled', 'title' => __( 'Disable Analysis', 'ai-powered-seo-suggestions' ), 'description' => __( 'Turn off the analysis done via save and cron job.', 'ai-powered-seo-suggestions' ), ] ); $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-general', 'checkbox', [ 'id' => 'post_types', 'title' => __( 'Post Types', 'ai-powered-seo-suggestions' ), 'options' => $this->get_supported_post_types(), 'default' => self::$defaults['post_types'], 'description' => __( 'Choose where the SEO panel appears.', 'ai-powered-seo-suggestions' ), ] ); $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-general', 'select', [ 'id' => 'analysis_trigger', 'title' => __( 'Run Analysis', 'ai-powered-seo-suggestions' ), 'options' => [ 'on_save' => __( 'On Save', 'ai-powered-seo-suggestions' ), 'on_update' => __( 'On Update', 'ai-powered-seo-suggestions' ), 'manual' => __( 'Manually', 'ai-powered-seo-suggestions' ), ], 'blank_option' => false, 'default' => self::$defaults['analysis_trigger'], 'description' => __( 'Choose when checks are run: on save, on content update, or only when triggered manually in the editor.', 'ai-powered-seo-suggestions' ), ] ); $sap->add_section( 'ait-aipseo-settings', [ 'id' => 'ait-aipseo-openai', 'title' => __( 'OpenAI', 'ai-powered-seo-suggestions' ), 'description' => __( 'Settings to enable and fine-tune the API connection to OpenAI.', 'ai-powered-seo-suggestions' ), 'tab' => 'ait-aipseo-general-tab' ] ); $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-openai', 'text', [ 'id' => 'openai_api_key', 'title' => __( 'OpenAI API Key', 'ai-powered-seo-suggestions' ), 'description' => __( 'Your OpenAI API key, which will be used for the image processing requests.', 'ai-powered-seo-suggestions' ), ] ); $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-openai', 'select', [ 'id' => 'openai_model', 'title' => __( 'OpenAI Model', 'ai-powered-seo-suggestions' ), 'description' => __('Which OpenAI model should be used to handle the image processing requests?', 'ai-powered-seo-suggestions'), 'options' => [ 'gpt-5.1' => __( 'GPT-5.1', 'ai-powered-seo-suggestions' ), 'gpt-5' => __( 'GPT-5', 'ai-powered-seo-suggestions' ), 'gpt-5-mini' => __( 'GPT-5 Mini', 'ai-powered-seo-suggestions' ), 'gpt-4.1' => __( 'GPT-4.1', 'ai-powered-seo-suggestions' ), 'gpt-4o' => __( 'GPT-4o', 'ai-powered-seo-suggestions' ), 'gpt-3.5-turbo' => __( 'GPT-3.5 Turbo', 'ai-powered-seo-suggestions' ), ], 'blank_option' => false, 'default' => self::$defaults['openai_model'], ] ); $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-openai', 'text', [ 'id' => 'force_model_override', 'title' => __( 'Force Model Override', 'ai-powered-seo-suggestions' ), 'description' => __( 'The OpenAI model you want to use instead of those listed above. Non-existent models or typos will cause all AI features to stop working.', 'ai-powered-seo-suggestions' ), ] ); $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-pro-generation', 'radio', [ 'id' => 'language', 'title' => __( 'Language', 'ai-powered-seo-suggestions' ), 'description' => __( 'Choose how AIPSEO decides which language to use when generating AI content (site language, detected from the content, or a custom language you set below).', 'ai-powered-seo-suggestions' ), 'options' => array( 'site' => __( 'Site Language', 'ai-powered-seo-suggestions' ), 'content-detected' => __( 'Detect from Content', 'ai-powered-seo-suggestions' ), 'custom' => __( 'Custom (set below)', 'ai-powered-seo-suggestions' ), ), 'default' => 'site', ] ); $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-openai', 'select', array( 'id' => 'custom_language', 'title' => __('Custom Language', 'ai-powered-seo-suggestions' ), 'description' => __('What language should the responses be in?', 'ai-powered-seo-suggestions'), 'options' => self::get_language_options(), 'blank_option' => false, 'default' => self::$defaults['default_language'], 'conditional_on' => 'language', 'conditional_on_value' => array( 'custom' ) ) ); /** * SEO ANALYSIS */ $sap->add_section( 'ait-aipseo-settings', [ 'id' => 'ait-aipseo-seo', 'title' => __( 'SEO Analysis', 'ai-powered-seo-suggestions' ), 'description' => __( 'Configure target keyword limits and scoring weights.', 'ai-powered-seo-suggestions' ), 'tab' => 'ait-aipseo-general-tab' ] ); $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-seo', 'toggle', [ 'id' => 'analyze_only_with_keyword', 'title' => __( 'Only Analyze When a Target Keyword Is Set', 'ai-powered-seo-suggestions' ), 'description' => __( 'Saves processing time by skipping posts without a target keyword.', 'ai-powered-seo-suggestions' ), ] ); $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-seo', 'number', [ 'id' => 'target_keyword_limit', 'title' => __( 'Target Keyword Limit (Lite)', 'ai-powered-seo-suggestions' ), 'min' => 1, 'max' => 2, 'placeholder' => self::$defaults['target_keyword_limit'], 'description' => __( 'Pro removes this limit.', 'ai-powered-seo-suggestions' ), ] ); $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-seo', 'number', [ 'id' => 'needs_improvement_threshold', 'title' => __( '“Needs Improvement” Threshold (%)', 'ai-powered-seo-suggestions' ), 'min' => 1, 'max' => 100, 'placeholder' => self::$defaults['needs_improvement_threshold'], 'description' => __( 'Posts scoring below this value will be flagged as “Needs Improvement”.', 'ai-powered-seo-suggestions' ), ] ); // Scoring weights $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-seo', 'number', [ 'id' => 'weight_title', 'title' => __( 'Title Weight (%)', 'ai-powered-seo-suggestions' ), 'min' => 0, 'max' => 100, 'placeholder' => self::$defaults['weight_title'], 'description' => __( 'How much the page title contributes to the overall SEO score (percentage). Default is 25.', 'ai-powered-seo-suggestions' ), ] ); $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-seo', 'number', [ 'id' => 'weight_meta', 'title' => __( 'Meta Description Weight (%)', 'ai-powered-seo-suggestions' ), 'min' => 0, 'max' => 100, 'placeholder' => self::$defaults['weight_meta'], 'description' => __( 'How much the meta description contributes to the overall SEO score (percentage). Default is 20.', 'ai-powered-seo-suggestions' ), ] ); $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-seo', 'number', [ 'id' => 'weight_headings', 'title' => __( 'Headings Weight (%)', 'ai-powered-seo-suggestions' ), 'min' => 0, 'max' => 100, 'placeholder' => self::$defaults['weight_headings'], 'description' => __( 'How much headings (H1–H6) contribute to the overall SEO score (percentage). Default is 20.', 'ai-powered-seo-suggestions' ), ] ); $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-seo', 'number', [ 'id' => 'weight_readability', 'title' => __( 'Readability Weight (%)', 'ai-powered-seo-suggestions' ), 'min' => 0, 'max' => 100, 'placeholder' => self::$defaults['weight_readability'], 'description' => __( 'How much readability signals (sentence length, structure, clarity) contribute to the SEO score (percentage). Default is 15.', 'ai-powered-seo-suggestions' ), ] ); $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-seo', 'number', [ 'id' => 'weight_links', 'title' => __( 'Links Weight (%)', 'ai-powered-seo-suggestions' ), 'min' => 0, 'max' => 100, 'placeholder' => self::$defaults['weight_links'], 'description' => __( 'How much internal and external linking quality contributes to the SEO score (percentage). Default is 10.', 'ai-powered-seo-suggestions' ), ] ); $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-seo', 'number', [ 'id' => 'weight_images', 'title' => __( 'Images/Alt Text Weight (%)', 'ai-powered-seo-suggestions' ), 'min' => 0, 'max' => 100, 'placeholder' => self::$defaults['weight_images'], 'description' => __( 'How much image usage/alt text contributes to the SEO score (percentage). Default is 10.', 'ai-powered-seo-suggestions' ), ] ); /** * META */ $sap->add_section( 'ait-aipseo-settings', [ 'id' => 'ait-aipseo-meta', 'title' => __( 'Meta Titles & Descriptions', 'ai-powered-seo-suggestions' ), 'description' => __( 'Control manual helpers in the editor sidebar.', 'ai-powered-seo-suggestions' ), 'tab' => 'ait-aipseo-general-tab' ] ); $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-meta', 'toggle', [ 'id' => 'manual_meta_disabled', 'title' => __( 'Disable Manual Suggestions', 'ai-powered-seo-suggestions' ), 'description' => __( 'Show manual fields to edit title and meta description. When enabled, you can override AI suggestions when using Pro.', 'ai-powered-seo-suggestions' ), ] ); $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-meta', 'select', [ 'id' => 'meta_length_pref', 'title' => __( 'Preferred Meta Length', 'ai-powered-seo-suggestions' ), 'options' => [ 'short' => __( 'Short', 'ai-powered-seo-suggestions' ), 'standard' => __( 'Standard', 'ai-powered-seo-suggestions' ), 'long' => __( 'Long', 'ai-powered-seo-suggestions' ), ], 'blank_option' => false, 'default' => self::$defaults['meta_length_pref'], 'description' => __( 'Used by AI generation in Pro.', 'ai-powered-seo-suggestions' ), ] ); /** * EDITOR INTEGRATION */ $sap->add_section( 'ait-aipseo-settings', [ 'id' => 'ait-aipseo-editor', 'title' => __( 'Editor Integration', 'ai-powered-seo-suggestions' ), 'description' => __( 'Toggle Gutenberg sidebar and Classic Editor metabox.', 'ai-powered-seo-suggestions' ), 'tab' => 'ait-aipseo-general-tab' ] ); $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-editor', 'toggle', [ 'id' => 'hide_gutenberg', 'title' => __( 'Hide Gutenberg Sidebar', 'ai-powered-seo-suggestions' ), 'description' => __( 'Hide the AIP SEO panel in the Block Editor (Gutenberg).', 'ai-powered-seo-suggestions' ), ] ); $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-editor', 'toggle', [ 'id' => 'hide_classic', 'title' => __( 'Hide Classic Editor Metabox', 'ai-powered-seo-suggestions' ), 'description' => __( 'Hide the AIP SEO panel in the Classic Editor.', 'ai-powered-seo-suggestions' ), ] ); $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-editor', 'checkbox', [ 'id' => 'visible_roles', 'title' => __( 'Visible To Roles', 'ai-powered-seo-suggestions' ), 'options' => [ 'administrator' => __( 'Administrator', 'ai-powered-seo-suggestions' ), 'editor' => __( 'Editor', 'ai-powered-seo-suggestions' ), 'author' => __( 'Author', 'ai-powered-seo-suggestions' ), 'contributor' => __( 'Contributor', 'ai-powered-seo-suggestions' ), ], 'default' => self::$defaults['visible_roles'], 'description' => __( 'Choose which roles can see the AI-Powered SEO sidebar/metabox.', 'ai-powered-seo-suggestions' ), ] ); /** * COMPATIBILITY (Yoast / Rank Math / SEOPress) */ $sap->add_section( 'ait-aipseo-settings', [ 'id' => 'ait-aipseo-compatability', 'title' => __( 'Compatibility', 'ai-powered-seo-suggestions' ), 'description' => __( 'Integrate with existing SEO plugins to read/write meta fields.', 'ai-powered-seo-suggestions' ), 'tab' => 'ait-aipseo-general-tab' ] ); $sap->add_setting( 'ait-aipseo-settings', 'ait-aipseo-compatability', 'checkbox', [ 'id' => 'compat_integrations', 'title' => __( 'Integrations', 'ai-powered-seo-suggestions' ), 'description' => __( 'Select which other SEO plugins AIPSEO should read from and write to, so titles, meta descriptions, and keywords stay in sync across plugins.', 'ai-powered-seo-suggestions' ), 'options' => [ 'aio_seo' => __( 'All-In-One SEO', 'ai-powered-seo-suggestions' ), 'yoast' => __( 'Yoast SEO', 'ai-powered-seo-suggestions' ), 'rankmath' => __( 'Rank Math', 'ai-powered-seo-suggestions' ), 'seopress' => __( 'SEOPress', 'ai-powered-seo-suggestions' ), ], 'default' => self::$defaults['compat_integrations'], ] ); /** * PRO FEATURES */ $sap->add_section( 'ait-aipseo-settings', array( 'id' => 'ait-aipseo-pro-tab', 'title' => __( 'Pro', 'ai-powered-seo-suggestions' ), 'is_tab' => true, 'icon' => 'awards', 'rank' => 2, //'tutorial_yt_id' => 'gV0mAkKWSXg', 'show_submit_button' => self::show_submit_button( 'can_pro' ) ) ); $sap->add_section( 'ait-aipseo-settings', array( 'id' => 'ait-aipseo-pro', 'tab' => 'ait-aipseo-pro-tab', 'callback' => self::premium_info( 'pro' ) ) ); $sap->add_section( 'ait-aipseo-settings', array( 'id' => 'ait-aipseo-keyword-recommendation-tab', 'title' => __( 'Semantic Keyword Recommendations', 'ai-powered-seo-suggestions' ), 'is_tab' => true, 'icon' => 'editor-spellcheck', 'rank' => 3, //'tutorial_yt_id' => 'gV0mAkKWSXg', 'show_submit_button' => self::show_submit_button( 'can_keyword_recommendation' ) ) ); $sap->add_section( 'ait-aipseo-settings', array( 'id' => 'ait-aipseo-keyword-recommendation', 'tab' => 'ait-aipseo-keyword-recommendation-tab', 'callback' => self::premium_info( 'keyword_recommendation' ) ) ); $sap->add_section( 'ait-aipseo-settings', array( 'id' => 'ait-aipseo-schema-tab', 'title' => __( 'Schema Markup Assistant', 'ai-powered-seo-suggestions' ), 'is_tab' => true, 'icon' => 'code-standards', 'rank' => 4, //'tutorial_yt_id' => 'gV0mAkKWSXg', 'show_submit_button' => self::show_submit_button( 'can_schema' ) ) ); $sap->add_section( 'ait-aipseo-settings', array( 'id' => 'ait-aipseo-schema', 'tab' => 'ait-aipseo-schema-tab', 'callback' => self::premium_info( 'schema' ) ) ); $sap->add_section( 'ait-aipseo-settings', array( 'id' => 'ait-aipseo-bulk-tab', 'title' => __( 'Bulk & Automation', 'ai-powered-seo-suggestions' ), 'is_tab' => true, 'icon' => 'images-alt2', 'rank' => 5, //'tutorial_yt_id' => 'gV0mAkKWSXg', 'show_submit_button' => self::show_submit_button( 'can_bulk' ) ) ); $sap->add_section( 'ait-aipseo-settings', array( 'id' => 'ait-aipseo-bulk', 'tab' => 'ait-aipseo-bulk-tab', 'callback' => self::premium_info( 'bulk' ) ) ); $sap->add_section( 'ait-aipseo-settings', array( 'id' => 'ait-aipseo-woocommerce-tab', 'title' => __( 'WooCommerce', 'ai-powered-seo-suggestions' ), 'is_tab' => true, 'icon' => 'cart', 'rank' => 6, //'tutorial_yt_id' => 'gV0mAkKWSXg', 'show_submit_button' => self::show_submit_button( 'can_woocommerce' ) ) ); $sap->add_section( 'ait-aipseo-settings', array( 'id' => 'ait-aipseo-woocommerce', 'tab' => 'ait-aipseo-woocommerce-tab', 'callback' => self::premium_info( 'woocommerce' ) ) ); $sap->add_section( 'ait-aipseo-settings', array( 'id' => 'ait-aipseo-advanced-tab', 'title' => __( 'Advanced', 'ai-powered-seo-suggestions' ), 'is_tab' => true, 'icon' => 'welcome-widgets-menus', 'rank' => 7, //'tutorial_yt_id' => 'gV0mAkKWSXg', 'show_submit_button' => self::show_submit_button( 'can_advanced' ) ) ); $sap->add_section( 'ait-aipseo-settings', array( 'id' => 'ait-aipseo-advanced', 'tab' => 'ait-aipseo-advanced-tab', 'callback' => self::premium_info( 'advanced' ) ) ); $sap->add_section( 'ait-aipseo-settings', array( 'id' => 'ait-aipseo-reports-tab', 'title' => __( 'Reports, History & REST API', 'ai-powered-seo-suggestions' ), 'is_tab' => true, 'icon' => 'analytics', 'rank' => 8, //'tutorial_yt_id' => 'gV0mAkKWSXg', 'show_submit_button' => self::show_submit_button( 'can_reports' ) ) ); $sap->add_section( 'ait-aipseo-settings', array( 'id' => 'ait-aipseo-reports', 'tab' => 'ait-aipseo-reports-tab', 'callback' => self::premium_info( 'reports' ) ) ); $sap = apply_filters( 'ait_aipseo_settings_page', $sap, $this ); $sap->add_admin_menus(); } public static function get_language_options() { return [ 'af' => 'Afrikaans', 'sq' => 'Shqip', 'am' => 'አማርኛ', 'ar' => 'العربية', 'hy' => 'Հայերեն', 'az' => 'Azərbaycan dili', 'bn' => 'বাংলা', 'bs' => 'Bosanski', 'bg' => 'Български', 'ca' => 'Català', 'zh_CN' => '简体中文', 'zh_TW' => '繁體中文', 'hr' => 'Hrvatski', 'cs' => 'Čeština', 'da' => 'Dansk', 'nl' => 'Nederlands', 'en' => 'English', 'et' => 'Eesti', 'fi' => 'Suomi', 'fr' => 'Français', 'de' => 'Deutsch', 'el' => 'Ελληνικά', 'gu' => 'ગુજરાતી', 'he' => 'עברית', 'hi' => 'हिन्दी', 'hu' => 'Magyar', 'is' => 'Íslenska', 'id' => 'Bahasa Indonesia', 'it' => 'Italiano', 'ja' => '日本語', 'kn' => 'ಕನ್ನಡ', 'ko' => '한국어', 'lv' => 'Latviešu', 'lt' => 'Lietuvių', 'mk' => 'Македонски', 'ms' => 'Bahasa Melayu', 'ml' => 'മലയാളം', 'mr' => 'मराठी', 'ne' => 'नेपाली', 'nb' => 'Norsk Bokmål', 'fa' => 'فارسی', 'pl' => 'Polski', 'pt_BR' => 'Português do Brasil', 'pt_PT' => 'Português', 'pa' => 'ਪੰਜਾਬੀ', 'ro' => 'Română', 'ru' => 'Русский', 'sr' => 'Српски', 'si' => 'සිංහල', 'sk' => 'Slovenčina', 'sl' => 'Slovenščina', 'es' => 'Español', 'sv' => 'Svenska', 'ta' => 'தமிழ்', 'te' => 'తెలుగు', 'th' => 'ไทย', 'tr' => 'Türkçe', 'uk' => 'Українська', 'ur' => 'اردو', 'vi' => 'Tiếng Việt', 'zh_HK' => '香港中文版', ]; } /** * Helper: discover supported post types */ private function get_supported_post_types(): array { $builtin = [ 'post' => __( 'Posts', 'ai-powered-seo-suggestions' ), 'page' => __( 'Pages', 'ai-powered-seo-suggestions' ) ]; $custom = []; foreach ( get_post_types( [ 'public' => true, '_builtin' => false ], 'objects' ) as $pt ) { $custom[ $pt->name ] = $pt->labels->name; } return $builtin + $custom; } public static function show_submit_button( $permission_type = '' ) { return (bool) apply_filters('ait_aipseo/' . $permission_type, false); } public static function premium_info( $section_and_perm_type ) { $is_pro_user = (bool) apply_filters('ait_aipseo/can_pro', false); if ( $is_pro_user ) { return false; } $content = ''; $premium_features = '

' . __( 'The pro version also gives you access to the following features:', 'ai-powered-seo-suggestions' ) . '

'; switch ( $section_and_perm_type ) { case 'pro': $content = '

' . __( 'Pro', 'ai-powered-seo-suggestions' ) . '' . __( 'Pro', 'ai-powered-seo-suggestions' ) . '

' . __( 'Fine tune the tone, content and AI-model settings for keyword suggestions.', 'ai-powered-seo-suggestions' ) . '

pro plugin options pro plugin options
' . $premium_features . '
'; break; case 'keyword_recommendation': $content = '

' . __( 'Semantic Keyword Recommendations', 'ai-powered-seo-suggestions' ) . '' . __( 'Pro', 'ai-powered-seo-suggestions' ) . '

' . __( 'Discover related terms and entities to improve topical coverage.', 'ai-powered-seo-suggestions' ) . '

semantic keyword options
' . $premium_features . '
'; break; case 'schema': $content = '

' . __( 'Schema Markup Assistant', 'ai-powered-seo-suggestions' ) . '' . __( 'Pro', 'ai-powered-seo-suggestions' ) . '

' . __( 'Insert Article, Product, FAQ, or HowTo schema with guided prompts.', 'ai-powered-seo-suggestions' ) . '

schema assistant options
' . $premium_features . '
'; break; case 'bulk': $content = '

' . __( 'Bulk & Automation', 'ai-powered-seo-suggestions' ) . '' . __( 'Pro', 'ai-powered-seo-suggestions' ) . '

' . __( 'Generate meta tags if missing and schedule rescoring of content.', 'ai-powered-seo-suggestions' ) . '

bulk options
' . $premium_features . '
'; break; case 'woocommerce': $content = '

' . __( 'WooComemrce', 'ai-powered-seo-suggestions' ) . '' . __( 'Pro', 'ai-powered-seo-suggestions' ) . '

' . __( 'Set a schema type, use your attributes as keywords and more.', 'ai-powered-seo-suggestions' ) . '

WooCommerce options
' . $premium_features . '
'; break; case 'advanced': $content = '

' . __( 'Advanced', 'ai-powered-seo-suggestions' ) . '' . __( 'Pro', 'ai-powered-seo-suggestions' ) . '

' . __( 'Implement rate limiting and quotas, store AI prompt data and more.', 'ai-powered-seo-suggestions' ) . '

advanced options
' . $premium_features . '
'; break; case 'reports': $content = '

' . __( 'Reports, History & REST API', 'ai-powered-seo-suggestions' ) . '' . __( 'Pro', 'ai-powered-seo-suggestions' ) . '

' . __( 'Track progress over time, export CSV/PDF, and use REST for automation.', 'ai-powered-seo-suggestions' ) . '

reports options
' . $premium_features . '
'; break; } return function() use ( $content ) { echo wp_kses_post( $content ); }; } }