diff --git a/php/classes/class-ssp-stats-hit.php b/php/classes/class-ssp-stats-hit.php index e3ed25b..3b0184e 100644 --- a/php/classes/class-ssp-stats-hit.php +++ b/php/classes/class-ssp-stats-hit.php @@ -124,7 +124,10 @@ public function track_hit( $file = '', $episode = 0, $referrer = '' ) { $referrer = 'overcast'; } else if ( stripos( $user_agent, 'Pocket Casts' ) !== false ) { $referrer = 'pocketcasts'; - } else if ( stripos( $user_agent, 'Android' ) !== false ) { + } else if ( stripos( $user_agent, 'Xiaoyuzhou' ) !== false ) { + // Put Xiaoyuzhou before 'android' otherwise 'Xiaoyuzhou Android' will miss match + $referrer = 'xiaoyuzhou'; + } else if ( stripos( $user_agent, 'Android' ) !== false ) { $referrer = 'android'; } else if ( stripos( $user_agent, 'PodcastAddict' ) !== false ) { $referrer = 'podcast_addict'; @@ -132,7 +135,13 @@ public function track_hit( $file = '', $episode = 0, $referrer = '' ) { $referrer = 'playerfm'; } else if ( stripos( $user_agent, 'Google-Play' ) !== false ) { $referrer = 'google_play'; - } + } else if ( stripos( $user_agent, 'Moon FM' ) !== false ) { + $referrer = 'MoonFM'; + } else if ( stripos( $user_agent, 'Castro' ) !== false ) { + $referrer = 'Castro'; + } else if ( stripos( $user_agent, 'watchOS' ) !== false ) { + $referrer = 'watchOS'; + } // Get episode ID for database insert $episode_id = $episode->ID; diff --git a/php/classes/class-ssp-stats.php b/php/classes/class-ssp-stats.php index 42f93a1..4c847b0 100755 --- a/php/classes/class-ssp-stats.php +++ b/php/classes/class-ssp-stats.php @@ -362,7 +362,7 @@ public function stats_meta_box_content( $post ) { $html .= '
' . __( 'Total listens', 'seriously-simple-stats' ) . ': ' . $total_downloads . '
'; - $itunes = $stitcher = $overcast = $pocketcasts = $direct = $new_window = $player = $android = $podcast_addict = $playerfm = $google_play = $unknown = 0; + $itunes = $stitcher = $overcast = $pocketcasts = $direct = $new_window = $player = $android = $podcast_addict = $playerfm = $google_play = $xiaoyuzhou = $moonFM = $castro = $watchOS = $unknown = 0; foreach ( $stats as $stat ) { $listeners[ $stat->ip_address ] = $stat->ip_address; @@ -401,6 +401,18 @@ public function stats_meta_box_content( $post ) { case 'google_play': ++ $google_play; break; + case 'xiaoyuzhou': + ++ $xiaoyuzhou; + break; + case 'MoonFM': + ++ $moonFM; + break; + case 'Castro': + ++ $castro; + break; + case 'watchOS': + ++ $watchOS; + break; default: ++ $unknown; break; @@ -443,6 +455,18 @@ public function stats_meta_box_content( $post ) { if ( $playerfm ) { $html .= '