Simple History - Version 1.3.8

Version Description

  • Added filter for rss feed: simple_history/rss_feed_show. Fixes more things in this thread: http://wordpress.org/support/topic/more-rss-feed-items.
Download this release

Release Info

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

Code changes from version 1.3.7 to 1.3.8

Files changed (3) hide show
  1. index.php +8 -2
  2. log-tests.php +119 -0
  3. readme.txt +5 -2
index.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Simple History
4
  Plugin URI: http://eskapism.se/code-playground/simple-history/
5
  Description: Get a log/history/audit log/version history of the changes made by users in WordPress.
6
- Version: 1.3.7
7
  Author: Pär Thernström
8
  Author URI: http://eskapism.se/
9
  License: GPL2
@@ -27,7 +27,7 @@ License: GPL2
27
 
28
  load_plugin_textdomain('simple-history', false, "/simple-history/languages");
29
 
30
- define( "SIMPLE_HISTORY_VERSION", "1.3.7");
31
  define( "SIMPLE_HISTORY_NAME", "Simple History");
32
 
33
  // Find the plugin directory URL
@@ -418,6 +418,12 @@ define("SIMPLE_HISTORY_URL", $plugin_dir_url);
418
  die();
419
  }
420
 
 
 
 
 
 
 
421
  header ("Content-Type:text/xml");
422
  echo '<?xml version="1.0" encoding="UTF-8"?>';
423
  $self_link = simple_history_get_rss_address();
3
  Plugin Name: Simple History
4
  Plugin URI: http://eskapism.se/code-playground/simple-history/
5
  Description: Get a log/history/audit log/version history of the changes made by users in WordPress.
6
+ Version: 1.3.8
7
  Author: Pär Thernström
8
  Author URI: http://eskapism.se/
9
  License: GPL2
27
 
28
  load_plugin_textdomain('simple-history', false, "/simple-history/languages");
29
 
30
+ define( "SIMPLE_HISTORY_VERSION", "1.3.8");
31
  define( "SIMPLE_HISTORY_NAME", "Simple History");
32
 
33
  // Find the plugin directory URL
418
  die();
419
  }
420
 
421
+ $rss_show = true;
422
+ $rss_show = apply_filters("simple_history/rss_feed_show", $rss_show);
423
+ if( ! $rss_show ) {
424
+ wp_die( 'Nothing here.' );
425
+ }
426
+
427
  header ("Content-Type:text/xml");
428
  echo '<?xml version="1.0" encoding="UTF-8"?>';
429
  $self_link = simple_history_get_rss_address();
log-tests.php ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ return;
3
+ //*
4
+
5
+ /*
6
+ SimpleLogger()->info("This is a message sent to the log");
7
+
8
+ // Second log entry with same info will make these two become an occasionGroup,
9
+ // collapsing their entries into one expandable log item
10
+ SimpleLogger()->info("This is a message sent to the log");
11
+
12
+ // Log entries can be of different severity
13
+ SimpleLogger()->info("User admin edited page 'About our company'");
14
+ SimpleLogger()->warning("User 'Jessie' deleted user 'Kim'");
15
+ SimpleLogger()->debug("Ok, cron job is running!");
16
+ */
17
+
18
+ // Log entries can have placeholders and context
19
+ // This makes log entried translatable and filterable
20
+ for ($i = 0; $i < rand(1, 50); $i++) {
21
+ SimpleLogger()->notice(
22
+ "User {username} edited page {pagename}",
23
+ array(
24
+ "username" => "bonnyerden",
25
+ "pagename" => "My test page",
26
+ "_initiator" => SimpleLoggerLogInitiators::WP_USER,
27
+ "_user_id" => rand(1,20),
28
+ "_user_login" => "loginname" . rand(1,20),
29
+ "_user_email" => "user" . rand(1,20) . "@example.com"
30
+ )
31
+ );
32
+ }
33
+ #return;
34
+
35
+ // Log entried can have custom occasionsID
36
+ // This will group items together and a log entry will only be shown once
37
+ // in the log overview
38
+ for ($i = 0; $i < rand(1, 50); $i++) {
39
+ SimpleLogger()->notice("User {username} edited page {pagename}", array(
40
+ "username" => "admin",
41
+ "pagename" => "My test page",
42
+ "_occasionsID" => "username:1,postID:24884,action:edited"
43
+ ));
44
+ }
45
+
46
+ // Add more data to context array. Data can be used later on to show detailed info about a log entry.
47
+ SimpleLogger()->notice("Edited product {pagename}", array(
48
+ "pagename" => "We are hiring!",
49
+ "_postType" => "product",
50
+ "_userID" => 1,
51
+ "_userLogin" => "jessie",
52
+ "_userEmail" => "jessie@example.com",
53
+ "_occasionsID" => "username:1,postID:24885,action:edited"
54
+ ));
55
+
56
+ for ($i = 0; $i < rand(50,1000); $i++) {
57
+ SimpleLogger()->info('User "{user_login}" failed to login because they did not enter a correct password', array(
58
+ "user_login" => "admin",
59
+ "_userID" => null
60
+ ));
61
+ }
62
+
63
+ // Test logging both inside and outside init-hook
64
+ // To make sure it works regardless of wp_get_current_user is avaialble or not
65
+ SimpleLogger()->warning("This is a warning log entry before init");
66
+ SimpleLogger()->error("This is an error log entry before init");
67
+ SimpleLogger()->debug("This is a debug log entry before init");
68
+
69
+ add_action("init", function() {
70
+
71
+ SimpleLogger()->warning("This is a warning log entry (after init)");
72
+ SimpleLogger()->error("This is an error log entry (after init)");
73
+ SimpleLogger()->debug("This is a debug log entry (after init)");
74
+
75
+
76
+ SimpleLogger()->info(
77
+ "WordPress updated itself from version {from_version} to {to_version}",
78
+ array(
79
+ "from_version" => "3.8",
80
+ "to_version" => "3.8.1",
81
+ "_initiator" => SimpleLoggerLogInitiators::WORDPRESS
82
+ )
83
+ );
84
+
85
+ SimpleLogger()->info(
86
+ "Plugin {plugin_name} was updated from version {plugin_from_version} to version {plugin_to_version}",
87
+ array(
88
+ "plugin_name" => "CMS Tree Page View",
89
+ "plugin_from_version" => "4.0",
90
+ "plugin_to_version" => "4.2",
91
+ "_initiator" => SimpleLoggerLogInitiators::WORDPRESS
92
+ )
93
+ );
94
+
95
+ SimpleLogger()->info(
96
+ "Updated plugin {plugin_name} from version {plugin_from_version} to version {plugin_to_version}",
97
+ array(
98
+ "plugin_name" => "Simple Fields",
99
+ "plugin_from_version" => "1.3.7",
100
+ "plugin_to_version" => "1.3.8",
101
+ "_initiator" => SimpleLoggerLogInitiators::WP_USER
102
+ )
103
+ );
104
+
105
+ SimpleLogger()->info(
106
+ "Updated plugin {plugin_name} from version {plugin_from_version} to version {plugin_to_version}",
107
+ array(
108
+ "plugin_name" => "Ninja Forms",
109
+ "plugin_from_version" => "1.1",
110
+ "plugin_to_version" => "1.1.2",
111
+ "_initiator" => SimpleLoggerLogInitiators::WP_USER
112
+ )
113
+ );
114
+
115
+ });
116
+
117
+
118
+
119
+ //*/
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: eskapism, MarsApril, Offereins
3
  Donate link: http://eskapism.se/sida/donate/
4
  Tags: history, log, changes, changelog, audit, trail, pages, attachments, users, cms, dashboard, admin, syslog
5
  Requires at least: 3.8.0
6
- Tested up to: 3.8.1
7
- Stable tag: 1.3.7
8
 
9
  View changes made by users within WordPress. See who created a page, uploaded an attachment or approved an comment, and more.
10
 
@@ -175,6 +175,9 @@ to only use the secret RSS feed to keep track of the changes on you web site/Wor
175
 
176
  == Changelog ==
177
 
 
 
 
178
  = 1.3.7 =
179
  - Added filter for rss feed: `simple_history/rss_feed_args`. Fixes http://wordpress.org/support/topic/more-rss-feed-items.
180
 
3
  Donate link: http://eskapism.se/sida/donate/
4
  Tags: history, log, changes, changelog, audit, trail, pages, attachments, users, cms, dashboard, admin, syslog
5
  Requires at least: 3.8.0
6
+ Tested up to: 3.9.1
7
+ Stable tag: 1.3.8
8
 
9
  View changes made by users within WordPress. See who created a page, uploaded an attachment or approved an comment, and more.
10
 
175
 
176
  == Changelog ==
177
 
178
+ = 1.3.8 =
179
+ - Added filter for rss feed: `simple_history/rss_feed_show`. Fixes more things in this thread: http://wordpress.org/support/topic/more-rss-feed-items.
180
+
181
  = 1.3.7 =
182
  - Added filter for rss feed: `simple_history/rss_feed_args`. Fixes http://wordpress.org/support/topic/more-rss-feed-items.
183