public function reports_page() { global $user_ID, $current_user, $wp_post_types, $wpdb; if (Word_Stats_State::is_worker_needed()) { _e('Stats collection hasn\'t completed yet. Try again later.', 'word-stats'); return false; } # Relevant when going straight to the graphs page right after installing the plugin. if (isset($_GET['view-all'])) { $period_start = '1900-01-01'; $period_end = date('Y-m-d'); } else { $period_start = isset($_GET['period-start']) ? $_GET['period-start'] : date('Y-m-d', time() - 15552000); $period_end = isset($_GET['period-end']) ? $_GET['period-end'] : date('Y-m-d'); } $author_graph = isset($_GET['author-tab']) ? intval($_GET['author-tab']) : $user_ID; $report = Word_Stats_Admin::load_report_stats($author_graph, $period_start, $period_end); if ($report) { # Get oldest date (for the graph) if (isset($_GET['view-all'])) { $period_start = date('Y-m-d', min(bst_Ym_to_unix(bst_array_first($report['author_count'][$author_graph]['post'])), bst_Ym_to_unix(bst_array_first($report['author_count'][$author_graph]['page'])), bst_Ym_to_unix(bst_array_first($report['author_count'][$author_graph]['custom'])))); } include 'graph-options.php'; $diagnostic_tables = Word_Stats_Admin::diagnostics_tables($report); include 'view-report-graphs.php'; } else { _e('Sorry, word counting failed for an unknown reason.', 'word-stats'); } }
Word_Stats_Admin::options_field('word_stats_options[diagnostic_spammed_keywords]', 'number', intval($word_stats_options['diagnostic_spammed_keywords']), false, false, '1', '50', $width, $align, __('Posts with any keyword count per 1000 words greater than this value will be diagnosed as having keyword spam.', 'word-stats')); echo '<br /><br />'; Word_Stats_Admin::options_section(__('Readability', 'word-stats')); Word_Stats_Admin::options_field('word_stats_options[RI_column]', 'checkbox', '1', '0', $word_stats_options['RI_column'], false, false, false, false, __('Display aggregate readability column in the manage posts list.', 'word-stats')); echo '<br /><br />'; Word_Stats_Admin::options_section(__('Total word counts', 'word-stats')); Word_Stats_Admin::options_field('word_stats_options[totals]', 'checkbox', '1', '0', $word_stats_options['totals'], false, false, false, false, __('Display total word counts in the dashboard.', 'word-stats')); Word_Stats_Admin::options_field('word_stats_options[count_unpublished]', 'checkbox', '1', '0', $word_stats_options['count_unpublished'], false, false, false, false, __('Count words from drafts and posts pending review.', 'word-stats')); echo '<br /><br />'; Word_Stats_Admin::options_section(__('Live stats', 'word-stats')); Word_Stats_Admin::options_field('word_stats_options[replace_word_count]', 'checkbox', '1', '0', $word_stats_options['replace_word_count'], false, false, false, false, __('Replace WordPress live word count with Word Stats word count.', 'word-stats')); Word_Stats_Admin::options_field('word_stats_options[live_averages]', 'checkbox', '1', '0', $word_stats_options['live_averages'], false, false, false, false, __('Display live character/word/sentence averages.', 'word-stats')); Word_Stats_Admin::options_field('word_stats_options[live_keywords]', 'checkbox', '1', '0', $word_stats_options['live_keywords'], false, false, false, false, __('Display live keyword count.', 'word-stats')); Word_Stats_Admin::options_field('word_stats_options[add_tags]', 'checkbox', '1', '0', $word_stats_options['add_tags'], false, false, false, false, __('Add the last saved tags to the live keyword count.', 'word-stats')); echo '<br /><br />'; Word_Stats_Admin::options_section(__('Ignored keywords', 'word-stats')); echo '<p>', __('Ignore common words for:', 'word-stats'), ' <select name="word_stats_options[ignore_common]" /> <option value="en" '; if ($word_stats_options['ignore_common'] == 'en') { echo 'selected="selected" '; } echo ' />', __('English', 'word-stats'), '</option> <option value="es" '; if ($word_stats_options['ignore_common'] == 'es') { echo 'selected="selected" '; } echo ' />', __('Spanish', 'word-stats'), '</option> <option value="0" '; if ($word_stats_options['ignore_common'] == '0') { echo 'selected="selected" ';