Simple History - Version 2.0.23

Version Description

  • Added: Filter simple_history/rss_item_link, so plugins can modify the link used in the RSS feed.
  • Added: Links for changed posts and attachments in RSS feed now links directly to WordPress admin, making is easier to follow things from your RSS reeder.
  • Added: Filters to hide history dashboard widget and history dashboard page. Filters are simple_history/show_dashboard_widget and simple_history/show_dashboard_page.
  • Fixed: A missing argument error when deleting a plugin. Fixes https://wordpress.org/support/topic/warning-missing-argument-1-for-simplepluginlogger.
Download this release

Release Info

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

Code changes from version 2.0.22 to 2.0.23

README.md CHANGED
@@ -43,4 +43,4 @@ SimpleLogger()->debug("Ok, cron job is running!");
43
 
44
  ```
45
 
46
- You will find more examples in the [examples.php](https://github.com/bonny/WordPress-Simple-History/blob/master/examples.php) file.
43
 
44
  ```
45
 
46
+ You will find more examples in the [examples.php](https://github.com/bonny/WordPress-Simple-History/blob/master/examples/examples.php) file.
dropins/SimpleHistoryFilterDropin.php CHANGED
@@ -26,9 +26,9 @@ class SimpleHistoryFilterDropin {
26
 
27
  $file_url = plugin_dir_url(__FILE__);
28
 
29
- wp_enqueue_script("simple_history_FilterDropin", $file_url . "SimpleHistoryFilterDropin.js", array("jquery"), SimpleHistory::VERSION, true);
30
 
31
- wp_enqueue_style("simple_history_FilterDropin", $file_url . "SimpleHistoryFilterDropin.css", null, SimpleHistory::VERSION);
32
 
33
  }
34
 
26
 
27
  $file_url = plugin_dir_url(__FILE__);
28
 
29
+ wp_enqueue_script("simple_history_FilterDropin", $file_url . "SimpleHistoryFilterDropin.js", array("jquery"), SIMPLE_HISTORY_VERSION, true);
30
 
31
+ wp_enqueue_style("simple_history_FilterDropin", $file_url . "SimpleHistoryFilterDropin.css", null, SIMPLE_HISTORY_VERSION);
32
 
33
  }
34
 
dropins/SimpleHistoryIpInfoDropin.php CHANGED
@@ -29,9 +29,9 @@ class SimpleHistoryIpInfoDropin {
29
 
30
  $file_url = plugin_dir_url(__FILE__);
31
 
32
- wp_enqueue_script("simple_history_IpInfoDropin", $file_url . "SimpleHistoryIpInfoDropin.js", array("jquery"), SimpleHistory::VERSION, true);
33
 
34
- wp_enqueue_style("simple_history_IpInfoDropin", $file_url . "SimpleHistoryIpInfoDropin.css", null, SimpleHistory::VERSION);
35
 
36
  }
37
 
29
 
30
  $file_url = plugin_dir_url(__FILE__);
31
 
32
+ wp_enqueue_script("simple_history_IpInfoDropin", $file_url . "SimpleHistoryIpInfoDropin.js", array("jquery"), SIMPLE_HISTORY_VERSION, true);
33
 
34
+ wp_enqueue_style("simple_history_IpInfoDropin", $file_url . "SimpleHistoryIpInfoDropin.css", null, SIMPLE_HISTORY_VERSION);
35
 
36
  }
37
 
dropins/SimpleHistoryNewRowsNotifier.php CHANGED
@@ -31,7 +31,7 @@ class SimpleHistoryNewRowsNotifier {
31
 
32
  $file_url = plugin_dir_url(__FILE__);
33
 
34
- wp_enqueue_script("simple_history_NewRowsNotifierDropin", $file_url . "SimpleHistoryNewRowsNotifierDropin.js", array("jquery"), SimpleHistory::VERSION, true);
35
 
36
  $arr_localize_data = array(
37
  "interval" => $this->interval,
@@ -40,7 +40,7 @@ class SimpleHistoryNewRowsNotifier {
40
 
41
  wp_localize_script( "simple_history_NewRowsNotifierDropin", "simple_history_NewRowsNotifierDropin", $arr_localize_data );
42
 
43
- wp_enqueue_style( "simple_history_NewRowsNotifierDropin", $file_url . "SimpleHistoryNewRowsNotifierDropin.css", null, SimpleHistory::VERSION);
44
 
45
  }
46
 
31
 
32
  $file_url = plugin_dir_url(__FILE__);
33
 
34
+ wp_enqueue_script("simple_history_NewRowsNotifierDropin", $file_url . "SimpleHistoryNewRowsNotifierDropin.js", array("jquery"), SIMPLE_HISTORY_VERSION, true);
35
 
36
  $arr_localize_data = array(
37
  "interval" => $this->interval,
40
 
41
  wp_localize_script( "simple_history_NewRowsNotifierDropin", "simple_history_NewRowsNotifierDropin", $arr_localize_data );
42
 
43
+ wp_enqueue_style( "simple_history_NewRowsNotifierDropin", $file_url . "SimpleHistoryNewRowsNotifierDropin.css", null, SIMPLE_HISTORY_VERSION);
44
 
45
  }
46
 
dropins/SimpleHistoryRSSDropin.php CHANGED
@@ -173,14 +173,27 @@ class SimpleHistoryRSSDropin {
173
  // Remove capability override after query is done
174
  // remove_action( $action_tag, array($this, "on_can_read_single_logger") );
175
 
176
- foreach ($queryResults["log_rows"] as $row) {
177
 
178
  $header_output = $this->sh->getLogRowHeaderOutput( $row );
179
  $text_output = $this->sh->getLogRowPlainTextOutput( $row );
180
  $details_output = $this->sh->getLogRowDetailsOutput( $row );
181
- $item_guid = home_url() . "?SimpleHistoryGuid=" . $row->id;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
 
183
- #$item_title = wp_kses( $header_output . ": " . $text_output, array() );
184
  $item_title = $this->sh->getLogLevelTranslated( $row->level ) . ": " . wp_kses( $text_output, array() );
185
 
186
  $level_output = sprintf( __('Severity level: %1$s'), $this->sh->getLogLevelTranslated( $row->level ));
@@ -205,8 +218,8 @@ class SimpleHistoryRSSDropin {
205
  /* <author><?php echo $row->initiator ?></author> */
206
  ?>
207
  <pubDate><?php echo date("D, d M Y H:i:s", strtotime($row->date)) ?> GMT</pubDate>
208
- <guid isPermaLink="false"><?php echo $item_guid ?></guid>
209
- <link><?php echo $item_guid ?></link>
210
  </item>
211
  <?php
212
  /*
173
  // Remove capability override after query is done
174
  // remove_action( $action_tag, array($this, "on_can_read_single_logger") );
175
 
176
+ foreach ( $queryResults["log_rows"] as $row ) {
177
 
178
  $header_output = $this->sh->getLogRowHeaderOutput( $row );
179
  $text_output = $this->sh->getLogRowPlainTextOutput( $row );
180
  $details_output = $this->sh->getLogRowDetailsOutput( $row );
181
+
182
+ // http://cyber.law.harvard.edu/rss/rss.html#ltguidgtSubelementOfLtitemgt
183
+ //$item_guid = home_url() . "?SimpleHistoryGuid=" . $row->id;
184
+ $item_guid = add_query_arg("SimpleHistoryGuid", $row->id, home_url());
185
+ $item_link = add_query_arg("SimpleHistoryGuid", $row->id, home_url());
186
+
187
+ /**
188
+ * Filter the guid/link URL used in RSS feed
189
+ *
190
+ * @since 2.0.23
191
+ *
192
+ * @param string $item_guid
193
+ * @param array $row
194
+ */
195
+ $item_link = apply_filters("simple_history/rss_item_link", $item_link, $row);
196
 
 
197
  $item_title = $this->sh->getLogLevelTranslated( $row->level ) . ": " . wp_kses( $text_output, array() );
198
 
199
  $level_output = sprintf( __('Severity level: %1$s'), $this->sh->getLogLevelTranslated( $row->level ));
218
  /* <author><?php echo $row->initiator ?></author> */
219
  ?>
220
  <pubDate><?php echo date("D, d M Y H:i:s", strtotime($row->date)) ?> GMT</pubDate>
221
+ <guid isPermaLink="false"><![CDATA[<?php echo $item_guid ?>]]></guid>
222
+ <link><![CDATA[<?php echo $item_link ?>]]></link>
223
  </item>
224
  <?php
225
  /*
dropins/SimpleHistorySettingsStatsDropin.php CHANGED
@@ -37,7 +37,7 @@ class SimpleHistorySettingsStatsDropin {
37
  $file_url = plugin_dir_url(__FILE__);
38
 
39
  wp_enqueue_script( "google-ajax-api", "https://www.google.com/jsapi");
40
- wp_enqueue_style( "simple_history_SettingsStatsDropin", $file_url . "SimpleHistorySettingsStatsDropin.css", null, SimpleHistory::VERSION);
41
 
42
  }
43
 
@@ -67,7 +67,7 @@ class SimpleHistorySettingsStatsDropin {
67
  <!-- Overview, larger text -->
68
  <div class='SimpleHistoryStats__intro'>
69
  <?php
70
- include(__DIR__ . "/../templates/settings-statsIntro.php");
71
  ?>
72
  </div>
73
 
@@ -76,24 +76,24 @@ class SimpleHistorySettingsStatsDropin {
76
 
77
  <!-- bar chart with rows per day -->
78
  <div class='SimpleHistoryStats__graph SimpleHistoryStats__graph--rowsPerDay'>
79
- <?php include(__DIR__ . "/../templates/settings-statsRowsPerDay.php") ?>
80
  </div><!-- // end bar chart rows per day -->
81
 
82
  <div class='SimpleHistoryStats__graph SimpleHistoryStats__graph--loggersPie'>
83
- <?php include(__DIR__ . "/../templates/settings-statsLoggers.php") ?>
84
  </div>
85
 
86
  <div class='SimpleHistoryStats__graph SimpleHistoryStats__graph--logLevels'>
87
- <?php include(__DIR__ . "/../templates/settings-statsLogLevels.php") ?>
88
  </div>
89
 
90
  <div class='SimpleHistoryStats__graph SimpleHistoryStats__graph--users'>
91
- <?php include(__DIR__ . "/../templates/settings-statsUsers.php") ?>
92
  </div>
93
 
94
  <!--
95
  <div class='SimpleHistoryStats__graph SimpleHistoryStats__graph--initiators'>
96
- <?php include(__DIR__ . "/../templates/settings-statsInitiators.php") ?>
97
  </div>
98
  -->
99
 
@@ -102,7 +102,7 @@ class SimpleHistorySettingsStatsDropin {
102
 
103
  <?php
104
 
105
- include(__DIR__ . "/../templates/settings-statsForGeeks.php");
106
 
107
  }
108
 
37
  $file_url = plugin_dir_url(__FILE__);
38
 
39
  wp_enqueue_script( "google-ajax-api", "https://www.google.com/jsapi");
40
+ wp_enqueue_style( "simple_history_SettingsStatsDropin", $file_url . "SimpleHistorySettingsStatsDropin.css", null, SIMPLE_HISTORY_VERSION);
41
 
42
  }
43
 
67
  <!-- Overview, larger text -->
68
  <div class='SimpleHistoryStats__intro'>
69
  <?php
70
+ include(SIMPLE_HISTORY_PATH . "templates/settings-statsIntro.php");
71
  ?>
72
  </div>
73
 
76
 
77
  <!-- bar chart with rows per day -->
78
  <div class='SimpleHistoryStats__graph SimpleHistoryStats__graph--rowsPerDay'>
79
+ <?php include(SIMPLE_HISTORY_PATH . "templates/settings-statsRowsPerDay.php") ?>
80
  </div><!-- // end bar chart rows per day -->
81
 
82
  <div class='SimpleHistoryStats__graph SimpleHistoryStats__graph--loggersPie'>
83
+ <?php include(SIMPLE_HISTORY_PATH . "templates/settings-statsLoggers.php") ?>
84
  </div>
85
 
86
  <div class='SimpleHistoryStats__graph SimpleHistoryStats__graph--logLevels'>
87
+ <?php include(SIMPLE_HISTORY_PATH . "templates/settings-statsLogLevels.php") ?>
88
  </div>
89
 
90
  <div class='SimpleHistoryStats__graph SimpleHistoryStats__graph--users'>
91
+ <?php include(SIMPLE_HISTORY_PATH . "templates/settings-statsUsers.php") ?>
92
  </div>
93
 
94
  <!--
95
  <div class='SimpleHistoryStats__graph SimpleHistoryStats__graph--initiators'>
96
+ <?php include(SIMPLE_HISTORY_PATH . "templates/settings-statsInitiators.php") ?>
97
  </div>
98
  -->
99
 
102
 
103
  <?php
104
 
105
+ include(SIMPLE_HISTORY_PATH . "templates/settings-statsForGeeks.php");
106
 
107
  }
108
 
dropins/SimpleHistorySidebarDropin.php CHANGED
@@ -183,7 +183,7 @@ class SimpleHistorySidebarDropin {
183
 
184
  $file_url = plugin_dir_url(__FILE__);
185
 
186
- wp_enqueue_style("simple_history_SidebarDropin", $file_url . "SimpleHistorySidebarDropin.css", null, SimpleHistory::VERSION);
187
 
188
  }
189
 
183
 
184
  $file_url = plugin_dir_url(__FILE__);
185
 
186
+ wp_enqueue_style("simple_history_SidebarDropin", $file_url . "SimpleHistorySidebarDropin.css", null, SIMPLE_HISTORY_VERSION);
187
 
188
  }
189
 
inc/SimpleHistory.php CHANGED
@@ -6,7 +6,9 @@
6
  class SimpleHistory {
7
 
8
  const NAME = "Simple History";
9
- const VERSION = "2.0.22";
 
 
10
 
11
  /**
12
  * For singleton
@@ -516,7 +518,7 @@ class SimpleHistory {
516
  $this->view_settings_capability = apply_filters("simple_history_view_settings_capability", $this->view_settings_capability);
517
  $this->view_settings_capability = apply_filters("simple_history/view_settings_capability", $this->view_settings_capability);
518
 
519
- $this->plugin_basename = plugin_basename(__DIR__ . "/../index.php");
520
 
521
  }
522
 
@@ -564,7 +566,7 @@ class SimpleHistory {
564
  */
565
  public function loadLoggers() {
566
 
567
- $loggersDir = __DIR__ . "/../loggers/";
568
 
569
  /**
570
  * Filter the directory to load loggers from
@@ -690,8 +692,6 @@ class SimpleHistory {
690
 
691
  do_action("simple_history/loggers_loaded");
692
 
693
- #sf_d($this->instantiatedLoggers);exit;
694
-
695
  }
696
 
697
  /**
@@ -700,7 +700,7 @@ class SimpleHistory {
700
  */
701
  public function loadDropins() {
702
 
703
- $dropinsDir = __DIR__ . "/../dropins/";
704
 
705
  /**
706
  * Filter the directory to load loggers from
@@ -836,9 +836,20 @@ class SimpleHistory {
836
  */
837
  function add_dashboard_widget() {
838
 
839
- if ($this->setting_show_on_dashboard() && current_user_can($this->view_history_capability)) {
840
 
841
- wp_add_dashboard_widget("simple_history_dashboard_widget", __("Simple History", 'simple-history'), array($this, "dashboard_widget_output"));
 
 
 
 
 
 
 
 
 
 
 
842
 
843
  }
844
  }
@@ -905,9 +916,10 @@ class SimpleHistory {
905
 
906
  add_thickbox();
907
 
908
- $plugin_url = plugin_dir_url(__DIR__ . "/../index.php");
909
- wp_enqueue_style("simple_history_styles", $plugin_url . "css/styles.css", false, SimpleHistory::VERSION);
910
- wp_enqueue_script("simple_history_script", $plugin_url . "js/scripts.js", array("jquery", "backbone", "wp-util"), SimpleHistory::VERSION, true);
 
911
 
912
  wp_enqueue_script("select2", $plugin_url . "/js/select2/select2.min.js", array("jquery"));
913
  wp_enqueue_style("select2", $plugin_url . "/js/select2/select2.css");
@@ -1259,19 +1271,19 @@ foreach ($arr_settings_tabs as $one_tab) {
1259
 
1260
  public function settings_output_log() {
1261
 
1262
- include __DIR__ . "/../templates/settings-log.php";
1263
 
1264
  }
1265
 
1266
  public function settings_output_general() {
1267
 
1268
- include __DIR__ . "/../templates/settings-general.php";
1269
 
1270
  }
1271
 
1272
  public function settings_output_styles_example() {
1273
 
1274
- include __DIR__ . "/../templates/settings-style-example.php";
1275
 
1276
  }
1277
 
@@ -1289,23 +1301,37 @@ foreach ($arr_settings_tabs as $one_tab) {
1289
  function add_admin_pages() {
1290
 
1291
  // Add a history page as a sub-page below the Dashboard menu item
1292
- if ($this->setting_show_as_page()) {
1293
 
1294
- add_dashboard_page(
1295
- SimpleHistory::NAME,
1296
- _x("Simple History", 'dashboard menu name', 'simple-history'),
1297
- $this->view_history_capability,
1298
- "simple_history_page",
1299
- array($this, "history_page_output")
1300
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
1301
 
1302
  }
1303
 
1304
  // Add a settings page
1305
  $show_settings_page = true;
1306
  $show_settings_page = apply_filters("simple_history_show_settings_page", $show_settings_page);
1307
- $show_settings_page = apply_filters("simple_history/show_settings_page", $show_settings_page);
1308
- if ($show_settings_page) {
 
1309
 
1310
  add_options_page(
1311
  __('Simple History Settings', "simple-history"),
@@ -1560,6 +1586,12 @@ foreach ($arr_settings_tabs as $one_tab) {
1560
 
1561
  $days = 60;
1562
 
 
 
 
 
 
 
1563
  $days = (int) apply_filters("simple_history_db_purge_days_interval", $days);
1564
  $days = (int) apply_filters("simple_history/db_purge_days_interval", $days);
1565
 
6
  class SimpleHistory {
7
 
8
  const NAME = "Simple History";
9
+
10
+ // Dont use this any more! Will be removed in future versions. Use global SIMPLE_HISTORY_VERSION instead.
11
+ const VERSION = "2.0.23";
12
 
13
  /**
14
  * For singleton
518
  $this->view_settings_capability = apply_filters("simple_history_view_settings_capability", $this->view_settings_capability);
519
  $this->view_settings_capability = apply_filters("simple_history/view_settings_capability", $this->view_settings_capability);
520
 
521
+ $this->plugin_basename = SIMPLE_HISTORY_BASENAME;
522
 
523
  }
524
 
566
  */
567
  public function loadLoggers() {
568
 
569
+ $loggersDir = SIMPLE_HISTORY_PATH . "loggers/";
570
 
571
  /**
572
  * Filter the directory to load loggers from
692
 
693
  do_action("simple_history/loggers_loaded");
694
 
 
 
695
  }
696
 
697
  /**
700
  */
701
  public function loadDropins() {
702
 
703
+ $dropinsDir = SIMPLE_HISTORY_PATH . "dropins/";
704
 
705
  /**
706
  * Filter the directory to load loggers from
836
  */
837
  function add_dashboard_widget() {
838
 
839
+ if ( $this->setting_show_on_dashboard() && current_user_can( $this->view_history_capability ) ) {
840
 
841
+ /**
842
+ * Filter to determine if history page should be added to page below dashboard or not
843
+ *
844
+ * @since 2.0.23
845
+ *
846
+ * @param bool Show the page or not
847
+ */
848
+ $show_dashboard_widget = apply_filters("simple_history/show_dashboard_widget", true);
849
+
850
+ if ( $show_dashboard_widget ) {
851
+ wp_add_dashboard_widget("simple_history_dashboard_widget", __("Simple History", 'simple-history'), array($this, "dashboard_widget_output"));
852
+ }
853
 
854
  }
855
  }
916
 
917
  add_thickbox();
918
 
919
+ $plugin_url = plugin_dir_url(SIMPLE_HISTORY_BASENAME);
920
+
921
+ wp_enqueue_style("simple_history_styles", $plugin_url . "css/styles.css", false, SIMPLE_HISTORY_VERSION);
922
+ wp_enqueue_script("simple_history_script", $plugin_url . "js/scripts.js", array("jquery", "backbone", "wp-util"), SIMPLE_HISTORY_VERSION, true);
923
 
924
  wp_enqueue_script("select2", $plugin_url . "/js/select2/select2.min.js", array("jquery"));
925
  wp_enqueue_style("select2", $plugin_url . "/js/select2/select2.css");
1271
 
1272
  public function settings_output_log() {
1273
 
1274
+ include SIMPLE_HISTORY_PATH . "templates/settings-log.php";
1275
 
1276
  }
1277
 
1278
  public function settings_output_general() {
1279
 
1280
+ include SIMPLE_HISTORY_PATH . "templates/settings-general.php";
1281
 
1282
  }
1283
 
1284
  public function settings_output_styles_example() {
1285
 
1286
+ include SIMPLE_HISTORY_PATH . "templates/settings-style-example.php";
1287
 
1288
  }
1289
 
1301
  function add_admin_pages() {
1302
 
1303
  // Add a history page as a sub-page below the Dashboard menu item
1304
+ if ( $this->setting_show_as_page() ) {
1305
 
1306
+ /**
1307
+ * Filter to determine if history page should be added to page below dashboard or not
1308
+ *
1309
+ * @since 2.0.23
1310
+ *
1311
+ * @param bool Show the page or not
1312
+ */
1313
+ $show_dashboard_page = apply_filters("simple_history/show_dashboard_page", true);
1314
+
1315
+ if ( $show_dashboard_page ) {
1316
+
1317
+ add_dashboard_page(
1318
+ SimpleHistory::NAME,
1319
+ _x("Simple History", 'dashboard menu name', 'simple-history'),
1320
+ $this->view_history_capability,
1321
+ "simple_history_page",
1322
+ array($this, "history_page_output")
1323
+ );
1324
+
1325
+ }
1326
 
1327
  }
1328
 
1329
  // Add a settings page
1330
  $show_settings_page = true;
1331
  $show_settings_page = apply_filters("simple_history_show_settings_page", $show_settings_page);
1332
+ $show_settings_page = apply_filters("simple_history/show_settings_page", $show_settings_page);
1333
+
1334
+ if ( $show_settings_page ) {
1335
 
1336
  add_options_page(
1337
  __('Simple History Settings', "simple-history"),
1586
 
1587
  $days = 60;
1588
 
1589
+ /**
1590
+ * Filter to modify number of days of history to keep.
1591
+ * Default is 60 days.
1592
+ *
1593
+ * @param $days Number of days of history to keep
1594
+ */
1595
  $days = (int) apply_filters("simple_history_db_purge_days_interval", $days);
1596
  $days = (int) apply_filters("simple_history/db_purge_days_interval", $days);
1597
 
index.php CHANGED
@@ -3,13 +3,13 @@
3
  Plugin Name: Simple History
4
  Plugin URI: http://simple-history.com
5
  Description: Plugin that logs various things that occur in WordPress and then presents those events in a very nice GUI.
6
- Version: 2.0.22
7
  Author: Pär Thernström
8
  Author URI: http://simple-history.com/
9
  License: GPL2
10
  */
11
 
12
- /* Copyright 2014 Pär Thernström (email: par.thernstrom@gmail.com)
13
 
14
  This program is free software; you can redistribute it and/or modify
15
  it under the terms of the GNU General Public License, version 2, as
@@ -42,6 +42,22 @@ if ( version_compare( phpversion(), "5.3", ">=") ) {
42
  */
43
  // register_activation_hook( trailingslashit(WP_PLUGIN_DIR) . trailingslashit( plugin_basename(__DIR__) ) . "index.php" , array("SimpleHistory", "on_plugin_activate" ) );
44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  /** Boot up */
46
  SimpleHistory::get_instance();
47
 
3
  Plugin Name: Simple History
4
  Plugin URI: http://simple-history.com
5
  Description: Plugin that logs various things that occur in WordPress and then presents those events in a very nice GUI.
6
+ Version: 2.0.23
7
  Author: Pär Thernström
8
  Author URI: http://simple-history.com/
9
  License: GPL2
10
  */
11
 
12
+ /* Copyright 2015 Pär Thernström (email: par.thernstrom@gmail.com)
13
 
14
  This program is free software; you can redistribute it and/or modify
15
  it under the terms of the GNU General Public License, version 2, as
42
  */
43
  // register_activation_hook( trailingslashit(WP_PLUGIN_DIR) . trailingslashit( plugin_basename(__DIR__) ) . "index.php" , array("SimpleHistory", "on_plugin_activate" ) );
44
 
45
+ define( 'SIMPLE_HISTORY_VERSION', '2.0.23' );
46
+
47
+ define( 'SIMPLE_HISTORY_FILE', __FILE__ );
48
+ define( 'SIMPLE_HISTORY_PATH', plugin_dir_path( SIMPLE_HISTORY_FILE ) );
49
+ define( 'SIMPLE_HISTORY_BASENAME', plugin_basename( SIMPLE_HISTORY_FILE ) );
50
+
51
+ // Constants will be like:
52
+ /*
53
+ SIMPLE_HISTORY_FILE:
54
+ Var is string with length 57: /Users/username/GIT/Simple-History/index.php
55
+ SIMPLE_HISTORY_PATH:
56
+ Var is string with length 48: /Users/username/GIT/Simple-History/
57
+ SIMPLE_HISTORY_BASENAME:
58
+ Var is string with length 24: simple-history/index.php
59
+ */
60
+
61
  /** Boot up */
62
  SimpleHistory::get_instance();
63
 
loggers/SimpleMediaLogger.php CHANGED
@@ -50,7 +50,9 @@ class SimpleMediaLogger extends SimpleLogger
50
 
51
  add_action("admin_init", array($this, "on_admin_init"));
52
 
53
- add_action( 'xmlrpc_call_success_mw_newMediaObject', array($this, "on_mw_newMediaObject"), 10, 2 );
 
 
54
 
55
  }
56
 
@@ -333,4 +335,31 @@ class SimpleMediaLogger extends SimpleLogger
333
 
334
  }
335
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
336
  }
50
 
51
  add_action("admin_init", array($this, "on_admin_init"));
52
 
53
+ add_action("xmlrpc_call_success_mw_newMediaObject", array($this, "on_mw_newMediaObject"), 10, 2);
54
+
55
+ add_filter("simple_history/rss_item_link", array($this, "filter_rss_item_link"), 10, 2);
56
 
57
  }
58
 
335
 
336
  }
337
 
338
+ /**
339
+ * Modify RSS links to they go directly to the correct media in wp admin
340
+ *
341
+ * @since 2.0.23
342
+ * @param string $link
343
+ * @param array $row
344
+ */
345
+ public function filter_rss_item_link($link, $row) {
346
+
347
+ if ( $row->logger != $this->slug ) {
348
+ return $link;
349
+ }
350
+
351
+ if ( isset( $row->context["attachment_id"] ) ) {
352
+
353
+ $permalink = add_query_arg(array("action" => "edit", "post" => $row->context["attachment_id"]), admin_url( "post.php" ) );
354
+
355
+ if ( $permalink ) {
356
+ $link = $permalink;
357
+ }
358
+
359
+ }
360
+
361
+ return $link;
362
+
363
+ }
364
+
365
  }
loggers/SimplePluginLogger.php CHANGED
@@ -194,7 +194,7 @@ class SimplePluginLogger extends SimpleLogger
194
  * Saves info about all installed plugins to an option.
195
  * When we are done logging then we remove the option.
196
  */
197
- function save_versions_before_update($bool, $hook_extra) {
198
 
199
  $plugins = get_plugins();
200
 
194
  * Saves info about all installed plugins to an option.
195
  * When we are done logging then we remove the option.
196
  */
197
+ function save_versions_before_update($bool = null, $hook_extra = null) {
198
 
199
  $plugins = get_plugins();
200
 
loggers/SimplePostLogger.php CHANGED
@@ -84,6 +84,8 @@ class SimplePostLogger extends SimpleLogger
84
 
85
  $this->add_xml_rpc_hooks();
86
 
 
 
87
  }
88
 
89
  /**
@@ -472,4 +474,31 @@ class SimplePostLogger extends SimpleLogger
472
 
473
  }
474
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
475
  }
84
 
85
  $this->add_xml_rpc_hooks();
86
 
87
+ add_filter("simple_history/rss_item_link", array($this, "filter_rss_item_link"), 10, 2);
88
+
89
  }
90
 
91
  /**
474
 
475
  }
476
 
477
+ /**
478
+ * Modify RSS links to they go directly to the correct post in wp admin
479
+ *
480
+ * @since 2.0.23
481
+ * @param string $link
482
+ * @param array $row
483
+ */
484
+ public function filter_rss_item_link($link, $row) {
485
+
486
+ if ( $row->logger != $this->slug ) {
487
+ return $link;
488
+ }
489
+
490
+ if ( isset( $row->context["post_id"] ) ) {
491
+
492
+ $permalink = add_query_arg(array("action" => "edit", "post" => $row->context["post_id"]), admin_url( "post.php" ) );
493
+
494
+ if ( $permalink ) {
495
+ $link = $permalink;
496
+ }
497
+
498
+ }
499
+
500
+ return $link;
501
+
502
+ }
503
+
504
  }
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.1
7
- Stable tag: 2.0.22
8
 
9
  View changes made by users within WordPress. See who created a page, uploaded an attachment or approved an comment, and more.
10
 
@@ -38,6 +38,8 @@ There is also a **RSS feed of changes** available, so you can keep track of the
38
  It’s a plugin that is good to have on websites where several people are
39
  involved in editing the content.
40
 
 
 
41
  #### Example scenarios
42
 
43
  Keep track of what other people are doing:
@@ -111,10 +113,17 @@ initiated by a specific user.
111
 
112
  == Changelog ==
113
 
 
 
 
 
 
 
 
114
  = 2.0.22 (February 2015) =
115
 
116
  - Fixed: Deleted plugins were not logged correctly (name and other info was missing).
117
- - Added: Filter `simple_history/logger/load_logger` and `simple_history/dropin/load_dropin` that can be used to control the loading of each logger or dropin. See [example file](https://github.com/bonny/WordPress-Simple-History/blob/master/examples.php) for usage examples.
118
  - Fixed: modal window with context data now works better on small screens.
119
  - Changed: Misc internal changes.
120
 
@@ -132,7 +141,7 @@ initiated by a specific user.
132
  - Added: changes via [WP-CLI](http://wp-cli.org) is now detected (was previously shown as "other").
133
  - Added: severity level (info, warning, debug, etc.) of event is includes in the RSS output.
134
  - Changed the way user login is logged. Should fix https://github.com/bonny/WordPress-Simple-History/issues/40 + possible more related issues.
135
- - Added: filter `simple_history/simple_logger/log_message_key` added, that can be used to shortcut log messages. See [example file](https://github.com/bonny/WordPress-Simple-History/blob/master/examples.php) for usage. Fixes https://wordpress.org/support/topic/stop-logging-certain-types-of-activity.
136
  - Added: now uses object caching at some places. Should speed up some parts of the plugin for users with caching enabled.
137
  - Fixed: IP info popup can now be closed with `esc`.
138
  - Fixed: works better on small screens (like mobile phones) + misc other style related fixes.
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.1
7
+ Stable tag: 2.0.23
8
 
9
  View changes made by users within WordPress. See who created a page, uploaded an attachment or approved an comment, and more.
10
 
38
  It’s a plugin that is good to have on websites where several people are
39
  involved in editing the content.
40
 
41
+ The plugin works fine on [multisite installations of WordPress](http://codex.wordpress.org/Glossary#Multisite) too.
42
+
43
  #### Example scenarios
44
 
45
  Keep track of what other people are doing:
113
 
114
  == Changelog ==
115
 
116
+ = 2.0.23 =
117
+
118
+ - Added: Filter `simple_history/rss_item_link`, so plugins can modify the link used in the RSS feed.
119
+ - Added: Links for changed posts and attachments in RSS feed now links directly to WordPress admin, making is easier to follow things from your RSS reeder.
120
+ - Added: Filters to hide history dashboard widget and history dashboard page. Filters are `simple_history/show_dashboard_widget` and `simple_history/show_dashboard_page`.
121
+ - Fixed: A missing argument error when deleting a plugin. Fixes https://wordpress.org/support/topic/warning-missing-argument-1-for-simplepluginlogger.
122
+
123
  = 2.0.22 (February 2015) =
124
 
125
  - Fixed: Deleted plugins were not logged correctly (name and other info was missing).
126
+ - Added: Filter `simple_history/logger/load_logger` and `simple_history/dropin/load_dropin` that can be used to control the loading of each logger or dropin. See [example file](https://github.com/bonny/WordPress-Simple-History/blob/master/examples/examples.php) for usage examples.
127
  - Fixed: modal window with context data now works better on small screens.
128
  - Changed: Misc internal changes.
129
 
141
  - Added: changes via [WP-CLI](http://wp-cli.org) is now detected (was previously shown as "other").
142
  - Added: severity level (info, warning, debug, etc.) of event is includes in the RSS output.
143
  - Changed the way user login is logged. Should fix https://github.com/bonny/WordPress-Simple-History/issues/40 + possible more related issues.
144
+ - Added: filter `simple_history/simple_logger/log_message_key` added, that can be used to shortcut log messages. See [example file](https://github.com/bonny/WordPress-Simple-History/blob/master/examples/examples.php) for usage. Fixes https://wordpress.org/support/topic/stop-logging-certain-types-of-activity.
145
  - Added: now uses object caching at some places. Should speed up some parts of the plugin for users with caching enabled.
146
  - Fixed: IP info popup can now be closed with `esc`.
147
  - Fixed: works better on small screens (like mobile phones) + misc other style related fixes.