Simple History - Version 2.1.5

Version Description

(August 2015) =

  • Fixed: It was not possible to modify the filters simple_history/view_settings_capability and simple_history/view_history_capability from the functions.php-file in a theme (filters where applied to early - they did however work from within a plugin!)
  • Changed: Use h1 instead of h2 on admin screens. Reason for this the changes in 4.3: https://make.wordpress.org/core/2015/07/31/headings-in-admin-screens-change-in-wordpress-4-3/.
  • Removed: the constant VERSION is now removed. Use constant SIMPLE_HISTORY_VERSION instead of you need to check the current version of Simple History.
Download this release

Release Info

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

Code changes from version 2.1.4 to 2.1.5

dropins/SimpleHistorySettingsLogtestDropin.php CHANGED
@@ -79,7 +79,7 @@ class SimpleHistorySettingsLogtestDropin {
79
  public function output() {
80
 
81
  ?>
82
- <h2>Test data</h2>
83
 
84
  <p>Add lots of test data to the log database.</p>
85
 
79
  public function output() {
80
 
81
  ?>
82
+ <h1>Test data</h1>
83
 
84
  <p>Add lots of test data to the log database.</p>
85
 
inc/SimpleHistory.php CHANGED
@@ -9,24 +9,11 @@ class SimpleHistory {
9
 
10
  const NAME = "Simple History";
11
 
12
- // Dont use this any more! Will be removed in future versions. Use global SIMPLE_HISTORY_VERSION instead.
13
- const VERSION = "2.1.4";
14
-
15
  /**
16
  * For singleton
17
  */
18
  private static $instance;
19
 
20
- /**
21
- * Capability required to view the history log
22
- */
23
- private $view_history_capability;
24
-
25
- /**
26
- * Capability required to view and edit the settings page
27
- */
28
- private $view_settings_capability;
29
-
30
  /**
31
  * Array with external loggers to load
32
  */
@@ -546,17 +533,39 @@ class SimpleHistory {
546
  $this->instantiatedLoggers = array();
547
  $this->instantiatedDropins = array();
548
 
549
- // Capability required to view history = for who will the History page be added
550
- $this->view_history_capability = "edit_pages";
551
- $this->view_history_capability = apply_filters("simple_history_view_history_capability", $this->view_history_capability);
552
- $this->view_history_capability = apply_filters("simple_history/view_history_capability", $this->view_history_capability);
553
 
554
- // Capability required to view settings
555
- $this->view_settings_capability = "manage_options";
556
- $this->view_settings_capability = apply_filters("simple_history_view_settings_capability", $this->view_settings_capability);
557
- $this->view_settings_capability = apply_filters("simple_history/view_settings_capability", $this->view_settings_capability);
558
 
559
- $this->plugin_basename = SIMPLE_HISTORY_BASENAME;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
560
 
561
  }
562
 
@@ -890,7 +899,7 @@ class SimpleHistory {
890
  function plugin_action_links($actions, $b, $c, $d) {
891
 
892
  // Only add link if user has the right to view the settings page
893
- if (!current_user_can($this->view_settings_capability)) {
894
  return $actions;
895
  }
896
 
@@ -909,7 +918,7 @@ class SimpleHistory {
909
  */
910
  function add_dashboard_widget() {
911
 
912
- if ( $this->setting_show_on_dashboard() && current_user_can( $this->view_history_capability ) ) {
913
 
914
  /**
915
  * Filter to determine if history page should be added to page below dashboard or not
@@ -1288,17 +1297,17 @@ class SimpleHistory {
1288
  ?>
1289
  <div class="wrap">
1290
 
1291
- <h2 class="SimpleHistoryPageHeadline">
1292
  <div class="dashicons dashicons-backup SimpleHistoryPageHeadline__icon"></div>
1293
  <?php _e("Simple History Settings", "simple-history")?>
1294
- </h2>
1295
 
1296
  <?php
1297
  $active_tab = isset($_GET["selected-tab"]) ? $_GET["selected-tab"] : "settings";
1298
  $settings_base_url = menu_page_url(SimpleHistory::SETTINGS_MENU_SLUG, 0);
1299
  ?>
1300
 
1301
- <h3 class="nav-tab-wrapper">
1302
  <?php
1303
  foreach ($arr_settings_tabs as $one_tab) {
1304
 
@@ -1314,7 +1323,7 @@ class SimpleHistory {
1314
 
1315
  }
1316
  ?>
1317
- </h3>
1318
 
1319
  <?php
1320
 
@@ -1388,7 +1397,7 @@ class SimpleHistory {
1388
  add_dashboard_page(
1389
  SimpleHistory::NAME,
1390
  _x("Simple History", 'dashboard menu name', 'simple-history'),
1391
- $this->view_history_capability,
1392
  "simple_history_page",
1393
  array($this, "history_page_output")
1394
  );
@@ -1407,7 +1416,7 @@ class SimpleHistory {
1407
  add_options_page(
1408
  __('Simple History Settings', "simple-history"),
1409
  SimpleHistory::NAME,
1410
- $this->view_settings_capability,
1411
  SimpleHistory::SETTINGS_MENU_SLUG,
1412
  array($this, 'settings_page_output')
1413
  );
@@ -1512,21 +1521,21 @@ class SimpleHistory {
1512
 
1513
  <div class="wrap SimpleHistoryWrap">
1514
 
1515
- <h2 class="SimpleHistoryPageHeadline">
1516
  <div class="dashicons dashicons-backup SimpleHistoryPageHeadline__icon"></div>
1517
  <?php echo _x("Simple History", 'history page headline', 'simple-history')?>
1518
- </h2>
1519
 
1520
  <?php
1521
- /**
1522
- * Fires before the gui div
1523
- *
1524
- * @since 2.0
1525
- *
1526
- * @param SimpleHistory $SimpleHistory This class.
1527
- */
1528
- do_action("simple_history/history_page/before_gui", $this);
1529
- ?>
1530
 
1531
  <div class="SimpleHistoryGuiWrap">
1532
 
9
 
10
  const NAME = "Simple History";
11
 
 
 
 
12
  /**
13
  * For singleton
14
  */
15
  private static $instance;
16
 
 
 
 
 
 
 
 
 
 
 
17
  /**
18
  * Array with external loggers to load
19
  */
533
  $this->instantiatedLoggers = array();
534
  $this->instantiatedDropins = array();
535
 
536
+ $this->plugin_basename = SIMPLE_HISTORY_BASENAME;
 
 
 
537
 
538
+ }
 
 
 
539
 
540
+ /**
541
+ * Return capability required to view history = for who will the History page be added
542
+ *
543
+ * @since 2.1.5
544
+ * @return string capability
545
+ */
546
+ public function get_view_history_capability() {
547
+
548
+ $view_history_capability = "edit_pages";
549
+ $view_history_capability = apply_filters("simple_history_view_history_capability", $view_history_capability);
550
+ $view_history_capability = apply_filters("simple_history/view_history_capability", $view_history_capability);
551
+
552
+ return $view_history_capability;
553
+
554
+ }
555
+
556
+ /**
557
+ * Return capability required to view settings
558
+ *
559
+ * @since 2.1.5
560
+ * @return string capability
561
+ */
562
+ public function get_view_settings_capability() {
563
+
564
+ $view_settings_capability = "manage_options";
565
+ $view_settings_capability = apply_filters("simple_history_view_settings_capability", $view_settings_capability);
566
+ $view_settings_capability = apply_filters("simple_history/view_settings_capability", $view_settings_capability);
567
+
568
+ return $view_settings_capability;
569
 
570
  }
571
 
899
  function plugin_action_links($actions, $b, $c, $d) {
900
 
901
  // Only add link if user has the right to view the settings page
902
+ if ( ! current_user_can( $this->get_view_settings_capability() ) ) {
903
  return $actions;
904
  }
905
 
918
  */
919
  function add_dashboard_widget() {
920
 
921
+ if ( $this->setting_show_on_dashboard() && current_user_can( $this->get_view_history_capability() ) ) {
922
 
923
  /**
924
  * Filter to determine if history page should be added to page below dashboard or not
1297
  ?>
1298
  <div class="wrap">
1299
 
1300
+ <h1 class="SimpleHistoryPageHeadline">
1301
  <div class="dashicons dashicons-backup SimpleHistoryPageHeadline__icon"></div>
1302
  <?php _e("Simple History Settings", "simple-history")?>
1303
+ </h1>
1304
 
1305
  <?php
1306
  $active_tab = isset($_GET["selected-tab"]) ? $_GET["selected-tab"] : "settings";
1307
  $settings_base_url = menu_page_url(SimpleHistory::SETTINGS_MENU_SLUG, 0);
1308
  ?>
1309
 
1310
+ <h2 class="nav-tab-wrapper">
1311
  <?php
1312
  foreach ($arr_settings_tabs as $one_tab) {
1313
 
1323
 
1324
  }
1325
  ?>
1326
+ </h2>
1327
 
1328
  <?php
1329
 
1397
  add_dashboard_page(
1398
  SimpleHistory::NAME,
1399
  _x("Simple History", 'dashboard menu name', 'simple-history'),
1400
+ $this->get_view_history_capability(),
1401
  "simple_history_page",
1402
  array($this, "history_page_output")
1403
  );
1416
  add_options_page(
1417
  __('Simple History Settings', "simple-history"),
1418
  SimpleHistory::NAME,
1419
+ $this->get_view_settings_capability(),
1420
  SimpleHistory::SETTINGS_MENU_SLUG,
1421
  array($this, 'settings_page_output')
1422
  );
1521
 
1522
  <div class="wrap SimpleHistoryWrap">
1523
 
1524
+ <h1 class="SimpleHistoryPageHeadline">
1525
  <div class="dashicons dashicons-backup SimpleHistoryPageHeadline__icon"></div>
1526
  <?php echo _x("Simple History", 'history page headline', 'simple-history')?>
1527
+ </h1>
1528
 
1529
  <?php
1530
+ /**
1531
+ * Fires before the gui div
1532
+ *
1533
+ * @since 2.0
1534
+ *
1535
+ * @param SimpleHistory $SimpleHistory This class.
1536
+ */
1537
+ do_action("simple_history/history_page/before_gui", $this);
1538
+ ?>
1539
 
1540
  <div class="SimpleHistoryGuiWrap">
1541
 
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.1.4
9
  Author: Pär Thernström
10
  Author URI: http://simple-history.com/
11
  License: GPL2
@@ -46,7 +46,7 @@ if ( version_compare( phpversion(), "5.3", ">=") ) {
46
  // register_activation_hook( trailingslashit(WP_PLUGIN_DIR) . trailingslashit( plugin_basename(__DIR__) ) . "index.php" , array("SimpleHistory", "on_plugin_activate" ) );
47
 
48
  if ( ! defined( 'SIMPLE_HISTORY_VERSION' ) ) {
49
- define( 'SIMPLE_HISTORY_VERSION', '2.1.4' );
50
  }
51
 
52
  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.1.5
9
  Author: Pär Thernström
10
  Author URI: http://simple-history.com/
11
  License: GPL2
46
  // register_activation_hook( trailingslashit(WP_PLUGIN_DIR) . trailingslashit( plugin_basename(__DIR__) ) . "index.php" , array("SimpleHistory", "on_plugin_activate" ) );
47
 
48
  if ( ! defined( 'SIMPLE_HISTORY_VERSION' ) ) {
49
+ define( 'SIMPLE_HISTORY_VERSION', '2.1.5' );
50
  }
51
 
52
  if ( ! defined( 'SIMPLE_HISTORY_PATH' ) ) {
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, cms, dashboard, admin, syslog, feed, activity, stream
5
  Requires at least: 3.6.0
6
  Tested up to: 4.3
7
- Stable tag: 2.1.4
8
 
9
  View changes made by users within WordPress. See who created a page, uploaded an attachment or approved an comment, and more.
10
 
@@ -117,6 +117,12 @@ initiated by a specific user.
117
 
118
  ## Changelog
119
 
 
 
 
 
 
 
120
  = 2.1.4 (July 2015) =
121
 
122
  - Fixed: WordPress core updates got the wrong previous version.
@@ -139,7 +145,7 @@ initiated by a specific user.
139
  - Added: Filter `SimpleHistoryFilterDropin/filter_default_user_ids` that is used to search/filter specific user ids by default (no need to search and select users). Should fix https://wordpress.org/support/topic/how-to-pass-array-of-user-ids-to-history-query.
140
  - Added: Filter `SimpleHistoryFilterDropin/filter_default_loglevel` that is used to search/filter for log levels by default.
141
  - Fixed: if trying to log an array or an object the logger now automagically runs `json_encode()` on the value to make it a string. Previously is just tried to run `$wpdb->insert() with the array and that gave errors. Should fix https://wordpress.org/support/topic/mysql_real_escape_string.
142
- - Fixed: The function that checks for new rows each second (or actually each tenth second to spare resourced) was called an extra time each time the submit button for the filter was clicked. Kinda stupid. Kinda fixed now.
143
  - Fixed: The export feature that was added in version 2.1 was actually not enabled for all users. Now it is!
144
  - Fixed: Image attachments that is deleted from file system no longer result in "broken image" in the log. (Rare case, I know, but it does happen for me that local dev server and remote prod server gets out of "sync" when it comes to attachments.)
145
 
4
  Tags: history, log, changes, changelog, audit, trail, pages, attachments, users, cms, dashboard, admin, syslog, feed, activity, stream
5
  Requires at least: 3.6.0
6
  Tested up to: 4.3
7
+ Stable tag: 2.1.5
8
 
9
  View changes made by users within WordPress. See who created a page, uploaded an attachment or approved an comment, and more.
10
 
117
 
118
  ## Changelog
119
 
120
+ = 2.1.5 (August 2015) =
121
+
122
+ - Fixed: It was not possible to modify the filters `simple_history/view_settings_capability` and `simple_history/view_history_capability` from the `functions.php`-file in a theme (filters where applied to early - they did however work from within a plugin!)
123
+ - Changed: Use `h1` instead of `h2` on admin screens. Reason for this the changes in 4.3: https://make.wordpress.org/core/2015/07/31/headings-in-admin-screens-change-in-wordpress-4-3/.
124
+ - Removed: the constant `VERSION` is now removed. Use constant `SIMPLE_HISTORY_VERSION` instead of you need to check the current version of Simple History.
125
+
126
  = 2.1.4 (July 2015) =
127
 
128
  - Fixed: WordPress core updates got the wrong previous version.
145
  - Added: Filter `SimpleHistoryFilterDropin/filter_default_user_ids` that is used to search/filter specific user ids by default (no need to search and select users). Should fix https://wordpress.org/support/topic/how-to-pass-array-of-user-ids-to-history-query.
146
  - Added: Filter `SimpleHistoryFilterDropin/filter_default_loglevel` that is used to search/filter for log levels by default.
147
  - Fixed: if trying to log an array or an object the logger now automagically runs `json_encode()` on the value to make it a string. Previously is just tried to run `$wpdb->insert() with the array and that gave errors. Should fix https://wordpress.org/support/topic/mysql_real_escape_string.
148
+ - Fixed: The function that checks for new rows each second (or actually each tenth second to spare resources) was called an extra time each time the submit button for the filter was clicked. Kinda stupid. Kinda fixed now.
149
  - Fixed: The export feature that was added in version 2.1 was actually not enabled for all users. Now it is!
150
  - Fixed: Image attachments that is deleted from file system no longer result in "broken image" in the log. (Rare case, I know, but it does happen for me that local dev server and remote prod server gets out of "sync" when it comes to attachments.)
151