public function get_word_counts($mode) { if (Word_Stats_State::is_worker_needed()) { return ''; } $report = Word_Stats_Core::recount_totals(); $total_all = $report['author_count_total'][-1]; $html = ''; foreach ($report['author_count'][-1] as $type => $months) { $words = array_sum($months); $text = __('Words', 'word-stats') . ' (' . $type . ')'; $html .= $mode == 'table' ? '<tr><td class="first b"><a>' . number_format_i18n($words) . ' </a></td><td class="t"><a>' . $text . "\n" . '</a></td></tr>' : '<li class="word-stats-count">' . number_format_i18n($words) . ' ' . $text . "\n" . '</li>'; } # Absolute total words $text = __('Total words', 'word-stats'); $total_all = number_format_i18n($total_all); $html .= $mode == 'table' ? '<tr><td class="first b word-stats-dash-total"><a>' . $total_all . ' </a></td><td class="t"><a>' . $text . "\n" . '</a></td></tr>' : '<li class="word-stats-count word-stats-list-total">' . $total_all . ' ' . $text . "\n" . '</li>'; return $html; }