Simple History - Version 2.0.26

Version Description

  • Fixed: Plugin installs from wordpress.org would show "wordpress plugin directory" as their source file. Looked stupid. Fixed now!
  • Added: composer.json added, so Simple History can be pulled in to other projects via Composer. Actually untested, but at least the file is there. Please let me know if it works! :)
Download this release

Release Info

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

Code changes from version 2.0.25 to 2.0.26

README.md CHANGED
@@ -3,7 +3,7 @@
3
  Simple History is a WordPress plugin that logs various things that occur in WordPress and then presents those events in a very nice GUI.
4
 
5
  Download from WordPress.org:
6
- http://wordpress.org/extend/plugins/simple-history/
7
 
8
  # Screenshots
9
 
3
  Simple History is a WordPress plugin that logs various things that occur in WordPress and then presents those events in a very nice GUI.
4
 
5
  Download from WordPress.org:
6
+ https://wordpress.org/plugins/simple-history/
7
 
8
  # Screenshots
9
 
composer.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "bonny/WordPress-Simple-History/",
3
+ "type": "wordpress-plugin",
4
+ "minimum-stability": "dev",
5
+ "require-dev": {},
6
+ "require": {},
7
+ "version": "2.0.25",
8
+ "dist": {
9
+ "url": "https://downloads.wordpress.org/plugin/simple-history.2.0.25.zip",
10
+ "type": "zip"
11
+ }
12
+ }
examples/examples.php CHANGED
@@ -16,6 +16,26 @@ define("SIMPLE_HISTORY_LOG_DEBUG", true);
16
  * Some examples of filter usage and so on
17
  */
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
 
21
  // Skip loading of loggers
16
  * Some examples of filter usage and so on
17
  */
18
 
19
+ // Allow only the users specified in $allowed_users to show the history page, the history widget on the dashboard, or the history settings page
20
+ add_filter("simple_history/show_dashboard_page", "function_show_history_dashboard_or_page");
21
+ add_filter("simple_history/show_dashboard_widget", "function_show_history_dashboard_or_page");
22
+ add_filter("simple_history/show_settings_page", "function_show_history_dashboard_or_page");
23
+ function function_show_history_dashboard_or_page($show) {
24
+
25
+ $allowed_users = array(
26
+ "user1@example.com",
27
+ "anotheruser@example.com"
28
+ );
29
+
30
+ $user = wp_get_current_user();
31
+
32
+ if ( ! in_array( $user->user_email, $allowed_users ) ) {
33
+ $show = false;
34
+ }
35
+
36
+ return $show;
37
+
38
+ }
39
 
40
 
41
  // Skip loading of loggers
inc/SimpleHistory.php CHANGED
@@ -10,7 +10,7 @@ class SimpleHistory {
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.0.25";
14
 
15
  /**
16
  * For singleton
@@ -583,7 +583,7 @@ class SimpleHistory {
583
  $loggersFiles = glob($loggersDir . "*.php");
584
 
585
  // SimpleLogger.php must be loaded first since the other loggers extend it
586
- require_once $loggersDir . "SimpleLogger.php";
587
 
588
  /**
589
  * Filter the array with absolute paths to files as returned by glob function.
@@ -618,15 +618,7 @@ class SimpleHistory {
618
  continue;
619
  }
620
 
621
- if ( basename( $oneLoggerFile ) == "SimpleLogger.php") {
622
-
623
- // SimpleLogger is already loaded
624
-
625
- } else {
626
-
627
- include_once $oneLoggerFile;
628
-
629
- }
630
 
631
  $arrLoggersToInstantiate[] = $basename_no_suffix;
632
 
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.0.26";
14
 
15
  /**
16
  * For singleton
583
  $loggersFiles = glob($loggersDir . "*.php");
584
 
585
  // SimpleLogger.php must be loaded first since the other loggers extend it
586
+ include_once $loggersDir . "SimpleLogger.php";
587
 
588
  /**
589
  * Filter the array with absolute paths to files as returned by glob function.
618
  continue;
619
  }
620
 
621
+ include_once $oneLoggerFile;
 
 
 
 
 
 
 
 
622
 
623
  $arrLoggersToInstantiate[] = $basename_no_suffix;
624
 
index.php CHANGED
@@ -3,7 +3,7 @@
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.24
7
  Author: Pär Thernström
8
  Author URI: http://simple-history.com/
9
  License: GPL2
@@ -42,7 +42,7 @@ 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
- define( 'SIMPLE_HISTORY_VERSION', '2.0.25' );
46
 
47
  define( 'SIMPLE_HISTORY_FILE', __FILE__ );
48
  define( 'SIMPLE_HISTORY_PATH', plugin_dir_path( SIMPLE_HISTORY_FILE ) );
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.26
7
  Author: Pär Thernström
8
  Author URI: http://simple-history.com/
9
  License: GPL2
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.26' );
46
 
47
  define( 'SIMPLE_HISTORY_FILE', __FILE__ );
48
  define( 'SIMPLE_HISTORY_PATH', plugin_dir_path( SIMPLE_HISTORY_FILE ) );
loggers/SimplePluginLogger.php CHANGED
@@ -240,8 +240,7 @@ class SimplePluginLogger extends SimpleLogger
240
  %3$s
241
 
242
  </style>
243
- <!-- <base href="%1$s/blob/master/"> -->
244
-
245
 
246
  <header class="repo-info">
247
  %1$s
@@ -253,7 +252,8 @@ class SimplePluginLogger extends SimpleLogger
253
  ',
254
  $repo_info,
255
  $response_body,
256
- $github_markdown_css
 
257
  );
258
 
259
  #echo($response_body);
@@ -1090,7 +1090,9 @@ class SimplePluginLogger extends SimpleLogger
1090
 
1091
  foreach ( $arr_plugin_keys as $key => $desc ) {
1092
 
1093
- switch ($key) {
 
 
1094
 
1095
  case "plugin_downloaded":
1096
  $desc_output = esc_html( number_format_i18n( (int) $context[ $key ] ) );
@@ -1147,6 +1149,10 @@ class SimplePluginLogger extends SimpleLogger
1147
  break;
1148
  }
1149
 
 
 
 
 
1150
  $output .= sprintf(
1151
  '
1152
  <tr>
240
  %3$s
241
 
242
  </style>
243
+ <!-- <base href="%4$s/blob/master/"> -->
 
244
 
245
  <header class="repo-info">
246
  %1$s
252
  ',
253
  $repo_info,
254
  $response_body,
255
+ $github_markdown_css,
256
+ esc_url( $repo ) // 4
257
  );
258
 
259
  #echo($response_body);
1090
 
1091
  foreach ( $arr_plugin_keys as $key => $desc ) {
1092
 
1093
+ $desc_output = "";
1094
+
1095
+ switch ( $key ) {
1096
 
1097
  case "plugin_downloaded":
1098
  $desc_output = esc_html( number_format_i18n( (int) $context[ $key ] ) );
1149
  break;
1150
  }
1151
 
1152
+ if ( ! trim( $desc_output ) ) {
1153
+ continue;
1154
+ }
1155
+
1156
  $output .= sprintf(
1157
  '
1158
  <tr>
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.25
8
 
9
  View changes made by users within WordPress. See who created a page, uploaded an attachment or approved an comment, and more.
10
 
@@ -115,6 +115,11 @@ initiated by a specific user.
115
 
116
  ## Changelog
117
 
 
 
 
 
 
118
  = 2.0.25 =
119
 
120
  - Added: Plugin installs now shows the source of the plugin. Supported sources are "WordPress plugin repository" and "uploaded ZIP archives".
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.26
8
 
9
  View changes made by users within WordPress. See who created a page, uploaded an attachment or approved an comment, and more.
10
 
115
 
116
  ## Changelog
117
 
118
+ = 2.0.26 =
119
+
120
+ - Fixed: Plugin installs from wordpress.org would show "wordpress plugin directory" as their source file. Looked stupid. Fixed now!
121
+ - Added: `composer.json` added, so Simple History can be pulled in to other projects via [Composer](https://getcomposer.org/). Actually untested, but at least the file is there. Please let me know if it works! :)
122
+
123
  = 2.0.25 =
124
 
125
  - Added: Plugin installs now shows the source of the plugin. Supported sources are "WordPress plugin repository" and "uploaded ZIP archives".