Activity Log - Version 2.0.5

Version Description

  • New! Register aal_init_caps filter.
  • Tweak! Change all methods to non-static.
  • Tweak! Some improved coding standards and PHPDoc.
  • Tweak! Split AAL_Hooks class to multiple classes.
  • New! Added translate: Armenia (hy_AM) - Thanks to Hayk Jomardyan.
Download this release

Release Info

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

Code changes from version 2.0.4 to 2.0.5

aryo-activity-log.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://wordpress.org/plugins/aryo-activity-log/
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: Yakir Sitbon, Maor Chasen, Ariel Klikstein
7
  Author URI: http://www.aryodigital.com
8
- Version: 2.0.4
9
  Text Domain: aryo-aal
10
  Domain Path: /languages/
11
  License: GPLv2 or later
@@ -28,7 +28,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28
 
29
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
30
 
31
- define( 'ACTIVITY_LOG_BASE', plugin_basename( __FILE__ ) );
 
32
 
33
  include( 'classes/class-aal-maintenance.php' );
34
  include( 'classes/class-aal-activity-log-list-table.php' );
@@ -43,8 +44,15 @@ include( 'classes/class-aal-integration-woocommerce.php' );
43
  // Probably we should put this in a separate file
44
  class AAL_Main {
45
 
 
 
 
 
 
 
46
  /**
47
  * @var AAL_Admin_Ui
 
48
  */
49
  public $ui;
50
 
@@ -55,8 +63,15 @@ class AAL_Main {
55
 
56
  /**
57
  * @var AAL_Settings
 
58
  */
59
  public $settings;
 
 
 
 
 
 
60
 
61
  public function load_textdomain() {
62
  load_plugin_textdomain( 'aryo-aal', false, basename( dirname( __FILE__ ) ) . '/language' );
@@ -68,15 +83,24 @@ class AAL_Main {
68
  $this->ui = new AAL_Admin_Ui();
69
  $this->hooks = new AAL_Hooks();
70
  $this->settings = new AAL_Settings();
 
71
 
72
  // set up our DB name
73
  $wpdb->activity_log = $wpdb->prefix . 'aryo_activity_log';
74
 
75
  add_action( 'plugins_loaded', array( &$this, 'load_textdomain' ) );
76
  }
 
 
 
 
 
 
 
 
 
77
 
78
  }
79
- global $aal_main_class;
80
- $aal_main_class = new AAL_Main();
81
 
82
- // EOF
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: Yakir Sitbon, Maor Chasen, Ariel Klikstein
7
  Author URI: http://www.aryodigital.com
8
+ Version: 2.0.5
9
  Text Domain: aryo-aal
10
  Domain Path: /languages/
11
  License: GPLv2 or later
28
 
29
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
30
 
31
+ define( 'ACTIVITY_LOG__FILE__', __FILE__ );
32
+ define( 'ACTIVITY_LOG_BASE', plugin_basename( ACTIVITY_LOG__FILE__ ) );
33
 
34
  include( 'classes/class-aal-maintenance.php' );
35
  include( 'classes/class-aal-activity-log-list-table.php' );
44
  // Probably we should put this in a separate file
45
  class AAL_Main {
46
 
47
+ /**
48
+ * @var AAL_Main The one true AAL_Main
49
+ * @since 2.0.5
50
+ */
51
+ private static $_instance = null;
52
+
53
  /**
54
  * @var AAL_Admin_Ui
55
+ * @since 1.0.0
56
  */
57
  public $ui;
58
 
63
 
64
  /**
65
  * @var AAL_Settings
66
+ * @since 1.0.0
67
  */
68
  public $settings;
69
+
70
+ /**
71
+ * @var AAL_API
72
+ * @since 2.0.5
73
+ */
74
+ public $api;
75
 
76
  public function load_textdomain() {
77
  load_plugin_textdomain( 'aryo-aal', false, basename( dirname( __FILE__ ) ) . '/language' );
83
  $this->ui = new AAL_Admin_Ui();
84
  $this->hooks = new AAL_Hooks();
85
  $this->settings = new AAL_Settings();
86
+ $this->api = new AAL_API();
87
 
88
  // set up our DB name
89
  $wpdb->activity_log = $wpdb->prefix . 'aryo_activity_log';
90
 
91
  add_action( 'plugins_loaded', array( &$this, 'load_textdomain' ) );
92
  }
93
+
94
+ /**
95
+ * @return AAL_Main
96
+ */
97
+ public static function instance() {
98
+ if ( is_null( self::$_instance ) )
99
+ self::$_instance = new AAL_Main();
100
+ return self::$_instance;
101
+ }
102
 
103
  }
104
+ AAL_Main::instance();
 
105
 
106
+ // EOF
classes/class-aal-activity-log-list-table.php CHANGED
@@ -71,11 +71,11 @@ class AAL_Activity_Log_List_Table extends WP_List_Table {
71
  'edit_pages' => array( 'Post', 'Taxonomy', 'Attachment' ),
72
  ) );
73
 
74
- $this->_caps = array(
75
  'administrator' => array( 'administrator', 'editor', 'author', 'guest' ),
76
  'editor' => array( 'editor', 'author', 'guest' ),
77
  'author' => array( 'author', 'guest' ),
78
- );
79
 
80
  add_screen_option( 'per_page', array(
81
  'default' => 50,
71
  'edit_pages' => array( 'Post', 'Taxonomy', 'Attachment' ),
72
  ) );
73
 
74
+ $this->_caps = apply_filters( 'aal_init_caps', array(
75
  'administrator' => array( 'administrator', 'editor', 'author', 'guest' ),
76
  'editor' => array( 'editor', 'author', 'guest' ),
77
  'author' => array( 'author', 'guest' ),
78
+ ) );
79
 
80
  add_screen_option( 'per_page', array(
81
  'default' => 50,
classes/class-aal-api.php CHANGED
@@ -4,10 +4,15 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
 
5
  class AAL_API {
6
 
7
- protected static function _delete_old_items() {
 
 
 
 
 
8
  global $wpdb;
9
 
10
- $logs_lifespan = absint( AAL_Settings::get_option( 'logs_lifespan' ) );
11
  if ( empty( $logs_lifespan ) )
12
  return;
13
 
@@ -18,8 +23,12 @@ class AAL_API {
18
  strtotime( '-' . $logs_lifespan . ' days', current_time( 'timestamp' ) )
19
  ) );
20
  }
21
-
22
- public static function erase_all_items() {
 
 
 
 
23
  global $wpdb;
24
 
25
  $wpdb->query( $wpdb->prepare(
@@ -28,7 +37,13 @@ class AAL_API {
28
  ) );
29
  }
30
 
31
- public static function insert( $args ) {
 
 
 
 
 
 
32
  global $wpdb;
33
 
34
  $args = wp_parse_args( $args, array(
@@ -98,12 +113,20 @@ class AAL_API {
98
  );
99
 
100
  // Remove old items.
101
- self::_delete_old_items();
102
  do_action( 'aal_insert_log', $args );
103
  }
104
 
105
  }
106
 
 
 
 
 
 
 
 
 
107
  function aal_insert_log( $args = array() ) {
108
- AAL_API::insert( $args );
109
  }
4
 
5
  class AAL_API {
6
 
7
+ /**
8
+ * @since 1.0.0
9
+ *
10
+ * @return void
11
+ */
12
+ protected function _delete_old_items() {
13
  global $wpdb;
14
 
15
+ $logs_lifespan = absint( AAL_Main::instance()->settings->get_option( 'logs_lifespan' ) );
16
  if ( empty( $logs_lifespan ) )
17
  return;
18
 
23
  strtotime( '-' . $logs_lifespan . ' days', current_time( 'timestamp' ) )
24
  ) );
25
  }
26
+
27
+ /**
28
+ * @since 2.0.0
29
+ * @return void
30
+ */
31
+ public function erase_all_items() {
32
  global $wpdb;
33
 
34
  $wpdb->query( $wpdb->prepare(
37
  ) );
38
  }
39
 
40
+ /**
41
+ * @since 1.0.0
42
+ *
43
+ * @param array $args
44
+ * @return void
45
+ */
46
+ public function insert( $args ) {
47
  global $wpdb;
48
 
49
  $args = wp_parse_args( $args, array(
113
  );
114
 
115
  // Remove old items.
116
+ $this->_delete_old_items();
117
  do_action( 'aal_insert_log', $args );
118
  }
119
 
120
  }
121
 
122
+ /**
123
+ * @since 1.0.0
124
+ *
125
+ * @see AAL_API::insert
126
+ *
127
+ * @param array $args
128
+ * @return void
129
+ */
130
  function aal_insert_log( $args = array() ) {
131
+ AAL_Main::instance()->api->insert( $args );
132
  }
classes/class-aal-hooks.php CHANGED
@@ -3,474 +3,31 @@
3
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
 
5
  class AAL_Hooks {
6
-
7
- protected function _add_log_attachment( $action, $attachment_id ) {
8
- $post = get_post( $attachment_id );
9
-
10
- aal_insert_log( array(
11
- 'action' => $action,
12
- 'object_type' => 'Attachment',
13
- 'object_subtype' => $post->post_type,
14
- 'object_id' => $attachment_id,
15
- 'object_name' => get_the_title( $post->ID ),
16
- ) );
17
- }
18
-
19
- protected function _add_log_plugin( $action, $plugin_name ) {
20
- // Get plugin name if is a path
21
- if ( false !== strpos( $plugin_name, '/' ) ) {
22
- $plugin_dir = explode( '/', $plugin_name );
23
- $plugin_data = array_shift( array_values( get_plugins( '/' . $plugin_dir[0] ) ) );
24
- $plugin_name = $plugin_data['Name'];
25
- }
26
-
27
- aal_insert_log( array(
28
- 'action' => $action,
29
- 'object_type' => 'Plugin',
30
- 'object_id' => 0,
31
- 'object_name' => $plugin_name,
32
- ) );
33
- }
34
-
35
- public function init() {
36
- // User
37
- add_filter( 'wp_login_failed', array( &$this, 'hooks_wrong_password' ) );
38
- add_action( 'wp_login', array( &$this, 'hooks_wp_login' ), 10, 2 );
39
- add_action( 'wp_logout', array( &$this, 'hooks_wp_logout' ) );
40
- add_action( 'delete_user', array( &$this, 'hooks_delete_user' ) );
41
- add_action( 'user_register', array( &$this, 'hooks_user_register' ) );
42
- add_action( 'profile_update', array( &$this, 'hooks_profile_update' ) );
43
-
44
- // Plugins
45
- add_action( 'activated_plugin', array( &$this, 'hooks_activated_plugin' ) );
46
- add_action( 'deactivated_plugin', array( &$this, 'hooks_deactivated_plugin' ) );
47
- add_filter( 'wp_redirect', array( &$this, 'hooks_plugin_modify' ), 10, 2 );
48
-
49
- // Theme
50
- add_filter( 'wp_redirect', array( &$this, 'hooks_theme_modify' ), 10, 2 );
51
- add_action( 'switch_theme', array( &$this, 'hooks_switch_theme' ), 10, 2 );
52
-
53
- // Theme customizer
54
- add_action( 'customize_save', array( &$this, 'hooks_theme_customizer_modified' ) );
55
- //add_action( 'customize_preview_init', array( &$this, 'hooks_theme_customizer_modified' ) );
56
-
57
- // Options
58
- add_action( 'updated_option', array( &$this, 'hooks_updated_option' ), 10, 3 );
59
-
60
- // Menu
61
- add_action( 'wp_update_nav_menu', array( &$this, 'hooks_menu_updated' ) );
62
-
63
- // Taxonomy
64
- add_action( 'created_term', array( &$this, 'hooks_created_edited_deleted_term' ), 10, 3 );
65
- add_action( 'edited_term', array( &$this, 'hooks_created_edited_deleted_term' ), 10, 3 );
66
- add_action( 'delete_term', array( &$this, 'hooks_created_edited_deleted_term' ), 10, 4 );
67
- }
68
-
69
- public function admin_init() {
70
- // Posts
71
- add_action( 'transition_post_status', array( &$this, 'hooks_transition_post_status' ), 10, 3 );
72
- add_action( 'delete_post', array( &$this, 'hooks_delete_post' ) );
73
-
74
- // Attachments
75
- add_action( 'add_attachment', array( &$this, 'hooks_add_attachment' ) );
76
- add_action( 'edit_attachment', array( &$this, 'hooks_edit_attachment' ) );
77
- add_action( 'delete_attachment', array( &$this, 'hooks_delete_attachment' ) );
78
-
79
- // Widgets
80
- add_filter( 'widget_update_callback', array( &$this, 'hooks_widget_update_callback' ), 9999, 4 );
81
- add_filter( 'sidebar_admin_setup', array( &$this, 'hooks_widget_delete' ) ); // Widget delete.
82
- }
83
-
84
- public function hooks_delete_attachment( $attachment_id ) {
85
- $this->_add_log_attachment( 'deleted', $attachment_id );
86
- }
87
-
88
- public function hooks_edit_attachment( $attachment_id ) {
89
- $this->_add_log_attachment( 'updated', $attachment_id );
90
- }
91
-
92
- public function hooks_add_attachment( $attachment_id ) {
93
- $this->_add_log_attachment( 'added', $attachment_id );
94
- }
95
-
96
- public function hooks_deactivated_plugin( $plugin_name ) {
97
- $this->_add_log_plugin( 'deactivated', $plugin_name );
98
- }
99
-
100
- public function hooks_activated_plugin( $plugin_name ) {
101
- $this->_add_log_plugin( 'activated', $plugin_name );
102
- }
103
-
104
- public function hooks_profile_update( $user_id ) {
105
- $user = get_user_by( 'id', $user_id );
106
-
107
- aal_insert_log( array(
108
- 'action' => 'updated',
109
- 'object_type' => 'User',
110
- 'object_id' => $user->ID,
111
- 'object_name' => $user->user_nicename,
112
- ) );
113
- }
114
-
115
- public function hooks_user_register( $user_id ) {
116
- $user = get_user_by( 'id', $user_id );
117
-
118
- aal_insert_log( array(
119
- 'action' => 'created',
120
- 'object_type' => 'User',
121
- 'object_id' => $user->ID,
122
- 'object_name' => $user->user_nicename,
123
- ) );
124
- }
125
-
126
- public function hooks_delete_user( $user_id ) {
127
- $user = get_user_by( 'id', $user_id );
128
-
129
- aal_insert_log( array(
130
- 'action' => 'deleted',
131
- 'object_type' => 'User',
132
- 'object_id' => $user->ID,
133
- 'object_name' => $user->user_nicename,
134
- ) );
135
- }
136
-
137
- public function hooks_wrong_password( $username ) {
138
- aal_insert_log( array(
139
- 'action' => 'wrong_password',
140
- 'object_type' => 'User',
141
- 'user_id' => 0,
142
- 'object_id' => 0,
143
- 'object_name' => $username,
144
- ) );
145
- }
146
-
147
- public function hooks_wp_login( $user_login, $user ) {
148
- aal_insert_log( array(
149
- 'action' => 'logged_in',
150
- 'object_type' => 'User',
151
- 'user_id' => $user->ID,
152
- 'object_id' => $user->ID,
153
- 'object_name' => $user->user_nicename,
154
- ) );
155
- }
156
-
157
- public function hooks_wp_logout() {
158
- $user = wp_get_current_user();
159
-
160
- aal_insert_log( array(
161
- 'action' => 'logged_out',
162
- 'object_type' => 'User',
163
- 'user_id' => $user->ID,
164
- 'object_id' => $user->ID,
165
- 'object_name' => $user->user_nicename,
166
- ) );
167
- }
168
-
169
- public function hooks_transition_post_status( $new_status, $old_status, $post ) {
170
- $action = '';
171
-
172
- if ( 'auto-draft' === $old_status && ( 'auto-draft' !== $new_status && 'inherit' !== $new_status ) ) {
173
- // page created
174
- $action = 'created';
175
- }
176
- elseif ( 'auto-draft' === $new_status || ( 'new' === $old_status && 'inherit' === $new_status ) ) {
177
- // nvm.. ignore it.
178
- return;
179
- }
180
- elseif ( 'trash' === $new_status ) {
181
- // page was deleted.
182
- $action = 'deleted';
183
- }
184
- else {
185
- // page updated. i guess.
186
- $action = 'updated';
187
- }
188
-
189
- if ( wp_is_post_revision( $post->ID ) )
190
- return;
191
-
192
- // Skip for menu items.
193
- if ( 'nav_menu_item' === get_post_type( $post->ID ) )
194
- return;
195
-
196
- aal_insert_log( array(
197
- 'action' => $action,
198
- 'object_type' => 'Post',
199
- 'object_subtype' => $post->post_type,
200
- 'object_id' => $post->ID,
201
- 'object_name' => _draft_or_post_title( $post->ID ),
202
- ) );
203
- }
204
-
205
- public function hooks_delete_post( $post_id ) {
206
- if ( wp_is_post_revision( $post_id ) )
207
- return;
208
-
209
- $post = get_post( $post_id );
210
-
211
- if ( in_array( $post->post_status, array( 'auto-draft', 'inherit' ) ) )
212
- return;
213
-
214
- // Skip for menu items.
215
- if ( 'nav_menu_item' === get_post_type( $post->ID ) )
216
- return;
217
-
218
- aal_insert_log( array(
219
- 'action' => 'deleted',
220
- 'object_type' => 'Post',
221
- 'object_subtype' => $post->post_type,
222
- 'object_id' => $post->ID,
223
- 'object_name' => _draft_or_post_title( $post->ID ),
224
- ) );
225
- }
226
-
227
- public function hooks_widget_update_callback( $instance, $new_instance, $old_instance, WP_Widget $widget ) {
228
- $aal_args = array(
229
- 'action' => 'updated',
230
- 'object_type' => 'Widget',
231
- 'object_subtype' => 'sidebar_unknown',
232
- 'object_id' => 0,
233
- 'object_name' => $widget->id_base,
234
- );
235
-
236
- if ( ! empty( $_REQUEST['sidebar'] ) )
237
- $aal_args['object_subtype'] = strtolower( $_REQUEST['sidebar'] );
238
-
239
- /** @todo: find any way to widget deleted detected */
240
- /*if ( isset( $_REQUEST['delete_widget'] ) && '1' === $_REQUEST['delete_widget'] ) {
241
- $aal_args['action'] = 'deleted';
242
- }*/
243
-
244
- aal_insert_log( $aal_args );
245
-
246
- // We are need return the instance, for complete the filter.
247
- return $instance;
248
- }
249
-
250
- public function hooks_widget_delete() {
251
- // A reference: http://grinninggecko.com/hooking-into-widget-delete-action-in-wordpress/
252
- if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && ! empty( $_REQUEST['widget-id'] ) ) {
253
- if ( isset( $_REQUEST['delete_widget'] ) && 1 === (int) $_REQUEST['delete_widget'] ) {
254
- aal_insert_log( array(
255
- 'action' => 'deleted',
256
- 'object_type' => 'Widget',
257
- 'object_subtype' => strtolower( $_REQUEST['sidebar'] ),
258
- 'object_id' => 0,
259
- 'object_name' => $_REQUEST['id_base'],
260
- ) );
261
- }
262
- }
263
- }
264
 
265
- public function hooks_switch_theme( $new_name, WP_Theme $new_theme ) {
266
- aal_insert_log( array(
267
- 'action' => 'activated',
268
- 'object_type' => 'Theme',
269
- 'object_subtype' => $new_theme->get_stylesheet(),
270
- 'object_id' => 0,
271
- 'object_name' => $new_name,
272
- ) );
273
- }
274
-
275
- public function hooks_theme_modify( $location, $status ) {
276
- if ( false !== strpos( $location, 'theme-editor.php?file=' ) ) {
277
- if ( ! empty( $_POST ) && 'update' === $_POST['action'] ) {
278
- $aal_args = array(
279
- 'action' => 'file_updated',
280
- 'object_type' => 'Theme',
281
- 'object_subtype' => 'theme_unknown',
282
- 'object_id' => 0,
283
- 'object_name' => 'file_unknown',
284
- );
285
-
286
- if ( ! empty( $_POST['file'] ) )
287
- $aal_args['object_name'] = $_POST['file'];
288
-
289
- if ( ! empty( $_POST['theme'] ) )
290
- $aal_args['object_subtype'] = $_POST['theme'];
291
-
292
- aal_insert_log( $aal_args );
293
- }
294
- }
295
-
296
- // We are need return the instance, for complete the filter.
297
- return $location;
298
- }
299
-
300
- public function hooks_plugin_modify( $location, $status ) {
301
- if ( false !== strpos( $location, 'plugin-editor.php' ) ) {
302
- if ( ( ! empty( $_POST ) && 'update' === $_REQUEST['action'] ) ) {
303
- $aal_args = array(
304
- 'action' => 'file_updated',
305
- 'object_type' => 'Plugin',
306
- 'object_subtype' => 'plugin_unknown',
307
- 'object_id' => 0,
308
- 'object_name' => 'file_unknown',
309
- );
310
-
311
- if ( ! empty( $_REQUEST['file'] ) ) {
312
- $aal_args['object_name'] = $_REQUEST['file'];
313
- // Get plugin name
314
- $plugin_dir = explode( '/', $_REQUEST['file'] );
315
- $plugin_data = array_shift( array_values( get_plugins( '/' . $plugin_dir[0] ) ) );
316
-
317
- $aal_args['object_subtype'] = $plugin_data['Name'];
318
- }
319
- aal_insert_log( $aal_args );
320
- }
321
- }
322
-
323
- // We are need return the instance, for complete the filter.
324
- return $location;
325
- }
326
-
327
- public function hooks_theme_customizer_modified( $obj ) {
328
- $aal_args = array(
329
- 'action' => 'updated',
330
- 'object_type' => 'Theme',
331
- 'object_subtype' => $obj->theme()->display( 'Name' ),
332
- 'object_id' => 0,
333
- 'object_name' => 'Theme Customizer',
334
- );
335
-
336
- if ( 'customize_preview_init' === current_filter() )
337
- $aal_args['action'] = 'accessed';
338
-
339
- aal_insert_log( $aal_args );
340
- }
341
-
342
- public function hooks_updated_option( $option, $oldvalue, $_newvalue ) {
343
- $whitelist_options = apply_filters( 'aal_whitelist_options', array(
344
- // General
345
- 'blogname',
346
- 'blogdescription',
347
- 'siteurl',
348
- 'home',
349
- 'admin_email',
350
- 'users_can_register',
351
- 'default_role',
352
- 'timezone_string',
353
- 'date_format',
354
- 'time_format',
355
- 'start_of_week',
356
-
357
- // Writing
358
- 'use_smilies',
359
- 'use_balanceTags',
360
- 'default_category',
361
- 'default_post_format',
362
- 'mailserver_url',
363
- 'mailserver_login',
364
- 'mailserver_pass',
365
- 'default_email_category',
366
- 'ping_sites',
367
-
368
- // Reading
369
- 'show_on_front',
370
- 'page_on_front',
371
- 'page_for_posts',
372
- 'posts_per_page',
373
- 'posts_per_rss',
374
- 'rss_use_excerpt',
375
- 'blog_public',
376
-
377
- // Discussion
378
- 'default_pingback_flag',
379
- 'default_ping_status',
380
- 'default_comment_status',
381
- 'require_name_email',
382
- 'comment_registration',
383
- 'close_comments_for_old_posts',
384
- 'close_comments_days_old',
385
- 'thread_comments',
386
- 'thread_comments_depth',
387
- 'page_comments',
388
- 'comments_per_page',
389
- 'default_comments_page',
390
- 'comment_order',
391
- 'comments_notify',
392
- 'moderation_notify',
393
- 'comment_moderation',
394
- 'comment_whitelist',
395
- 'comment_max_links',
396
- 'moderation_keys',
397
- 'blacklist_keys',
398
- 'show_avatars',
399
- 'avatar_rating',
400
- 'avatar_default',
401
-
402
- // Media
403
- 'thumbnail_size_w',
404
- 'thumbnail_size_h',
405
- 'thumbnail_crop',
406
- 'medium_size_w',
407
- 'medium_size_h',
408
- 'large_size_w',
409
- 'large_size_h',
410
- 'uploads_use_yearmonth_folders',
411
-
412
- // Permalinks
413
- 'permalink_structure',
414
- 'category_base',
415
- 'tag_base',
416
-
417
- // Widgets
418
- 'sidebars_widgets',
419
- ) );
420
-
421
- if ( ! in_array( $option, $whitelist_options ) )
422
- return;
423
-
424
- // TODO: need to think about save old & new values.
425
- aal_insert_log( array(
426
- 'action' => 'updated',
427
- 'object_type' => 'Options',
428
- 'object_name' => $option,
429
- ) );
430
- }
431
-
432
- public function hooks_menu_updated( $nav_menu_selected_id ) {
433
- if ( $menu_object = wp_get_nav_menu_object( $nav_menu_selected_id ) ) {
434
- aal_insert_log( array(
435
- 'action' => 'updated',
436
- 'object_type' => 'Menu',
437
- 'object_name' => $menu_object->name,
438
- ) );
439
- }
440
- }
441
-
442
- public function hooks_created_edited_deleted_term( $term_id, $tt_id, $taxonomy, $deleted_term = null ) {
443
- // Make sure do not action nav menu taxonomy.
444
- if ( 'nav_menu' === $taxonomy )
445
- return;
446
-
447
- if ( 'delete_term' === current_filter() )
448
- $term = $deleted_term;
449
- else
450
- $term = get_term( $term_id, $taxonomy );
451
-
452
- if ( $term && ! is_wp_error( $term ) ) {
453
- if ( 'edited_term' === current_filter() ) {
454
- $action = 'updated';
455
- } elseif ( 'delete_term' === current_filter() ) {
456
- $action = 'deleted';
457
- $term_id = '';
458
- } else {
459
- $action = 'created';
460
- }
461
-
462
- aal_insert_log( array(
463
- 'action' => $action,
464
- 'object_type' => 'Taxonomy',
465
- 'object_subtype' => $taxonomy,
466
- 'object_id' => $term_id,
467
- 'object_name' => $term->name,
468
- ) );
469
- }
470
- }
471
-
472
  public function __construct() {
473
- add_action( 'init', array( &$this, 'init' ) );
474
- add_action( 'admin_init', array( &$this, 'admin_init' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
475
  }
476
  }
3
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
 
5
  class AAL_Hooks {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  public function __construct() {
8
+ // Load abstract class.
9
+ include( plugin_dir_path( ACTIVITY_LOG__FILE__ ) . '/hooks/abstract-class-aal-hook-base.php' );
10
+
11
+ // TODO: Maybe I will use with glob() function for this.
12
+ // Load all our hooks.
13
+ include( plugin_dir_path( ACTIVITY_LOG__FILE__ ) . '/hooks/class-aal-hook-user.php' );
14
+ include( plugin_dir_path( ACTIVITY_LOG__FILE__ ) . '/hooks/class-aal-hook-attachment.php' );
15
+ include( plugin_dir_path( ACTIVITY_LOG__FILE__ ) . '/hooks/class-aal-hook-menu.php' );
16
+ include( plugin_dir_path( ACTIVITY_LOG__FILE__ ) . '/hooks/class-aal-hook-options.php' );
17
+ include( plugin_dir_path( ACTIVITY_LOG__FILE__ ) . '/hooks/class-aal-hook-plugins.php' );
18
+ include( plugin_dir_path( ACTIVITY_LOG__FILE__ ) . '/hooks/class-aal-hook-posts.php' );
19
+ include( plugin_dir_path( ACTIVITY_LOG__FILE__ ) . '/hooks/class-aal-hook-taxonomy.php' );
20
+ include( plugin_dir_path( ACTIVITY_LOG__FILE__ ) . '/hooks/class-aal-hook-theme.php' );
21
+ include( plugin_dir_path( ACTIVITY_LOG__FILE__ ) . '/hooks/class-aal-hook-widgets.php' );
22
+
23
+ new AAL_Hook_User();
24
+ new AAL_Hook_Attachment();
25
+ new AAL_Hook_Menu();
26
+ new AAL_Hook_Options();
27
+ new AAL_Hook_Plugins();
28
+ new AAL_Hook_Posts();
29
+ new AAL_Hook_Taxonomy();
30
+ new AAL_Hook_Theme();
31
+ new AAL_Hook_Widgets();
32
  }
33
  }
classes/class-aal-settings.php CHANGED
@@ -14,7 +14,7 @@ class AAL_Settings {
14
  add_action( 'admin_footer', array( &$this, 'admin_footer' ) );
15
  add_filter( 'plugin_action_links_' . ACTIVITY_LOG_BASE, array( &$this, 'plugin_action_links' ) );
16
 
17
- add_action( 'wp_ajax_aal_reset_stream', array( &$this, 'ajax_aal_reset_stream' ) );
18
  }
19
 
20
  public function plugin_action_links( $links ) {
@@ -86,8 +86,8 @@ class AAL_Settings {
86
  'general_settings_section',
87
  array(
88
  'html' => sprintf( __( '<a href="%s" id="%s">Reset Database</a>', 'aryo-aal' ), add_query_arg( array(
89
- 'action' => 'aal_reset_stream',
90
- '_nonce' => wp_create_nonce( 'aal_reset_stream' ),
91
  ), admin_url( 'admin-ajax.php' ) ), 'aal-delete-log-activities' ),
92
  'desc' => __( 'Warning: Clicking this will delete all activities from the database.', 'aryo-aal' ),
93
  )
@@ -141,12 +141,13 @@ class AAL_Settings {
141
  <?php
142
  }
143
 
144
- public function ajax_aal_reset_stream() {
145
- if ( ! check_ajax_referer( 'aal_reset_stream', '_nonce', false ) || ! current_user_can( 'manage_options' ) ) {
146
  wp_die( 'You do not have sufficient permissions to access this page.', 'aryo-aal' );
147
  }
148
 
149
- AAL_API::erase_all_items();
 
150
  wp_redirect( add_query_arg( array(
151
  'page' => 'activity-log-settings',
152
  'message' => 'data_erased',
@@ -154,7 +155,7 @@ class AAL_Settings {
154
  die();
155
  }
156
 
157
- public static function get_option( $key = '' ) {
158
  $settings = get_option( 'activity-log-settings' );
159
  return ! empty( $settings[ $key ] ) ? $settings[ $key ] : false;
160
  }
@@ -188,7 +189,7 @@ final class AAL_Settings_Fields {
188
  return;
189
 
190
  ?>
191
- <input type="text" id="<?php echo esc_attr( $args['id'] ); ?>" name="<?php printf( '%s[%s]', esc_attr( $args['page'] ), esc_attr( $args['id'] ) ); ?>" value="<?php echo AAL_Settings::get_option( $args['id'] ); ?>" class="<?php echo implode( ' ', $args['classes'] ); ?>" />
192
  <?php
193
  }
194
 
@@ -203,7 +204,7 @@ final class AAL_Settings_Fields {
203
  return;
204
 
205
  ?>
206
- <input type="number" id="<?php echo esc_attr( $args['id'] ); ?>" name="<?php printf( '%s[%s]', esc_attr( $args['page'] ), esc_attr( $args['id'] ) ); ?>" value="<?php echo AAL_Settings::get_option( $args['id'] ); ?>" class="<?php echo implode( ' ', $args['classes'] ); ?>" min="<?php echo $args['min']; ?>" step="<?php echo $args['step']; ?>" />
207
  <?php if ( ! empty( $args['sub_desc'] ) ) echo $args['sub_desc']; ?>
208
  <?php if ( ! empty( $args['desc'] ) ) : ?>
209
  <p class="description"><?php echo $args['desc']; ?></p>
@@ -219,7 +220,7 @@ final class AAL_Settings_Fields {
219
  ?>
220
  <select id="<?php echo esc_attr( $id ); ?>" name="<?php printf( '%s[%s]', esc_attr( $page ), esc_attr( $id ) ); ?>">
221
  <?php foreach ( $options as $name => $label ) : ?>
222
- <option value="<?php echo esc_attr( $name ); ?>" <?php selected( $name, (string) AAL_Settings::get_option( $id ) ); ?>>
223
  <?php echo esc_html( $label ); ?>
224
  </option>
225
  <?php endforeach; ?>
14
  add_action( 'admin_footer', array( &$this, 'admin_footer' ) );
15
  add_filter( 'plugin_action_links_' . ACTIVITY_LOG_BASE, array( &$this, 'plugin_action_links' ) );
16
 
17
+ add_action( 'wp_ajax_aal_reset_items', array( &$this, 'ajax_aal_reset_items' ) );
18
  }
19
 
20
  public function plugin_action_links( $links ) {
86
  'general_settings_section',
87
  array(
88
  'html' => sprintf( __( '<a href="%s" id="%s">Reset Database</a>', 'aryo-aal' ), add_query_arg( array(
89
+ 'action' => 'aal_reset_items',
90
+ '_nonce' => wp_create_nonce( 'aal_reset_items' ),
91
  ), admin_url( 'admin-ajax.php' ) ), 'aal-delete-log-activities' ),
92
  'desc' => __( 'Warning: Clicking this will delete all activities from the database.', 'aryo-aal' ),
93
  )
141
  <?php
142
  }
143
 
144
+ public function ajax_aal_reset_items() {
145
+ if ( ! check_ajax_referer( 'aal_reset_items', '_nonce', false ) || ! current_user_can( 'manage_options' ) ) {
146
  wp_die( 'You do not have sufficient permissions to access this page.', 'aryo-aal' );
147
  }
148
 
149
+ AAL_Main::instance()->api->erase_all_items();
150
+
151
  wp_redirect( add_query_arg( array(
152
  'page' => 'activity-log-settings',
153
  'message' => 'data_erased',
155
  die();
156
  }
157
 
158
+ public function get_option( $key = '' ) {
159
  $settings = get_option( 'activity-log-settings' );
160
  return ! empty( $settings[ $key ] ) ? $settings[ $key ] : false;
161
  }
189
  return;
190
 
191
  ?>
192
+ <input type="text" id="<?php echo esc_attr( $args['id'] ); ?>" name="<?php printf( '%s[%s]', esc_attr( $args['page'] ), esc_attr( $args['id'] ) ); ?>" value="<?php echo AAL_Main::instance()->settings->get_option( $args['id'] ); ?>" class="<?php echo implode( ' ', $args['classes'] ); ?>" />
193
  <?php
194
  }
195
 
204
  return;
205
 
206
  ?>
207
+ <input type="number" id="<?php echo esc_attr( $args['id'] ); ?>" name="<?php printf( '%s[%s]', esc_attr( $args['page'] ), esc_attr( $args['id'] ) ); ?>" value="<?php echo AAL_Main::instance()->settings->get_option( $args['id'] ); ?>" class="<?php echo implode( ' ', $args['classes'] ); ?>" min="<?php echo $args['min']; ?>" step="<?php echo $args['step']; ?>" />
208
  <?php if ( ! empty( $args['sub_desc'] ) ) echo $args['sub_desc']; ?>
209
  <?php if ( ! empty( $args['desc'] ) ) : ?>
210
  <p class="description"><?php echo $args['desc']; ?></p>
220
  ?>
221
  <select id="<?php echo esc_attr( $id ); ?>" name="<?php printf( '%s[%s]', esc_attr( $page ), esc_attr( $id ) ); ?>">
222
  <?php foreach ( $options as $name => $label ) : ?>
223
+ <option value="<?php echo esc_attr( $name ); ?>" <?php selected( $name, (string) AAL_Main::instance()->settings->get_option( $id ) ); ?>>
224
  <?php echo esc_html( $label ); ?>
225
  </option>
226
  <?php endforeach; ?>
hooks/abstract-class-aal-hook-base.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
+
4
+ /**
5
+ * Empty class for now..
6
+ *
7
+ * Class AAL_Hook_Base
8
+ */
9
+ abstract class AAL_Hook_Base {
10
+
11
+ public function __construct() {}
12
+
13
+ }
hooks/class-aal-hook-attachment.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
+
4
+ class AAL_Hook_Attachment extends AAL_Hook_Base {
5
+
6
+ protected function _add_log_attachment( $action, $attachment_id ) {
7
+ $post = get_post( $attachment_id );
8
+
9
+ aal_insert_log( array(
10
+ 'action' => $action,
11
+ 'object_type' => 'Attachment',
12
+ 'object_subtype' => $post->post_type,
13
+ 'object_id' => $attachment_id,
14
+ 'object_name' => get_the_title( $post->ID ),
15
+ ) );
16
+ }
17
+
18
+ public function hooks_delete_attachment( $attachment_id ) {
19
+ $this->_add_log_attachment( 'deleted', $attachment_id );
20
+ }
21
+
22
+ public function hooks_edit_attachment( $attachment_id ) {
23
+ $this->_add_log_attachment( 'updated', $attachment_id );
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
+
38
+ }
hooks/class-aal-hook-menu.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
+
4
+ class AAL_Hook_Menu extends AAL_Hook_Base {
5
+
6
+ public function hooks_menu_updated( $nav_menu_selected_id ) {
7
+ if ( $menu_object = wp_get_nav_menu_object( $nav_menu_selected_id ) ) {
8
+ aal_insert_log( array(
9
+ 'action' => 'updated',
10
+ 'object_type' => 'Menu',
11
+ 'object_name' => $menu_object->name,
12
+ ) );
13
+ }
14
+ }
15
+
16
+ public function __construct() {
17
+ add_action( 'wp_update_nav_menu', array( &$this, 'hooks_menu_updated' ) );
18
+
19
+ parent::__construct();
20
+ }
21
+
22
+ }
hooks/class-aal-hook-options.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
+
4
+ class AAL_Hook_Options extends AAL_Hook_Base {
5
+
6
+ public function hooks_updated_option( $option, $oldvalue, $_newvalue ) {
7
+ $whitelist_options = apply_filters( 'aal_whitelist_options', array(
8
+ // General
9
+ 'blogname',
10
+ 'blogdescription',
11
+ 'siteurl',
12
+ 'home',
13
+ 'admin_email',
14
+ 'users_can_register',
15
+ 'default_role',
16
+ 'timezone_string',
17
+ 'date_format',
18
+ 'time_format',
19
+ 'start_of_week',
20
+
21
+ // Writing
22
+ 'use_smilies',
23
+ 'use_balanceTags',
24
+ 'default_category',
25
+ 'default_post_format',
26
+ 'mailserver_url',
27
+ 'mailserver_login',
28
+ 'mailserver_pass',
29
+ 'default_email_category',
30
+ 'ping_sites',
31
+
32
+ // Reading
33
+ 'show_on_front',
34
+ 'page_on_front',
35
+ 'page_for_posts',
36
+ 'posts_per_page',
37
+ 'posts_per_rss',
38
+ 'rss_use_excerpt',
39
+ 'blog_public',
40
+
41
+ // Discussion
42
+ 'default_pingback_flag',
43
+ 'default_ping_status',
44
+ 'default_comment_status',
45
+ 'require_name_email',
46
+ 'comment_registration',
47
+ 'close_comments_for_old_posts',
48
+ 'close_comments_days_old',
49
+ 'thread_comments',
50
+ 'thread_comments_depth',
51
+ 'page_comments',
52
+ 'comments_per_page',
53
+ 'default_comments_page',
54
+ 'comment_order',
55
+ 'comments_notify',
56
+ 'moderation_notify',
57
+ 'comment_moderation',
58
+ 'comment_whitelist',
59
+ 'comment_max_links',
60
+ 'moderation_keys',
61
+ 'blacklist_keys',
62
+ 'show_avatars',
63
+ 'avatar_rating',
64
+ 'avatar_default',
65
+
66
+ // Media
67
+ 'thumbnail_size_w',
68
+ 'thumbnail_size_h',
69
+ 'thumbnail_crop',
70
+ 'medium_size_w',
71
+ 'medium_size_h',
72
+ 'large_size_w',
73
+ 'large_size_h',
74
+ 'uploads_use_yearmonth_folders',
75
+
76
+ // Permalinks
77
+ 'permalink_structure',
78
+ 'category_base',
79
+ 'tag_base',
80
+
81
+ // Widgets
82
+ 'sidebars_widgets',
83
+ ) );
84
+
85
+ if ( ! in_array( $option, $whitelist_options ) )
86
+ return;
87
+
88
+ // TODO: need to think about save old & new values.
89
+ aal_insert_log( array(
90
+ 'action' => 'updated',
91
+ 'object_type' => 'Options',
92
+ 'object_name' => $option,
93
+ ) );
94
+ }
95
+
96
+ public function __construct() {
97
+ add_action( 'updated_option', array( &$this, 'hooks_updated_option' ), 10, 3 );
98
+
99
+ parent::__construct();
100
+ }
101
+
102
+ }
hooks/class-aal-hook-plugins.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
+
4
+ class AAL_Hook_Plugins extends AAL_Hook_Base {
5
+
6
+ protected function _add_log_plugin( $action, $plugin_name ) {
7
+ // Get plugin name if is a path
8
+ if ( false !== strpos( $plugin_name, '/' ) ) {
9
+ $plugin_dir = explode( '/', $plugin_name );
10
+ $plugin_data = array_shift( array_values( get_plugins( '/' . $plugin_dir[0] ) ) );
11
+ $plugin_name = $plugin_data['Name'];
12
+ }
13
+
14
+ aal_insert_log( array(
15
+ 'action' => $action,
16
+ 'object_type' => 'Plugin',
17
+ 'object_id' => 0,
18
+ 'object_name' => $plugin_name,
19
+ ) );
20
+ }
21
+
22
+ public function hooks_deactivated_plugin( $plugin_name ) {
23
+ $this->_add_log_plugin( 'deactivated', $plugin_name );
24
+ }
25
+
26
+ public function hooks_activated_plugin( $plugin_name ) {
27
+ $this->_add_log_plugin( 'activated', $plugin_name );
28
+ }
29
+
30
+ public function hooks_plugin_modify( $location, $status ) {
31
+ if ( false !== strpos( $location, 'plugin-editor.php' ) ) {
32
+ if ( ( ! empty( $_POST ) && 'update' === $_REQUEST['action'] ) ) {
33
+ $aal_args = array(
34
+ 'action' => 'file_updated',
35
+ 'object_type' => 'Plugin',
36
+ 'object_subtype' => 'plugin_unknown',
37
+ 'object_id' => 0,
38
+ 'object_name' => 'file_unknown',
39
+ );
40
+
41
+ if ( ! empty( $_REQUEST['file'] ) ) {
42
+ $aal_args['object_name'] = $_REQUEST['file'];
43
+ // Get plugin name
44
+ $plugin_dir = explode( '/', $_REQUEST['file'] );
45
+ $plugin_data = array_shift( array_values( get_plugins( '/' . $plugin_dir[0] ) ) );
46
+
47
+ $aal_args['object_subtype'] = $plugin_data['Name'];
48
+ }
49
+ aal_insert_log( $aal_args );
50
+ }
51
+ }
52
+
53
+ // We are need return the instance, for complete the filter.
54
+ return $location;
55
+ }
56
+
57
+ public function __construct() {
58
+ add_action( 'activated_plugin', array( &$this, 'hooks_activated_plugin' ) );
59
+ add_action( 'deactivated_plugin', array( &$this, 'hooks_deactivated_plugin' ) );
60
+ add_filter( 'wp_redirect', array( &$this, 'hooks_plugin_modify' ), 10, 2 );
61
+
62
+ parent::__construct();
63
+ }
64
+
65
+ }
hooks/class-aal-hook-posts.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
+
4
+ class AAL_Hook_Posts extends AAL_Hook_Base {
5
+
6
+ public function hooks_transition_post_status( $new_status, $old_status, $post ) {
7
+ $action = '';
8
+
9
+ if ( 'auto-draft' === $old_status && ( 'auto-draft' !== $new_status && 'inherit' !== $new_status ) ) {
10
+ // page created
11
+ $action = 'created';
12
+ }
13
+ elseif ( 'auto-draft' === $new_status || ( 'new' === $old_status && 'inherit' === $new_status ) ) {
14
+ // nvm.. ignore it.
15
+ return;
16
+ }
17
+ elseif ( 'trash' === $new_status ) {
18
+ // page was deleted.
19
+ $action = 'deleted';
20
+ }
21
+ else {
22
+ // page updated. i guess.
23
+ $action = 'updated';
24
+ }
25
+
26
+ if ( wp_is_post_revision( $post->ID ) )
27
+ return;
28
+
29
+ // Skip for menu items.
30
+ if ( 'nav_menu_item' === get_post_type( $post->ID ) )
31
+ return;
32
+
33
+ aal_insert_log( array(
34
+ 'action' => $action,
35
+ 'object_type' => 'Post',
36
+ 'object_subtype' => $post->post_type,
37
+ 'object_id' => $post->ID,
38
+ 'object_name' => _draft_or_post_title( $post->ID ),
39
+ ) );
40
+ }
41
+
42
+ public function hooks_delete_post( $post_id ) {
43
+ if ( wp_is_post_revision( $post_id ) )
44
+ return;
45
+
46
+ $post = get_post( $post_id );
47
+
48
+ if ( in_array( $post->post_status, array( 'auto-draft', 'inherit' ) ) )
49
+ return;
50
+
51
+ // Skip for menu items.
52
+ if ( 'nav_menu_item' === get_post_type( $post->ID ) )
53
+ return;
54
+
55
+ aal_insert_log( array(
56
+ 'action' => 'deleted',
57
+ 'object_type' => 'Post',
58
+ 'object_subtype' => $post->post_type,
59
+ 'object_id' => $post->ID,
60
+ 'object_name' => _draft_or_post_title( $post->ID ),
61
+ ) );
62
+ }
63
+
64
+ public function __construct() {
65
+ add_action( 'transition_post_status', array( &$this, 'hooks_transition_post_status' ), 10, 3 );
66
+ add_action( 'delete_post', array( &$this, 'hooks_delete_post' ) );
67
+
68
+ parent::__construct();
69
+ }
70
+
71
+ }
hooks/class-aal-hook-taxonomy.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
+
4
+ class AAL_Hook_Taxonomy extends AAL_Hook_Base {
5
+
6
+ public function hooks_created_edited_deleted_term( $term_id, $tt_id, $taxonomy, $deleted_term = null ) {
7
+ // Make sure do not action nav menu taxonomy.
8
+ if ( 'nav_menu' === $taxonomy )
9
+ return;
10
+
11
+ if ( 'delete_term' === current_filter() )
12
+ $term = $deleted_term;
13
+ else
14
+ $term = get_term( $term_id, $taxonomy );
15
+
16
+ if ( $term && ! is_wp_error( $term ) ) {
17
+ if ( 'edited_term' === current_filter() ) {
18
+ $action = 'updated';
19
+ } elseif ( 'delete_term' === current_filter() ) {
20
+ $action = 'deleted';
21
+ $term_id = '';
22
+ } else {
23
+ $action = 'created';
24
+ }
25
+
26
+ aal_insert_log( array(
27
+ 'action' => $action,
28
+ 'object_type' => 'Taxonomy',
29
+ 'object_subtype' => $taxonomy,
30
+ 'object_id' => $term_id,
31
+ 'object_name' => $term->name,
32
+ ) );
33
+ }
34
+ }
35
+
36
+ public function __construct() {
37
+ add_action( 'created_term', array( &$this, 'hooks_created_edited_deleted_term' ), 10, 3 );
38
+ add_action( 'edited_term', array( &$this, 'hooks_created_edited_deleted_term' ), 10, 3 );
39
+ add_action( 'delete_term', array( &$this, 'hooks_created_edited_deleted_term' ), 10, 4 );
40
+
41
+ parent::__construct();
42
+ }
43
+
44
+ }
hooks/class-aal-hook-theme.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
+
4
+ class AAL_Hook_Theme extends AAL_Hook_Base {
5
+
6
+ public function hooks_theme_modify( $location, $status ) {
7
+ if ( false !== strpos( $location, 'theme-editor.php?file=' ) ) {
8
+ if ( ! empty( $_POST ) && 'update' === $_POST['action'] ) {
9
+ $aal_args = array(
10
+ 'action' => 'file_updated',
11
+ 'object_type' => 'Theme',
12
+ 'object_subtype' => 'theme_unknown',
13
+ 'object_id' => 0,
14
+ 'object_name' => 'file_unknown',
15
+ );
16
+
17
+ if ( ! empty( $_POST['file'] ) )
18
+ $aal_args['object_name'] = $_POST['file'];
19
+
20
+ if ( ! empty( $_POST['theme'] ) )
21
+ $aal_args['object_subtype'] = $_POST['theme'];
22
+
23
+ aal_insert_log( $aal_args );
24
+ }
25
+ }
26
+
27
+ // We are need return the instance, for complete the filter.
28
+ return $location;
29
+ }
30
+
31
+ public function hooks_switch_theme( $new_name, WP_Theme $new_theme ) {
32
+ aal_insert_log( array(
33
+ 'action' => 'activated',
34
+ 'object_type' => 'Theme',
35
+ 'object_subtype' => $new_theme->get_stylesheet(),
36
+ 'object_id' => 0,
37
+ 'object_name' => $new_name,
38
+ ) );
39
+ }
40
+
41
+ public function hooks_theme_customizer_modified( WP_Customize_Manager $obj ) {
42
+ $aal_args = array(
43
+ 'action' => 'updated',
44
+ 'object_type' => 'Theme',
45
+ 'object_subtype' => $obj->theme()->display( 'Name' ),
46
+ 'object_id' => 0,
47
+ 'object_name' => 'Theme Customizer',
48
+ );
49
+
50
+ if ( 'customize_preview_init' === current_filter() )
51
+ $aal_args['action'] = 'accessed';
52
+
53
+ aal_insert_log( $aal_args );
54
+ }
55
+
56
+ public function __construct() {
57
+ add_filter( 'wp_redirect', array( &$this, 'hooks_theme_modify' ), 10, 2 );
58
+ add_action( 'switch_theme', array( &$this, 'hooks_switch_theme' ), 10, 2 );
59
+
60
+ // Theme customizer
61
+ add_action( 'customize_save', array( &$this, 'hooks_theme_customizer_modified' ) );
62
+ //add_action( 'customize_preview_init', array( &$this, 'hooks_theme_customizer_modified' ) );
63
+
64
+ parent::__construct();
65
+ }
66
+
67
+ }
hooks/class-aal-hook-user.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ 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
+ }
36
+
37
+ public function hooks_wp_logout() {
38
+ $user = wp_get_current_user();
39
+
40
+ aal_insert_log( array(
41
+ 'action' => 'logged_out',
42
+ 'object_type' => 'User',
43
+ 'user_id' => $user->ID,
44
+ 'object_id' => $user->ID,
45
+ 'object_name' => $user->user_nicename,
46
+ ) );
47
+ }
48
+
49
+ public function hooks_profile_update( $user_id ) {
50
+ $user = get_user_by( 'id', $user_id );
51
+
52
+ aal_insert_log( array(
53
+ 'action' => 'updated',
54
+ 'object_type' => 'User',
55
+ 'object_id' => $user->ID,
56
+ 'object_name' => $user->user_nicename,
57
+ ) );
58
+ }
59
+
60
+ public function hooks_wrong_password( $username ) {
61
+ aal_insert_log( array(
62
+ 'action' => 'wrong_password',
63
+ 'object_type' => 'User',
64
+ 'user_id' => 0,
65
+ 'object_id' => 0,
66
+ 'object_name' => $username,
67
+ ) );
68
+ }
69
+
70
+ public function __construct() {
71
+ add_action( 'wp_login', array( &$this, 'hooks_wp_login' ), 10, 2 );
72
+ add_action( 'wp_logout', array( &$this, 'hooks_wp_logout' ) );
73
+ add_action( 'delete_user', array( &$this, 'hooks_delete_user' ) );
74
+ add_action( 'user_register', array( &$this, 'hooks_user_register' ) );
75
+ add_action( 'profile_update', array( &$this, 'hooks_profile_update' ) );
76
+ add_filter( 'wp_login_failed', array( &$this, 'hooks_wrong_password' ) );
77
+
78
+ parent::__construct();
79
+ }
80
+
81
+ }
hooks/class-aal-hook-widgets.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
+
4
+ class AAL_Hook_Widgets extends AAL_Hook_Base {
5
+
6
+ public function hooks_widget_update_callback( $instance, $new_instance, $old_instance, WP_Widget $widget ) {
7
+ $aal_args = array(
8
+ 'action' => 'updated',
9
+ 'object_type' => 'Widget',
10
+ 'object_subtype' => 'sidebar_unknown',
11
+ 'object_id' => 0,
12
+ 'object_name' => $widget->id_base,
13
+ );
14
+
15
+ if ( ! empty( $_REQUEST['sidebar'] ) )
16
+ $aal_args['object_subtype'] = strtolower( $_REQUEST['sidebar'] );
17
+
18
+ /** @todo: find any way to widget deleted detected */
19
+ /*if ( isset( $_REQUEST['delete_widget'] ) && '1' === $_REQUEST['delete_widget'] ) {
20
+ $aal_args['action'] = 'deleted';
21
+ }*/
22
+
23
+ aal_insert_log( $aal_args );
24
+
25
+ // We are need return the instance, for complete the filter.
26
+ return $instance;
27
+ }
28
+
29
+ public function hooks_widget_delete() {
30
+ // A reference: http://grinninggecko.com/hooking-into-widget-delete-action-in-wordpress/
31
+ if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && ! empty( $_REQUEST['widget-id'] ) ) {
32
+ if ( isset( $_REQUEST['delete_widget'] ) && 1 === (int) $_REQUEST['delete_widget'] ) {
33
+ aal_insert_log( array(
34
+ 'action' => 'deleted',
35
+ 'object_type' => 'Widget',
36
+ 'object_subtype' => strtolower( $_REQUEST['sidebar'] ),
37
+ 'object_id' => 0,
38
+ 'object_name' => $_REQUEST['id_base'],
39
+ ) );
40
+ }
41
+ }
42
+ }
43
+
44
+ public function __construct() {
45
+ add_filter( 'widget_update_callback', array( &$this, 'hooks_widget_update_callback' ), 9999, 4 );
46
+ add_filter( 'sidebar_admin_setup', array( &$this, 'hooks_widget_delete' ) ); // Widget delete.
47
+
48
+ parent::__construct();
49
+ }
50
+
51
+ }
language/aryo-aal-hy_AM.mo ADDED
Binary file
language/aryo-aal-hy_AM.po ADDED
@@ -0,0 +1,493 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2013
2
+ # This file is distributed under the same license as the package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: ARYO Activity Log\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/activity-log\n"
7
+ "POT-Creation-Date: 2014-02-17 19:21-0000\n"
8
+ "PO-Revision-Date: 2014-02-28 08:29-0000\n"
9
+ "Last-Translator: Yakir Sitbon <kingyes1@gmail.com>\n"
10
+ "Language-Team: LANGUAGE <LL@li.org>\n"
11
+ "MIME-Version: 1.0\n"
12
+ "Content-Type: text/plain; charset=UTF-8\n"
13
+ "Content-Transfer-Encoding: 8bit\n"
14
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
15
+ "X-Generator: Poedit 1.6.4\n"
16
+ "X-Poedit-SourceCharset: UTF-8\n"
17
+ "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e;_x;_n:1,2;_c,_nc:4c,1,2\n"
18
+ "X-Poedit-Basepath: .\n"
19
+ "Language: hy_AM\n"
20
+ "X-Poedit-SearchPath-0: ..\n"
21
+
22
+ #: ../classes/class-aal-activity-log-list-table.php:82
23
+ msgid "Activities"
24
+ msgstr "Ակտիվություն"
25
+
26
+ #: ../classes/class-aal-activity-log-list-table.php:92
27
+ msgid "Date"
28
+ msgstr "Ամսաթիվ"
29
+
30
+ #: ../classes/class-aal-activity-log-list-table.php:93
31
+ msgid "Author"
32
+ msgstr "Հեղինակ"
33
+
34
+ #: ../classes/class-aal-activity-log-list-table.php:94
35
+ msgid "IP"
36
+ msgstr "IP"
37
+
38
+ #: ../classes/class-aal-activity-log-list-table.php:95
39
+ msgid "Type"
40
+ msgstr "Տիպ"
41
+
42
+ #: ../classes/class-aal-activity-log-list-table.php:96
43
+ msgid "Label"
44
+ msgstr "պիտակ"
45
+
46
+ #: ../classes/class-aal-activity-log-list-table.php:97
47
+ msgid "Action"
48
+ msgstr "Գործողություն"
49
+
50
+ #: ../classes/class-aal-activity-log-list-table.php:98
51
+ msgid "Description"
52
+ msgstr "Նկարագիր"
53
+
54
+ #: ../classes/class-aal-activity-log-list-table.php:118
55
+ #, php-format
56
+ msgid "%s ago"
57
+ msgstr "%s տարիք"
58
+
59
+ #: ../classes/class-aal-activity-log-list-table.php:145
60
+ msgid "Unknown"
61
+ msgstr "անհայտ"
62
+
63
+ #: ../classes/class-aal-activity-log-list-table.php:151
64
+ #: ../classes/class-aal-activity-log-list-table.php:229
65
+ msgid "Guest"
66
+ msgstr "Հյուր"
67
+
68
+ #: ../classes/class-aal-activity-log-list-table.php:240
69
+ msgid "All Users"
70
+ msgstr "Բոլոր օգտվողները"
71
+
72
+ #: ../classes/class-aal-activity-log-list-table.php:267
73
+ msgid "All Types"
74
+ msgstr "Բոլոր տիպերը"
75
+
76
+ #: ../classes/class-aal-activity-log-list-table.php:278
77
+ msgid "All Time"
78
+ msgstr "Ամբողջ ժամանակ"
79
+
80
+ #: ../classes/class-aal-activity-log-list-table.php:279
81
+ msgid "Today"
82
+ msgstr "Այսօր"
83
+
84
+ #: ../classes/class-aal-activity-log-list-table.php:280
85
+ msgid "Yesterday"
86
+ msgstr "Երեկ"
87
+
88
+ #: ../classes/class-aal-activity-log-list-table.php:281
89
+ msgid "Week"
90
+ msgstr "Շաբաթ"
91
+
92
+ #: ../classes/class-aal-activity-log-list-table.php:282
93
+ msgid "Month"
94
+ msgstr "Ամիս"
95
+
96
+ #: ../classes/class-aal-activity-log-list-table.php:289
97
+ msgid "Filter"
98
+ msgstr "Ֆիլտր"
99
+
100
+ #: ../classes/class-aal-admin-ui.php:17 ../classes/class-aal-admin-ui.php:27
101
+ msgid "Activity Log"
102
+ msgstr "Ակտիվության գրանցամատյան"
103
+
104
+ #: ../classes/class-aal-settings.php:21
105
+ msgid "GitHub"
106
+ msgstr "GitHub"
107
+
108
+ #: ../classes/class-aal-settings.php:24 ../classes/class-aal-settings.php:39
109
+ msgid "Settings"
110
+ msgstr "պարամետրեր"
111
+
112
+ #: ../classes/class-aal-settings.php:38 ../classes/class-aal-settings.php:106
113
+ msgid "Activity Log Settings"
114
+ msgstr "Activity Log Settings"
115
+
116
+ #: ../classes/class-aal-settings.php:59
117
+ msgid "Display Options"
118
+ msgstr "Դիտման կարգավորումներ"
119
+
120
+ #: ../classes/class-aal-settings.php:66
121
+ msgid "Keep logs for"
122
+ msgstr "Պահմանել գրանցամատյանը "
123
+
124
+ #: ../classes/class-aal-settings.php:75
125
+ msgid "days."
126
+ msgstr "օր:"
127
+
128
+ #: ../classes/class-aal-settings.php:76
129
+ msgid ""
130
+ "Maximum number of days to keep activity log. Leave blank to keep activity "
131
+ "log forever (not recommended)."
132
+ msgstr ""
133
+ "Մաքսիմում օրերի քանակը որպեսզի պահպանվի գրանցամոտյանը: Բաց թողեք եթե ուզում "
134
+ "եք պահպանվի ընդմիշտ:"
135
+
136
+ #: ../classes/class-aal-settings.php:83
137
+ msgid "Delete Log Activities"
138
+ msgstr "Ջնջել գրանցամատյանի ակտիվությունը"
139
+
140
+ #: ../classes/class-aal-settings.php:88
141
+ #, php-format
142
+ msgid "<a href=\"%s\" id=\"%s\">Reset Database</a>"
143
+ msgstr "<a href=\"%s\" id=\"%s\"> Սկզբնական վիճակին բերել տվյալների բազան</a>"
144
+
145
+ #: ../classes/class-aal-settings.php:92
146
+ msgid "Warning: Clicking this will delete all activities from the database."
147
+ msgstr "Warning: Clicking this will delete all activities from the database."
148
+
149
+ #: ../classes/class-aal-settings.php:124
150
+ msgid "All activities have been successfully deleted."
151
+ msgstr "Գրանցամատյանը հաջողությամբ ջնջվեց:"
152
+
153
+ #: ../classes/class-aal-settings.php:135
154
+ msgid "Are you sure you want to do this action?"
155
+ msgstr "Համոզված եք, որ ոզւոմ եք շարունակել գործողությունը"
156
+
157
+ #: ../classes/class-aal-settings.php:169
158
+ msgid "These are some basic settings for Activity Log."
159
+ msgstr "These are some basic settings for Activity Log."
160
+
161
+ #: ../language/strings.php:2
162
+ msgid "ARYO Activity Log"
163
+ msgstr "ARYO Ակտիվության գրանցամատյան"
164
+
165
+ #: ../language/strings.php:3
166
+ msgid ""
167
+ "Get aware of any activities that are taking place on your dashboard! Imagine "
168
+ "it like a black-box for your WordPress site. e.g. post was deleted, plugin "
169
+ "was activated, user logged in or logged out - it’s all these for you to see."
170
+ msgstr ""
171
+ "Get aware of any activities that are taking place on your dashboard! Imagine "
172
+ "it like a black-box for your WordPress site. e.g. post was deleted, plugin "
173
+ "was activated, user logged in or logged out - it’s all these for you to see."
174
+
175
+ #: ../language/strings.php:6
176
+ msgid "Post"
177
+ msgstr "Post"
178
+
179
+ #: ../language/strings.php:7
180
+ msgid "created"
181
+ msgstr "created"
182
+
183
+ #: ../language/strings.php:8
184
+ msgid "updated"
185
+ msgstr "updated"
186
+
187
+ #: ../language/strings.php:9
188
+ msgid "deleted"
189
+ msgstr "deleted"
190
+
191
+ #: ../language/strings.php:12
192
+ msgid "Attachment"
193
+ msgstr "Attachment"
194
+
195
+ #: ../language/strings.php:13
196
+ msgid "added"
197
+ msgstr "added"
198
+
199
+ #: ../language/strings.php:16
200
+ msgid "User"
201
+ msgstr "User"
202
+
203
+ #: ../language/strings.php:17
204
+ msgid "logged_out"
205
+ msgstr "logged_out"
206
+
207
+ #: ../language/strings.php:18
208
+ msgid "logged_in"
209
+ msgstr "logged_in"
210
+
211
+ #: ../language/strings.php:19
212
+ msgid "wrong_password"
213
+ msgstr "wrong_password"
214
+
215
+ #: ../language/strings.php:22
216
+ msgid "Plugin"
217
+ msgstr "Plugin"
218
+
219
+ #: ../language/strings.php:23
220
+ msgid "activated"
221
+ msgstr "activated"
222
+
223
+ #: ../language/strings.php:24
224
+ msgid "deactivated"
225
+ msgstr "deactivated"
226
+
227
+ #: ../language/strings.php:27
228
+ msgid "Theme"
229
+ msgstr "Theme"
230
+
231
+ #: ../language/strings.php:28
232
+ msgid "Theme Customizer"
233
+ msgstr "Theme Customizer"
234
+
235
+ #: ../language/strings.php:31
236
+ msgid "Widget"
237
+ msgstr "Widget"
238
+
239
+ #: ../language/strings.php:34
240
+ msgid "Options"
241
+ msgstr "Options"
242
+
243
+ #: ../language/strings.php:37
244
+ msgid "Menu"
245
+ msgstr "Menu"
246
+
247
+ #: ../language/strings.php:40
248
+ msgid "Taxonomy"
249
+ msgstr "Taxonomy"
250
+
251
+ #: ../language/strings.php:45
252
+ msgid "blogname"
253
+ msgstr "blogname"
254
+
255
+ #: ../language/strings.php:46
256
+ msgid "blogdescription"
257
+ msgstr "blogdescription"
258
+
259
+ #: ../language/strings.php:47
260
+ msgid "siteurl"
261
+ msgstr "siteurl"
262
+
263
+ #: ../language/strings.php:48
264
+ msgid "home"
265
+ msgstr "home"
266
+
267
+ #: ../language/strings.php:49
268
+ msgid "admin_email"
269
+ msgstr "admin_email"
270
+
271
+ #: ../language/strings.php:50
272
+ msgid "users_can_register"
273
+ msgstr "users_can_register"
274
+
275
+ #: ../language/strings.php:51
276
+ msgid "default_role"
277
+ msgstr "default_role"
278
+
279
+ #: ../language/strings.php:52
280
+ msgid "timezone_string"
281
+ msgstr "timezone_string"
282
+
283
+ #: ../language/strings.php:53
284
+ msgid "date_format"
285
+ msgstr "date_format"
286
+
287
+ #: ../language/strings.php:54
288
+ msgid "time_format"
289
+ msgstr "time_format"
290
+
291
+ #: ../language/strings.php:55
292
+ msgid "start_of_week"
293
+ msgstr "start_of_week"
294
+
295
+ #: ../language/strings.php:58
296
+ msgid "use_smilies"
297
+ msgstr "use_smilies"
298
+
299
+ #: ../language/strings.php:59
300
+ msgid "use_balanceTags"
301
+ msgstr "use_balanceTags"
302
+
303
+ #: ../language/strings.php:60
304
+ msgid "default_category"
305
+ msgstr "default_category"
306
+
307
+ #: ../language/strings.php:61
308
+ msgid "default_post_format"
309
+ msgstr "default_post_format"
310
+
311
+ #: ../language/strings.php:62
312
+ msgid "mailserver_url"
313
+ msgstr "mailserver_url"
314
+
315
+ #: ../language/strings.php:63
316
+ msgid "mailserver_login"
317
+ msgstr "mailserver_login"
318
+
319
+ #: ../language/strings.php:64
320
+ msgid "mailserver_pass"
321
+ msgstr "mailserver_pass"
322
+
323
+ #: ../language/strings.php:65
324
+ msgid "default_email_category"
325
+ msgstr "default_email_category"
326
+
327
+ #: ../language/strings.php:66
328
+ msgid "ping_sites"
329
+ msgstr "ping_sites"
330
+
331
+ #: ../language/strings.php:69
332
+ msgid "show_on_front"
333
+ msgstr "show_on_front"
334
+
335
+ #: ../language/strings.php:70
336
+ msgid "page_on_front"
337
+ msgstr "page_on_front"
338
+
339
+ #: ../language/strings.php:71
340
+ msgid "page_for_posts"
341
+ msgstr "page_for_posts"
342
+
343
+ #: ../language/strings.php:72
344
+ msgid "posts_per_page"
345
+ msgstr "posts_per_page"
346
+
347
+ #: ../language/strings.php:73
348
+ msgid "posts_per_rss"
349
+ msgstr "posts_per_rss"
350
+
351
+ #: ../language/strings.php:74
352
+ msgid "rss_use_excerpt"
353
+ msgstr "rss_use_excerpt"
354
+
355
+ #: ../language/strings.php:75
356
+ msgid "blog_public"
357
+ msgstr "blog_public"
358
+
359
+ #: ../language/strings.php:78
360
+ msgid "default_pingback_flag"
361
+ msgstr "default_pingback_flag"
362
+
363
+ #: ../language/strings.php:79
364
+ msgid "default_ping_status"
365
+ msgstr "default_ping_status"
366
+
367
+ #: ../language/strings.php:80
368
+ msgid "default_comment_status"
369
+ msgstr "default_comment_status"
370
+
371
+ #: ../language/strings.php:81
372
+ msgid "require_name_email"
373
+ msgstr "require_name_email"
374
+
375
+ #: ../language/strings.php:82
376
+ msgid "comment_registration"
377
+ msgstr "comment_registration"
378
+
379
+ #: ../language/strings.php:83
380
+ msgid "close_comments_for_old_posts"
381
+ msgstr "close_comments_for_old_posts"
382
+
383
+ #: ../language/strings.php:84
384
+ msgid "close_comments_days_old"
385
+ msgstr "close_comments_days_old"
386
+
387
+ #: ../language/strings.php:85
388
+ msgid "thread_comments"
389
+ msgstr "thread_comments"
390
+
391
+ #: ../language/strings.php:86
392
+ msgid "thread_comments_depth"
393
+ msgstr "thread_comments_depth"
394
+
395
+ #: ../language/strings.php:87
396
+ msgid "page_comments"
397
+ msgstr "page_comments"
398
+
399
+ #: ../language/strings.php:88
400
+ msgid "comments_per_page"
401
+ msgstr "comments_per_page"
402
+
403
+ #: ../language/strings.php:89
404
+ msgid "default_comments_page"
405
+ msgstr "default_comments_page"
406
+
407
+ #: ../language/strings.php:90
408
+ msgid "comment_order"
409
+ msgstr "comment_order"
410
+
411
+ #: ../language/strings.php:91
412
+ msgid "comments_notify"
413
+ msgstr "comments_notify"
414
+
415
+ #: ../language/strings.php:92
416
+ msgid "moderation_notify"
417
+ msgstr "moderation_notify"
418
+
419
+ #: ../language/strings.php:93
420
+ msgid "comment_moderation"
421
+ msgstr "comment_moderation"
422
+
423
+ #: ../language/strings.php:94
424
+ msgid "comment_whitelist"
425
+ msgstr "comment_whitelist"
426
+
427
+ #: ../language/strings.php:95
428
+ msgid "comment_max_links"
429
+ msgstr "comment_max_links"
430
+
431
+ #: ../language/strings.php:96
432
+ msgid "moderation_keys"
433
+ msgstr "moderation_keys"
434
+
435
+ #: ../language/strings.php:97
436
+ msgid "blacklist_keys"
437
+ msgstr "blacklist_keys"
438
+
439
+ #: ../language/strings.php:98
440
+ msgid "show_avatars"
441
+ msgstr "show_avatars"
442
+
443
+ #: ../language/strings.php:99
444
+ msgid "avatar_rating"
445
+ msgstr "avatar_rating"
446
+
447
+ #: ../language/strings.php:100
448
+ msgid "avatar_default"
449
+ msgstr "avatar_default"
450
+
451
+ #: ../language/strings.php:103
452
+ msgid "thumbnail_size_w"
453
+ msgstr "thumbnail_size_w"
454
+
455
+ #: ../language/strings.php:104
456
+ msgid "thumbnail_size_h"
457
+ msgstr "thumbnail_size_h"
458
+
459
+ #: ../language/strings.php:105
460
+ msgid "thumbnail_crop"
461
+ msgstr "thumbnail_crop"
462
+
463
+ #: ../language/strings.php:106
464
+ msgid "medium_size_w"
465
+ msgstr "medium_size_w"
466
+
467
+ #: ../language/strings.php:107
468
+ msgid "medium_size_h"
469
+ msgstr "medium_size_h"
470
+
471
+ #: ../language/strings.php:108
472
+ msgid "large_size_w"
473
+ msgstr "large_size_w"
474
+
475
+ #: ../language/strings.php:109
476
+ msgid "large_size_h"
477
+ msgstr "large_size_h"
478
+
479
+ #: ../language/strings.php:110
480
+ msgid "uploads_use_yearmonth_folders"
481
+ msgstr "uploads_use_yearmonth_folders"
482
+
483
+ #: ../language/strings.php:113
484
+ msgid "permalink_structure"
485
+ msgstr "permalink_structure"
486
+
487
+ #: ../language/strings.php:114
488
+ msgid "category_base"
489
+ msgstr "category_base"
490
+
491
+ #: ../language/strings.php:115
492
+ msgid "tag_base"
493
+ msgstr "tag_base"
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: KingYes, ariel.k, maor
3
  Tags: access, administration, activity, community, event, monitor, multisite, multi-users, log, logger, login, network, stats, security, tracking, madeinisrael, woocommerce
4
  Requires at least: 3.5
5
  Tested up to: 3.8.1
6
- Stable tag: 2.0.4
7
  License: GPLv2 or later
8
 
9
  Get aware of any activities that are taking place on your dashboard! Imagine it like a black-box for your WordPress site.
@@ -45,6 +45,7 @@ If you have tens of users or more, you really can’t know who did it. This plug
45
  * Serbo-Croatian (sr_RS) - [Borisa Djuraskovic](http://www.webhostinghub.com/)
46
  * Danish (da_DK) - [Morten Dalgaard Johansen](http://www.iosoftgame.com/)
47
  * Hebrew (he_IL) + RTL Support - [ARYO Digital](http://www.aryodigital.com/)
 
48
 
49
  The plugin does not require any kind of setup. It works out of the box (and that’s why we love it too).
50
 
@@ -79,12 +80,19 @@ Would you like to like to cotribute to Activity Log? You are more than welcome t
79
 
80
  == Changelog ==
81
 
 
 
 
 
 
 
 
82
  = 2.0.4 =
83
- * Tweak! don't allowed to access in direct files.
84
  * New! Added translate: Danish (da_DK) - Thanks to [Morten Dalgaard Johansen](http://www.iosoftgame.com/)
85
 
86
  = 2.0.3 =
87
- * New! record when widgets change orders.
88
 
89
  = 2.0.2 =
90
  * New! Save more Options:
3
  Tags: access, administration, activity, community, event, monitor, multisite, multi-users, log, logger, login, network, stats, security, tracking, madeinisrael, woocommerce
4
  Requires at least: 3.5
5
  Tested up to: 3.8.1
6
+ Stable tag: 2.0.5
7
  License: GPLv2 or later
8
 
9
  Get aware of any activities that are taking place on your dashboard! Imagine it like a black-box for your WordPress site.
45
  * Serbo-Croatian (sr_RS) - [Borisa Djuraskovic](http://www.webhostinghub.com/)
46
  * Danish (da_DK) - [Morten Dalgaard Johansen](http://www.iosoftgame.com/)
47
  * Hebrew (he_IL) + RTL Support - [ARYO Digital](http://www.aryodigital.com/)
48
+ * Armenia (hy_AM) - Hayk Jomardyan
49
 
50
  The plugin does not require any kind of setup. It works out of the box (and that’s why we love it too).
51
 
80
 
81
  == Changelog ==
82
 
83
+ = 2.0.5 =
84
+ * New! Register `aal_init_caps` filter.
85
+ * Tweak! Change all methods to non-static.
86
+ * Tweak! Some improved coding standards and PHPDoc.
87
+ * Tweak! Split `AAL_Hooks` class to multiple classes.
88
+ * New! Added translate: Armenia (hy_AM) - Thanks to Hayk Jomardyan.
89
+
90
  = 2.0.4 =
91
+ * Tweak! Don't allowed to access in direct files.
92
  * New! Added translate: Danish (da_DK) - Thanks to [Morten Dalgaard Johansen](http://www.iosoftgame.com/)
93
 
94
  = 2.0.3 =
95
+ * New! Record when widgets change orders.
96
 
97
  = 2.0.2 =
98
  * New! Save more Options: