Activity Log - Version 2.5.0

Version Description

  • New! Added log to Export Personal Data tool for better GDPR Compliance (Topic)
Download this release

Release Info

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

Code changes from version 2.4.1 to 2.5.0

Files changed (3) hide show
  1. aryo-activity-log.php +12 -4
  2. classes/class-aal-privacy.php +117 -0
  3. readme.txt +12 -2
aryo-activity-log.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
  /*
3
  Plugin Name: Activity Log
4
- 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://pojo.me/
8
- Version: 2.4.1
9
  Text Domain: aryo-activity-log
10
  License: GPLv2 or later
11
 
@@ -39,6 +39,7 @@ include( 'classes/class-aal-hooks.php' );
39
  include( 'classes/class-aal-notifications.php' );
40
  include( 'classes/class-aal-help.php' );
41
  include( 'classes/class-aal-export.php' );
 
42
  include( 'classes/abstract-class-aal-exporter.php' );
43
 
44
  // Integrations
@@ -77,6 +78,12 @@ final class AAL_Main {
77
  */
78
  public $api;
79
 
 
 
 
 
 
 
80
  /**
81
  * Load text domain
82
  */
@@ -97,6 +104,7 @@ final class AAL_Main {
97
  $this->notifications = new AAL_Notifications();
98
  $this->help = new AAL_Help();
99
  $this->export = new AAL_Export();
 
100
 
101
  // set up our DB name
102
  $wpdb->activity_log = $wpdb->prefix . 'aryo_activity_log';
1
  <?php
2
  /*
3
  Plugin Name: Activity Log
4
+ Plugin URI: https://activitylog.io/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
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.5.0
9
  Text Domain: aryo-activity-log
10
  License: GPLv2 or later
11
 
39
  include( 'classes/class-aal-notifications.php' );
40
  include( 'classes/class-aal-help.php' );
41
  include( 'classes/class-aal-export.php' );
42
+ include( 'classes/class-aal-privacy.php' );
43
  include( 'classes/abstract-class-aal-exporter.php' );
44
 
45
  // Integrations
78
  */
79
  public $api;
80
 
81
+ /**
82
+ * @var AAL_Privacy
83
+ * @since 2.1.0
84
+ */
85
+ private $privacy;
86
+
87
  /**
88
  * Load text domain
89
  */
104
  $this->notifications = new AAL_Notifications();
105
  $this->help = new AAL_Help();
106
  $this->export = new AAL_Export();
107
+ $this->privacy = new AAL_Privacy();
108
 
109
  // set up our DB name
110
  $wpdb->activity_log = $wpdb->prefix . 'aryo_activity_log';
classes/class-aal-privacy.php ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit; // Exit if accessed directly
4
+ }
5
+
6
+ /**
7
+ * Class AAL_Privacy
8
+ * @since 2.1.0
9
+ */
10
+ class AAL_Privacy {
11
+
12
+ public function __construct() {
13
+ add_filter( 'wp_privacy_personal_data_exporters', [ $this, 'register_exporter' ] );
14
+ add_action( 'admin_init', [ $this, 'add_privacy_policy_content' ] );
15
+ }
16
+
17
+ public function register_exporter( $exporters ) {
18
+ $exporters['activity-log'] = array(
19
+ 'exporter_friendly_name' => __( 'Activity Log Plugin', 'aryo-activity-log' ),
20
+ 'callback' => [ $this, 'wp_exporter' ],
21
+ );
22
+ return $exporters;
23
+ }
24
+
25
+ public function wp_exporter( $email_address, $page = 1 ) {
26
+ $number = 500; // Limit us to avoid timing out
27
+ $page = (int) $page;
28
+
29
+ $export_items = array();
30
+
31
+ $user = get_user_by( 'email', $email_address );
32
+
33
+ if ( ! $user ) {
34
+ return [
35
+ 'data' => [],
36
+ 'done' => true,
37
+ ];
38
+ }
39
+
40
+ global $wpdb;
41
+
42
+ $items = $wpdb->get_results( $wpdb->prepare(
43
+ "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->activity_log
44
+ WHERE `user_id` = %d
45
+ ORDER BY `hist_time` ASC
46
+ LIMIT %d, %d;",
47
+ $user->ID, $page, $number
48
+ ) );
49
+
50
+ $found_rows = $wpdb->get_var( 'SELECT FOUND_ROWS();' );
51
+
52
+ $group_id = 'activity-log';
53
+ $group_label = __( 'Activity Log', 'aryo-activity-log' );
54
+
55
+ foreach ( $items as $item ) {
56
+ $item_id = "activity-log-{$item->histid}";
57
+ $created = date( 'Y-m-d H:i:s', $item->hist_time );
58
+ $data = [
59
+ [
60
+ 'name' => __( 'Time', 'aryo-activity-log' ),
61
+ 'value' => get_date_from_gmt( $created, 'Y/m/d h:i:s A' ),
62
+ ],
63
+ [
64
+ 'name' => __( 'Action', 'aryo-activity-log' ),
65
+ 'value' => $this->get_action_label( $item->action ),
66
+ ],
67
+ [
68
+ 'name' => __( 'Object Type', 'aryo-activity-log' ),
69
+ 'value' => $item->object_type,
70
+ ],
71
+ [
72
+ 'name' => __( 'Object Subtype', 'aryo-activity-log' ),
73
+ 'value' => $item->object_subtype,
74
+ ],
75
+ [
76
+ 'name' => __( 'Description', 'aryo-activity-log' ),
77
+ 'value' => $item->object_name,
78
+ ],
79
+ [
80
+ 'name' => __( 'IP', 'aryo-activity-log' ),
81
+ 'value' => $item->hist_ip,
82
+ ],
83
+ ];
84
+
85
+ $export_items[] = [
86
+ 'group_id' => $group_id,
87
+ 'group_label' => $group_label,
88
+ 'item_id' => $item_id,
89
+ 'data' => $data,
90
+ ];
91
+ } // End foreach().
92
+
93
+ // Tell core if we have more comments to work on still
94
+ $done = $found_rows < $number;
95
+ return [
96
+ 'data' => $export_items,
97
+ 'done' => $done,
98
+ ];
99
+ }
100
+
101
+ public function add_privacy_policy_content() {
102
+ if ( ! function_exists( 'wp_add_privacy_policy_content' ) ) {
103
+ return;
104
+ }
105
+
106
+ $content = sprintf( __( 'If you are a registered user, we save your content activity like create/update/delete posts and comments.', 'aryo-activity-log' ) );
107
+
108
+ wp_add_privacy_policy_content(
109
+ __( 'Activity Log', 'aryo-activity-log' ),
110
+ wp_kses_post( wpautop( $content, false ) )
111
+ );
112
+ }
113
+
114
+ public function get_action_label( $action ) {
115
+ return ucwords( str_replace( '_', ' ', __( $action, 'aryo-activity-log' ) ) );
116
+ }
117
+ }
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Activity Log ===
2
  Contributors: pojo.me, KingYes, ariel.k, maor
3
- Tags: automation, actions, activity, Activity Log, admin, admin actions, administration, analytics, audit, audit log, audit logs, bbPress, changes, dashboard, email notifications, event, event log, log, logger, Logs, monitor, multi-users, multisite, notifications, security, security audit trail, security event log, stats, stream, tracking, troubleshooting, user activity report, user tracking, woocommerce, bbPress
4
  Requires at least: 4.4
5
  Tested up to: 4.9
6
- Stable tag: 2.4.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.
@@ -17,6 +17,9 @@ Want to monitor and track your site activity? Find out exactly who does what on
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
 
21
  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).
22
 
@@ -48,12 +51,16 @@ If you have tens of users or more, you really can’t know who did what. This pl
48
 
49
  <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.
50
 
 
 
51
  <h4>What people are saying</h4>
52
  * <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)
53
  * <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/)
54
  * <em>“Optimized code - The plugin itself is blazing fast and leaves almost no footprint on the server.”</em> - [freshtechtips.com](http://www.freshtechtips.com/2014/01/best-audit-trail-plugins-for-wordpress.html)
55
  * <em>“The plugin successful for activity log for WordPress.”</em> - [wp-tricks.co.il](http://www.wp-tricks.co.il/2013/08/%D7%99%D7%95%D7%9E%D7%9F-%D7%A4%D7%A2%D7%99%D7%9C%D7%95%D7%AA-%D7%9C%D7%95%D7%95%D7%A8%D7%93%D7%A4%D7%A8%D7%A1-aryo-activity-log/)
56
  * <em>“This is a pretty simple yet quite effective plugin for keeping track of what your admins and users do on your sites.”</em> - [shadowdragonunlimited.com](http://shadowdragonunlimited.com/plugin-of-the-week-9302013-aryo-activity-log/plugin-of-the-week/)
 
 
57
 
58
  <h4>Translators:</h4>
59
  * German (de_DE) - [Robert Harm](http://www.mapsmarker.com/)
@@ -105,6 +112,9 @@ Would you like to like to contribute to Activity Log? You are more than welcome
105
 
106
  == Changelog ==
107
 
 
 
 
108
  = 2.4.1 =
109
  * Fix : Escape title before saving to database
110
 
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: 4.9
6
+ Stable tag: 2.5.0
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.
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
 
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/)
59
  * <em>“Optimized code - The plugin itself is blazing fast and leaves almost no footprint on the server.”</em> - [freshtechtips.com](http://www.freshtechtips.com/2014/01/best-audit-trail-plugins-for-wordpress.html)
60
  * <em>“The plugin successful for activity log for WordPress.”</em> - [wp-tricks.co.il](http://www.wp-tricks.co.il/2013/08/%D7%99%D7%95%D7%9E%D7%9F-%D7%A4%D7%A2%D7%99%D7%9C%D7%95%D7%AA-%D7%9C%D7%95%D7%95%D7%A8%D7%93%D7%A4%D7%A8%D7%A1-aryo-activity-log/)
61
  * <em>“This is a pretty simple yet quite effective plugin for keeping track of what your admins and users do on your sites.”</em> - [shadowdragonunlimited.com](http://shadowdragonunlimited.com/plugin-of-the-week-9302013-aryo-activity-log/plugin-of-the-week/)
62
+ * <em>“Activity Log lets you track a huge range of activities. Overall, very easy to use and setup.”</em> - [elegantthemes.com](https://www.elegantthemes.com/blog/tips-tricks/5-best-ways-to-monitor-wordpress-activity-via-the-dashboard)
63
+
64
 
65
  <h4>Translators:</h4>
66
  * German (de_DE) - [Robert Harm](http://www.mapsmarker.com/)
112
 
113
  == Changelog ==
114
 
115
+ = 2.5.0 =
116
+ * New! Added log to Export Personal Data tool for better GDPR Compliance ([Topic](https://wordpress.org/support/topic/activity-log-gdpr-compliance/))
117
+
118
  = 2.4.1 =
119
  * Fix : Escape title before saving to database
120