Activity Log - Version 2.7.0

Version Description

  • 2021-05-06 =
  • New: Added an option to skip or keep the failed login logs for better optimization (#125)
  • Fix: Add input sanitization to avoid security issues
  • Tweak: Improved the activity log table with clear labels and re-order columns for better UX
  • Tweak: Changed the wrong_password action to failed_login in User topic
  • Tweak: Changed the added action to uploaded in Attachment topic
  • Tweak: Changed the created action to registered in User topic
Download this release

Release Info

Developer KingYes
Plugin Icon 128x128 Activity Log
Version 2.7.0
Comparing to
See all releases

Code changes from version 2.6.1 to 2.7.0

aryo-activity-log.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://activitylog.io/?utm_source=wp-plugins&utm_campaign=plugin-ur
5
  Description: Get aware of any activities that are taking place on your dashboard! Imagine it like a black-box for your WordPress site. e.g. post was deleted, plugin was activated, user logged in or logged out - it's all these for you to see.
6
  Author: Activity Log Team
7
  Author URI: https://activitylog.io/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
8
- Version: 2.6.1
9
  Text Domain: aryo-activity-log
10
  License: GPLv2 or later
11
 
5
  Description: Get aware of any activities that are taking place on your dashboard! Imagine it like a black-box for your WordPress site. e.g. post was deleted, plugin was activated, user logged in or logged out - it's all these for you to see.
6
  Author: Activity Log Team
7
  Author URI: https://activitylog.io/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
8
+ Version: 2.7.0
9
  Text Domain: aryo-activity-log
10
  License: GPLv2 or later
11
 
classes/class-aal-activity-log-list-table.php CHANGED
@@ -127,12 +127,12 @@ class AAL_Activity_Log_List_Table extends WP_List_Table {
127
  public function get_columns() {
128
  $columns = array(
129
  'date' => __( 'Date', 'aryo-activity-log' ),
130
- 'author' => __( 'Author', 'aryo-activity-log' ),
131
  'ip' => __( 'IP', 'aryo-activity-log' ),
132
- 'type' => __( 'Type', 'aryo-activity-log' ),
133
- 'label' => __( 'Label', 'aryo-activity-log' ),
 
134
  'action' => __( 'Action', 'aryo-activity-log' ),
135
- 'description' => __( 'Description', 'aryo-activity-log' ),
136
  );
137
 
138
  return $columns;
@@ -176,7 +176,6 @@ class AAL_Activity_Log_List_Table extends WP_List_Table {
176
  if ( ! empty( $item->user_id ) && 0 !== (int) $item->user_id ) {
177
  $user = get_user_by( 'id', $item->user_id );
178
  if ( $user instanceof WP_User && 0 !== $user->ID ) {
179
- //$user->display_name
180
  return sprintf(
181
  '<a href="%s">%s <span class="aal-author-name">%s</span></a><br /><small>%s</small>',
182
  get_edit_user_link( $user->ID ),
@@ -202,7 +201,7 @@ class AAL_Activity_Log_List_Table extends WP_List_Table {
202
  public function column_label( $item ) {
203
  $return = '';
204
  if ( ! empty( $item->object_subtype ) ) {
205
- $pt = get_post_type_object( $item->object_subtype );
206
  $return = ! empty( $pt->label ) ? $pt->label : $item->object_subtype;
207
  }
208
 
@@ -212,20 +211,53 @@ class AAL_Activity_Log_List_Table extends WP_List_Table {
212
 
213
  public function column_description( $item ) {
214
  $return = esc_html( $item->object_name );
 
215
 
216
  switch ( $item->object_type ) {
217
  case 'Post' :
218
- $return = sprintf( '<a href="%s">%s</a>', get_edit_post_link( $item->object_id ), esc_html( $item->object_name ) );
 
 
 
 
 
219
  break;
220
 
221
  case 'Taxonomy' :
222
- if ( ! empty( $item->object_id ) )
223
- $return = sprintf( '<a href="%s">%s</a>', get_edit_term_link( $item->object_id, $item->object_subtype ), esc_html( $item->object_name ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
  break;
225
 
226
  case 'Comments' :
227
  if ( ! empty( $item->object_id ) && $comment = get_comment( $item->object_id ) ) {
228
- $return = sprintf( '<a href="%s">%s #%d</a>', get_edit_comment_link( $item->object_id ), $item->object_name, $item->object_id );
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  }
230
  break;
231
 
@@ -245,6 +277,18 @@ class AAL_Activity_Log_List_Table extends WP_List_Table {
245
  }
246
 
247
  $return = apply_filters( 'aal_table_list_column_description', $return, $item );
 
 
 
 
 
 
 
 
 
 
 
 
248
 
249
  return $return;
250
  }
@@ -405,7 +449,7 @@ class AAL_Activity_Log_List_Table extends WP_List_Table {
405
  $output[] = sprintf( '<option value="%s"%s>%s</option>', $type->object_type, selected( $_REQUEST['typeshow'], $type->object_type, false ), __( $type->object_type, 'aryo-activity-log' ) );
406
 
407
  echo '<select name="typeshow" id="hs-filter-typeshow">';
408
- printf( '<option value="">%s</option>', __( 'All Types', 'aryo-activity-log' ) );
409
  echo implode( '', $output );
410
  echo '</select>';
411
  }
@@ -500,7 +544,7 @@ class AAL_Activity_Log_List_Table extends WP_List_Table {
500
  ' . $this->_get_where_by_role()
501
  );
502
 
503
- $items_orderby = filter_input( INPUT_GET, 'orderby', FILTER_SANITIZE_STRING );
504
  if ( empty( $items_orderby ) ) {
505
  $items_orderby = 'hist_time'; // Sort by time by default.
506
  }
127
  public function get_columns() {
128
  $columns = array(
129
  'date' => __( 'Date', 'aryo-activity-log' ),
130
+ 'author' => __( 'User', 'aryo-activity-log' ),
131
  'ip' => __( 'IP', 'aryo-activity-log' ),
132
+ 'type' => __( 'Topic', 'aryo-activity-log' ),
133
+ 'label' => __( 'Context', 'aryo-activity-log' ),
134
+ 'description' => __( 'Meta', 'aryo-activity-log' ),
135
  'action' => __( 'Action', 'aryo-activity-log' ),
 
136
  );
137
 
138
  return $columns;
176
  if ( ! empty( $item->user_id ) && 0 !== (int) $item->user_id ) {
177
  $user = get_user_by( 'id', $item->user_id );
178
  if ( $user instanceof WP_User && 0 !== $user->ID ) {
 
179
  return sprintf(
180
  '<a href="%s">%s <span class="aal-author-name">%s</span></a><br /><small>%s</small>',
181
  get_edit_user_link( $user->ID ),
201
  public function column_label( $item ) {
202
  $return = '';
203
  if ( ! empty( $item->object_subtype ) ) {
204
+ $pt = get_post_type_object( $item->object_subtype );
205
  $return = ! empty( $pt->label ) ? $pt->label : $item->object_subtype;
206
  }
207
 
211
 
212
  public function column_description( $item ) {
213
  $return = esc_html( $item->object_name );
214
+ $actions = [];
215
 
216
  switch ( $item->object_type ) {
217
  case 'Post' :
218
+ $actions = [
219
+ 'view' => sprintf( '<a href="%s">%s</a>', get_permalink( $item->object_id ), __( 'View', 'aryo-activity-log' ) ),
220
+ 'edit' => sprintf( '<a href="%s">%s</a>', get_edit_post_link( $item->object_id ), __( 'Edit', 'aryo-activity-log' ) ),
221
+ ];
222
+
223
+ $return = esc_html( $item->object_name );
224
  break;
225
 
226
  case 'Taxonomy' :
227
+ if ( ! empty( $item->object_id ) ) {
228
+ if ( is_taxonomy_viewable( $item->object_subtype ) ) {
229
+ $term_view_link = get_term_link( absint( $item->object_id ), $item->object_subtype );
230
+
231
+ if ( ! is_wp_error( $term_view_link ) ) {
232
+ $actions['view'] = sprintf( '<a href="%s">%s</a>', $term_view_link, __( 'View', 'aryo-activity-log' ) );
233
+ }
234
+ }
235
+
236
+ $term_edit_link = get_edit_term_link( $item->object_id, $item->object_subtype );
237
+ if ( ! empty( $term_edit_link ) ) {
238
+ $actions['edit'] = sprintf( '<a href="%s">%s</a>', $term_edit_link, __( 'Edit', 'aryo-activity-log' ) );
239
+ }
240
+
241
+ $return = esc_html( $item->object_name );
242
+ }
243
  break;
244
 
245
  case 'Comments' :
246
  if ( ! empty( $item->object_id ) && $comment = get_comment( $item->object_id ) ) {
247
+ $actions['edit'] = sprintf( '<a href="%s">%s</a>', get_edit_comment_link( $item->object_id ), __( 'Edit', 'aryo-activity-log' ) );
248
+ }
249
+
250
+ $return = esc_html( "{$item->object_name} #{$item->object_id}" );
251
+ break;
252
+
253
+ case 'User' :
254
+ $user_edit_link = get_edit_user_link( $item->object_id );
255
+ if ( ! empty( $user_edit_link ) ) {
256
+ $actions['edit'] = sprintf( '<a href="%s">%s</a>', $user_edit_link, __( 'Edit', 'aryo-activity-log' ) );
257
+ }
258
+
259
+ if ( ! empty( $item->object_name ) ) {
260
+ $return = __( 'Username:', 'aryo-activity-log' ) . ' ' . $item->object_name;
261
  }
262
  break;
263
 
277
  }
278
 
279
  $return = apply_filters( 'aal_table_list_column_description', $return, $item );
280
+
281
+ if ( ! empty( $actions ) ) {
282
+ $i = 0;
283
+
284
+ $return .= '<div class="row-actions">';
285
+ foreach ( $actions as $action_name => $action_label ) {
286
+ ++$i;
287
+ ( 1 === $i ) ? $sep = '' : $sep = ' | ';
288
+ $return .= "<span class=\"{$action_name}\">{$sep}{$action_label}</span>";
289
+ }
290
+ $return .= '</div>';
291
+ }
292
 
293
  return $return;
294
  }
449
  $output[] = sprintf( '<option value="%s"%s>%s</option>', $type->object_type, selected( $_REQUEST['typeshow'], $type->object_type, false ), __( $type->object_type, 'aryo-activity-log' ) );
450
 
451
  echo '<select name="typeshow" id="hs-filter-typeshow">';
452
+ printf( '<option value="">%s</option>', __( 'All Topics', 'aryo-activity-log' ) );
453
  echo implode( '', $output );
454
  echo '</select>';
455
  }
544
  ' . $this->_get_where_by_role()
545
  );
546
 
547
+ $items_orderby = sanitize_sql_orderby( filter_input( INPUT_GET, 'orderby', FILTER_SANITIZE_STRING ) );
548
  if ( empty( $items_orderby ) ) {
549
  $items_orderby = 'hist_time'; // Sort by time by default.
550
  }
classes/class-aal-admin-ui.php CHANGED
@@ -108,11 +108,11 @@ class AAL_Admin_Ui {
108
  ?>
109
  <style>
110
  .notice.aal-notice {
111
- border-left-color: #9b0a46 !important;
112
  padding: 20px;
113
  }
114
  .rtl .notice.aal-notice {
115
- border-right-color: #9b0a46 !important;
116
  }
117
  .notice.aal-notice .aal-notice-inner {
118
  display: table;
@@ -125,9 +125,10 @@ class AAL_Admin_Ui {
125
  vertical-align: middle;
126
  }
127
  .notice.aal-notice .aal-notice-icon {
128
- color: #9b0a46;
129
  font-size: 50px;
130
  width: 50px;
 
131
  }
132
  .notice.aal-notice .aal-notice-content {
133
  padding: 0 20px;
@@ -143,10 +144,10 @@ class AAL_Admin_Ui {
143
  text-align: center;
144
  }
145
  .notice.aal-notice .aal-install-now .aal-install-button {
146
- background-color: #9b0a46;
147
  color: #fff;
148
- border-color: #7c1337;
149
- box-shadow: 0 1px 0 #7c1337;
150
  padding: 5px 30px;
151
  height: auto;
152
  line-height: 20px;
@@ -160,10 +161,10 @@ class AAL_Admin_Ui {
160
  padding-left: 5px;
161
  }
162
  .notice.aal-notice .aal-install-now .aal-install-button:hover {
163
- background-color: #a0124a;
164
  }
165
  .notice.aal-notice .aal-install-now .aal-install-button:active {
166
- box-shadow: inset 0 1px 0 #7c1337;
167
  transform: translateY(1px);
168
  }
169
  @media (max-width: 767px) {
@@ -186,7 +187,13 @@ class AAL_Admin_Ui {
186
  <div class="notice updated is-dismissible aal-notice aal-install-elementor">
187
  <div class="aal-notice-inner">
188
  <div class="aal-notice-icon">
189
- <img src="<?php echo plugins_url( 'assets/images/elementor-logo.png', ACTIVITY_LOG__FILE__ ); ?>" alt="Elementor Logo" />
 
 
 
 
 
 
190
  </div>
191
 
192
  <div class="aal-notice-content">
108
  ?>
109
  <style>
110
  .notice.aal-notice {
111
+ border-left-color: #92003B !important;
112
  padding: 20px;
113
  }
114
  .rtl .notice.aal-notice {
115
+ border-right-color: #92003B !important;
116
  }
117
  .notice.aal-notice .aal-notice-inner {
118
  display: table;
125
  vertical-align: middle;
126
  }
127
  .notice.aal-notice .aal-notice-icon {
128
+ color: #92003B;
129
  font-size: 50px;
130
  width: 50px;
131
+ height: 50px;
132
  }
133
  .notice.aal-notice .aal-notice-content {
134
  padding: 0 20px;
144
  text-align: center;
145
  }
146
  .notice.aal-notice .aal-install-now .aal-install-button {
147
+ background-color: #92003B;
148
  color: #fff;
149
+ border-color: #92003B;
150
+ box-shadow: 0 1px 0 #92003B;
151
  padding: 5px 30px;
152
  height: auto;
153
  line-height: 20px;
161
  padding-left: 5px;
162
  }
163
  .notice.aal-notice .aal-install-now .aal-install-button:hover {
164
+ background-color: #92003B;
165
  }
166
  .notice.aal-notice .aal-install-now .aal-install-button:active {
167
+ box-shadow: inset 0 1px 0 #92003B;
168
  transform: translateY(1px);
169
  }
170
  @media (max-width: 767px) {
187
  <div class="notice updated is-dismissible aal-notice aal-install-elementor">
188
  <div class="aal-notice-inner">
189
  <div class="aal-notice-icon">
190
+ <svg width="50" height="50" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
191
+ <path d="M14.0035 3.98515e-07C8.34084 -0.00134594 3.23499 3.40874 1.06704 8.64C-1.10092 13.8713 0.0960255 19.8934 4.09968 23.898C8.10333 27.9026 14.1252 29.1009 19.3569 26.9342C24.5887 24.7675 28 19.6625 28 13.9998C28 6.26922 21.7341 0.00183839 14.0035 3.98515e-07Z" fill="#92003B"/>
192
+ <rect x="8.1687" y="8.16504" width="2.3333" height="11.6665" fill="white"/>
193
+ <rect x="12.8352" y="17.498" width="6.9999" height="2.3333" fill="white"/>
194
+ <rect x="12.8352" y="12.8315" width="6.9999" height="2.3333" fill="white"/>
195
+ <rect x="12.8352" y="8.16504" width="6.9999" height="2.3333" fill="white"/>
196
+ </svg>
197
  </div>
198
 
199
  <div class="aal-notice-content">
classes/class-aal-notifications.php CHANGED
@@ -95,14 +95,14 @@ class AAL_Notifications {
95
  'unspammed',
96
  'downloaded',
97
  'installed',
98
- 'added',
99
  'activated',
100
  'deactivated',
101
  'accessed',
102
  'file_updated',
103
  'logged_in',
104
  'logged_out',
105
- 'wrong_password',
106
  )
107
  );
108
  $ready = array();
95
  'unspammed',
96
  'downloaded',
97
  'installed',
98
+ 'uploaded',
99
  'activated',
100
  'deactivated',
101
  'accessed',
102
  'file_updated',
103
  'logged_in',
104
  'logged_out',
105
+ 'failed_login',
106
  )
107
  );
108
  $ready = array();
classes/class-aal-settings.php CHANGED
@@ -68,6 +68,7 @@ class AAL_Settings {
68
  if ( ! get_option( $this->slug ) ) {
69
  update_option( $this->slug, apply_filters( 'aal_default_options', array(
70
  'logs_lifespan' => '30',
 
71
  ) ) );
72
  }
73
 
@@ -100,6 +101,23 @@ class AAL_Settings {
100
  )
101
  );
102
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  if ( apply_filters( 'aal_allow_option_erase_logs', true ) ) {
104
  add_settings_field(
105
  'raw_delete_log_activities',
68
  if ( ! get_option( $this->slug ) ) {
69
  update_option( $this->slug, apply_filters( 'aal_default_options', array(
70
  'logs_lifespan' => '30',
71
+ 'logs_failed_login' => 'yes',
72
  ) ) );
73
  }
74
 
101
  )
102
  );
103
 
104
+ add_settings_field(
105
+ 'logs_failed_login',
106
+ __( 'Keep Failed Login Logs', 'aryo-activity-log' ),
107
+ array( 'AAL_Settings_Fields', 'select_field' ),
108
+ $this->slug,
109
+ 'general_settings_section',
110
+ array(
111
+ 'id' => 'logs_failed_login',
112
+ 'page' => $this->slug,
113
+ 'type' => 'select',
114
+ 'options' => array(
115
+ 'yes' => __( 'Keep', 'aryo-activity-log' ),
116
+ 'no' => __( "Don't Keep (Not recommended)", 'aryo-activity-log' ),
117
+ ),
118
+ )
119
+ );
120
+
121
  if ( apply_filters( 'aal_allow_option_erase_logs', true ) ) {
122
  add_settings_field(
123
  'raw_delete_log_activities',
hooks/class-aal-hook-attachment.php CHANGED
@@ -24,14 +24,14 @@ class AAL_Hook_Attachment extends AAL_Hook_Base {
24
  }
25
 
26
  public function hooks_add_attachment( $attachment_id ) {
27
- $this->_add_log_attachment( 'added', $attachment_id );
28
  }
29
 
30
  public function __construct() {
31
  add_action( 'add_attachment', array( &$this, 'hooks_add_attachment' ) );
32
  add_action( 'edit_attachment', array( &$this, 'hooks_edit_attachment' ) );
33
  add_action( 'delete_attachment', array( &$this, 'hooks_delete_attachment' ) );
34
-
35
  parent::__construct();
36
  }
37
 
24
  }
25
 
26
  public function hooks_add_attachment( $attachment_id ) {
27
+ $this->_add_log_attachment( 'uploaded', $attachment_id );
28
  }
29
 
30
  public function __construct() {
31
  add_action( 'add_attachment', array( &$this, 'hooks_add_attachment' ) );
32
  add_action( 'edit_attachment', array( &$this, 'hooks_edit_attachment' ) );
33
  add_action( 'delete_attachment', array( &$this, 'hooks_delete_attachment' ) );
34
+
35
  parent::__construct();
36
  }
37
 
hooks/class-aal-hook-menu.php CHANGED
@@ -5,29 +5,26 @@ class AAL_Hook_Menu extends AAL_Hook_Base {
5
 
6
  public function hooks_menu_created_or_updated( $nav_menu_selected_id ) {
7
  if ( $menu_object = wp_get_nav_menu_object( $nav_menu_selected_id ) ) {
8
- if ( 'wp_create_nav_menu' === current_filter() )
9
  $action = 'created';
10
- else
11
  $action = 'updated';
12
-
13
- aal_insert_log(
14
- array(
15
- 'action' => $action,
16
- 'object_type' => 'Menu',
17
- 'object_name' => $menu_object->name,
18
- )
19
- );
20
  }
21
  }
22
 
23
  public function hooks_menu_deleted( $term, $tt_id, $deleted_term ) {
24
- aal_insert_log(
25
- array(
26
- 'action' => 'deleted',
27
- 'object_type' => 'Menu',
28
- 'object_name' => $deleted_term->name,
29
- )
30
- );
31
  }
32
 
33
  public function __construct() {
5
 
6
  public function hooks_menu_created_or_updated( $nav_menu_selected_id ) {
7
  if ( $menu_object = wp_get_nav_menu_object( $nav_menu_selected_id ) ) {
8
+ if ( 'wp_create_nav_menu' === current_filter() ) {
9
  $action = 'created';
10
+ } else {
11
  $action = 'updated';
12
+ }
13
+
14
+ aal_insert_log( array(
15
+ 'action' => $action,
16
+ 'object_type' => 'Menu',
17
+ 'object_name' => $menu_object->name,
18
+ ) );
 
19
  }
20
  }
21
 
22
  public function hooks_menu_deleted( $term, $tt_id, $deleted_term ) {
23
+ aal_insert_log( array(
24
+ 'action' => 'deleted',
25
+ 'object_type' => 'Menu',
26
+ 'object_name' => $deleted_term->name,
27
+ ) );
 
 
28
  }
29
 
30
  public function __construct() {
hooks/class-aal-hook-user.php CHANGED
@@ -3,33 +3,36 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
  class AAL_Hook_User extends AAL_Hook_Base {
5
 
6
- public function hooks_wp_login( $user_login, $user ) {
 
 
7
  aal_insert_log( array(
8
- 'action' => 'logged_in',
9
  'object_type' => 'User',
10
- 'user_id' => $user->ID,
11
- 'object_id' => $user->ID,
12
  'object_name' => $user->user_nicename,
13
  ) );
14
  }
15
-
16
- public function hooks_user_register( $user_id ) {
17
  $user = get_user_by( 'id', $user_id );
18
 
19
  aal_insert_log( array(
20
- 'action' => 'created',
21
  'object_type' => 'User',
22
- 'object_id' => $user->ID,
 
23
  'object_name' => $user->user_nicename,
24
  ) );
25
  }
26
- public function hooks_delete_user( $user_id ) {
27
- $user = get_user_by( 'id', $user_id );
28
 
 
29
  aal_insert_log( array(
30
- 'action' => 'deleted',
31
  'object_type' => 'User',
32
- 'object_id' => $user->ID,
 
 
33
  'object_name' => $user->user_nicename,
34
  ) );
35
  }
@@ -42,10 +45,11 @@ class AAL_Hook_User extends AAL_Hook_Base {
42
  }
43
 
44
  aal_insert_log( array(
45
- 'action' => 'logged_out',
46
  'object_type' => 'User',
47
- 'user_id' => $user->ID,
48
- 'object_id' => $user->ID,
 
49
  'object_name' => $user->user_nicename,
50
  ) );
51
  }
@@ -54,19 +58,25 @@ class AAL_Hook_User extends AAL_Hook_Base {
54
  $user = get_user_by( 'id', $user_id );
55
 
56
  aal_insert_log( array(
57
- 'action' => 'updated',
58
  'object_type' => 'User',
59
- 'object_id' => $user->ID,
 
60
  'object_name' => $user->user_nicename,
61
  ) );
62
  }
63
 
64
  public function hooks_wrong_password( $username ) {
 
 
 
 
65
  aal_insert_log( array(
66
- 'action' => 'wrong_password',
67
  'object_type' => 'User',
68
- 'user_id' => 0,
69
- 'object_id' => 0,
 
70
  'object_name' => $username,
71
  ) );
72
  }
3
 
4
  class AAL_Hook_User extends AAL_Hook_Base {
5
 
6
+ public function hooks_user_register( $user_id ) {
7
+ $user = get_user_by( 'id', $user_id );
8
+
9
  aal_insert_log( array(
10
+ 'action' => 'registered',
11
  'object_type' => 'User',
12
+ 'object_subtype' => 'Profile',
13
+ 'object_id' => $user->ID,
14
  'object_name' => $user->user_nicename,
15
  ) );
16
  }
17
+ public function hooks_delete_user( $user_id ) {
 
18
  $user = get_user_by( 'id', $user_id );
19
 
20
  aal_insert_log( array(
21
+ 'action' => 'deleted',
22
  'object_type' => 'User',
23
+ 'object_subtype' => 'Profile',
24
+ 'object_id' => $user->ID,
25
  'object_name' => $user->user_nicename,
26
  ) );
27
  }
 
 
28
 
29
+ public function hooks_wp_login( $user_login, $user ) {
30
  aal_insert_log( array(
31
+ 'action' => 'logged_in',
32
  'object_type' => 'User',
33
+ 'object_subtype' => 'Session',
34
+ 'user_id' => $user->ID,
35
+ 'object_id' => $user->ID,
36
  'object_name' => $user->user_nicename,
37
  ) );
38
  }
45
  }
46
 
47
  aal_insert_log( array(
48
+ 'action' => 'logged_out',
49
  'object_type' => 'User',
50
+ 'object_subtype' => 'Session',
51
+ 'user_id' => $user->ID,
52
+ 'object_id' => $user->ID,
53
  'object_name' => $user->user_nicename,
54
  ) );
55
  }
58
  $user = get_user_by( 'id', $user_id );
59
 
60
  aal_insert_log( array(
61
+ 'action' => 'updated',
62
  'object_type' => 'User',
63
+ 'object_subtype' => 'Profile',
64
+ 'object_id' => $user->ID,
65
  'object_name' => $user->user_nicename,
66
  ) );
67
  }
68
 
69
  public function hooks_wrong_password( $username ) {
70
+ if ( 'no' === AAL_Main::instance()->settings->get_option( 'logs_failed_login' ) ) {
71
+ return;
72
+ }
73
+
74
  aal_insert_log( array(
75
+ 'action' => 'failed_login',
76
  'object_type' => 'User',
77
+ 'object_subtype' => 'Session',
78
+ 'user_id' => 0,
79
+ 'object_id' => 0,
80
  'object_name' => $username,
81
  ) );
82
  }
i18n/strings.php CHANGED
@@ -18,13 +18,15 @@ __( 'restored', 'aryo-activity-log' );
18
 
19
  // Attachment
20
  __( 'Attachment', 'aryo-activity-log' );
21
- __( 'added', 'aryo-activity-log' );
22
 
23
  // User
24
  __( 'User', 'aryo-activity-log' );
25
  __( 'logged_out', 'aryo-activity-log' );
26
  __( 'logged_in', 'aryo-activity-log' );
27
- __( 'wrong_password', 'aryo-activity-log' );
 
 
28
 
29
  // Plugin
30
  __( 'Plugin', 'aryo-activity-log' );
18
 
19
  // Attachment
20
  __( 'Attachment', 'aryo-activity-log' );
21
+ __( 'uploaded', 'aryo-activity-log' );
22
 
23
  // User
24
  __( 'User', 'aryo-activity-log' );
25
  __( 'logged_out', 'aryo-activity-log' );
26
  __( 'logged_in', 'aryo-activity-log' );
27
+ __( 'failed_login', 'aryo-activity-log' );
28
+ __( 'registered', 'aryo-activity-log' );
29
+ __( 'removed', 'aryo-activity-log' );
30
 
31
  // Plugin
32
  __( 'Plugin', 'aryo-activity-log' );
readme.txt CHANGED
@@ -1,31 +1,34 @@
1
  === Activity Log ===
2
  Contributors: pojo.me, KingYes, ariel.k, maor
3
- Tags: Activity Log, Security Log, User Activity, User Log, Activity, audit log, monitor, security, tracking, woocommerce, bbPress,
4
  Requires at least: 4.4
5
- Tested up to: 5.7
6
- Stable tag: 2.6.1
7
  License: GPLv2 or later
8
 
9
- The #1 Activity Log plugin helps you monitor & log all changes and activities on your site, so you can run a safer, more organized WordPress site.
10
 
11
  == Description ==
12
 
13
  <strong>A COMPLETE, EASY TO USE & WELL SUPPORTED WORDPRESS ACTIVITY LOG PLUGIN</strong><br />
14
 
15
- Want to monitor and track your site activity? Find out exactly who does what on your WordPress website. the Activity Log plugin is like an airplane's black box that logs every activity in WordPress, and lets you see exactly what people are doing on your site.
16
 
17
  * Like, if someone is trying to hack your site.
18
  * Or, when a post was published, and who published it.
19
- * Or, if a plugin was activated/deactivated.
20
- * Log suspicious admin activity
21
  * Securing your site by tracking log of all user activity?
22
 
23
-
24
- Useful, right? Trust us, you won't understand how you managed your website without it. The plugin is also lightning fast and works behind the scenes, so it doesn't affect site and admin performance (For optimal performance, we built the plugin so it runs on a separate table in the database).
25
 
26
  If you have tens of users or more, you really can’t know who did what. This plugin tries to solve this issue by tracking what users do, and displaying it in an easy to use and easy to filter view on the dashboard of your WordPress site.
27
 
28
- <h4>With the Activity Log you can log:</h4>
 
 
 
 
29
  * <strong>WordPress</strong> - Core Updates
30
  * <strong>Posts</strong> - Created, Updated, Deleted
31
  * <strong>Pages</strong> - Created, Updated, Deleted
@@ -43,16 +46,10 @@ If you have tens of users or more, you really can’t know who did what. This pl
43
  * <strong>Setting</strong> - General, Writing, Reading, Discussion, Media, Permalinks
44
  * <strong>Options</strong> - Can be extend by east filter
45
  * <strong>Export</strong> - User download export file from the site
46
- * <strong>WooCommerce</strong> - Monitor all shop options
47
  * <strong>bbPress</strong> - Forums, Topics, Replies, Taxonomies and other actions
48
  * There's more, but you get the point...
49
 
50
- <strong>New!</strong> You are now able to get email notifications once an event you have defined (via rules) has occurred. This is useful in cases you must know right away when someone does something on your site. We use it to thwart hacker attempts, for example.
51
-
52
- <strong>New!</strong> Export your Activity Log data records to CSV. Developers can easily add support for custom data formats with our new dedicated Export API.
53
-
54
- <strong>New!</strong> Export your Activity Log data records to Export Personal Data tool (WordPress 4.9.6+) for better GDPR Compliance.
55
-
56
  <h4>What people are saying</h4>
57
  * <em>“Best 10 Free WordPress Plugins of the Month – July 2014: Keeping tabs on what your users do with their access to the Dashboard”</em> - [ManageWp.com](https://managewp.com/best-free-wordpress-plugins-july-2014)
58
  * <em>“Thanks to this step, we’ve discovered that our site was undergoing a brute force attack”</em> - [artdriver.com](http://www.artdriver.com/wordpress-site-hacked-solution-time/)
@@ -95,7 +92,6 @@ Would you like to like to contribute to Activity Log? You are more than welcome
95
  1. The log viewer page
96
  2. The settings page
97
  3. Screen Options
98
- 4. Interface for defining notification rules
99
 
100
  == Frequently Asked Questions ==
101
 
@@ -112,8 +108,16 @@ Would you like to like to contribute to Activity Log? You are more than welcome
112
 
113
  == Changelog ==
114
 
 
 
 
 
 
 
 
 
115
  = 2.6.1 - 2021-02-15 =
116
- * Fix: Conflict with WooCommerce while you using new editor
117
 
118
  = 2.6.0 - 2020-10-19 =
119
  * Tweak: Added support for CloudFlare and CloudFlare Enterprise client IP header ([#133](https://github.com/pojome/activity-log/issues/133))
1
  === Activity Log ===
2
  Contributors: pojo.me, KingYes, ariel.k, maor
3
+ Tags: Activity Log, User Activity, User Log, Audit Log, Security, Tracking, WooCommerce, bbPress, GDPR,
4
  Requires at least: 4.4
5
+ Tested up to: 5.8
6
+ Stable tag: 2.7.0
7
  License: GPLv2 or later
8
 
9
+ The #1 Activity Log plugin helps you monitor & log all changes and activities on your WordPress site, so you can run more securely and organized. Works simple & completely free!
10
 
11
  == Description ==
12
 
13
  <strong>A COMPLETE, EASY TO USE & WELL SUPPORTED WORDPRESS ACTIVITY LOG PLUGIN</strong><br />
14
 
15
+ Want to monitor and track your WordPress website activity? Find out exactly who does what on your WordPress website. the Activity Log plugin is like an airplane's black box that logs every activity in WordPress admin, and lets you see exactly what users are doing on your WordPress website.
16
 
17
  * Like, if someone is trying to hack your site.
18
  * Or, when a post was published, and who published it.
19
+ * Or, if a plugin/theme was activated/deactivated.
20
+ * Log suspicious admin activity.
21
  * Securing your site by tracking log of all user activity?
22
 
23
+ Useful, right? Trust us, you won't understand how you managed your website without it. The plugin is also lightning fast and works behind the scenes, so it doesn't affect site and admin performance. For optimal performance, we built the plugin so it runs on a separate table in the database.
 
24
 
25
  If you have tens of users or more, you really can’t know who did what. This plugin tries to solve this issue by tracking what users do, and displaying it in an easy to use and easy to filter view on the dashboard of your WordPress site.
26
 
27
+ <strong>Export to CSV</strong> Export your Activity Log data records to CSV. Developers can easily add support for custom data formats with our new dedicated Export API.
28
+
29
+ <strong>Data Privacy and GDPR Compliance</strong> We provide the tools to help you be GDPR compliant, including Export/Erasure of data via the WordPress Privacy Tools.
30
+
31
+ <h3>With the Activity Log you can record:</h3>
32
  * <strong>WordPress</strong> - Core Updates
33
  * <strong>Posts</strong> - Created, Updated, Deleted
34
  * <strong>Pages</strong> - Created, Updated, Deleted
46
  * <strong>Setting</strong> - General, Writing, Reading, Discussion, Media, Permalinks
47
  * <strong>Options</strong> - Can be extend by east filter
48
  * <strong>Export</strong> - User download export file from the site
49
+ * <strong>WooCommerce</strong> - Monitor all shop settings and options
50
  * <strong>bbPress</strong> - Forums, Topics, Replies, Taxonomies and other actions
51
  * There's more, but you get the point...
52
 
 
 
 
 
 
 
53
  <h4>What people are saying</h4>
54
  * <em>“Best 10 Free WordPress Plugins of the Month – July 2014: Keeping tabs on what your users do with their access to the Dashboard”</em> - [ManageWp.com](https://managewp.com/best-free-wordpress-plugins-july-2014)
55
  * <em>“Thanks to this step, we’ve discovered that our site was undergoing a brute force attack”</em> - [artdriver.com](http://www.artdriver.com/wordpress-site-hacked-solution-time/)
92
  1. The log viewer page
93
  2. The settings page
94
  3. Screen Options
 
95
 
96
  == Frequently Asked Questions ==
97
 
108
 
109
  == Changelog ==
110
 
111
+ = 2.7.0 - 2021-05-06 =
112
+ * New: Added an option to skip or keep the failed login logs for better optimization ([#125](https://github.com/pojome/activity-log/issues/125))
113
+ * Fix: Add input sanitization to avoid security issues
114
+ * Tweak: Improved the activity log table with clear labels and re-order columns for better UX
115
+ * Tweak: Changed the wrong_password action to failed_login in User topic
116
+ * Tweak: Changed the added action to uploaded in Attachment topic
117
+ * Tweak: Changed the created action to registered in User topic
118
+
119
  = 2.6.1 - 2021-02-15 =
120
+ * Fix: Conflict with WooCommerce while you using new block editor
121
 
122
  = 2.6.0 - 2020-10-19 =
123
  * Tweak: Added support for CloudFlare and CloudFlare Enterprise client IP header ([#133](https://github.com/pojome/activity-log/issues/133))