From 9cee337d2626ca96429996c849d639344fc25f5a Mon Sep 17 00:00:00 2001 From: Sergey Zakharchenko Date: Tue, 4 Oct 2022 14:13:06 +0300 Subject: [PATCH] Improvements for new sources (Xiaoyuzhou,Moon FM,Castro,watchOS) --- admin.css.map | 2 +- assets/css/admin.css | 2 +- assets/css/admin.less | 2 +- php/classes/class-ssp-stats-hit.php | 6 +-- php/classes/class-ssp-stats.php | 57 ++++++++++++++--------------- 5 files changed, 34 insertions(+), 35 deletions(-) diff --git a/admin.css.map b/admin.css.map index ea53e61..eee629a 100644 --- a/admin.css.map +++ b/admin.css.map @@ -1 +1 @@ -{"version":3,"sources":["assets/css/admin.less"],"names":[],"mappings":"AAAA,uBAAyB,kBAAkB,gBAC1C,SAAA,CACA,WAFD,uBAAyB,kBAAkB,eAI1C,YAAW,iBACV,eAMA,sBADD,mBACE,QACA,mBAAoB,WAApB,CACA,UAAA,CACA,UAAA,CACA,oBAAA,CACA,iBAAA,CACA,KAAA,CACA,SAAA,CACA,iBAAA,CACA,kBAAA,CACA,kCAAA,CACA,iCAAA,CACA,gCAGA,sBAhBF,mBAeE,gBACC,QACE,QAAS,QAIZ,sBArBF,mBAoBE,gBACC,QACE,QAAS,QAGb,sBAzBD,mBAyBE,SACA,gBAAA,CACE,gBACF,sBA5BF,mBAyBE,QAGC,QACE,QAAS,QA9Bf,sBAkCC,GAAE,cACD,gBAAA,CACA,eApCF,sBAkCC,GAAE,aAGD,IACC,kBACA,sBALF,GAAE,aAGD,GAEE,QACA,mBAAoB,WAApB,CACA,UAAA,CACA,UAAA,CACA,oBAAA,CACA,iBAAA,CACA,KAAA,CACA,SAAA,CACA,iBAAA,CACA,qBAAA,CACA,kCAAA,CACA,iCAAA,CACA,gCAGA,sBApBH,GAAE,aAGD,GAgBE,OACC,QAAD,sBApBH,GAAE,aAGD,GAgBY,SACT,QAAD,sBApBH,GAAE,aAGD,GAgBwB,SACrB,QAAD,sBApBH,GAAE,aAGD,GAgBoC,YACjC,QAAD,sB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GC,GAGC,GAMC,YACC,oBAAA,CACA,YACA,iBAhBL,mBACC,QAGC,GAGC,GAMC,WAGE,eACA,eADD,iBAhBL,mBACC,QAGC,GAGC,GAMC,WAGE,cAEA,MACC,cA5ER,iBAyDC,mBACC,QAGC,GAGC,GAgBC,gBACC,eAQN,wBAA0C,iBACzC,iBAAkB,eAAe,aAChC"} \ No newline at end of file +{"version":3,"sources":["assets/css/admin.less"],"names":[],"mappings":"AAAA,uBAAyB,kBAAkB,gBAC1C,SAAA,CACA,WAFD,uBAAyB,kBAAkB,eAI1C,YAAW,iBACV,eAMA,sBADD,mBACE,QACA,mBAAoB,WAApB,CACA,UAAA,CACA,UAAA,CACA,oBAAA,CACA,iBAAA,CACA,KAAA,CACA,SAAA,CACA,iBAAA,CACA,kBAAA,CACA,kCAAA,CACA,iCAAA,CACA,gCAGA,sBAhBF,mBAeE,gBACC,QACE,QAAS,QAIZ,sBArBF,mBAoBE,gBACC,QACE,QAAS,QAGb,sBAzBD,mBAyBE,SACA,gBAAA,CACE,gBACF,sBA5BF,mBAyBE,QAGC,QACE,QAAS,QA9Bf,sBAkCC,GAAE,cACD,gBAAA,CACA,eApCF,sBAkCC,GAAE,aAGD,IACC,kBACA,sBALF,GAAE,aAGD,GAEE,QACA,mBAAoB,WAApB,CACA,UAAA,CACA,UAAA,CACA,oBAAA,CACA,iBAAA,CACA,KAAA,CACA,SAAA,CACA,iBAAA,CACA,qBAAA,CACA,kCAAA,CACA,iCAAA,CACA,gCAGA,sBApBH,GAAE,aAGD,GAgBE,OACC,QACA,QAAS,QAIV,sBAzBH,GAAE,aAGD,GAqBE,OACC,QACE,QAAS,QAIZ,sBA9BH,GAAE,aAGD,GA0BE,WACC,QACE,QAAS,QAIZ,sBAnCH,GAAE,aAGD,GA+BE,OACC,QACE,QAAS,QAIZ,sBAxCH,GAAE,aAGD,GAoCE,QACC,QACE,QAAS,QA3EhB,sBAgFC,cACC,eAAA,CACA,gBAAA,CACA,kBAnFF,sBAgFC,aAIC,GACC,UAAA,CACA,eACA,sBAPF,aAIC,EAGE,QACA,aACA,sBATH,aAIC,EAGE,OAEC,QACA,QAAS,OAAT,CACA,6BAAA,CACA,UAAA,CACA,aAAA,CACA,gBAAA,CACA,SAAA,CACA,aAAA,CACA,iBAAA,CACA,iBAAA,CACA,kCAAA,CACA,gCAOL,iBACC,QACC,UAAA,CACA,WAHF,iBAKC,QACC,0BANF,iBAQC,oBACC,cACC,eAAA,CACA,gBAAA,CACA,kBAZH,iBAQC,oBACC,aAIC,GACC,UAAA,CACA,eACA,iBARH,oBACC,aAIC,EAGE,QACA,aACA,iBAVJ,oBACC,aAIC,EAGE,OAEC,QACA,QAAS,OAAT,CACA,6BAAA,CACA,UAAA,CACA,aAAA,CACA,gBAAA,CACA,SAAA,CACA,aAAA,CACA,iBAAA,CACA,iBAAA,CACA,kCAAA,CACA,gCA7BN,iBAmCC,0BACC,SACC,iBArCH,iBAmCC,0BAIC,wBACC,gBAxCH,iBA2CC,gBACC,SAAA,CACA,UAAA,CACA,kBA9CF,iBA2CC,eAIC,aACC,cAAA,CACA,aAAA,CACA,kBAAA,CACA,iBAnDH,iBA2CC,eAUC,mBACC,kBAtDH,iBAyDC,mBACC,SACC,QAAA,CACA,UA5DH,iBAyDC,mBACC,QAGC,IACC,eAAA,CACA,SA/DJ,iBAyDC,mBACC,QAGC,GAGC,IAIC,QAAA,CACA,aAJA,iBARJ,mBACC,QAGC,GAGC,GACE,SACA,iBAlEN,iBAyDC,mBACC,QAGC,GAGC,GAMC,YACC,oBAAA,CACA,YACA,iBAhBL,mBACC,QAGC,GAGC,GAMC,WAGE,eACA,eADD,iBAhBL,mBACC,QAGC,GAGC,GAMC,WAGE,cAEA,MACC,cA5ER,iBAyDC,mBACC,QAGC,GAGC,GAgBC,gBACC,eAQN,wBAA0C,iBACzC,iBAAkB,eAAe,aAChC"} \ No newline at end of file diff --git a/assets/css/admin.css b/assets/css/admin.css index 9b4af6c..de7e4a8 100644 --- a/assets/css/admin.css +++ b/assets/css/admin.css @@ -1 +1 @@ -#dashboard-widgets-wrap #podcast_settings .overview-stat{width:28%;margin:5px}#dashboard-widgets-wrap #podcast_settings .overview-stat .stat-total.stat-font-small{font-size:150%}#podcast-episode-stats .episode-stat-data:before{font:normal 20px/1 'dashicons';color:#888;speak:none;display:inline-block;padding:0 2px 0 0;top:0;left:-1px;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none !important}#podcast-episode-stats .episode-stat-data.total-downloads:before{content:"\f521"}#podcast-episode-stats .episode-stat-data.total-listeners:before{content:'\f307'}#podcast-episode-stats .episode-stat-data.sources{font-weight:bold;margin-bottom:0}#podcast-episode-stats .episode-stat-data.sources:before{content:'\f319'}#podcast-episode-stats ul.sources-list{text-indent:10px;margin-top:2px}#podcast-episode-stats ul.sources-list li{font-style:italic}#podcast-episode-stats ul.sources-list li:before{font:normal 100%/1 'dashicons';color:#888;speak:none;display:inline-block;padding:0 2px 0 0;top:0;left:-1px;position:relative;vertical-align:middle;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none !important}#podcast-episode-stats ul.sources-list li.itunes:before,#podcast-episode-stats ul.sources-list li.stitcher:before,#podcast-episode-stats ul.sources-list li.overcast:before,#podcast-episode-stats ul.sources-list li.pocketcasts:before,#podcast-episode-stats ul.sources-list li.android:before{content:'\f482'}#podcast-episode-stats ul.sources-list li.direct:before{content:'\f316'}#podcast-episode-stats ul.sources-list li.new_window:before{content:"\f504"}#podcast-episode-stats ul.sources-list li.player:before{content:"\f522"}#podcast-episode-stats ul.sources-list li.unknown:before{content:'\f223'}#podcast-episode-stats .no-activity{overflow:hidden;padding:0 0 12px;text-align:center}#podcast-episode-stats .no-activity p{color:#999;font-size:16px}#podcast-episode-stats .no-activity p.smiley{margin-top:0}#podcast-episode-stats .no-activity p.smiley:before{content:"\f328";font:normal 120px/1 dashicons;speak:none;display:block;margin:0 5px 0 0;padding:0;text-indent:0;text-align:center;position:relative;-webkit-font-smoothing:antialiased;text-decoration:none !important}#podcast_settings .clear{clear:both;float:none}#podcast_settings .hndle{cursor:default !important}#podcast_settings #no-stats-container .no-activity{overflow:hidden;padding:0 0 12px;text-align:center}#podcast_settings #no-stats-container .no-activity p{color:#999;font-size:16px}#podcast_settings #no-stats-container .no-activity p.smiley{margin-top:0}#podcast_settings #no-stats-container .no-activity p.smiley:before{content:"\f328";font:normal 120px/1 dashicons;speak:none;display:block;margin:0 5px 0 0;padding:0;text-indent:0;text-align:center;position:relative;-webkit-font-smoothing:antialiased;text-decoration:none !important}#podcast_settings #content-filter-container .inside{padding-bottom:0}#podcast_settings #content-filter-container #content-filter-button{margin-left:5px}#podcast_settings .overview-stat{width:25%;float:left;text-align:center}#podcast_settings .overview-stat .stat-total{font-size:400%;line-height:1;margin-bottom:10px;font-weight:bold}#podcast_settings .overview-stat .stat-description{font-style:italic}#podcast_settings #top-ten-container .inside{margin:0;padding:0}#podcast_settings #top-ten-container .inside ul{list-style:none;margin:0}#podcast_settings #top-ten-container .inside ul li{margin:0;padding:10px}#podcast_settings #top-ten-container .inside ul li.headers{font-weight:bold}#podcast_settings #top-ten-container .inside ul li .first-col{display:inline-block;width:100px}#podcast_settings #top-ten-container .inside ul li .first-col.top-ten-count{font-size:150%}#podcast_settings #top-ten-container .inside ul li .first-col.top-ten-count span{font-size:60%}#podcast_settings #top-ten-container .inside ul li .top-ten-title{font-size:135%}@media only screen and (max-width:768px){#podcast_settings .overview-stat .stat-total{font-size:150%}}/*# sourceMappingURL=admin.css.map */ \ No newline at end of file +#dashboard-widgets-wrap #podcast_settings .overview-stat{width:28%;margin:5px}#dashboard-widgets-wrap #podcast_settings .overview-stat .stat-total.stat-font-small{font-size:150%}#podcast-episode-stats .episode-stat-data:before{font:normal 20px/1 'dashicons';color:#888;speak:none;display:inline-block;padding:0 2px 0 0;top:0;left:-1px;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none !important}#podcast-episode-stats .episode-stat-data.total-downloads:before{content:"\f521"}#podcast-episode-stats .episode-stat-data.total-listeners:before{content:'\f307'}#podcast-episode-stats .episode-stat-data.sources{font-weight:bold;margin-bottom:0}#podcast-episode-stats .episode-stat-data.sources:before{content:'\f319'}#podcast-episode-stats ul.sources-list{text-indent:10px;margin-top:2px}#podcast-episode-stats ul.sources-list li{font-style:italic}#podcast-episode-stats ul.sources-list li:before{font:normal 100%/1 'dashicons';color:#888;speak:none;display:inline-block;padding:0 2px 0 0;top:0;left:-1px;position:relative;vertical-align:middle;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none !important}#podcast-episode-stats ul.sources-list li.source:before{content:'\f482'}#podcast-episode-stats ul.sources-list li.direct:before{content:'\f316'}#podcast-episode-stats ul.sources-list li.new_window:before{content:"\f504"}#podcast-episode-stats ul.sources-list li.player:before{content:"\f522"}#podcast-episode-stats ul.sources-list li.unknown:before{content:'\f223'}#podcast-episode-stats .no-activity{overflow:hidden;padding:0 0 12px;text-align:center}#podcast-episode-stats .no-activity p{color:#999;font-size:16px}#podcast-episode-stats .no-activity p.smiley{margin-top:0}#podcast-episode-stats .no-activity p.smiley:before{content:"\f328";font:normal 120px/1 dashicons;speak:none;display:block;margin:0 5px 0 0;padding:0;text-indent:0;text-align:center;position:relative;-webkit-font-smoothing:antialiased;text-decoration:none !important}#podcast_settings .clear{clear:both;float:none}#podcast_settings .hndle{cursor:default !important}#podcast_settings #no-stats-container .no-activity{overflow:hidden;padding:0 0 12px;text-align:center}#podcast_settings #no-stats-container .no-activity p{color:#999;font-size:16px}#podcast_settings #no-stats-container .no-activity p.smiley{margin-top:0}#podcast_settings #no-stats-container .no-activity p.smiley:before{content:"\f328";font:normal 120px/1 dashicons;speak:none;display:block;margin:0 5px 0 0;padding:0;text-indent:0;text-align:center;position:relative;-webkit-font-smoothing:antialiased;text-decoration:none !important}#podcast_settings #content-filter-container .inside{padding-bottom:0}#podcast_settings #content-filter-container #content-filter-button{margin-left:5px}#podcast_settings .overview-stat{width:25%;float:left;text-align:center}#podcast_settings .overview-stat .stat-total{font-size:400%;line-height:1;margin-bottom:10px;font-weight:bold}#podcast_settings .overview-stat .stat-description{font-style:italic}#podcast_settings #top-ten-container .inside{margin:0;padding:0}#podcast_settings #top-ten-container .inside ul{list-style:none;margin:0}#podcast_settings #top-ten-container .inside ul li{margin:0;padding:10px}#podcast_settings #top-ten-container .inside ul li.headers{font-weight:bold}#podcast_settings #top-ten-container .inside ul li .first-col{display:inline-block;width:100px}#podcast_settings #top-ten-container .inside ul li .first-col.top-ten-count{font-size:150%}#podcast_settings #top-ten-container .inside ul li .first-col.top-ten-count span{font-size:60%}#podcast_settings #top-ten-container .inside ul li .top-ten-title{font-size:135%}@media only screen and (max-width:768px){#podcast_settings .overview-stat .stat-total{font-size:150%}}/*# sourceMappingURL=admin.css.map */ \ No newline at end of file diff --git a/assets/css/admin.less b/assets/css/admin.less index 5b391fb..3d752ff 100644 --- a/assets/css/admin.less +++ b/assets/css/admin.less @@ -60,7 +60,7 @@ -moz-osx-font-smoothing: grayscale; text-decoration: none !important; } - &.itunes, &.stitcher, &.overcast, &.pocketcasts, &.android { + &.source { &:before { content: '\f482'; } diff --git a/php/classes/class-ssp-stats-hit.php b/php/classes/class-ssp-stats-hit.php index 2549f7c..56a7cc8 100644 --- a/php/classes/class-ssp-stats-hit.php +++ b/php/classes/class-ssp-stats-hit.php @@ -133,11 +133,11 @@ public function track_hit( $file = '', $episode = 0, $referrer = '' ) { } else if ( stripos( $user_agent, 'Google-Play' ) !== false ) { $referrer = 'google_play'; } else if ( stripos( $user_agent, 'Moon FM' ) !== false ) { - $referrer = 'MoonFM'; + $referrer = 'moonfm'; } else if ( stripos( $user_agent, 'Castro' ) !== false ) { - $referrer = 'Castro'; + $referrer = 'castro'; } else if ( stripos( $user_agent, 'watchOS' ) !== false ) { - $referrer = 'watchOS'; + $referrer = 'watchos'; } else if ( stripos( $user_agent, 'Android' ) !== false ) { $referrer = 'android'; } diff --git a/php/classes/class-ssp-stats.php b/php/classes/class-ssp-stats.php index 89f54e1..6bf9fc3 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 = $xiaoyuzhou = $moonFM = $castro = $watchOS = $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; @@ -404,14 +404,14 @@ public function stats_meta_box_content( $post ) { case 'xiaoyuzhou': ++ $xiaoyuzhou; break; - case 'MoonFM': - ++ $moonFM; + case 'moonfm': + ++ $moonfm; break; - case 'Castro': + case 'castro': ++ $castro; break; - case 'watchOS': - ++ $watchOS; + case 'watchos': + ++ $watchos; break; default: ++ $unknown; @@ -425,54 +425,53 @@ public function stats_meta_box_content( $post ) { $html .= '

' . __( 'Listening sources', 'seriously-simple-stats' ) . ':

'; $html .= ''; @@ -912,8 +911,8 @@ private function referrers_chart () { 'playerfm' => __( 'Player FM', 'seriously-simple-stats' ), // 'google_play' => __( 'Google Play', 'seriously-simple-stats' ) //Commented out for now 'xiaoyuzhou' => __( 'Xiaoyuzhou', 'seriously-simple-stats' ), - 'MoonFM' => __( 'MoonFM', 'seriously-simple-stats' ), - 'Castro' => __( 'Castro', 'seriously-simple-stats' ), + 'moonfm' => __( 'MoonFM', 'seriously-simple-stats' ), + 'castro' => __( 'Castro', 'seriously-simple-stats' ), 'watchOS' => __( 'watchOS', 'seriously-simple-stats' ), );