Simple History - Version 2.9.1

Version Description

(August 2016) =

  • Fixed an issue where the logged time was off by some hours, due to timezone being manually set elsewhere. Should fix https://wordpress.org/support/topic/logged-time-off-by-2-hours and https://wordpress.org/support/topic/different-time-between-dashboard-and-logger.
  • Fixed Nextgen Gallery and Nextgen Gallery Plus logging lots and lots of event when viewing posts with galleries. The posts was actually updated, so this plugin did nothing wrong. But it was indeed a bit annoying and most likely something you didn't want in your log. Fixes https://wordpress.org/support/topic/non-stop-logging-nextgen-gallery-items.
Download this release

Release Info

Developer eskapism
Plugin Icon 128x128 Simple History
Version 2.9.1
Comparing to
See all releases

Code changes from version 2.9 to 2.9.1

dropins/SimpleHistoryPluginPatchesDropin.php CHANGED
@@ -18,8 +18,71 @@ class SimpleHistoryPluginPatchesDropin {
18
 
19
  $this->patch_captcha_on_login();
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  }
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  /**
24
  * Captcha on Login
25
  *
18
 
19
  $this->patch_captcha_on_login();
20
 
21
+ $this->patch_nextgen_gallery();
22
+
23
+ }
24
+
25
+ /**
26
+ *
27
+ * Nextgen Gallery and Nextgen Gallery Plus updates posts every 30 minutes or so when accessing
28
+ * posts with galleries on the front
29
+ *
30
+ * Logged messages are like "Updated nextgen gallery - display type "NextGen Pro Mosaic""
31
+ * and it can be a lot of them.
32
+ *
33
+ * Support forum thread:
34
+ * https://wordpress.org/support/topic/non-stop-logging-nextgen-gallery-items
35
+ *
36
+ * Note that Simple History does nothing wrong, the posts are updated, but it's just annoying
37
+ * and unneeded/unwanted info.
38
+ *
39
+ * We solve this by canceling logging of these events.
40
+ *
41
+ */
42
+ function patch_nextgen_gallery() {
43
+
44
+ add_action( "simple_history/log/do_log", array( $this, "patch_nextgen_gallery_on_log" ), 10, 5 );
45
+
46
  }
47
 
48
+ function patch_nextgen_gallery_on_log( $doLog, $level = null, $message = null, $context = null, $loggerInstance = null ) {
49
+
50
+ // Check that NextGen is installed
51
+ if ( ! defined("NGG_PLUGIN") ) {
52
+ return $doLog;
53
+ }
54
+
55
+ if ( ! isset( $context["_message_key"]) || $context["_message_key"] !== "post_updated" ) {
56
+ return $doLog;
57
+ }
58
+
59
+ if ( ! isset( $context["post_type"]) || $context["post_type"] !== "display_type" ) {
60
+ return $doLog;
61
+ }
62
+
63
+ // The log spamming thingie is happening on the front, so only continue if this is not in the admin area
64
+ if ( is_admin() ) {
65
+ return $doLog;
66
+ }
67
+
68
+ // The calls must come from logger SimplePostLogger
69
+ if ( $loggerInstance->slug !== "SimplePostLogger" ) {
70
+ return $doLog;
71
+ }
72
+
73
+ // There. All checked. Now cancel the logging.
74
+ $doLog = false;
75
+
76
+ #error_log(simpleHistory::json_encode( $context ));
77
+ #error_log(simpleHistory::json_encode( $loggerInstance ));
78
+ #error_log(simpleHistory::json_encode( is_admin() ));
79
+ // error_log( __METHOD__ . " canceled logging" );
80
+
81
+ return $doLog;
82
+
83
+ }
84
+
85
+
86
  /**
87
  * Captcha on Login
88
  *
inc/SimpleHistory.php CHANGED
@@ -154,6 +154,8 @@ class SimpleHistory {
154
  $postdata = file_get_contents( "php://input" );
155
  $context["_debug_http_raw_post_data"] = $sh->json_encode( $postdata );
156
 
 
 
157
  return $context;
158
 
159
  }, 10, 4 );
154
  $postdata = file_get_contents( "php://input" );
155
  $context["_debug_http_raw_post_data"] = $sh->json_encode( $postdata );
156
 
157
+ $context["_debug_wp_debug_backtrace_summary"] = wp_debug_backtrace_summary();
158
+
159
  return $context;
160
 
161
  }, 10, 4 );
index.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://simple-history.com
5
  Text Domain: simple-history
6
  Domain Path: /languages
7
  Description: Plugin that logs various things that occur in WordPress and then presents those events in a very nice GUI.
8
- Version: 2.9
9
  Author: Pär Thernström
10
  Author URI: http://simple-history.com/
11
  License: GPL2
@@ -42,7 +42,7 @@ if ( version_compare( phpversion(), "5.3", ">=") ) {
42
  // register_activation_hook( trailingslashit(WP_PLUGIN_DIR) . trailingslashit( plugin_basename(__DIR__) ) . "index.php" , array("SimpleHistory", "on_plugin_activate" ) );
43
 
44
  if ( ! defined( 'SIMPLE_HISTORY_VERSION' ) ) {
45
- define( 'SIMPLE_HISTORY_VERSION', '2.9' );
46
  }
47
 
48
  if ( ! defined( 'SIMPLE_HISTORY_PATH' ) ) {
5
  Text Domain: simple-history
6
  Domain Path: /languages
7
  Description: Plugin that logs various things that occur in WordPress and then presents those events in a very nice GUI.
8
+ Version: 2.9.1
9
  Author: Pär Thernström
10
  Author URI: http://simple-history.com/
11
  License: GPL2
42
  // register_activation_hook( trailingslashit(WP_PLUGIN_DIR) . trailingslashit( plugin_basename(__DIR__) ) . "index.php" , array("SimpleHistory", "on_plugin_activate" ) );
43
 
44
  if ( ! defined( 'SIMPLE_HISTORY_VERSION' ) ) {
45
+ define( 'SIMPLE_HISTORY_VERSION', '2.9.1' );
46
  }
47
 
48
  if ( ! defined( 'SIMPLE_HISTORY_PATH' ) ) {
loggers/SimpleLogger.php CHANGED
@@ -391,7 +391,7 @@ class SimpleLogger {
391
  $str_when = "";
392
 
393
  // $row->date is in GMT
394
- $date_datetime = new DateTime( $row->date );
395
 
396
  // Current datetime in GMT
397
  $time_current = strtotime( current_time("mysql", 1) );
391
  $str_when = "";
392
 
393
  // $row->date is in GMT
394
+ $date_datetime = new DateTime( $row->date, new DateTimeZone('GMT') );
395
 
396
  // Current datetime in GMT
397
  $time_current = strtotime( current_time("mysql", 1) );
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://eskapism.se/sida/donate/
4
  Tags: history, log, changes, changelog, audit, trail, pages, attachments, users, dashboard, admin, syslog, feed, activity, stream, audit trail, brute-force
5
  Requires at least: 4.5.1
6
  Tested up to: 4.5.3
7
- Stable tag: 2.9
8
 
9
  View changes made by users within WordPress. See who created a page, uploaded an attachment or approved an comment, and more.
10
 
@@ -153,9 +153,15 @@ A simple way to see any uncommon activity, for example an increased number of lo
153
 
154
  ## Changelog
155
 
 
 
 
 
 
 
156
  = 2.9 (August 2016) =
157
 
158
- - Added custom date ranges to the dates filter. Just select "Custom date range..." in the dates dropdown and you can choose to se the log between any two exact dates.
159
  - The values in the statistics graph can now be clicked and when clicked the log is filtered to only show logged events from that day. Very convenient if you have a larger number of events logged for one day and quickly want to find out what exactly was logged that day.
160
  - Dates filter no longer accepts multi values. It was indeed a bit confusing that you could select both "Last 7 days" and "Last 3 days".
161
  - Fix for empty previous plugin version (the `{plugin_prev_version}` placeholder) when updating plugins.
4
  Tags: history, log, changes, changelog, audit, trail, pages, attachments, users, dashboard, admin, syslog, feed, activity, stream, audit trail, brute-force
5
  Requires at least: 4.5.1
6
  Tested up to: 4.5.3
7
+ Stable tag: 2.9.1
8
 
9
  View changes made by users within WordPress. See who created a page, uploaded an attachment or approved an comment, and more.
10
 
153
 
154
  ## Changelog
155
 
156
+ = 2.9.1 (August 2016) =
157
+
158
+ - Fixed an issue where the logged time was off by some hours, due to timezone being manually set elsewhere.
159
+ Should fix https://wordpress.org/support/topic/logged-time-off-by-2-hours and https://wordpress.org/support/topic/different-time-between-dashboard-and-logger.
160
+ - Fixed Nextgen Gallery and Nextgen Gallery Plus logging lots and lots of event when viewing posts with galleries. The posts was actually updated, so this plugin did nothing wrong. But it was indeed a bit annoying and most likely something you didn't want in your log. Fixes https://wordpress.org/support/topic/non-stop-logging-nextgen-gallery-items.
161
+
162
  = 2.9 (August 2016) =
163
 
164
+ - Added custom date ranges to the dates filter. Just select "Custom date range..." in the dates dropdown and you can choose to see the log between any two exact dates.
165
  - The values in the statistics graph can now be clicked and when clicked the log is filtered to only show logged events from that day. Very convenient if you have a larger number of events logged for one day and quickly want to find out what exactly was logged that day.
166
  - Dates filter no longer accepts multi values. It was indeed a bit confusing that you could select both "Last 7 days" and "Last 3 days".
167
  - Fix for empty previous plugin version (the `{plugin_prev_version}` placeholder) when updating plugins.