Simple History - Version 2.27

Version Description

(August 2018) = - Fix notice errors when syncing an ACF field group. Fixes https://github.com/bonny/WordPress-Simple-History/issues/150. - Fix notice error when trying to read plugin info for a plugin that no longer exists or has changed name. Fixes https://github.com/bonny/WordPress-Simple-History/issues/146. - Always load the SimpleLogger logger. Fixes https://github.com/bonny/WordPress-Simple-History/issues/129. - Make more texts translatable. - Show plugin slug instead of name when translations are updated and a plugin name is not provided by the upgrader. This can happen when a plugin is using an external update service, like EDD. - Group translation updates in the log. Useful because sometimes you update a lot of translations at the same time and the log is full of just those messages.

Download this release

Release Info

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

Code changes from version 2.26.1 to 2.27

composer.json CHANGED
@@ -13,7 +13,7 @@
13
  "require": {
14
  "php": ">=5.3.0"
15
  },
16
- "version": "2.26.1",
17
  "authors": [
18
  {
19
  "name": "Pär Thernström",
13
  "require": {
14
  "php": ">=5.3.0"
15
  },
16
+ "version": "2.27",
17
  "authors": [
18
  {
19
  "name": "Pär Thernström",
inc/SimpleHistory.php CHANGED
@@ -1012,7 +1012,7 @@ class SimpleHistory {
1012
  );
1013
 
1014
  // SimpleLogger.php must be loaded first and always since the other loggers extend it.
1015
- // Include it manually so risk of anyone using filters or similar disables it.
1016
  include_once $loggersDir . 'SimpleLogger.php';
1017
 
1018
  /**
@@ -1050,6 +1050,12 @@ class SimpleHistory {
1050
  */
1051
  $load_logger = apply_filters( 'simple_history/logger/load_logger', $load_logger, $basename_no_suffix );
1052
 
 
 
 
 
 
 
1053
  if ( ! $load_logger ) {
1054
  continue;
1055
  }
1012
  );
1013
 
1014
  // SimpleLogger.php must be loaded first and always since the other loggers extend it.
1015
+ // Include it manually so no risk of anyone using filters or similar disables it.
1016
  include_once $loggersDir . 'SimpleLogger.php';
1017
 
1018
  /**
1050
  */
1051
  $load_logger = apply_filters( 'simple_history/logger/load_logger', $load_logger, $basename_no_suffix );
1052
 
1053
+ // If logger was SimpleLogger then force it to be loaded because for example
1054
+ // custom extended plugins added later probably depends on it.
1055
+ if ( 'SimpleLogger' === $basename_no_suffix ) {
1056
+ $load_logger = true;
1057
+ }
1058
+
1059
  if ( ! $load_logger ) {
1060
  continue;
1061
  }
index.php CHANGED
@@ -5,7 +5,7 @@
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.26.1
9
  * Author: Pär Thernström
10
  * Author URI: http://simple-history.com/
11
  * License: GPL2
@@ -47,7 +47,7 @@ if ( $ok_php_version && $ok_wp_version ) {
47
  */
48
 
49
  if ( ! defined( 'SIMPLE_HISTORY_VERSION' ) ) {
50
- define( 'SIMPLE_HISTORY_VERSION', '2.26.1' );
51
  }
52
 
53
  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.27
9
  * Author: Pär Thernström
10
  * Author URI: http://simple-history.com/
11
  * License: GPL2
47
  */
48
 
49
  if ( ! defined( 'SIMPLE_HISTORY_VERSION' ) ) {
50
+ define( 'SIMPLE_HISTORY_VERSION', '2.27' );
51
  }
52
 
53
  if ( ! defined( 'SIMPLE_HISTORY_PATH' ) ) {
loggers/AvailableUpdatesLogger.php CHANGED
@@ -113,7 +113,11 @@ if ( ! class_exists( 'AvailableUpdatesLogger' ) ) {
113
 
114
  }
115
 
116
-
 
 
 
 
117
  function on_setted_update_plugins_transient( $updates ) {
118
 
119
  if ( empty( $updates->response ) || ! is_array( $updates->response ) ) {
@@ -140,16 +144,22 @@ if ( ! class_exists( 'AvailableUpdatesLogger' ) ) {
140
  require_once ABSPATH . 'wp-admin/includes/plugin.php';
141
  }
142
 
143
- // For each available update
144
  foreach ( $updates->response as $key => $data ) {
145
 
146
  // Make sure plugin directory exists or get_plugin_data will
147
  // give warning like
148
  // "PHP Warning: fread() expects parameter 1 to be resource, boolean given in /wp/wp-includes/functions.php on line 4837"
149
  $file = WP_PLUGIN_DIR . '/' . $key;
150
- $fp = fopen( $file, 'r' );
151
 
152
  // Continue with next plugin if plugin file did not exist.
 
 
 
 
 
 
 
153
  if (false === $fp) {
154
  continue;
155
  }
113
 
114
  }
115
 
116
+ /**
117
+ * Called when WordPress is done checking for plugin updates.
118
+ * WP sets site transient 'update_plugins' when done.
119
+ * Log found plugin updates.
120
+ */
121
  function on_setted_update_plugins_transient( $updates ) {
122
 
123
  if ( empty( $updates->response ) || ! is_array( $updates->response ) ) {
144
  require_once ABSPATH . 'wp-admin/includes/plugin.php';
145
  }
146
 
147
+ // For each available update.
148
  foreach ( $updates->response as $key => $data ) {
149
 
150
  // Make sure plugin directory exists or get_plugin_data will
151
  // give warning like
152
  // "PHP Warning: fread() expects parameter 1 to be resource, boolean given in /wp/wp-includes/functions.php on line 4837"
153
  $file = WP_PLUGIN_DIR . '/' . $key;
 
154
 
155
  // Continue with next plugin if plugin file did not exist.
156
+ if ( ! file_exists( $file ) ) {
157
+ continue;
158
+ }
159
+
160
+ $fp = fopen( $file, 'r' );
161
+
162
+ // Continue with next plugin if plugin file could not be read.
163
  if (false === $fp) {
164
  continue;
165
  }
loggers/Plugin_ACF.php CHANGED
@@ -949,6 +949,10 @@ if ( ! class_exists( 'Plugin_ACF' ) ) {
949
  return $data;
950
  }
951
 
 
 
 
 
952
  $this->oldAndNewFieldGroupsAndFields['fieldGroup']['old'] = acf_get_field_group( $postarr['ID'] );
953
 
954
  $this->oldAndNewFieldGroupsAndFields['fieldGroup']['new'] = acf_get_valid_field_group( $_POST['acf_field_group'] );
949
  return $data;
950
  }
951
 
952
+ if ( empty( $_POST['acf_field_group'] ) ) {
953
+ return $data;
954
+ }
955
+
956
  $this->oldAndNewFieldGroupsAndFields['fieldGroup']['old'] = acf_get_field_group( $postarr['ID'] );
957
 
958
  $this->oldAndNewFieldGroupsAndFields['fieldGroup']['new'] = acf_get_valid_field_group( $_POST['acf_field_group'] );
loggers/class-sh-translations-logger.php CHANGED
@@ -62,10 +62,17 @@ class SH_Translations_Logger extends SimpleLogger {
62
  foreach ($translations as $translation) {
63
  $name = $upgrader->get_name_for_update( (object) $translation );
64
 
 
 
 
 
 
 
65
  $context = array(
66
  'name' => $name,
67
  'language' => $translation['language'],
68
  'translations' => $translation,
 
69
  );
70
 
71
  $this->infoMessage(
62
  foreach ($translations as $translation) {
63
  $name = $upgrader->get_name_for_update( (object) $translation );
64
 
65
+ // Name can be empty, this is the case for for example Polylang Pro.
66
+ // If so then use slug as name, so message won't be empty.
67
+ if ( empty( $name ) && ! empty( $translation['slug'] ) ) {
68
+ $name = $translation['slug'];
69
+ }
70
+
71
  $context = array(
72
  'name' => $name,
73
  'language' => $translation['language'],
74
  'translations' => $translation,
75
+ '_occasionsID' => __CLASS__ . '/translations_updated',
76
  );
77
 
78
  $this->infoMessage(
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: history, log, changes, changelog, audit, trail, pages, attachments, users,
5
  Requires at least: 4.5.1
6
  Tested up to: 4.9
7
  Requires PHP: 5.3
8
- Stable tag: 2.26.1
9
 
10
  View changes made by users within WordPress. See who created a page, uploaded an attachment or approved an comment, and more.
11
 
@@ -69,12 +69,12 @@ The [Enable Media Replace plugin](https://wordpress.org/plugins/enable-media-rep
69
  Simple history will log details about the file being replaced and details about the new file.
70
 
71
  **Limit Login Attempts**<br>
72
- The plugin [Limit Login Attempts](https://sv.wordpress.org/plugins/limit-login-attempts/) is old
73
  and has not been updated for 4 years. However it still has +1 million installs, so many users will benefit from
74
  Simple History logging login attempts, lockouts, and configuration changes made in the plugin Limit Login Attempts.
75
 
76
  **Redirection**
77
- The [redirection plugin](https://sv.wordpress.org/plugins/redirection/) manages url redirections, using a nice GUI.
78
  Simple History will log redirects and groups that are created, changed, enabled or disabled and also when the global plugin settings have been modified.
79
 
80
  **Duplicate Post**
@@ -172,6 +172,14 @@ A simple way to see any uncommon activity, for example an increased number of lo
172
 
173
  ## Changelog
174
 
 
 
 
 
 
 
 
 
175
  = 2.26.1 (July 2018) =
176
  - Fix 5.3 compatibility.
177
 
5
  Requires at least: 4.5.1
6
  Tested up to: 4.9
7
  Requires PHP: 5.3
8
+ Stable tag: 2.27
9
 
10
  View changes made by users within WordPress. See who created a page, uploaded an attachment or approved an comment, and more.
11
 
69
  Simple history will log details about the file being replaced and details about the new file.
70
 
71
  **Limit Login Attempts**<br>
72
+ The plugin [Limit Login Attempts](https://wordpress.org/plugins/limit-login-attempts/) is old
73
  and has not been updated for 4 years. However it still has +1 million installs, so many users will benefit from
74
  Simple History logging login attempts, lockouts, and configuration changes made in the plugin Limit Login Attempts.
75
 
76
  **Redirection**
77
+ The [redirection plugin](https://wordpress.org/plugins/redirection/) manages url redirections, using a nice GUI.
78
  Simple History will log redirects and groups that are created, changed, enabled or disabled and also when the global plugin settings have been modified.
79
 
80
  **Duplicate Post**
172
 
173
  ## Changelog
174
 
175
+ = 2.27 (August 2018) =
176
+ - Fix notice errors when syncing an ACF field group. Fixes https://github.com/bonny/WordPress-Simple-History/issues/150.
177
+ - Fix notice error when trying to read plugin info for a plugin that no longer exists or has changed name. Fixes https://github.com/bonny/WordPress-Simple-History/issues/146.
178
+ - Always load the SimpleLogger logger. Fixes https://github.com/bonny/WordPress-Simple-History/issues/129.
179
+ - Make more texts translatable.
180
+ - Show plugin slug instead of name when translations are updated and a plugin name is not provided by the upgrader. This can happen when a plugin is using an external update service, like EDD.
181
+ - Group translation updates in the log. Useful because sometimes you update a lot of translations at the same time and the log is full of just those messages.
182
+
183
  = 2.26.1 (July 2018) =
184
  - Fix 5.3 compatibility.
185
 
templates/template-settings-tab-debug.php CHANGED
@@ -20,7 +20,8 @@ $period_end_date = DateTime::createFromFormat( 'U', time() );
20
  * Size of database in both number or rows and table size
21
  */
22
 
23
- echo '<h3>Database size</h3>';
 
24
 
25
  // Get table sizes in mb.
26
  $sql_table_size = sprintf( '
@@ -219,7 +220,7 @@ foreach ( $logger_rows_count as $one_logger_slug => $one_logger_val ) {
219
  );
220
 
221
  } else {
222
- $html_logger_messages = '<p>No message strings</p>';
223
  }
224
 
225
  printf(
@@ -261,8 +262,9 @@ foreach ( $logger_rows_count as $one_logger_slug => $one_logger_val ) {
261
  echo '</table>';
262
 
263
  // List installed plugins
264
- echo '<h2>Plugins</h2>';
265
- echo '<p>As returned from <code>get_plugins()</code></p>';
 
266
 
267
  $plugins = get_plugins();
268
 
@@ -293,7 +295,10 @@ foreach ( $plugins as $pluginFilePath => $onePlugin ) {
293
  ',
294
  esc_html( $onePlugin['Name'] ),
295
  esc_html( $pluginFilePath ),
296
- $isPluginActive ? 'Yes' : 'No' // 3
 
 
 
297
  );
298
  }
299
 
20
  * Size of database in both number or rows and table size
21
  */
22
 
23
+ echo '<h3>' . _x( 'Database size', 'debug dropin', 'simple-history' ) . '</h3>';
24
+
25
 
26
  // Get table sizes in mb.
27
  $sql_table_size = sprintf( '
220
  );
221
 
222
  } else {
223
+ $html_logger_messages = '<p>' . _x( 'No message strings', 'debug dropin', 'simple-history' ) . '</p>';
224
  }
225
 
226
  printf(
262
  echo '</table>';
263
 
264
  // List installed plugins
265
+ echo '<h2>' . _x( 'Plugins', 'debug dropin', 'simple-history' ) . '</h2>';
266
+
267
+ echo '<p>' . _x( 'As returned from <code>get_plugins()</code>', 'debug dropin', 'simple-history' ) . '</p>';
268
 
269
  $plugins = get_plugins();
270
 
295
  ',
296
  esc_html( $onePlugin['Name'] ),
297
  esc_html( $pluginFilePath ),
298
+ $isPluginActive ?
299
+ _x( 'Yes', 'debug dropin', 'simple-history' ) :
300
+ _x( 'No', 'debug dropin', 'simple-history' )
301
+ // 3
302
  );
303
  }
304