get(); $total_indexed = $stats['total_posts_indexed']; $broken_count = $stats['broken_links_count']; $orphan_count = $stats['orphan_count']; $gaining_count = $stats['posts_gaining_links']; $health_score = $stats['health_score']; $monthly_links = $stats['monthly_links']; // Health score colour class. $score_class = 'pl-dash-health__score--good'; if ( $health_score < 90 ) { $score_class = 'pl-dash-health__score--warn'; } if ( $health_score < 70 ) { $score_class = 'pl-dash-health__score--bad'; } // Bar-chart: normalise bar heights against the max month. $chart_max = 0; foreach ( $monthly_links as $month_link_total ) { if ( $month_link_total['count'] > $chart_max ) { $chart_max = $month_link_total['count']; } } // Time-based greeting and the page-header subtitle / actions. $hour = (int) current_time( 'G' ); $greeting = $hour < 12 ? __( 'Good morning', 'postlinkly' ) : ( $hour < 18 ? __( 'Good afternoon', 'postlinkly' ) : __( 'Good evening', 'postlinkly' ) ); $report_url = \Postlinkly\Admin\AdminUrls::report(); $tools_url = \Postlinkly\Admin\AdminUrls::tools(); $editor_url = admin_url( 'post-new.php' ); $page_title = $greeting; $page_sub = sprintf( /* translators: %d: number of posts indexed */ _n( '%d post indexed — here is what needs attention.', '%d posts indexed — here is what needs attention.', $total_indexed, 'postlinkly' ), $total_indexed ); $page_action = sprintf( '%2$s %4$s', esc_url( $tools_url ), esc_html__( 'Re-scan content', 'postlinkly' ), esc_url( $editor_url ), esc_html__( 'Find link opportunities', 'postlinkly' ) ); require __DIR__ . '/partials/page-header.php'; ?>

%
0 ? max( 4, (int) round( ( $month_link_total['count'] / $chart_max ) * 100 ) ) : 4; $bar_label = '' !== $month_link_total['month'] ? substr( $month_link_total['month'], 5 ) : ''; ?>