Activity Log - Version 2.1.8

Version Description

  • New! Now tracking when plugins installed and updated (#59 and #43)
Download this release

Release Info

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

Code changes from version 2.1.7 to 2.1.8

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.1.7
9
  Text Domain: aryo-aal
10
  Domain Path: /language/
11
  License: GPLv2 or later
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.1.8
9
  Text Domain: aryo-aal
10
  Domain Path: /language/
11
  License: GPLv2 or later
hooks/class-aal-hook-plugins.php CHANGED
@@ -6,18 +6,20 @@ class AAL_Hook_Plugins extends AAL_Hook_Base {
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_values( get_plugins( '/' . $plugin_dir[0] ) );
11
  $plugin_data = array_shift( $plugin_data );
12
  $plugin_name = $plugin_data['Name'];
13
  }
14
 
15
- aal_insert_log( array(
16
- 'action' => $action,
17
- 'object_type' => 'Plugin',
18
- 'object_id' => 0,
19
- 'object_name' => $plugin_name,
20
- ) );
 
 
21
  }
22
 
23
  public function hooks_deactivated_plugin( $plugin_name ) {
@@ -55,11 +57,59 @@ class AAL_Hook_Plugins extends AAL_Hook_Base {
55
  return $location;
56
  }
57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  public function __construct() {
59
  add_action( 'activated_plugin', array( &$this, 'hooks_activated_plugin' ) );
60
  add_action( 'deactivated_plugin', array( &$this, 'hooks_deactivated_plugin' ) );
61
  add_filter( 'wp_redirect', array( &$this, 'hooks_plugin_modify' ), 10, 2 );
62
 
 
 
63
  parent::__construct();
64
  }
65
 
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_values( get_plugins( '/' . $plugin_dir[0] ) );
11
  $plugin_data = array_shift( $plugin_data );
12
  $plugin_name = $plugin_data['Name'];
13
  }
14
 
15
+ aal_insert_log(
16
+ array(
17
+ 'action' => $action,
18
+ 'object_type' => 'Plugin',
19
+ 'object_id' => 0,
20
+ 'object_name' => $plugin_name,
21
+ )
22
+ );
23
  }
24
 
25
  public function hooks_deactivated_plugin( $plugin_name ) {
57
  return $location;
58
  }
59
 
60
+ /**
61
+ * @param Plugin_Upgrader $upgrader
62
+ * @param array $extra
63
+ */
64
+ public function hooks_plugin_install_or_update( $upgrader, $extra ) {
65
+ if ( ! isset( $extra['type'] ) || 'plugin' !== $extra['type'] )
66
+ return;
67
+
68
+ if ( 'install' === $extra['action'] ) {
69
+ $path = $upgrader->plugin_info();
70
+ if ( ! $path )
71
+ return;
72
+
73
+ $data = get_plugin_data( $upgrader->skin->result['local_destination'] . '/' . $path, true, false );
74
+
75
+ aal_insert_log(
76
+ array(
77
+ 'action' => 'installed',
78
+ 'object_type' => 'Plugin',
79
+ 'object_name' => $data['Name'],
80
+ 'object_subtype' => $data['Version'],
81
+ )
82
+ );
83
+ }
84
+
85
+ if ( 'update' === $extra['action'] ) {
86
+ if ( isset( $extra['bulk'] ) && true == $extra['bulk'] )
87
+ $slugs = $extra['plugins'];
88
+ else
89
+ $slugs = array( $upgrader->skin->plugin );
90
+
91
+ foreach ( $slugs as $slug ) {
92
+ $data = get_plugin_data( WP_PLUGIN_DIR . '/' . $slug, true, false );
93
+
94
+ aal_insert_log(
95
+ array(
96
+ 'action' => 'updated',
97
+ 'object_type' => 'Plugin',
98
+ 'object_name' => $data['Name'],
99
+ 'object_subtype' => $data['Version'],
100
+ )
101
+ );
102
+ }
103
+ }
104
+ }
105
+
106
  public function __construct() {
107
  add_action( 'activated_plugin', array( &$this, 'hooks_activated_plugin' ) );
108
  add_action( 'deactivated_plugin', array( &$this, 'hooks_deactivated_plugin' ) );
109
  add_filter( 'wp_redirect', array( &$this, 'hooks_plugin_modify' ), 10, 2 );
110
 
111
+ add_action( 'upgrader_process_complete', array( &$this, 'hooks_plugin_install_or_update' ), 10, 2 );
112
+
113
  parent::__construct();
114
  }
115
 
language/aryo-aal.pot CHANGED
@@ -6,9 +6,9 @@
6
  #, fuzzy
7
  msgid ""
8
  msgstr ""
9
- "Project-Id-Version: aryo-activity-log 2.1.7\n"
10
  "Report-Msgid-Bugs-To: \n"
11
- "POT-Creation-Date: 2014-08-20 10:14+0300\n"
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
6
  #, fuzzy
7
  msgid ""
8
  msgstr ""
9
+ "Project-Id-Version: aryo-activity-log 2.1.8\n"
10
  "Report-Msgid-Bugs-To: \n"
11
+ "POT-Creation-Date: 2014-08-27 08:22+0300\n"
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: pojo.me, KingYes, ariel.k, maor
3
  Tags: administration, activity, event, monitor, multisite, multi-users, log, logger, audit log, stats, security, tracking, woocommerce, notifications, email notifications
4
  Requires at least: 3.5
5
  Tested up to: 3.9.2
6
- Stable tag: 2.1.7
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.
@@ -27,8 +27,8 @@ If you have tens of users or more, you really can’t know who did it. This plug
27
  * <strong>Comments</strong> - Created, Approved, Unproved, Trashed, Untrashed, Spammed, Unspammed, Deleted
28
  * <strong>Media</strong> - Uploaded, Edited, Deleted
29
  * <strong>Users</strong> - Login, Logout, Login has failed, Update profile, Registered and Deleted
30
- * <strong>Plugins</strong> - Activated, Deactivated, Changed
31
- * <strong>Themes</strong> - Installed, Updated, Deleted, Activeted, Changed (Editor and Customizer)
32
  * <strong>Widgets</strong> - Added to a sidebar / Deleted from a sidebar, Order widgets
33
  * <strong>Menus</strong> - A menu is being updated
34
  * <strong>Setting</strong> - General, Writing, Reading, Discussion, Media, Permalinks
@@ -89,8 +89,11 @@ Would you like to like to contribute to Activity Log? You are more than welcome
89
 
90
  == Changelog ==
91
 
 
 
 
92
  = 2.1.7 =
93
- * New! Now tracking when user download export file from the site.
94
 
95
  = 2.1.6 =
96
  * Tested up to WordPress v3.9.2.
3
  Tags: administration, activity, event, monitor, multisite, multi-users, log, logger, audit log, stats, security, tracking, woocommerce, notifications, email notifications
4
  Requires at least: 3.5
5
  Tested up to: 3.9.2
6
+ Stable tag: 2.1.8
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.
27
  * <strong>Comments</strong> - Created, Approved, Unproved, Trashed, Untrashed, Spammed, Unspammed, Deleted
28
  * <strong>Media</strong> - Uploaded, Edited, Deleted
29
  * <strong>Users</strong> - Login, Logout, Login has failed, Update profile, Registered and Deleted
30
+ * <strong>Plugins</strong> - Installed, Updated, Activated, Deactivated, Changed
31
+ * <strong>Themes</strong> - Installed, Updated, Deleted, Activated, Changed (Editor and Customizer)
32
  * <strong>Widgets</strong> - Added to a sidebar / Deleted from a sidebar, Order widgets
33
  * <strong>Menus</strong> - A menu is being updated
34
  * <strong>Setting</strong> - General, Writing, Reading, Discussion, Media, Permalinks
89
 
90
  == Changelog ==
91
 
92
+ = 2.1.8 =
93
+ * New! Now tracking when plugins installed and updated ([#59](https://github.com/KingYes/wordpress-aryo-activity-log/pull/59) and [#43](https://github.com/KingYes/wordpress-aryo-activity-log/issues/43))
94
+
95
  = 2.1.7 =
96
+ * New! Now tracking when user download export file from the site ([#58](https://github.com/KingYes/wordpress-aryo-activity-log/issues/58) and [#63](https://github.com/KingYes/wordpress-aryo-activity-log/pull/63))
97
 
98
  = 2.1.6 =
99
  * Tested up to WordPress v3.9.2.