publish;
$cat_count = wp_count_terms( array( 'taxonomy' => Taxonomy::TAXONOMY, 'hide_empty' => false ) );
$cat_count = is_wp_error( $cat_count ) ? 0 : (int) $cat_count;
$totals = Tracker::totals();
$helpful = ( $totals['up'] + $totals['down'] ) > 0
? round( ( $totals['up'] / ( $totals['up'] + $totals['down'] ) ) * 100 )
: 0;
AdminUi::header( __( 'Welcome back — here is your FAQ overview.', 'accordion-faq-plugin' ) );
?>
stat( '📄', __( 'Published FAQs', 'accordion-faq-plugin' ), number_format_i18n( $faq_count ) );
$this->stat( '🗂️', __( 'Categories', 'accordion-faq-plugin' ), number_format_i18n( $cat_count ) );
$this->stat( '👁️', __( 'Total views', 'accordion-faq-plugin' ), number_format_i18n( $totals['view'] ) );
$this->stat( '👍', __( 'Helpfulness', 'accordion-faq-plugin' ), $helpful . '%' );
?>
top_list( Tracker::top( Tracker::META_VIEWS, 6 ) ); ?>
' . esc_html__( 'No view data yet.', 'accordion-faq-plugin' ) . '';
return;
}
$max = max( array_map( function ( $r ) {
return $r['value'];
}, $rows ) );
echo '';
foreach ( $rows as $row ) {
$pct = $max > 0 ? round( ( $row['value'] / $max ) * 100 ) : 0;
printf(
'- %2$s%3$s
',
esc_url( get_edit_post_link( $row['id'] ) ),
esc_html( $row['title'] ),
esc_html( number_format_i18n( $row['value'] ) ),
(int) $pct
);
}
echo '
';
}
}