array( 'label' => __( 'Nightly AI writing (SEO, General): page titles and content to DataForSEO and, through rooster.systems, to Claude', 'ai-eshop-optimizer' ), 'url' => $dmm . '&dmm_tab=seo_general#aieo-seo-ai-write-nightly', 'on' => static function () use ( $seo ) { return $seo( 'seo.ai_write_nightly' ); }, ), 'dfs_weekly' => array( 'label' => __( 'Weekly rankings pull (SEO, General): this site’s address to DataForSEO, billed within your monthly budget', 'ai-eshop-optimizer' ), 'url' => $dmm . '&dmm_tab=seo_general#aieo-dfs-weekly', 'on' => static function () use ( $seo ) { return $seo( 'seo.dfs_weekly_pull' ); }, ), 'proposals_narrate' => array( 'label' => __( 'Name proposals with AI (Proposals): each new proposal’s figures, through rooster.systems, to Claude', 'ai-eshop-optimizer' ), 'url' => $dmm . '&dmm_tab=proposals#aieo-prop-narrate', 'on' => static function () { return 'yes' === (string) get_option( 'aieo_proposals_narrate', '' ); }, ), 'chat_index' => array( 'label' => __( 'Index products and courses for the chat (AI Chat, Step 1): the text of your products, courses and pages, through rooster.systems, to Voyage AI', 'ai-eshop-optimizer' ), 'url' => class_exists( 'AIEO_Chat_Indexing' ) ? AIEO_Chat_Indexing::settings_url() : admin_url( 'admin.php?page=ai-eshop-chat' ), 'on' => static function () { return class_exists( 'AIEO_Chat_Indexing' ) && '1' === (string) get_option( AIEO_Chat_Indexing::OPTION, '0' ); }, ), 'competition_consent' => array( 'label' => __( 'Competition entry forms show a newsletter consent box, ticked to start with: only entrants who leave it ticked are subscribed. The Competitions setting can start it unticked.', 'ai-eshop-optimizer' ), 'url' => $dmm . '&dmm_tab=competitions#aieo-comp-consent', ), ); } public static function render() { $page = isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : ''; if ( 0 !== strpos( $page, 'ai-eshop' ) && 0 !== strpos( $page, 'rooster-one' ) ) { return; } $items = self::fold_chat_legacy( get_option( self::OPTION, array() ) ); if ( ! is_array( $items ) || ! $items || ! current_user_can( 'manage_options' ) || ! self::existing_shop() ) { return; } $defs = self::items(); $rows = ''; foreach ( $items as $key => $state ) { if ( ! isset( $defs[ $key ] ) ) { continue; } if ( self::NOTE !== $state && ( 'on' !== $state || ( isset( $defs[ $key ]['on'] ) && ! call_user_func( $defs[ $key ]['on'] ) ) ) ) { continue; } $link = '' . esc_html( $defs[ $key ]['label'] ) . ''; $rows .= '
' . esc_html__( 'Your data and consent settings', 'ai-eshop-optimizer' ) . '
' . esc_html__( 'Each of these features has a setting of its own. On this shop they are set as below; change any of them from its link.', 'ai-eshop-optimizer' ) . '