Simple History - Version 2.43.0

Version Description

(October 2021) =

  • Fixed: PHP notices on menu save when there are ACF fields attached (#235)

  • Fixed: array_map and reset cause warning in PHP 8 (#263)

Download this release

Release Info

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

Code changes from version 2.42.0 to 2.43.0

Files changed (3) hide show
  1. index.php +2 -2
  2. loggers/Plugin_ACF.php +7 -3
  3. readme.txt +7 -1
index.php CHANGED
@@ -6,7 +6,7 @@
6
  * Text Domain: simple-history
7
  * Domain Path: /languages
8
  * Description: Plugin that logs various things that occur in WordPress and then presents those events in a very nice GUI.
9
- * Version: 2.42.0
10
  * Author: Pär Thernström
11
  * Author URI: http://simple-history.com/
12
  * License: GPL2
@@ -45,7 +45,7 @@ if ($ok_php_version && $ok_wp_version) {
45
  * @TODO: make activation multi site aware, as in https://github.com/scribu/wp-proper-network-activation
46
  * register_activation_hook( trailingslashit(WP_PLUGIN_DIR) . trailingslashit( plugin_basename(__DIR__) ) . "index.php" , array("SimpleHistory", "on_plugin_activate" ) );
47
  */
48
- define('SIMPLE_HISTORY_VERSION', '2.42.0');
49
  define('SIMPLE_HISTORY_PATH', plugin_dir_path(__FILE__));
50
  define('SIMPLE_HISTORY_BASENAME', plugin_basename(__FILE__));
51
  define('SIMPLE_HISTORY_DIR_URL', plugin_dir_url(__FILE__));
6
  * Text Domain: simple-history
7
  * Domain Path: /languages
8
  * Description: Plugin that logs various things that occur in WordPress and then presents those events in a very nice GUI.
9
+ * Version: 2.43.0
10
  * Author: Pär Thernström
11
  * Author URI: http://simple-history.com/
12
  * License: GPL2
45
  * @TODO: make activation multi site aware, as in https://github.com/scribu/wp-proper-network-activation
46
  * register_activation_hook( trailingslashit(WP_PLUGIN_DIR) . trailingslashit( plugin_basename(__DIR__) ) . "index.php" , array("SimpleHistory", "on_plugin_activate" ) );
47
  */
48
+ define('SIMPLE_HISTORY_VERSION', '2.43.0');
49
  define('SIMPLE_HISTORY_PATH', plugin_dir_path(__FILE__));
50
  define('SIMPLE_HISTORY_BASENAME', plugin_basename(__FILE__));
51
  define('SIMPLE_HISTORY_DIR_URL', plugin_dir_url(__FILE__));
loggers/Plugin_ACF.php CHANGED
@@ -203,7 +203,9 @@ if (! class_exists('Plugin_ACF')) {
203
  $prev_post_meta = isset($this->oldPostData['prev_post_meta']) ? $this->oldPostData['prev_post_meta'] : array();
204
 
205
  $new_post_meta = get_post_custom($post_id);
206
- $new_post_meta = array_map('reset', $new_post_meta);
 
 
207
 
208
  // New and old post meta can contain different amount of keys,
209
  // join them so we have the name of all post meta thaf have been added, removed, or modified.
@@ -269,7 +271,7 @@ if (! class_exists('Plugin_ACF')) {
269
  $post_logger = $this->simpleHistory->getInstantiatedLoggerBySlug('SimplePostLogger');
270
 
271
  // Save ACF diff if detected post here is same as the last one used in Postlogger.
272
- if ($post_id === $post_logger->lastInsertContext['post_id']) {
273
  $last_insert_id = $post_logger->lastInsertID;
274
 
275
  // Append new info to the context of history item with id $post_logger->lastInsertID.
@@ -526,7 +528,9 @@ if (! class_exists('Plugin_ACF')) {
526
  $post_meta = get_post_custom($post_ID);
527
 
528
  // Meta is array of arrays, get first value of each array value.
529
- $post_meta = array_map('reset', $post_meta);
 
 
530
 
531
  $this->oldPostData['prev_post_meta'] = $post_meta;
532
  }
203
  $prev_post_meta = isset($this->oldPostData['prev_post_meta']) ? $this->oldPostData['prev_post_meta'] : array();
204
 
205
  $new_post_meta = get_post_custom($post_id);
206
+ array_walk($new_post_meta, function(&$value, $key){
207
+ $value = reset($value);
208
+ });
209
 
210
  // New and old post meta can contain different amount of keys,
211
  // join them so we have the name of all post meta thaf have been added, removed, or modified.
271
  $post_logger = $this->simpleHistory->getInstantiatedLoggerBySlug('SimplePostLogger');
272
 
273
  // Save ACF diff if detected post here is same as the last one used in Postlogger.
274
+ if (isset($post_logger->lastInsertContext['post_id']) && $post_id === $post_logger->lastInsertContext['post_id']) {
275
  $last_insert_id = $post_logger->lastInsertID;
276
 
277
  // Append new info to the context of history item with id $post_logger->lastInsertID.
528
  $post_meta = get_post_custom($post_ID);
529
 
530
  // Meta is array of arrays, get first value of each array value.
531
+ array_walk($post_meta, function(&$value, $key){
532
+ $value = reset($value);
533
+ });
534
 
535
  $this->oldPostData['prev_post_meta'] = $post_meta;
536
  }
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: history, log, changes, changelog, audit, audit log, event log, user tracki
5
  Requires at least: 5.2
6
  Tested up to: 5.7
7
  Requires PHP: 5.6
8
- Stable tag: 2.42.0
9
 
10
  View changes made by users within WordPress. See who created a page, uploaded an attachment or approved an comment, and more.
11
 
@@ -193,6 +193,12 @@ Events in the log are stored for 60 days by default. Events older than this will
193
 
194
  == Changelog ==
195
 
 
 
 
 
 
 
196
  = 2.42.0 (April 2021) =
197
 
198
  - Fixed: Quick diff table had to wrong sizes of the table cells. ([#246](https://github.com/bonny/WordPress-Simple-History/issues/246))
5
  Requires at least: 5.2
6
  Tested up to: 5.7
7
  Requires PHP: 5.6
8
+ Stable tag: 2.43.0
9
 
10
  View changes made by users within WordPress. See who created a page, uploaded an attachment or approved an comment, and more.
11
 
193
 
194
  == Changelog ==
195
 
196
+ = 2.43.0 (October 2021) =
197
+
198
+ - Fixed: PHP notices on menu save when there are ACF fields attached ([#235](https://github.com/bonny/WordPress-Simple-History/issues/235))
199
+
200
+ - Fixed: `array_map` and `reset` cause warning in PHP 8 ([#263](https://github.com/bonny/WordPress-Simple-History/pull/263))
201
+
202
  = 2.42.0 (April 2021) =
203
 
204
  - Fixed: Quick diff table had to wrong sizes of the table cells. ([#246](https://github.com/bonny/WordPress-Simple-History/issues/246))