| @@ -957,9 +957,9 @@ | ||
| 957 | 957 | margin: 0 8px 0 10px; |
| 958 | 958 | } |
| 959 | 959 | #wpadminbar .quicklinks li#wp-admin-bar-stats a img { |
| 960 | 960 | height: 24px; |
| 961 | - padding: 4px 0; | |
| 961 | + margin: 4px 0; | |
| 962 | 962 | max-width: none; |
| 963 | 963 | border: none; |
| 964 | 964 | } |
| 965 | 965 | </style> |
| @@ -982,9 +982,17 @@ | ||
| 982 | 982 | $alt = esc_attr( __( 'Stats', 'jetpack' ) ); |
| 983 | 983 | |
| 984 | 984 | $title = esc_attr( __( 'Views over 48 hours. Click for more Site Stats.', 'jetpack' ) ); |
| 985 | 985 | |
| 986 | - $menu = array( 'id' => 'stats', 'title' => "<div><script type='text/javascript'>var src;if(typeof(window.devicePixelRatio)=='undefined'||window.devicePixelRatio<2){src='$img_src';}else{src='$img_src_2x';}document.write('<img src=\''+src+'\' alt=\'$alt\' title=\'$title\' />');</script></div>", 'href' => $url ); | |
| 986 | + $menu = array( | |
| 987 | + 'id' => 'stats', | |
| 988 | + 'href' => $url, | |
| 989 | + ); | |
| 990 | + if ( Jetpack_AMP_Support::is_amp_request() ) { | |
| 991 | + $menu['title'] = "<amp-img src='$img_src_2x' width=112 height=24 layout=fixed alt='$alt' title='$title'></amp-img>"; | |
| 992 | + } else { | |
| 993 | + $menu['title'] = "<div><script type='text/javascript'>var src;if(typeof(window.devicePixelRatio)=='undefined'||window.devicePixelRatio<2){src='$img_src';}else{src='$img_src_2x';}document.write('<img src=\''+src+'\' alt=\'$alt\' title=\'$title\' />');</script></div>"; | |
| 994 | + } | |
| 987 | 995 | |
| 988 | 996 | $wp_admin_bar->add_menu( $menu ); |
| 989 | 997 | } |
| 990 | 998 | |
| @@ -1195,9 +1203,9 @@ | ||
| 1195 | 1203 | <?php wp_nonce_field( 'edit-dashboard-widget_dashboard_stats', 'dashboard-widget-nonce' ); ?> |
| 1196 | 1204 | <input type="hidden" name="widget_id" value="dashboard_stats" /> |
| 1197 | 1205 | <?php submit_button( __( 'Submit', 'jetpack' ) ); ?> |
| 1198 | 1206 | </form> |
| 1199 | - <span id="js-toggle-stats_dashboard_widget_control"> | |
| 1207 | + <span class="js-toggle-stats_dashboard_widget_control"> | |
| 1200 | 1208 | <?php esc_html_e( 'Configure', 'jetpack' ); ?> |
| 1201 | 1209 | </span> |
| 1202 | 1210 | <div id="dashboard_stats"> |
| 1203 | 1211 | <div class="inside"> |
| @@ -1205,9 +1213,9 @@ | ||
| 1205 | 1213 | </div> |
| 1206 | 1214 | </div> |
| 1207 | 1215 | <script> |
| 1208 | 1216 | jQuery(document).ready(function($){ |
| 1209 | - var $toggle = $('#js-toggle-stats_dashboard_widget_control'); | |
| 1217 | + var $toggle = $('.js-toggle-stats_dashboard_widget_control'); | |
| 1210 | 1218 | |
| 1211 | 1219 | $toggle.parent().prev().append( $toggle ); |
| 1212 | 1220 | $toggle.show().click(function(e){ |
| 1213 | 1221 | e.preventDefault(); |
| @@ -1217,9 +1225,9 @@ | ||
| 1217 | 1225 | }); |
| 1218 | 1226 | }); |
| 1219 | 1227 | </script> |
| 1220 | 1228 | <style> |
| 1221 | - #js-toggle-stats_dashboard_widget_control { | |
| 1229 | + .js-toggle-stats_dashboard_widget_control { | |
| 1222 | 1230 | display: none; |
| 1223 | 1231 | float: right; |
| 1224 | 1232 | margin-top: 0.2em; |
| 1225 | 1233 | font-weight: 400; |
| @@ -1446,9 +1454,8 @@ | ||
| 1446 | 1454 | $searches[] = esc_html( $search_term['searchterm'] ); |
| 1447 | 1455 | } |
| 1448 | 1456 | |
| 1449 | 1457 | ?> |
| 1450 | -<a class="button" href="admin.php?page=stats"><?php esc_html_e( 'View All', 'jetpack' ); ?></a> | |
| 1451 | 1458 | <div id="stats-info"> |
| 1452 | 1459 | <div id="top-posts" class='stats-section'> |
| 1453 | 1460 | <div class="stats-section-inner"> |
| 1454 | 1461 | <h3 class="heading"><?php esc_html_e( 'Top Posts' , 'jetpack' ); ?></h3> |
| @@ -1482,15 +1489,28 @@ | ||
| 1482 | 1489 | ?> |
| 1483 | 1490 | <p class="nothing"><?php esc_html_e( 'Sorry, nothing to report.', 'jetpack' ); ?></p> |
| 1484 | 1491 | <?php |
| 1485 | 1492 | } else { |
| 1486 | -?> | |
| 1487 | - <p><?php echo join( ', ', $searches );?></p> | |
| 1488 | - <?php | |
| 1493 | + foreach ( $searches as $search_term_item ) { | |
| 1494 | + printf( | |
| 1495 | + '<p>%s</p>', | |
| 1496 | + $search_term_item | |
| 1497 | + ); | |
| 1498 | + } | |
| 1489 | 1499 | } |
| 1490 | 1500 | ?> |
| 1491 | 1501 | </div> |
| 1492 | 1502 | </div> |
| 1503 | +</div> | |
| 1504 | +<div class="clear"></div> | |
| 1505 | +<div class="stats-view-all"> | |
| 1506 | +<?php | |
| 1507 | + printf( | |
| 1508 | + '<a class="button" target="_blank" rel="noopener noreferrer" href="%1$s">%2$s</a>', | |
| 1509 | + esc_url( "https://wordpress.com/stats/day/" . Jetpack::build_raw_urls( get_home_url() ) ), | |
| 1510 | + esc_html__( 'View all stats', 'jetpack' ) | |
| 1511 | + ); | |
| 1512 | +?> | |
| 1493 | 1513 | </div> |
| 1494 | 1514 | <div class="clear"></div> |
| 1495 | 1515 | <?php |
| 1496 | 1516 | exit; |