Title: [Plugin: FeedStats] Please include function to only return average subscribers
Last modified: August 20, 2016

---

# [Plugin: FeedStats] Please include function to only return average subscribers

 *  ResolvedPlugin Author [Ben](https://wordpress.org/support/users/benjaminwittorf/)
 * (@benjaminwittorf)
 * [14 years ago](https://wordpress.org/support/topic/plugin-feedstats-please-include-function-to-only-return-average-subscribers/)
 * Hey there,
 * again, thank you for this great plugin!
 * Here’s a quick hack I added to my functions.php to only return the average subscriber
   count, as I don’t need the badge. It would be awesome if you could include this
   to your main functions:
 *     ```
       function get_feedstats_getfeeds_average() {
   
       	$count = get_transient('get_feedstats_getfeeds_average');
       	if ($count !== false) return $count;
       	$count = 0;  
   
       	global $wpdb;  
   
       	$total_visits = $wpdb->get_var("SELECT count(*) FROM " . $wpdb->prefix . 'fs_visits');
       	$total_visits = htmlspecialchars($total_visits, ENT_QUOTES);  
   
       	$time         = time();
       	$time_begin   = feedstats_get_midnight( $wpdb->get_var("SELECT time_install FROM " . $wpdb->prefix . 'fs_data') );
       	$num_days     = ceil( ($time-$time_begin) / FEEDSTATS_DAY );  
   
       	if ( $num_days > get_option('fs_days') ) {
       		$num_days = get_option('fs_days') + 1;
       	}  
   
       	$average_visits = ($num_days) ? ( round( $total_visits / ($num_days) ) ) : '0';
       	$average_visits = htmlspecialchars($average_visits, ENT_QUOTES);
       	set_transient('get_feedstats_getfeeds_average', $average_visits, 60*60*1);  
   
       	return $average_visits;
       }
       ```
   
 * Yours,
    – Ben
 * [http://wordpress.org/extend/plugins/feedstats-de/](http://wordpress.org/extend/plugins/feedstats-de/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Frank Bueltge](https://wordpress.org/support/users/bueltge/)
 * (@bueltge)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-feedstats-please-include-function-to-only-return-average-subscribers/#post-2762301)
 * included

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: FeedStats] Please include function to only return average subscribers’
is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/feedstats-de.svg)
 * [FeedStats](https://wordpress.org/plugins/feedstats-de/)
 * [Support Threads](https://wordpress.org/support/plugin/feedstats-de/)
 * [Active Topics](https://wordpress.org/support/plugin/feedstats-de/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/feedstats-de/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/feedstats-de/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Frank Bueltge](https://wordpress.org/support/users/bueltge/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-feedstats-please-include-function-to-only-return-average-subscribers/#post-2762301)
 * Status: resolved