Changeset 3199667
- Timestamp:
- 11/29/2024 10:03:44 PM (16 months ago)
- Location:
- just-writing-statistics
- Files:
-
- 24 edited
- 1 copied
-
tags/5.1 (copied) (copied from just-writing-statistics/trunk)
-
tags/5.1/admin/class-jws-admin.php (modified) (8 diffs)
-
tags/5.1/admin/partials/jws-statistics-all.php (modified) (1 diff)
-
tags/5.1/admin/partials/jws-statistics-author.php (modified) (1 diff)
-
tags/5.1/admin/partials/jws-statistics-category.php (modified) (1 diff)
-
tags/5.1/admin/partials/jws-statistics-frequency.php (modified) (3 diffs)
-
tags/5.1/admin/partials/jws-statistics-tags.php (modified) (1 diff)
-
tags/5.1/admin/partials/jws-statistics-top.php (modified) (1 diff)
-
tags/5.1/includes/class-jws-activator.php (modified) (1 diff)
-
tags/5.1/includes/class-jws.php (modified) (1 diff)
-
tags/5.1/just-writing-statistics.php (modified) (2 diffs)
-
tags/5.1/public/class-jws-public.php (modified) (1 diff)
-
tags/5.1/readme.txt (modified) (2 diffs)
-
trunk/admin/class-jws-admin.php (modified) (8 diffs)
-
trunk/admin/partials/jws-statistics-all.php (modified) (1 diff)
-
trunk/admin/partials/jws-statistics-author.php (modified) (1 diff)
-
trunk/admin/partials/jws-statistics-category.php (modified) (1 diff)
-
trunk/admin/partials/jws-statistics-frequency.php (modified) (3 diffs)
-
trunk/admin/partials/jws-statistics-tags.php (modified) (1 diff)
-
trunk/admin/partials/jws-statistics-top.php (modified) (1 diff)
-
trunk/includes/class-jws-activator.php (modified) (1 diff)
-
trunk/includes/class-jws.php (modified) (1 diff)
-
trunk/just-writing-statistics.php (modified) (2 diffs)
-
trunk/public/class-jws-public.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
just-writing-statistics/tags/5.1/admin/class-jws-admin.php
r3199097 r3199667 748 748 749 749 $sql_jws_statistics = ''; 750 $frequency_title = ''; 750 751 751 752 if (!isset($jws_tab) || $jws_tab == 'top-content') { … … 796 797 ORDER BY post_author ASC"; 797 798 } elseif ($jws_tab == 'frequency') { 799 $tag_join = ''; 800 $tag_where = ''; 801 $cat_join = ''; 802 $cat_where = ''; 803 $author_where = ''; 804 $post_where = ''; 805 806 // Check to see if we have a specific tag to query against. 807 if (isset( $_GET['tag'] ) ) { 808 $tag_obj = get_term_by('id', $_GET['tag'], 'post_tag'); 809 810 if( $tag_obj !== false ) { 811 $tag_id = $tag_obj->term_id; 812 813 $tag_join = $wpdb->prepare( 814 "JOIN %i ON (`$table_name_posts`.post_id = %i.object_id)", 815 $wpdb->prefix . 'term_relationships', 816 $wpdb->prefix . 'term_relationships' 817 ); 818 $tag_where = $wpdb->prepare( 819 "AND %i.term_taxonomy_id = %d", 820 $wpdb->prefix . 'term_relationships', 821 $tag_id 822 ); 823 } 824 $frequency_title = sprintf(__('Word frequency statistics for tag: %s', 'just-writing-statistics'), $tag_obj->name); 825 } 826 827 // Check to see if we have a specific category to query against. 828 if (isset( $_GET['cat'] ) ) { 829 $cat_obj = get_term_by('id', $_GET['cat'], 'category'); 830 831 if( $cat_obj !== false ) { 832 $cat_id = $cat_obj->term_id; 833 834 $cat_join = $wpdb->prepare( 835 "JOIN %i ON (`$table_name_posts`.post_id = %i.object_id)", 836 $wpdb->prefix . 'term_relationships', 837 $wpdb->prefix . 'term_relationships' 838 ); 839 $cat_where = $wpdb->prepare( 840 "AND %i.term_taxonomy_id = %d", 841 $wpdb->prefix . 'term_relationships', 842 $cat_id 843 ); 844 $frequency_title = sprintf(__('Word frequency statistics for category: %s', 'just-writing-statistics'), $cat_obj->name); 845 } 846 } 847 848 // Check to see if we have a specific author to query against. 849 if (isset( $_GET['author'] ) ) { 850 $author_obj = get_user_by('login', $_GET['author']); 851 852 if( $author_obj !== false ) { 853 $author_id = $author_obj->ID; 854 855 $author_where = $wpdb->prepare( 856 "AND post_author = %d", 857 $author_id 858 ); 859 } 860 $frequency_title = sprintf(__('Word frequency statistics for author: %s', 'just-writing-statistics'), $author_obj->display_name); 861 } 862 863 // Check to see if we have a specific post to query against. 864 if (isset( $_GET['post'] ) ) { 865 $post_obj = get_post($_GET['post']); 866 867 if( $post_obj !== false ) { 868 $post_id = $post_obj->ID; 869 870 $post_where = $wpdb->prepare( 871 "AND post_id = %d", 872 $post_id 873 ); 874 } 875 $frequency_title = sprintf(__('Word frequency statistics for post: %s', 'just-writing-statistics'), $post_obj->post_title); 876 } 877 798 878 $sql_jws_statistics = " 799 879 SELECT post_word_frequency 800 880 FROM $table_name_posts 801 WHERE (post_status = 'publish' OR post_status = 'draft' OR post_status = 'future') $excluded_types_sql"; 881 $tag_join 882 $cat_join 883 WHERE (post_status = 'publish' OR post_status = 'draft' OR post_status = 'future') $tag_where $cat_where $author_where $post_where $excluded_types_sql"; 802 884 } elseif ($jws_tab == 'word-to-posts') { 803 885 // Set a default word query that should pretty much aways be around. … … 975 1057 976 1058 foreach( $tags as $tag ) { 1059 $jws_dataset_tags[$tag->name]['id'] = $tag->term_id; 1060 977 1061 if (!isset($jws_dataset_tags[$tag->name][$total->post_type])) { 978 1062 $jws_dataset_tags[$tag->name][$total->post_type]['published']['posts'] = 0; … … 1026 1110 1027 1111 foreach( $categories as $category ) { 1112 $jws_dataset_categories[$category->name]['id'] = $category->term_id; 1113 1028 1114 if (!isset($jws_dataset_categories[$category->name][$total->post_type])) { 1029 1115 $jws_dataset_categories[$category->name][$total->post_type]['published']['posts'] = 0; … … 1077 1163 if (!isset($jws_dataset_authors[$total->post_author])) { 1078 1164 $jws_dataset_authors[$total->post_author]['display_name'] = get_the_author_meta('display_name', $total->post_author); 1165 $jws_dataset_authors[$total->post_author]['id'] = $total->post_author; 1166 $jws_dataset_authors[$total->post_author]['login'] = get_the_author_meta('user_login', $total->post_author);; 1079 1167 $jws_dataset_authors[$total->post_author]['total'] = 0; 1080 1168 $jws_dataset_authors[$total->post_author]['items'] = 0; … … 1112 1200 ); 1113 1201 } elseif ($jws_tab == 'frequency') { 1114 $jws_dataset_word_frequency = []; 1202 $jws_dataset_word_frequency = array(); 1203 $jws_dataset_word_frequency['words'] = array(); 1115 1204 $global_word_frequencies = []; 1116 1205 $unique_counts = []; … … 1145 1234 // Now store the sorted values into the data set. 1146 1235 foreach( $count_groupings[$count] as $word => $count) { 1147 $jws_dataset_word_frequency[$word] = $count; 1148 } 1149 } 1236 $jws_dataset_word_frequency['words'][$word] = $count; 1237 } 1238 } 1239 1240 $jws_dataset_word_frequency['title'] = $frequency_title; 1150 1241 } elseif ($jws_tab == 'word-to-posts') { 1151 1242 $jws_dataset_word_to_posts = []; … … 1295 1386 echo jws_calculate_word_count_post( $post ); 1296 1387 } 1297 1388 } 1389 1390 /** 1391 * Add frequency stats to the post action list. 1392 * 1393 * @since 5.1.0 1394 * @param array $actions The current list of actions in the list. 1395 * @param object $post The post object. 1396 * @return array The new list of actions. 1397 */ 1398 public function add_frequency_stats_action_link( $actions, $post ) { 1399 if ( $post instanceof WP_Post && is_array( $actions ) ) { 1400 $actions[] = '<a href="' . add_query_arg(array( 'page' => $this->plugin_name, 'tab' => 'frequency', 'post' => $post->ID ), admin_url('admin.php')) . '">' . __('Frequency Stats', 'just-writing-statistics') . '</a>'; 1401 } 1402 1403 return $actions; 1298 1404 } 1299 1405 -
just-writing-statistics/tags/5.1/admin/partials/jws-statistics-all.php
r3199097 r3199667 183 183 <span class="edit"><?php edit_post_link(__('Edit', 'just-writing-statistics'), '', ' | ', $post['post_id']); ?></span> 184 184 <span class="trash"><a href="<?php echo get_delete_post_link($post['post_id']); ?>"><?php _e('Trash', 'just-writing-statistics'); ?></a> | </span> 185 <span class='view'><a href="<?php echo esc_attr( $post['permalink'] ); ?>"><?php _e('View', 'just-writing-statistics'); ?></a></span> 185 <span class='view'><a href="<?php echo esc_attr( $post['permalink'] ); ?>"><?php _e('View', 'just-writing-statistics'); ?></a> | </span> 186 <span class="frequency"><a href="<?php echo add_query_arg(array( 'page' => $this->plugin_name, 'tab' => 'frequency', 'post' => $post['post_id'] ), admin_url('admin.php')); ?>"><?php _e('Frequency Stats', 'just-writing-statistics'); ?></a></span> 186 187 </div> 187 188 </td> -
just-writing-statistics/tags/5.1/admin/partials/jws-statistics-author.php
r3116736 r3199667 143 143 <?php echo get_avatar($index, 32, 'mysteryman', $author['display_name'], ['class' => 'avatar avatar-32 photo']); ?> 144 144 <?php echo esc_html( $author['display_name'] ); ?> 145 <div class="row-actions"> 146 <span class='view'><a href="<?php echo add_query_arg(array( 'user_id' => $author['id'] ), admin_url('user-edit.php')); ?>"><?php _e('Edit', 'just-writing-statistics'); ?></a> | </span> 147 <span class="frequency"><a href="<?php echo add_query_arg(array( 'page' => $this->plugin_name, 'tab' => 'frequency', 'author' => $author['login'] ), admin_url('admin.php')); ?>"><?php _e('Frequency Stats', 'just-writing-statistics'); ?></a></span> 148 </div> 145 149 </td> 146 150 <td><?php echo number_format($author['total']); ?></td> -
just-writing-statistics/tags/5.1/admin/partials/jws-statistics-category.php
r2852111 r3199667 122 122 123 123 <?php echo '<tr'.($jws_counter_monthly_statistics % 2 == 1 ? '' : " class='alternate'").'>'; ?> 124 <td><nobr><?php echo esc_html( $category_name ); ?></td> 124 <td> 125 <nobr><?php echo esc_html( $category_name ); ?> 126 <div class="row-actions"> 127 <span class='view'><a href="<?php echo add_query_arg(array( 'taxonomy' => 'category', 'tag_ID' => $category['id'], 'post_type' => 'post' ), admin_url('term.php')); ?>"><?php _e('Edit', 'just-writing-statistics'); ?></a> | </span> 128 <span class="frequency"><a href="<?php echo add_query_arg(array( 'page' => $this->plugin_name, 'tab' => 'frequency', 'cat' => $category['id'] ), admin_url('admin.php')); ?>"><?php _e('Frequency Stats', 'just-writing-statistics'); ?></a></span> 129 </div> 130 </td> 125 131 <td><?php echo number_format($category['total']); ?></td> 126 132 <?php foreach ($jws_dataset_post_types as $index => $post_type) : ?> -
just-writing-statistics/tags/5.1/admin/partials/jws-statistics-frequency.php
r3199097 r3199667 14 14 15 15 ?> 16 <?php if( $jws_dataset_word_frequency['title'] !== '' ) { ?> 17 <div> 18 <h2> 19 <?php echo $jws_dataset_word_frequency['title'];?> 20 </h2> 21 </div> 22 <?php } ?> 16 23 <div> 17 24 <div class="full jws-chart-container" id="JWSWordCloud"> … … 27 34 $table_rows = ''; 28 35 $i = 0; 29 $top_weight = $jws_dataset_word_frequency[array_key_first($jws_dataset_word_frequency)]; 36 $top_weight = 400; 37 if( array_key_exists( 'words', $jws_dataset_word_frequency) ) { 38 $first_key = array_key_first($jws_dataset_word_frequency['words']); 39 if( $first_key != '' ) { 40 $top_weight = $jws_dataset_word_frequency['words'][$first_key]; 41 } 42 } 30 43 31 foreach ($jws_dataset_word_frequency as $word => $frequency) {44 foreach ($jws_dataset_word_frequency['words'] as $word => $frequency) { 32 45 $size = round( $frequency / $top_weight * 400 ); 33 46 if ($size >= 16) { … … 107 120 <thead> 108 121 <tr> 109 <th colspan="3" class="jws_totals_title"><?php printf(__('Word Frequency (%d Unique Words)', 'just-writing-statistics'), count( $jws_dataset_word_frequency )); ?></th>122 <th colspan="3" class="jws_totals_title"><?php printf(__('Word Frequency (%d Unique Words)', 'just-writing-statistics'), count( $jws_dataset_word_frequency['words'])); ?></th> 110 123 </tr> 111 124 <tr> -
just-writing-statistics/tags/5.1/admin/partials/jws-statistics-tags.php
r2852111 r3199667 122 122 123 123 <?php echo '<tr'.($jws_counter_monthly_statistics % 2 == 1 ? '' : " class='alternate'").'>'; ?> 124 <td><nobr><?php echo esc_html( $tag_name ); ?></td> 124 <td> 125 <nobr><?php echo esc_html( $tag_name ); ?> 126 <div class="row-actions"> 127 <span class='view'><a href="<?php echo add_query_arg(array( 'taxonomy' => 'post_tag', 'tag_ID' => $tag['id'], 'post_type' => 'post' ), admin_url('term.php')); ?>"><?php _e('Edit', 'just-writing-statistics'); ?></a> | </span> 128 <span class="frequency"><a href="<?php echo add_query_arg(array( 'page' => $this->plugin_name, 'tab' => 'frequency', 'tag' => $tag['id'] ), admin_url('admin.php')); ?>"><?php _e('Frequency Stats', 'just-writing-statistics'); ?></a></span> 129 </div> 130 </td> 125 131 <td><?php echo number_format($tag['total']); ?></td> 126 132 <?php foreach ($jws_dataset_post_types as $index => $post_type) : ?> -
just-writing-statistics/tags/5.1/admin/partials/jws-statistics-top.php
r2852111 r3199667 174 174 <span class="edit"><?php edit_post_link(__('Edit', 'just-writing-statistics'), '', ' | ', $post['post_id']); ?></span> 175 175 <span class="trash"><a href="<?php echo get_delete_post_link($post['post_id']); ?>"><?php _e('Trash', 'just-writing-statistics'); ?></a> | </span> 176 <span class='view'><a href="<?php echo esc_attr( $post['permalink'] ); ?>"><?php _e('View', 'just-writing-statistics'); ?></a></span> 176 <span class='view'><a href="<?php echo esc_attr( $post['permalink'] ); ?>"><?php _e('View', 'just-writing-statistics'); ?></a> | </span> 177 <span class="frequency"><a href="<?php echo add_query_arg(array( 'page' => $this->plugin_name, 'tab' => 'frequency', 'post' => $post['post_id'] ), admin_url('admin.php')); ?>"><?php _e('Frequency Stats', 'just-writing-statistics'); ?></a></span> 177 178 </div> 178 179 </td> -
just-writing-statistics/tags/5.1/includes/class-jws-activator.php
r2842555 r3199667 12 12 * @author GregRoss, RedLettuce 13 13 */ 14 class Just_Writing_Stat sitics_Activator14 class Just_Writing_Statistics_Activator 15 15 { 16 16 /** -
just-writing-statistics/tags/5.1/includes/class-jws.php
r2852111 r3199667 177 177 } 178 178 179 $this->loader->add_filter( 'post_row_actions', $plugin_admin, 'add_frequency_stats_action_link', 10, 2 ); 180 $this->loader->add_filter( 'page_row_actions', $plugin_admin, 'add_frequency_stats_action_link', 10, 2 ); 179 181 } 180 182 -
just-writing-statistics/tags/5.1/just-writing-statistics.php
r3199097 r3199667 10 10 * Plugin URI: https://toolstack.com/just-writing-statistics 11 11 * Description: Count the words on your WordPress site instantly. 12 * Version: 5. 012 * Version: 5.1 13 13 * Author: GregRoss 14 14 * Author URI: https://toolstack.com … … 25 25 } 26 26 27 define('JWS_VERSION', '5. 0');27 define('JWS_VERSION', '5.1'); 28 28 29 29 function activate_just_writing_statistics() -
just-writing-statistics/tags/5.1/public/class-jws-public.php
r3078086 r3199667 123 123 $option = get_option('jws_reading_time'); 124 124 125 if ($post && is_array( $option) && array_key_exists('insert', $option) && $option['insert'] == 'Y') {125 if ($post && is_array($option) && array_key_exists('insert', $option) && $option['insert'] == 'Y') { 126 126 127 127 $reading_time_settings_wpm = (get_option('jws_reading_time')['wpm'] ?: 250); -
just-writing-statistics/tags/5.1/readme.txt
r3199097 r3199667 4 4 Requires at least: 4.6 5 5 Tested up to: 6.7.1 6 Stable tag: 5. 06 Stable tag: 5.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 110 110 111 111 == Changelog == 112 = 5.1 = 113 * Release date: November 29, 2024 114 * Add category, tag, author, and post frequency stats UI. 115 * Fix activation error. 116 112 117 = 5.0 = 113 118 * Release date: November 28, 2024 -
just-writing-statistics/trunk/admin/class-jws-admin.php
r3199097 r3199667 748 748 749 749 $sql_jws_statistics = ''; 750 $frequency_title = ''; 750 751 751 752 if (!isset($jws_tab) || $jws_tab == 'top-content') { … … 796 797 ORDER BY post_author ASC"; 797 798 } elseif ($jws_tab == 'frequency') { 799 $tag_join = ''; 800 $tag_where = ''; 801 $cat_join = ''; 802 $cat_where = ''; 803 $author_where = ''; 804 $post_where = ''; 805 806 // Check to see if we have a specific tag to query against. 807 if (isset( $_GET['tag'] ) ) { 808 $tag_obj = get_term_by('id', $_GET['tag'], 'post_tag'); 809 810 if( $tag_obj !== false ) { 811 $tag_id = $tag_obj->term_id; 812 813 $tag_join = $wpdb->prepare( 814 "JOIN %i ON (`$table_name_posts`.post_id = %i.object_id)", 815 $wpdb->prefix . 'term_relationships', 816 $wpdb->prefix . 'term_relationships' 817 ); 818 $tag_where = $wpdb->prepare( 819 "AND %i.term_taxonomy_id = %d", 820 $wpdb->prefix . 'term_relationships', 821 $tag_id 822 ); 823 } 824 $frequency_title = sprintf(__('Word frequency statistics for tag: %s', 'just-writing-statistics'), $tag_obj->name); 825 } 826 827 // Check to see if we have a specific category to query against. 828 if (isset( $_GET['cat'] ) ) { 829 $cat_obj = get_term_by('id', $_GET['cat'], 'category'); 830 831 if( $cat_obj !== false ) { 832 $cat_id = $cat_obj->term_id; 833 834 $cat_join = $wpdb->prepare( 835 "JOIN %i ON (`$table_name_posts`.post_id = %i.object_id)", 836 $wpdb->prefix . 'term_relationships', 837 $wpdb->prefix . 'term_relationships' 838 ); 839 $cat_where = $wpdb->prepare( 840 "AND %i.term_taxonomy_id = %d", 841 $wpdb->prefix . 'term_relationships', 842 $cat_id 843 ); 844 $frequency_title = sprintf(__('Word frequency statistics for category: %s', 'just-writing-statistics'), $cat_obj->name); 845 } 846 } 847 848 // Check to see if we have a specific author to query against. 849 if (isset( $_GET['author'] ) ) { 850 $author_obj = get_user_by('login', $_GET['author']); 851 852 if( $author_obj !== false ) { 853 $author_id = $author_obj->ID; 854 855 $author_where = $wpdb->prepare( 856 "AND post_author = %d", 857 $author_id 858 ); 859 } 860 $frequency_title = sprintf(__('Word frequency statistics for author: %s', 'just-writing-statistics'), $author_obj->display_name); 861 } 862 863 // Check to see if we have a specific post to query against. 864 if (isset( $_GET['post'] ) ) { 865 $post_obj = get_post($_GET['post']); 866 867 if( $post_obj !== false ) { 868 $post_id = $post_obj->ID; 869 870 $post_where = $wpdb->prepare( 871 "AND post_id = %d", 872 $post_id 873 ); 874 } 875 $frequency_title = sprintf(__('Word frequency statistics for post: %s', 'just-writing-statistics'), $post_obj->post_title); 876 } 877 798 878 $sql_jws_statistics = " 799 879 SELECT post_word_frequency 800 880 FROM $table_name_posts 801 WHERE (post_status = 'publish' OR post_status = 'draft' OR post_status = 'future') $excluded_types_sql"; 881 $tag_join 882 $cat_join 883 WHERE (post_status = 'publish' OR post_status = 'draft' OR post_status = 'future') $tag_where $cat_where $author_where $post_where $excluded_types_sql"; 802 884 } elseif ($jws_tab == 'word-to-posts') { 803 885 // Set a default word query that should pretty much aways be around. … … 975 1057 976 1058 foreach( $tags as $tag ) { 1059 $jws_dataset_tags[$tag->name]['id'] = $tag->term_id; 1060 977 1061 if (!isset($jws_dataset_tags[$tag->name][$total->post_type])) { 978 1062 $jws_dataset_tags[$tag->name][$total->post_type]['published']['posts'] = 0; … … 1026 1110 1027 1111 foreach( $categories as $category ) { 1112 $jws_dataset_categories[$category->name]['id'] = $category->term_id; 1113 1028 1114 if (!isset($jws_dataset_categories[$category->name][$total->post_type])) { 1029 1115 $jws_dataset_categories[$category->name][$total->post_type]['published']['posts'] = 0; … … 1077 1163 if (!isset($jws_dataset_authors[$total->post_author])) { 1078 1164 $jws_dataset_authors[$total->post_author]['display_name'] = get_the_author_meta('display_name', $total->post_author); 1165 $jws_dataset_authors[$total->post_author]['id'] = $total->post_author; 1166 $jws_dataset_authors[$total->post_author]['login'] = get_the_author_meta('user_login', $total->post_author);; 1079 1167 $jws_dataset_authors[$total->post_author]['total'] = 0; 1080 1168 $jws_dataset_authors[$total->post_author]['items'] = 0; … … 1112 1200 ); 1113 1201 } elseif ($jws_tab == 'frequency') { 1114 $jws_dataset_word_frequency = []; 1202 $jws_dataset_word_frequency = array(); 1203 $jws_dataset_word_frequency['words'] = array(); 1115 1204 $global_word_frequencies = []; 1116 1205 $unique_counts = []; … … 1145 1234 // Now store the sorted values into the data set. 1146 1235 foreach( $count_groupings[$count] as $word => $count) { 1147 $jws_dataset_word_frequency[$word] = $count; 1148 } 1149 } 1236 $jws_dataset_word_frequency['words'][$word] = $count; 1237 } 1238 } 1239 1240 $jws_dataset_word_frequency['title'] = $frequency_title; 1150 1241 } elseif ($jws_tab == 'word-to-posts') { 1151 1242 $jws_dataset_word_to_posts = []; … … 1295 1386 echo jws_calculate_word_count_post( $post ); 1296 1387 } 1297 1388 } 1389 1390 /** 1391 * Add frequency stats to the post action list. 1392 * 1393 * @since 5.1.0 1394 * @param array $actions The current list of actions in the list. 1395 * @param object $post The post object. 1396 * @return array The new list of actions. 1397 */ 1398 public function add_frequency_stats_action_link( $actions, $post ) { 1399 if ( $post instanceof WP_Post && is_array( $actions ) ) { 1400 $actions[] = '<a href="' . add_query_arg(array( 'page' => $this->plugin_name, 'tab' => 'frequency', 'post' => $post->ID ), admin_url('admin.php')) . '">' . __('Frequency Stats', 'just-writing-statistics') . '</a>'; 1401 } 1402 1403 return $actions; 1298 1404 } 1299 1405 -
just-writing-statistics/trunk/admin/partials/jws-statistics-all.php
r3199097 r3199667 183 183 <span class="edit"><?php edit_post_link(__('Edit', 'just-writing-statistics'), '', ' | ', $post['post_id']); ?></span> 184 184 <span class="trash"><a href="<?php echo get_delete_post_link($post['post_id']); ?>"><?php _e('Trash', 'just-writing-statistics'); ?></a> | </span> 185 <span class='view'><a href="<?php echo esc_attr( $post['permalink'] ); ?>"><?php _e('View', 'just-writing-statistics'); ?></a></span> 185 <span class='view'><a href="<?php echo esc_attr( $post['permalink'] ); ?>"><?php _e('View', 'just-writing-statistics'); ?></a> | </span> 186 <span class="frequency"><a href="<?php echo add_query_arg(array( 'page' => $this->plugin_name, 'tab' => 'frequency', 'post' => $post['post_id'] ), admin_url('admin.php')); ?>"><?php _e('Frequency Stats', 'just-writing-statistics'); ?></a></span> 186 187 </div> 187 188 </td> -
just-writing-statistics/trunk/admin/partials/jws-statistics-author.php
r3116736 r3199667 143 143 <?php echo get_avatar($index, 32, 'mysteryman', $author['display_name'], ['class' => 'avatar avatar-32 photo']); ?> 144 144 <?php echo esc_html( $author['display_name'] ); ?> 145 <div class="row-actions"> 146 <span class='view'><a href="<?php echo add_query_arg(array( 'user_id' => $author['id'] ), admin_url('user-edit.php')); ?>"><?php _e('Edit', 'just-writing-statistics'); ?></a> | </span> 147 <span class="frequency"><a href="<?php echo add_query_arg(array( 'page' => $this->plugin_name, 'tab' => 'frequency', 'author' => $author['login'] ), admin_url('admin.php')); ?>"><?php _e('Frequency Stats', 'just-writing-statistics'); ?></a></span> 148 </div> 145 149 </td> 146 150 <td><?php echo number_format($author['total']); ?></td> -
just-writing-statistics/trunk/admin/partials/jws-statistics-category.php
r2852111 r3199667 122 122 123 123 <?php echo '<tr'.($jws_counter_monthly_statistics % 2 == 1 ? '' : " class='alternate'").'>'; ?> 124 <td><nobr><?php echo esc_html( $category_name ); ?></td> 124 <td> 125 <nobr><?php echo esc_html( $category_name ); ?> 126 <div class="row-actions"> 127 <span class='view'><a href="<?php echo add_query_arg(array( 'taxonomy' => 'category', 'tag_ID' => $category['id'], 'post_type' => 'post' ), admin_url('term.php')); ?>"><?php _e('Edit', 'just-writing-statistics'); ?></a> | </span> 128 <span class="frequency"><a href="<?php echo add_query_arg(array( 'page' => $this->plugin_name, 'tab' => 'frequency', 'cat' => $category['id'] ), admin_url('admin.php')); ?>"><?php _e('Frequency Stats', 'just-writing-statistics'); ?></a></span> 129 </div> 130 </td> 125 131 <td><?php echo number_format($category['total']); ?></td> 126 132 <?php foreach ($jws_dataset_post_types as $index => $post_type) : ?> -
just-writing-statistics/trunk/admin/partials/jws-statistics-frequency.php
r3199097 r3199667 14 14 15 15 ?> 16 <?php if( $jws_dataset_word_frequency['title'] !== '' ) { ?> 17 <div> 18 <h2> 19 <?php echo $jws_dataset_word_frequency['title'];?> 20 </h2> 21 </div> 22 <?php } ?> 16 23 <div> 17 24 <div class="full jws-chart-container" id="JWSWordCloud"> … … 27 34 $table_rows = ''; 28 35 $i = 0; 29 $top_weight = $jws_dataset_word_frequency[array_key_first($jws_dataset_word_frequency)]; 36 $top_weight = 400; 37 if( array_key_exists( 'words', $jws_dataset_word_frequency) ) { 38 $first_key = array_key_first($jws_dataset_word_frequency['words']); 39 if( $first_key != '' ) { 40 $top_weight = $jws_dataset_word_frequency['words'][$first_key]; 41 } 42 } 30 43 31 foreach ($jws_dataset_word_frequency as $word => $frequency) {44 foreach ($jws_dataset_word_frequency['words'] as $word => $frequency) { 32 45 $size = round( $frequency / $top_weight * 400 ); 33 46 if ($size >= 16) { … … 107 120 <thead> 108 121 <tr> 109 <th colspan="3" class="jws_totals_title"><?php printf(__('Word Frequency (%d Unique Words)', 'just-writing-statistics'), count( $jws_dataset_word_frequency )); ?></th>122 <th colspan="3" class="jws_totals_title"><?php printf(__('Word Frequency (%d Unique Words)', 'just-writing-statistics'), count( $jws_dataset_word_frequency['words'])); ?></th> 110 123 </tr> 111 124 <tr> -
just-writing-statistics/trunk/admin/partials/jws-statistics-tags.php
r2852111 r3199667 122 122 123 123 <?php echo '<tr'.($jws_counter_monthly_statistics % 2 == 1 ? '' : " class='alternate'").'>'; ?> 124 <td><nobr><?php echo esc_html( $tag_name ); ?></td> 124 <td> 125 <nobr><?php echo esc_html( $tag_name ); ?> 126 <div class="row-actions"> 127 <span class='view'><a href="<?php echo add_query_arg(array( 'taxonomy' => 'post_tag', 'tag_ID' => $tag['id'], 'post_type' => 'post' ), admin_url('term.php')); ?>"><?php _e('Edit', 'just-writing-statistics'); ?></a> | </span> 128 <span class="frequency"><a href="<?php echo add_query_arg(array( 'page' => $this->plugin_name, 'tab' => 'frequency', 'tag' => $tag['id'] ), admin_url('admin.php')); ?>"><?php _e('Frequency Stats', 'just-writing-statistics'); ?></a></span> 129 </div> 130 </td> 125 131 <td><?php echo number_format($tag['total']); ?></td> 126 132 <?php foreach ($jws_dataset_post_types as $index => $post_type) : ?> -
just-writing-statistics/trunk/admin/partials/jws-statistics-top.php
r2852111 r3199667 174 174 <span class="edit"><?php edit_post_link(__('Edit', 'just-writing-statistics'), '', ' | ', $post['post_id']); ?></span> 175 175 <span class="trash"><a href="<?php echo get_delete_post_link($post['post_id']); ?>"><?php _e('Trash', 'just-writing-statistics'); ?></a> | </span> 176 <span class='view'><a href="<?php echo esc_attr( $post['permalink'] ); ?>"><?php _e('View', 'just-writing-statistics'); ?></a></span> 176 <span class='view'><a href="<?php echo esc_attr( $post['permalink'] ); ?>"><?php _e('View', 'just-writing-statistics'); ?></a> | </span> 177 <span class="frequency"><a href="<?php echo add_query_arg(array( 'page' => $this->plugin_name, 'tab' => 'frequency', 'post' => $post['post_id'] ), admin_url('admin.php')); ?>"><?php _e('Frequency Stats', 'just-writing-statistics'); ?></a></span> 177 178 </div> 178 179 </td> -
just-writing-statistics/trunk/includes/class-jws-activator.php
r2842555 r3199667 12 12 * @author GregRoss, RedLettuce 13 13 */ 14 class Just_Writing_Stat sitics_Activator14 class Just_Writing_Statistics_Activator 15 15 { 16 16 /** -
just-writing-statistics/trunk/includes/class-jws.php
r2852111 r3199667 177 177 } 178 178 179 $this->loader->add_filter( 'post_row_actions', $plugin_admin, 'add_frequency_stats_action_link', 10, 2 ); 180 $this->loader->add_filter( 'page_row_actions', $plugin_admin, 'add_frequency_stats_action_link', 10, 2 ); 179 181 } 180 182 -
just-writing-statistics/trunk/just-writing-statistics.php
r3199097 r3199667 10 10 * Plugin URI: https://toolstack.com/just-writing-statistics 11 11 * Description: Count the words on your WordPress site instantly. 12 * Version: 5. 012 * Version: 5.1 13 13 * Author: GregRoss 14 14 * Author URI: https://toolstack.com … … 25 25 } 26 26 27 define('JWS_VERSION', '5. 0');27 define('JWS_VERSION', '5.1'); 28 28 29 29 function activate_just_writing_statistics() -
just-writing-statistics/trunk/public/class-jws-public.php
r3078086 r3199667 123 123 $option = get_option('jws_reading_time'); 124 124 125 if ($post && is_array( $option) && array_key_exists('insert', $option) && $option['insert'] == 'Y') {125 if ($post && is_array($option) && array_key_exists('insert', $option) && $option['insert'] == 'Y') { 126 126 127 127 $reading_time_settings_wpm = (get_option('jws_reading_time')['wpm'] ?: 250); -
just-writing-statistics/trunk/readme.txt
r3199097 r3199667 4 4 Requires at least: 4.6 5 5 Tested up to: 6.7.1 6 Stable tag: 5. 06 Stable tag: 5.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 110 110 111 111 == Changelog == 112 = 5.1 = 113 * Release date: November 29, 2024 114 * Add category, tag, author, and post frequency stats UI. 115 * Fix activation error. 116 112 117 = 5.0 = 113 118 * Release date: November 28, 2024
Note: See TracChangeset
for help on using the changeset viewer.