Seriously-Simple-Podcasting icon indicating copy to clipboard operation
Seriously-Simple-Podcasting copied to clipboard

Three month stat display isn't specific to the year

Open joshnewton16 opened this issue 4 years ago • 2 comments

When looking at the podcast_stats page, stats for the last three months per episode are listed. However the month headings aren't specific to the year, so an episode which received no listens today (November) is showing listens because there were listens last November.

The object which tallies these is classes/class-all-episode-stats.php

and the code block is:

$sql= "SELECT `date` FROM $this->table WHERE `post_id` = '" . $result->post_id . "'";
$episode_results = $wpdb->get_results( $sql );
$lifetime_count  = count( $episode_results );
foreach ( $episode_results as $ref ) {
//Increase the count of listens per month
if ( isset( $total_listens_array[ intval( date( 'm', intval( $ref->date ) ) ) ] ) ) {
++ $total_listens_array[ intval( date( 'm', intval( $ref->date ) ) ) ];
}
}

joshnewton16 avatar Nov 02 '21 00:11 joshnewton16

…I think this is in the stats code, not in SSP itself? We have an open issue for it already:

https://github.com/CastosHQ/Seriously-Simple-Stats/issues/74

craigconstantine avatar Nov 20 '21 15:11 craigconstantine

Gah, yeah, you are absolutely right. I didn't dig far enough to see there was a separate project.

joshnewton16 avatar Nov 20 '21 16:11 joshnewton16