Limit Login Attempts Reloaded - Version 2.20.2

Version Description

  • Updated email text.
Download this release

Release Info

Developer wpchefgadget
Plugin Icon 128x128 Limit Login Attempts Reloaded
Version 2.20.2
Comparing to
See all releases

Code changes from version 2.20.1 to 2.20.2

core/App.php CHANGED
@@ -77,9 +77,10 @@ class LLAR_App {
77
 
78
  /**
79
  * @param $link
 
80
  * @return false[]
81
  */
82
- public static function setup( $link ) {
83
 
84
  $return = array(
85
  'success' => false,
@@ -96,6 +97,10 @@ class LLAR_App {
96
  $plugin_data = get_plugin_data( LLA_PLUGIN_DIR . '/limit-login-attempts-reloaded.php' );
97
  $link = add_query_arg( 'version', $plugin_data['Version'], $link );
98
 
 
 
 
 
99
  $setup_response = wp_remote_get( $link );
100
  $setup_response_body = json_decode( wp_remote_retrieve_body( $setup_response ), true );
101
 
77
 
78
  /**
79
  * @param $link
80
+ * @param bool $is_update
81
  * @return false[]
82
  */
83
+ public static function setup( $link, $is_update = false ) {
84
 
85
  $return = array(
86
  'success' => false,
97
  $plugin_data = get_plugin_data( LLA_PLUGIN_DIR . '/limit-login-attempts-reloaded.php' );
98
  $link = add_query_arg( 'version', $plugin_data['Version'], $link );
99
 
100
+ if( $is_update ) {
101
+ $link = add_query_arg( 'is_update', 1, $link );
102
+ }
103
+
104
  $setup_response = wp_remote_get( $link );
105
  $setup_response_body = json_decode( wp_remote_retrieve_body( $setup_response ), true );
106
 
core/LimitLoginAttempts.php CHANGED
@@ -938,15 +938,18 @@ class Limit_Login_Attempts {
938
  $admin_name = ' ' . $res[0];
939
  }
940
 
941
- $subject = sprintf( __( "Failed login attempt alert for %s", 'limit-login-attempts-reloaded' ) , str_replace( array( 'http://', 'https://' ), '', home_url() ) );
 
 
 
 
942
 
943
  $message = __( '<p>Hello%1$s,</p>' .
944
  '<p>%2$d failed login attempts (%3$d lockout(s)) from IP <b>%4$s</b><br>' .
945
  'Last user attempted: <b>%5$s</b><br>'.
946
  'IP was blocked for %6$s</p>'.
947
  '<p>This notification was sent automatically via Limit Login Attempts Reloaded Plugin. ' .
948
- '<b>This is installed on your WordPress site.</b></p>'.
949
- '<p><b><a href="%7$s">Visit your WordPress Dashboard</a> for complete stats and logs.</b></p>'.
950
  '<p>Under Attack? Try our <a href="%8$s" target="_blank">advanced protection</a>. ' .
951
  'Have Questions? Visit our <a href="%9$s" target="_blank">help section</a>.</p>' .
952
  '<hr><a href="%10$s">Unsubscribe</a> from these notifications.', 'limit-login-attempts-reloaded' );
@@ -961,7 +964,7 @@ class Limit_Login_Attempts {
961
  $ip,
962
  $user,
963
  $when,
964
- admin_url( 'options-general.php?page=limit-login-attempts&tab=dashboard' ),
965
  'https://www.limitloginattempts.com/info.php?from=plugin-lockout-email&v='.$plugin_data['Version'],
966
  'https://www.limitloginattempts.com/resources/?from=plugin-lockout-email',
967
  admin_url( 'options-general.php?page=limit-login-attempts&tab=settings' )
@@ -1606,7 +1609,7 @@ class Limit_Login_Attempts {
1606
 
1607
  if( !empty( $_POST['llar_app_settings'] ) && $this->app ) {
1608
 
1609
- if( ( $app_setup_code = $this->get_option( 'app_setup_code' ) ) && $setup_result = LLAR_App::setup( strrev( $app_setup_code ) ) ) {
1610
 
1611
  if( $setup_result['success'] && $active_app_config = $setup_result['app_config'] ) {
1612
 
938
  $admin_name = ' ' . $res[0];
939
  }
940
 
941
+ $site_domain = str_replace( array( 'http://', 'https://' ), '', home_url() );
942
+ $blogname = $this->use_local_options ? get_option( 'blogname' ) : get_site_option( 'site_name' );
943
+ $blogname = htmlspecialchars_decode( $blogname, ENT_QUOTES );
944
+
945
+ $subject = sprintf( __( "[%s] Failed login attempt alert", 'limit-login-attempts-reloaded' ), $blogname );
946
 
947
  $message = __( '<p>Hello%1$s,</p>' .
948
  '<p>%2$d failed login attempts (%3$d lockout(s)) from IP <b>%4$s</b><br>' .
949
  'Last user attempted: <b>%5$s</b><br>'.
950
  'IP was blocked for %6$s</p>'.
951
  '<p>This notification was sent automatically via Limit Login Attempts Reloaded Plugin. ' .
952
+ '<b>This is installed on your %7$s WordPress site.</b></p>'.
 
953
  '<p>Under Attack? Try our <a href="%8$s" target="_blank">advanced protection</a>. ' .
954
  'Have Questions? Visit our <a href="%9$s" target="_blank">help section</a>.</p>' .
955
  '<hr><a href="%10$s">Unsubscribe</a> from these notifications.', 'limit-login-attempts-reloaded' );
964
  $ip,
965
  $user,
966
  $when,
967
+ $site_domain,
968
  'https://www.limitloginattempts.com/info.php?from=plugin-lockout-email&v='.$plugin_data['Version'],
969
  'https://www.limitloginattempts.com/resources/?from=plugin-lockout-email',
970
  admin_url( 'options-general.php?page=limit-login-attempts&tab=settings' )
1609
 
1610
  if( !empty( $_POST['llar_app_settings'] ) && $this->app ) {
1611
 
1612
+ if( ( $app_setup_code = $this->get_option( 'app_setup_code' ) ) && $setup_result = LLAR_App::setup( strrev( $app_setup_code ), true ) ) {
1613
 
1614
  if( $setup_result['success'] && $active_app_config = $setup_result['app_config'] ) {
1615
 
limit-login-attempts-reloaded.php CHANGED
@@ -5,7 +5,7 @@ Description: Limit the rate of login attempts for each IP address.
5
  Author: Limit Login Attempts Reloaded
6
  Author URI: https://www.limitloginattempts.com/
7
  Text Domain: limit-login-attempts-reloaded
8
- Version: 2.20.1
9
 
10
  Copyright 2008 - 2012 Johan Eenfeldt, 2016 - 2021 Limit Login Attempts Reloaded
11
  */
5
  Author: Limit Login Attempts Reloaded
6
  Author URI: https://www.limitloginattempts.com/
7
  Text Domain: limit-login-attempts-reloaded
8
+ Version: 2.20.3
9
 
10
  Copyright 2008 - 2012 Johan Eenfeldt, 2016 - 2021 Limit Login Attempts Reloaded
11
  */
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/donate?hosted_button_id=FKD4MYFCMNVQQ
4
  Tags: brute force, login, security, firewall, protection
5
  Requires at least: 3.0
6
  Tested up to: 5.6
7
- Stable tag: 2.20.1
8
 
9
  Reloaded version of the original Limit Login Attempts plugin for Login Protection by a team of WordPress developers. GDPR compliant.
10
 
@@ -97,6 +97,14 @@ Please follow this link: <a href="https://www.limitloginattempts.com/resources/"
97
 
98
  == Changelog ==
99
 
 
 
 
 
 
 
 
 
100
  = 2.20.1 =
101
  * New dashboard more clear stats.
102
 
4
  Tags: brute force, login, security, firewall, protection
5
  Requires at least: 3.0
6
  Tested up to: 5.6
7
+ Stable tag: 2.20.2
8
 
9
  Reloaded version of the original Limit Login Attempts plugin for Login Protection by a team of WordPress developers. GDPR compliant.
10
 
97
 
98
  == Changelog ==
99
 
100
+ = 2.20.3 =
101
+ * More clear wording.
102
+ * Cloud API: fixed double submit in the settings form.
103
+ * Better displaying of stats.
104
+
105
+ = 2.20.2 =
106
+ * Updated email text.
107
+
108
  = 2.20.1 =
109
  * New dashboard more clear stats.
110
 
views/tab-dashboard.php CHANGED
@@ -10,12 +10,11 @@ $retries_chart_color = '';
10
  $retries_chart_show_actions = false;
11
 
12
  $api_stats = false;
13
- $app_attacks = 0;
14
  if( $active_app === 'local' ) {
15
 
16
  $retries_stats = $this->get_option( 'retries_stats' );
17
 
18
- $retries_count = 0;
19
  if( $retries_stats ) {
20
  if( array_key_exists( date_i18n( 'Y-m-d' ), $retries_stats ) ) {
21
  $retries_count = (int) $retries_stats[date_i18n( 'Y-m-d' )];
@@ -24,19 +23,19 @@ if( $active_app === 'local' ) {
24
 
25
  if( $retries_count === 0 ) {
26
 
27
- $retries_chart_title = __( 'Hooray! Zero suspicious login attempts in the last 24 hr', 'limit-login-attempts-reloaded' );
28
  $retries_chart_color = '#66CC66';
29
  }
30
  else if ( $retries_count < 100 ) {
31
 
32
- $retries_chart_title = sprintf( _n( '%d suspicious login attempt ', '%d suspicious login attempts ', $retries_count, 'limit-login-attempts-reloaded' ), $retries_count );
33
- $retries_chart_title .= __( 'in the last 24 hr', 'limit-login-attempts-reloaded' );
34
- $retries_chart_desc = __( 'Your site might have been discovered by hackers.', 'limit-login-attempts-reloaded' );
35
  $retries_chart_color = '#FFCC66';
36
  } else {
37
 
38
- $retries_chart_title = __( 'Warning: More than 100 suspicious login attempts in the last 24 hr', 'limit-login-attempts-reloaded' );
39
- $retries_chart_desc = __( 'Your site is likely under a brute-force attack.', 'limit-login-attempts-reloaded' );
40
  $retries_chart_color = '#FF6633';
41
  $retries_chart_show_actions = true;
42
  }
@@ -47,15 +46,11 @@ if( $active_app === 'local' ) {
47
 
48
  if( $api_stats && !empty( $api_stats['attempts']['count'] )) {
49
 
50
- $app_attacks = (int) end( $api_stats['attempts']['count'] );
51
  }
52
 
53
- $retries_count = 0;
54
-
55
- $retries_chart_title = __( 'Zero local suspicious login attempts in the last 24 hr', 'limit-login-attempts-reloaded' );
56
- $retries_chart_desc = ($app_attacks)
57
- ? sprintf( __( 'All %d excessive login attempts have been neutralized in the cloud', 'limit-login-attempts-reloaded' ), $app_attacks )
58
- : '';
59
  $retries_chart_color = '#66CC66';
60
  }
61
 
@@ -67,11 +62,7 @@ if( $active_app === 'local' ) {
67
  </div>
68
  <div class="dashboard-section-1 <?php echo esc_attr( $active_app ); ?>">
69
  <div class="info-box-1">
70
- <div class="section-title"><?php echo ($active_app === 'local')
71
- ? __( 'Suspicious Login Activity', 'limit-login-attempts-reloaded' ) .
72
- ' (<span class="llar-tooltip" data-text="' . esc_attr__( '"Local" means the server that hosts your website.', 'limit-login-attempts-reloaded' ) . '">' .
73
- __( 'Local', 'limit-login-attempts-reloaded' ) . '</span>)'
74
- : __( 'Suspicious Login Attempts Prevented', 'limit-login-attempts-reloaded' ); ?></div>
75
  <div class="section-content">
76
  <div class="chart">
77
  <canvas id="llar-attack-velocity-chart"></canvas>
@@ -136,7 +127,7 @@ if( $active_app === 'local' ) {
136
  <ol>
137
  <li><?php _e( 'Change your password to something more secure.', 'limit-login-attempts-reloaded' ); ?></li>
138
  <li><?php _e( 'Make sure WordPress and all your plugins are updated.', 'limit-login-attempts-reloaded' ); ?></li>
139
- <li><?php echo sprintf( __( '<a href="%s" target="_blank">Update to Premium</a> Limit Login Attempts Reloaded.', 'limit-login-attempts-reloaded' ), 'https://www.limitloginattempts.com/features/?from=plugin-dashboard-status' ); ?></li>
140
  </ol>
141
  </div>
142
  <?php endif; ?>
@@ -165,7 +156,7 @@ if( $active_app === 'local' ) {
165
  $chart2_labels = $stats_dates;
166
 
167
  $chart2_datasets[] = array(
168
- 'label' => __( 'Suspicious Login Attempts', 'limit-login-attempts-reloaded' ),
169
  'data' => $api_stats['attempts']['count'],
170
  'backgroundColor' => 'rgb(54, 162, 235)',
171
  'borderColor' => 'rgb(54, 162, 235)',
@@ -209,7 +200,7 @@ if( $active_app === 'local' ) {
209
 
210
 
211
  $chart2_datasets[] = array(
212
- 'label' => __( 'Suspicious Login Attempts', 'limit-login-attempts-reloaded' ),
213
  'data' => $chart2_data,
214
  'backgroundColor' => 'rgb(54, 162, 235)',
215
  'borderColor' => 'rgb(54, 162, 235)',
@@ -280,7 +271,7 @@ if( $active_app === 'local' ) {
280
  <div class="title"><?php _e( 'Premium Protection Disabled', 'limit-login-attempts-reloaded' ); ?></div>
281
  <div class="desc"><?php _e( 'As a free user, your local server is absorbing the traffic brought on by brute force attacks, potentially slowing down your website. Upgrade to Premium today to outsource these attacks through our cloud app, and slow down future attacks with advanced throttling.', 'limit-login-attempts-reloaded' ); ?></div>
282
  <div class="actions">
283
- <a href="https://www.limitloginattempts.com/features/?from=plugin-dashboard-cta" target="_blank" class="button button-primary"><?php _e( 'Upgrade to Premium', 'limit-login-attempts-reloaded' ); ?></a><br>
284
  </div>
285
  </div>
286
  </div>
@@ -323,7 +314,7 @@ if( $active_app === 'local' ) {
323
  <span class="dashicons dashicons-sos"></span>
324
  </div>
325
  <div class="info-box-content">
326
- <div class="title"><a href="https://www.limitloginattempts.com/resources/?from=plugin-dashboard" target="_blank"><?php _e( 'Help', 'limit-login-attempts-reloaded' ); ?></a></div>
327
  <div class="desc"><?php _e( 'Find the documentation and help you need.', 'limit-login-attempts-reloaded' ); ?></div>
328
  </div>
329
  </div>
@@ -377,7 +368,7 @@ if( $active_app === 'local' ) {
377
  </tr>
378
  <?php endforeach; ?>
379
  </table>
380
- <p class="countries-table-info"><?php _e( 'last 24 hr', 'limit-login-attempts-reloaded' ); ?></p>
381
  </div>
382
  </div>
383
 
10
  $retries_chart_show_actions = false;
11
 
12
  $api_stats = false;
13
+ $retries_count = 0;
14
  if( $active_app === 'local' ) {
15
 
16
  $retries_stats = $this->get_option( 'retries_stats' );
17
 
 
18
  if( $retries_stats ) {
19
  if( array_key_exists( date_i18n( 'Y-m-d' ), $retries_stats ) ) {
20
  $retries_count = (int) $retries_stats[date_i18n( 'Y-m-d' )];
23
 
24
  if( $retries_count === 0 ) {
25
 
26
+ $retries_chart_title = __( 'Hooray! Zero failed login attempts today', 'limit-login-attempts-reloaded' );
27
  $retries_chart_color = '#66CC66';
28
  }
29
  else if ( $retries_count < 100 ) {
30
 
31
+ $retries_chart_title = sprintf( _n( '%d failed login attempt ', '%d failed login attempts ', $retries_count, 'limit-login-attempts-reloaded' ), $retries_count );
32
+ $retries_chart_title .= __( 'today', 'limit-login-attempts-reloaded' );
33
+ $retries_chart_desc = __( 'Your site might have been discovered by hackers', 'limit-login-attempts-reloaded' );
34
  $retries_chart_color = '#FFCC66';
35
  } else {
36
 
37
+ $retries_chart_title = __( 'Warning: More than 100 failed login attempts today', 'limit-login-attempts-reloaded' );
38
+ $retries_chart_desc = __( 'Your site is likely under a brute-force attack', 'limit-login-attempts-reloaded' );
39
  $retries_chart_color = '#FF6633';
40
  $retries_chart_show_actions = true;
41
  }
46
 
47
  if( $api_stats && !empty( $api_stats['attempts']['count'] )) {
48
 
49
+ $retries_count = (int) end( $api_stats['attempts']['count'] );
50
  }
51
 
52
+ $retries_chart_title = __( 'Failed Login Attempts Today', 'limit-login-attempts-reloaded' );
53
+ $retries_chart_desc = __( 'All failed login attempts have been neutralized in the cloud', 'limit-login-attempts-reloaded' );
 
 
 
 
54
  $retries_chart_color = '#66CC66';
55
  }
56
 
62
  </div>
63
  <div class="dashboard-section-1 <?php echo esc_attr( $active_app ); ?>">
64
  <div class="info-box-1">
65
+ <div class="section-title"><?php _e( 'Failed Login Attempts', 'limit-login-attempts-reloaded' ); ?></div>
 
 
 
 
66
  <div class="section-content">
67
  <div class="chart">
68
  <canvas id="llar-attack-velocity-chart"></canvas>
127
  <ol>
128
  <li><?php _e( 'Change your password to something more secure.', 'limit-login-attempts-reloaded' ); ?></li>
129
  <li><?php _e( 'Make sure WordPress and all your plugins are updated.', 'limit-login-attempts-reloaded' ); ?></li>
130
+ <li><?php echo sprintf( __( '<a href="%s" target="_blank">Update to Premium</a> Limit Login Attempts Reloaded.', 'limit-login-attempts-reloaded' ), 'https://www.limitloginattempts.com/info.php?from=plugin-dashboard-status' ); ?></li>
131
  </ol>
132
  </div>
133
  <?php endif; ?>
156
  $chart2_labels = $stats_dates;
157
 
158
  $chart2_datasets[] = array(
159
+ 'label' => __( 'Failed Login Attempts', 'limit-login-attempts-reloaded' ),
160
  'data' => $api_stats['attempts']['count'],
161
  'backgroundColor' => 'rgb(54, 162, 235)',
162
  'borderColor' => 'rgb(54, 162, 235)',
200
 
201
 
202
  $chart2_datasets[] = array(
203
+ 'label' => __( 'Failed Login Attempts', 'limit-login-attempts-reloaded' ),
204
  'data' => $chart2_data,
205
  'backgroundColor' => 'rgb(54, 162, 235)',
206
  'borderColor' => 'rgb(54, 162, 235)',
271
  <div class="title"><?php _e( 'Premium Protection Disabled', 'limit-login-attempts-reloaded' ); ?></div>
272
  <div class="desc"><?php _e( 'As a free user, your local server is absorbing the traffic brought on by brute force attacks, potentially slowing down your website. Upgrade to Premium today to outsource these attacks through our cloud app, and slow down future attacks with advanced throttling.', 'limit-login-attempts-reloaded' ); ?></div>
273
  <div class="actions">
274
+ <a href="https://www.limitloginattempts.com/info.php?from=plugin-dashboard-cta" target="_blank" class="button button-primary"><?php _e( 'Upgrade to Premium', 'limit-login-attempts-reloaded' ); ?></a><br>
275
  </div>
276
  </div>
277
  </div>
314
  <span class="dashicons dashicons-sos"></span>
315
  </div>
316
  <div class="info-box-content">
317
+ <div class="title"><a href="https://www.limitloginattempts.com/info.php?from=plugin-dashboard-help" target="_blank"><?php _e( 'Help', 'limit-login-attempts-reloaded' ); ?></a></div>
318
  <div class="desc"><?php _e( 'Find the documentation and help you need.', 'limit-login-attempts-reloaded' ); ?></div>
319
  </div>
320
  </div>
368
  </tr>
369
  <?php endforeach; ?>
370
  </table>
371
+ <p class="countries-table-info"><?php _e( 'today', 'limit-login-attempts-reloaded' ); ?></p>
372
  </div>
373
  </div>
374