Skip to content

Commit

Permalink
Clarify distinction between Dashboard widgets (#14574)
Browse files Browse the repository at this point in the history
* Clarify distinction between Dashboard widgets

Fix #13952.

Add headers to clarify that two different features
are being shown in the Dashboard footer widget,
for Jetpack.

* Make new headers translatable

* Change counts reported from h3 to p with class.

[not verified] (giving error about not escaping the
blocked attempts / spam count)

* Style the blocked-count class same as h3 tag.

* Superficial whitespace change to returned HTML.

Because Travis CI #43386.6 job timed out (??):

develop.git.wordpress.org[0: 198.143.164.245]: errno=Connection timed out

[not verified]

* Change wording to match other product usages.

Protect -> Brute force attack protection
Akismet -> Anti-spam

* Make h3 smaller font size in dashboard widget

* Add small margin-bottom to h3 in widget.
  • Loading branch information
coleshaw authored Feb 11, 2020
1 parent 6127aa8 commit 77a59d1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
7 changes: 7 additions & 0 deletions _inc/client/dashboard-widget/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@
}

h3 {
font-size: 1em;
font-weight: normal;
margin: 0 0 0.25em 0;
padding: 0;
}

p.blocked-count {
font-size: 1.5em;
font-weight: normal;
margin: 0;
Expand Down
20 changes: 13 additions & 7 deletions class.jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -6775,8 +6775,11 @@ public static function dashboard_widget_footer() {
<footer>

<div class="protect">
<h3><?php esc_html_e( 'Brute force attack protection', 'jetpack' ); ?></h3>
<?php if ( self::is_module_active( 'protect' ) ) : ?>
<h3><?php echo number_format_i18n( get_site_option( 'jetpack_protect_blocked_attempts', 0 ) ); ?></h3>
<p class="blocked-count">
<?php echo number_format_i18n( get_site_option( 'jetpack_protect_blocked_attempts', 0 ) ); ?>
</p>
<p><?php echo esc_html_x( 'Blocked malicious login attempts', '{#} Blocked malicious login attempts -- number is on a prior line, text is a caption.', 'jetpack' ); ?></p>
<?php elseif ( current_user_can( 'jetpack_activate_modules' ) && ! ( new Status() )->is_development_mode() ) : ?>
<a href="
Expand All @@ -6794,17 +6797,20 @@ public static function dashboard_widget_footer() {
);
?>
" class="button button-jetpack" title="<?php esc_attr_e( 'Protect helps to keep you secure from brute-force login attacks.', 'jetpack' ); ?>">
<?php esc_html_e( 'Activate Protect', 'jetpack' ); ?>
<?php esc_html_e( 'Activate brute force attack protection', 'jetpack' ); ?>
</a>
<?php else : ?>
<?php esc_html_e( 'Protect is inactive.', 'jetpack' ); ?>
<?php esc_html_e( 'Brute force attack protection is inactive.', 'jetpack' ); ?>
<?php endif; ?>
</div>

<div class="akismet">
<h3><?php esc_html_e( 'Anti-spam', 'jetpack' ); ?></h3>
<?php if ( is_plugin_active( 'akismet/akismet.php' ) ) : ?>
<h3><?php echo number_format_i18n( get_option( 'akismet_spam_count', 0 ) ); ?></h3>
<p><?php echo esc_html_x( 'Spam comments blocked by Akismet.', '{#} Spam comments blocked by Akismet -- number is on a prior line, text is a caption.', 'jetpack' ); ?></p>
<p class="blocked-count">
<?php echo number_format_i18n( get_option( 'akismet_spam_count', 0 ) ); ?>
</p>
<p><?php echo esc_html_x( 'Blocked spam comments.', '{#} Spam comments blocked by Akismet -- number is on a prior line, text is a caption.', 'jetpack' ); ?></p>
<?php elseif ( current_user_can( 'activate_plugins' ) && ! is_wp_error( validate_plugin( 'akismet/akismet.php' ) ) ) : ?>
<a href="
<?php
Expand All @@ -6822,10 +6828,10 @@ public static function dashboard_widget_footer() {
);
?>
" class="button button-jetpack">
<?php esc_html_e( 'Activate Akismet', 'jetpack' ); ?>
<?php esc_html_e( 'Activate Anti-spam', 'jetpack' ); ?>
</a>
<?php else : ?>
<p><a href="<?php echo esc_url( 'https://akismet.com/?utm_source=jetpack&utm_medium=link&utm_campaign=Jetpack%20Dashboard%20Widget%20Footer%20Link' ); ?>"><?php esc_html_e( 'Akismet can help to keep your blog safe from spam!', 'jetpack' ); ?></a></p>
<p><a href="<?php echo esc_url( 'https://akismet.com/?utm_source=jetpack&utm_medium=link&utm_campaign=Jetpack%20Dashboard%20Widget%20Footer%20Link' ); ?>"><?php esc_html_e( 'Anti-spam can help to keep your blog safe from spam!', 'jetpack' ); ?></a></p>
<?php endif; ?>
</div>

Expand Down

0 comments on commit 77a59d1

Please sign in to comment.