'; printf( /* translators: %d: Number of skipped FAQ rows */ esc_html__( 'AEOLynx for WebMCP skipped %d FAQ row(s) because FAQPage schema answers must be factual and at least 40 characters long.', 'aeolynx-for-webmcp' ), absint( $skipped ) ); echo '
'; } /** * Add the WebMCP AEO meta box to public post types. * * @return void */ public static function register_meta_boxes() { $screens = array( 'post', 'page' ); if ( post_type_exists( 'product' ) ) { $screens[] = 'product'; } foreach ( $screens as $screen ) { add_meta_box( 'aeolynx_aeo_metabox', __( 'AEOLynx for WebMCP — AEO & AI Answer Engine Optimization', 'aeolynx-for-webmcp' ), array( __CLASS__, 'render_meta_box' ), $screen, 'normal', 'high' ); } } /** * Render the meta box HTML. * * @param mixed $post Current post object. * @return void */ public static function render_meta_box( $post = null ) { if ( ! ( $post instanceof WP_Post ) ) { return; } wp_nonce_field( 'aeolynx_save_metabox', 'aeolynx_metabox_nonce' ); echo ''; $ai_summary = (string) get_post_meta( $post->ID, '_aeolynx_ai_summary', true ); $auto_summary = AEOLynx_Activity_Log::get_effective_ai_summary( $post ); $schema_type = (string) get_post_meta( $post->ID, '_aeolynx_schema_type', true ); $speakable_disable = (bool) get_post_meta( $post->ID, '_aeolynx_speakable_disable', true ); $speakable_on = (bool) get_option( 'aeolynx_speakable_enabled', 1 ) && ! $speakable_disable; $faqs = get_post_meta( $post->ID, '_aeolynx_faq_items', true ); $auto_faqs = AEOLynx_Activity_Log::extract_auto_faqs_from_html( $post->post_content ); $faqs_manual = is_array( $faqs ) && ! empty( $faqs ); if ( ! $faqs_manual ) { $faqs = ! empty( $auto_faqs ) ? $auto_faqs : array( array( 'q' => '', 'a' => '', ), ); } $permalink = get_permalink( $post ); $md_url = $permalink ? add_query_arg( 'format', 'markdown', $permalink ) : ''; $xray_url = admin_url( 'admin.php?page=aeolynx-for-webmcp&tab=xray&post_id=' . (int) $post->ID ); ?> $question ) { $q_clean = trim( $question ); $a_clean = isset( $raw_as[ $index ] ) ? trim( $raw_as[ $index ] ) : ''; if ( '' === $q_clean && '' === $a_clean ) { continue; } if ( '' !== $q_clean && AEOLynx_Schema_Graph::is_publishable_faq_answer( $a_clean ) ) { $faqs[] = array( 'q' => $q_clean, 'a' => $a_clean, ); } else { ++$skipped; } } if ( $skipped > 0 && get_current_user_id() > 0 ) { set_transient( 'aeolynx_faq_skipped_' . get_current_user_id(), $skipped, 60 ); } if ( ! empty( $faqs ) ) { update_post_meta( $post_id, '_aeolynx_faq_items', $faqs ); } else { delete_post_meta( $post_id, '_aeolynx_faq_items' ); } } } } }