summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/modules/widgets/blog-stats.php')
-rw-r--r--plugins/jetpack/modules/widgets/blog-stats.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/jetpack/modules/widgets/blog-stats.php b/plugins/jetpack/modules/widgets/blog-stats.php
index e89db686..7265d114 100644
--- a/plugins/jetpack/modules/widgets/blog-stats.php
+++ b/plugins/jetpack/modules/widgets/blog-stats.php
@@ -4,7 +4,7 @@
*
* @since 4.5.0
*
- * @package Jetpack
+ * @package automattic/jetpack
*/
/**
@@ -94,7 +94,7 @@ class Jetpack_Blog_Stats_Widget extends WP_Widget {
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>" />
</p>
<p>
- <label for="<?php echo esc_attr( $this->get_field_id( 'hits' ) ); ?>"><?php echo number_format_i18n( '12345' ); ?></label>
+ <label for="<?php echo esc_attr( $this->get_field_id( 'hits' ) ); ?>"><?php esc_html_e( 'Pageview Description:', 'jetpack' ); ?></label>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'hits' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'hits' ) ); ?>" type="text" value="<?php echo esc_attr( $instance['hits'] ); ?>" />
</p>
<p><?php esc_html_e( 'Hit counter is delayed by up to 60 seconds.', 'jetpack' ); ?></p>
@@ -137,13 +137,15 @@ class Jetpack_Blog_Stats_Widget extends WP_Widget {
echo $args['before_widget'];
if ( ! empty( $title ) ) {
- echo $args['before_title'] . esc_html( $title ) . $args['after_title'];
+ echo $args['before_title'] . $title . $args['after_title']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
// Get the Site Stats.
$views = $this->get_stats();
- if ( ! empty( $views ) ) {
+ if ( 0 === $views ) {
+ esc_html_e( 'There is nothing to display yet', 'jetpack' );
+ } elseif ( $views ) {
printf(
'<ul><li>%1$s %2$s</li></ul>',
number_format_i18n( $views ),