Activity Log - Version 2.8.3

Version Description

  • 2022-03-09 =
  • Tweak: Run Clear old items from DB once daily to avoid unexpected errors (#156)
Download this release

Release Info

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

Code changes from version 2.8.2 to 2.8.3

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.8.2
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.8.3
9
  Text Domain: aryo-activity-log
10
  License: GPLv2 or later
11
 
classes/class-aal-api.php CHANGED
@@ -3,17 +3,17 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
  class AAL_API {
5
 
6
- /**
7
- * @since 1.0.0
8
- *
9
- * @return void
10
- */
11
- protected function _delete_old_items() {
12
  global $wpdb;
13
 
14
  $logs_lifespan = absint( AAL_Main::instance()->settings->get_option( 'logs_lifespan' ) );
15
- if ( empty( $logs_lifespan ) )
16
  return;
 
17
 
18
  $wpdb->query(
19
  $wpdb->prepare(
@@ -145,8 +145,6 @@ class AAL_API {
145
  array( '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s', '%d' )
146
  );
147
 
148
- // Remove old items.
149
- $this->_delete_old_items();
150
  do_action( 'aal_insert_log', $args );
151
  }
152
  }
3
 
4
  class AAL_API {
5
 
6
+ public function __construct() {
7
+ add_action( 'aal/maintenance/clear_old_items', [ $this, 'delete_old_items' ] );
8
+ }
9
+
10
+ public function delete_old_items() {
 
11
  global $wpdb;
12
 
13
  $logs_lifespan = absint( AAL_Main::instance()->settings->get_option( 'logs_lifespan' ) );
14
+ if ( empty( $logs_lifespan ) ) {
15
  return;
16
+ }
17
 
18
  $wpdb->query(
19
  $wpdb->prepare(
145
  array( '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s', '%d' )
146
  );
147
 
 
 
148
  do_action( 'aal_insert_log', $args );
149
  }
150
  }
classes/class-aal-maintenance.php CHANGED
@@ -16,6 +16,9 @@ class AAL_Maintenance {
16
  } else {
17
  self::_create_tables();
18
  }
 
 
 
19
  }
20
 
21
  public static function uninstall() {
@@ -31,6 +34,8 @@ class AAL_Maintenance {
31
  } else {
32
  self::_remove_tables();
33
  }
 
 
34
  }
35
 
36
  public static function mu_new_blog_installer( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
16
  } else {
17
  self::_create_tables();
18
  }
19
+
20
+ wp_clear_scheduled_hook( 'aal/maintenance/clear_old_items' );
21
+ wp_schedule_event( time(), 'daily', 'aal/maintenance/clear_old_items' );
22
  }
23
 
24
  public static function uninstall() {
34
  } else {
35
  self::_remove_tables();
36
  }
37
+
38
+ wp_clear_scheduled_hook( 'aal/maintenance/clear_old_items' );
39
  }
40
 
41
  public static function mu_new_blog_installer( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
readme.txt CHANGED
@@ -2,8 +2,8 @@
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.9
6
- Stable tag: 2.8.2
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!
@@ -108,6 +108,9 @@ Would you like to like to contribute to Activity Log? You are more than welcome
108
 
109
  == Changelog ==
110
 
 
 
 
111
  = 2.8.2 - 2022-01-25 =
112
  * Fix: Auto-updates of core, plugins and themes are not registered to the log ([#155](https://github.com/pojome/activity-log/issues/155), props [@nicomollet](https://github.com/nicomollet))
113
 
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: 6.0
6
+ Stable tag: 2.8.3
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!
108
 
109
  == Changelog ==
110
 
111
+ = 2.8.3 - 2022-03-09 =
112
+ * Tweak: Run Clear old items from DB once daily to avoid unexpected errors ([#156](https://github.com/pojome/activity-log/issues/156))
113
+
114
  = 2.8.2 - 2022-01-25 =
115
  * Fix: Auto-updates of core, plugins and themes are not registered to the log ([#155](https://github.com/pojome/activity-log/issues/155), props [@nicomollet](https://github.com/nicomollet))
116