Site Health > Info. * * @since 2.8.3 */ final class FunnelDebugInfo { /** Site Health section key. */ public const SECTION = 'aipt_first_run'; /** * Hook the section into Site Health. Safe to call more than once. * * @return void */ public static function register(): void { if ( false === has_filter( 'debug_information', array( self::class, 'addSection' ) ) ) { add_filter( 'debug_information', array( self::class, 'addSection' ) ); } } /** * Add the section to the Site Health debug data. * * @param mixed $info Debug information sections. * @return mixed */ public static function addSection( $info ) { if ( ! is_array( $info ) ) { return $info; } $yes = __( 'Yes', 'ai-product-tools' ); $no = __( 'No', 'ai-product-tools' ); $not_reached = __( 'Not reached', 'ai-product-tools' ); $eligible = FirstRunState::isEligible(); $first_value = FirstRunState::firstValueReached(); $fields = array( 'eligible' => array( 'label' => __( 'First-run experience eligible', 'ai-product-tools' ), 'value' => $eligible ? $yes : $no, 'debug' => $eligible ? 'yes' : 'no', ), 'first_value' => array( 'label' => __( 'First value reached', 'ai-product-tools' ), 'value' => $first_value ? $yes : $no, 'debug' => $first_value ? 'yes' : 'no', ), ); $milestones = FunnelMilestones::all(); foreach ( FunnelMilestones::allEvents() as $event ) { $fields[ 'milestone_' . $event ] = array( /* translators: %s: funnel event name, for example key_saved */ 'label' => sprintf( __( 'Milestone: %s', 'ai-product-tools' ), $event ), 'value' => isset( $milestones[ $event ] ) ? $milestones[ $event ] : $not_reached, 'debug' => isset( $milestones[ $event ] ) ? $milestones[ $event ] : 'not reached', ); } $info[ self::SECTION ] = array( 'label' => __( 'AI Product Tools first run', 'ai-product-tools' ), 'description' => __( 'Local-only milestones of the first-run experience. Nothing is sent anywhere.', 'ai-product-tools' ), 'fields' => $fields, ); return $info; } }