Simple History - Version 0.6

Version Description

  • Changed widget name to just "History" instead of "Simple History". Keep it simple. Previous name implied there also was an "Advanced History" somewhere.
  • Made the widget look a bit WordPress-ish by borrwing some of the looks from the comments widget.
  • Fix for database that didn't use UTF-8 (sorry international users!)
  • Some security fixes
  • Updated POT-file
Download this release

Release Info

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

Code changes from version 0.5 to 0.6

Files changed (4) hide show
  1. index.php +264 -237
  2. languages/simple-history.pot +159 -58
  3. readme.txt +10 -3
  4. styles.css +8 -8
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: 0.5
7
  Author: Pär Thernström
8
  Author URI: http://eskapism.se/
9
  License: GPL2
@@ -27,214 +27,264 @@ License: GPL2
27
 
28
  load_plugin_textdomain('simple-history', false, "/simple-history/languages");
29
 
30
- define( "SIMPLE_HISTORY_VERSION", "0.4");
31
  define( "SIMPLE_HISTORY_NAME", "Simple History");
32
  define( "SIMPLE_HISTORY_URL", WP_PLUGIN_URL . '/simple-history/');
33
 
34
- add_action( 'admin_head', "simple_history_admin_head" );
35
- add_action( 'admin_init', 'simple_history_admin_init' ); // start listening to changes
36
- add_action( 'init', 'simple_history_init' ); // start listening to changes
37
- add_action( 'admin_menu', 'simple_history_admin_menu' );
38
- add_action( 'wp_dashboard_setup', 'simple_history_wp_dashboard_setup' );
39
- add_action( 'wp_ajax_simple_history_ajax', 'simple_history_ajax' );
40
-
41
- function simple_history_ajax() {
42
-
43
- $type = $_POST["type"];
44
- if ($type == __( "All types", 'simple-history' )) { $type = ""; }
45
-
46
- $user = $_POST["user"];
47
- if ($user == __( "By all users", 'simple-history' )) { $user = ""; }
48
 
49
- $page = 0;
50
- if (isset($_POST["page"])) {
51
- $page = (int) $_POST["page"];
 
 
 
52
  }
53
 
54
- $items = (int) (isset($_POST["items"])) ? $_POST["items"] : 5;
55
-
56
- $search = (isset($_POST["search"])) ? $_POST["search"] : "";
57
-
58
- $args = array(
59
- "is_ajax" => true,
60
- "filter_type" => $type,
61
- "filter_user" => $user,
62
- "page" => $page,
63
- "items" => $items,
64
- "search" => $search
65
- );
66
- simple_history_print_history($args);
67
- exit;
68
-
69
- }
70
-
71
- function simple_history_admin_menu() {
72
-
73
- #define( "SIMPLE_HISTORY_PAGE_FILE", menu_page_url("simple_history_page", false)); // no need yet
74
-
75
- // show as page?
76
- if (simple_history_setting_show_as_page()) {
77
- add_dashboard_page(SIMPLE_HISTORY_NAME, SIMPLE_HISTORY_NAME, "edit_pages", "simple_history_page", "simple_history_management_page");
 
 
 
 
 
 
 
78
  }
 
 
 
79
 
80
- }
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
 
83
- function simple_history_wp_dashboard_setup() {
84
- if (simple_history_setting_show_on_dashboard()) {
85
- if (current_user_can("edit_pages")) {
86
- wp_add_dashboard_widget("simple_history_dashboard_widget", SIMPLE_HISTORY_NAME, "simple_history_dashboard");
 
87
  }
 
88
  }
89
- }
90
-
91
- function simple_history_dashboard() {
92
- simple_history_purge_db();
93
- simple_history_print_nav();
94
- simple_history_print_history();
95
- }
96
-
97
- function simple_history_admin_head() {
98
- }
99
-
100
-
101
- function simple_history_init() {
102
-
103
- // users and stuff
104
- add_action("wp_login", "simple_history_wp_login");
105
- add_action("wp_logout", "simple_history_wp_logout");
106
- add_action("delete_user", "simple_history_delete_user");
107
- add_action("user_register", "simple_history_user_register");
108
- add_action("profile_update", "simple_history_profile_update");
109
-
110
- // options
111
- #add_action("updated_option", "simple_history_updated_option", 10, 3);
112
- #add_action("updated_option", "simple_history_updated_option2", 10, 2);
113
- #add_action("updated_option", "simple_history_updated_option3", 10, 1);
114
- #add_action("update_option", "simple_history_update_option", 10, 3);
115
 
116
- // plugin
117
- add_action("activated_plugin", "simple_history_activated_plugin");
118
- add_action("deactivated_plugin", "simple_history_deactivated_plugin");
 
 
 
119
 
120
- // check for RSS
121
- // don't know if this is the right way to do this, but it seems to work!
122
- if (isset($_GET["simple_history_get_rss"])) {
123
 
124
- $rss_secret_option = get_option("simple_history_rss_secret");
125
- $rss_secret_get = $_GET["rss_secret"];
126
-
127
- echo '<?xml version="1.0"?>';
128
- $self_link = simple_history_get_rss_address();
129
-
130
- if ($rss_secret_option == $rss_secret_get) {
131
- ?>
132
- <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
133
- <channel>
134
- <title><?php printf(__("Simple History for %s", 'simple-history'), get_bloginfo("name")) ?></title>
135
- <description><?php printf(__("WordPress History for %s", 'simple-history'), get_bloginfo("name")) ?></description>
136
- <link><?php echo get_bloginfo("url") ?></link>
137
- <atom:link href="<?php echo $self_link; ?>" rel="self" type="application/rss+xml" />
138
- <?php
139
- $arr_items = simple_history_get_items_array("items=10");
140
- foreach ($arr_items as $one_item) {
141
- $object_type = ucwords($one_item->object_type);
142
- $object_name = esc_html($one_item->object_name);
143
- $user = get_user_by("id", $one_item->user_id);
144
- $user_nicename = esc_html($user->user_nicename);
145
- $description = "";
146
- if ($user_nicename) {
147
- $description .= sprintf(__("By %s", 'simple-history'), $user_nicename);
148
- $description .= "<br />";
149
- }
150
- if ($one_item->occasions) {
151
- $description .= sprintf(__("%d occasions", 'simple-history'), sizeof($one_item->occasions));
152
- $description .= "<br />";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  }
154
-
155
- $item_title = "$object_type \"{$object_name}\" {$one_item->action}";
156
- $item_title = html_entity_decode($item_title, ENT_COMPAT, "UTF-8");
157
- $item_guid = get_bloginfo("siteurl") . "?simple-history-guid=" . $one_item->id;
158
  ?>
159
- <item>
160
- <title><![CDATA[<?php echo $item_title; ?>]]></title>
161
- <description><![CDATA[<?php echo $description ?>]]></description>
162
- <author><?php echo $user_nicename ?></author>
163
- <pubDate><?php echo date("D, d M Y H:i:s", strtotime($one_item->date)) ?> GMT</pubDate>
164
- <guid isPermaLink="false"><?php echo $item_guid ?></guid>
165
- </item>
166
- <?php
167
- }
168
- ?>
169
- </channel>
170
- </rss>
171
- <?php
172
- } else {
173
- // not ok rss secret
174
- ?>
175
- <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
176
- <channel>
177
- <title><?php printf(__("Simple History for %s", 'simple-history'), get_bloginfo("name")) ?></title>
178
- <description><?php printf(__("WordPress History for %s", 'simple-history'), get_bloginfo("name")) ?></description>
179
- <link><?php echo get_bloginfo("siteurl") ?></link>
180
- <atom:link href="<?php echo $self_link; ?>" rel="self" type="application/rss+xml" />
181
- <item>
182
- <title><?php _e("Wrong RSS secret", 'simple-history')?></title>
183
- <description><?php _e("Your RSS secret for Simple History RSS feed is wrong. Please see WordPress settings for current link to the RSS feed.", 'simple-history')?></description>
184
- <pubDate><?php echo date("D, d M Y H:i:s", time()) ?> GMT</pubDate>
185
- <guid><?php echo get_bloginfo("siteurl") . "?simple-history-guid=wrong-secret" ?></guid>
186
- </item>
187
- </channel>
188
- </rss>
189
- <?php
190
 
 
 
 
 
 
 
 
 
 
 
 
191
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  exit;
193
- }
194
 
195
- }
196
-
197
-
198
- function simple_history_admin_init() {
199
 
200
- // load_plugin_textdomain('simple-history', false, "/simple-history/languages");
201
 
202
- // posts
203
- add_action("save_post", "simple_history_save_post");
204
- add_action("transition_post_status", "simple_history_transition_post_status", 10, 3);
205
- add_action("delete_post", "simple_history_delete_post");
206
-
207
- // attachments/media
208
- add_action("add_attachment", "simple_history_add_attachment");
209
- add_action("edit_attachment", "simple_history_edit_attachment");
210
- add_action("delete_attachment", "simple_history_delete_attachment");
211
-
212
- add_action("edit_comment", "simple_history_edit_comment");
213
- add_action("delete_comment", "simple_history_delete_comment");
214
- add_action("wp_set_comment_status", "simple_history_set_comment_status", 10, 2);
215
- /*
216
- edit_comment
217
- Runs after a comment is updated/edited in the database. Action function arguments: comment ID.
218
-
219
- delete_comment
220
- Runs just before a comment is deleted. Action function arguments: comment ID.
221
 
222
- wp_set_comment_status
223
- Runs when the status of a comment changes. Action function arguments: comment ID, status string indicating the new status ("delete", "approve", "spam", "hold").
224
- */
225
- // comments
226
 
227
- add_settings_section("simple_history_settings_general", SIMPLE_HISTORY_NAME, "simple_history_settings_page", "general");
228
- add_settings_field("simple_history_settings_field_1", "Show Simple History", "simple_history_settings_field", "general", "simple_history_settings_general");
229
- add_settings_field("simple_history_settings_field_2", "RSS feed", "simple_history_settings_field_rss", "general", "simple_history_settings_general");
230
- register_setting("general", "simple_history_show_on_dashboard");
231
- register_setting("general", "simple_history_show_as_page");
232
 
233
- wp_enqueue_style( "simple_history_styles", SIMPLE_HISTORY_URL . "styles.css", false, SIMPLE_HISTORY_VERSION );
234
-
235
- wp_enqueue_script("simple_history", SIMPLE_HISTORY_URL . "scripts.js", array("jquery"), SIMPLE_HISTORY_VERSION);
236
 
 
 
 
 
237
  }
 
238
  function simple_history_settings_page() {
239
  // never remove this function, it must exist.
240
  echo "<div id='simple-history-settings-page'></div>";
@@ -247,7 +297,6 @@ function simple_history_setting_show_as_page() {
247
  return (bool) get_option("simple_history_show_as_page", 1);
248
  }
249
 
250
-
251
  function simple_history_settings_field() {
252
  $show_on_dashboard = simple_history_setting_show_on_dashboard();
253
  $show_as_page = simple_history_setting_show_as_page();
@@ -605,7 +654,7 @@ function simple_history_add($args) {
605
 
606
  $args = wp_parse_args( $args, $defaults );
607
 
608
- $action = $args["action"];
609
  $object_type = $args["object_type"];
610
  $object_subtype = $args["object_subtype"];
611
  $object_id = $args["object_id"];
@@ -646,7 +695,7 @@ function simple_history_management_page() {
646
  ?>
647
 
648
  <div class="wrap">
649
- <h2><?php echo SIMPLE_HISTORY_NAME ?></h2>
650
  <?php
651
  simple_history_print_nav();
652
  simple_history_print_history();
@@ -668,6 +717,16 @@ if (!function_exists("bonny_d")) {
668
  // when activating plugin: create tables
669
  // __FILE__ doesnt work for me because of soft linkes directories
670
  register_activation_hook( WP_PLUGIN_DIR . "/simple-history/index.php" , 'simple_history_install' );
 
 
 
 
 
 
 
 
 
 
671
  function simple_history_install() {
672
 
673
  global $wpdb;
@@ -678,14 +737,15 @@ function simple_history_install() {
678
  $sql = "CREATE TABLE " . $table_name . " (
679
  id int(10) NOT NULL AUTO_INCREMENT,
680
  date datetime NOT NULL,
681
- action varchar(255) NOT NULL,
682
- object_type varchar(255) NOT NULL,
683
- object_subtype VARCHAR(255) NOT NULL,
684
  user_id int(10) NOT NULL,
685
  object_id int(10) NOT NULL,
686
- object_name varchar(255) NOT NULL,
687
- PRIMARY KEY (id)
688
- );";
 
689
  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
690
  dbDelta($sql);
691
 
@@ -696,7 +756,6 @@ function simple_history_install() {
696
 
697
  simple_history_add("action=" . __( 'activated', 'simple-history' ) . "&object_type=" . __('Plugin') . "&object_name=$plugin_name");
698
 
699
-
700
  // also generate a rss secret, if it does not exist
701
  if (!get_option("simple_history_rss_secret")) {
702
  simple_history_update_rss_secret();
@@ -730,7 +789,7 @@ function simple_history_print_nav() {
730
  // add_query_arg(
731
  $link = esc_html(add_query_arg("simple_history_type_to_show", ""));
732
  $str_types_desc = __("All types", 'simple-history');
733
- $str_types .= "<li $css><a href='$link'>$str_types_desc</a> | </li>";
734
  foreach ($arr_types as $one_type) {
735
  $css = "";
736
  if ($one_type->object_subtype && $simple_history_type_to_show == ($one_type->object_type."/".$one_type->object_subtype)) {
@@ -747,9 +806,9 @@ function simple_history_print_nav() {
747
  }
748
  $link = esc_html(add_query_arg("simple_history_type_to_show", $arg));
749
  $str_types .= "<a href='$link'>";
750
- $str_types .= $one_type->object_type;
751
  if ($one_type->object_subtype) {
752
- $str_types .= "/".$one_type->object_subtype;
753
  }
754
  $str_types .= "</a> | ";
755
  $str_types .= "</li>";
@@ -979,28 +1038,6 @@ function simple_history_print_history($args = null) {
979
 
980
  $real_loop_num++;
981
 
982
- #if ($args["page"] > 0 && ($args["page"] * $args["items"] > $real_loop_num)) {
983
- # continue;
984
- #}
985
-
986
- #if ($loopNum >= $args["items"]) {
987
- # break;
988
- #}
989
- /*
990
- stdClass Object
991
- (
992
- [id] => 94
993
- [date] => 2010-07-03 21:08:43
994
- [action] => update
995
- [object_type] => post
996
- [object_subtype] => page
997
- [user_id] => 1
998
- [object_id] => 732
999
- [occasions] => array
1000
- )
1001
- */
1002
- #bonny_d($one_row);
1003
-
1004
  $object_type = $one_row->object_type;
1005
  $object_subtype = $one_row->object_subtype;
1006
  $object_id = $one_row->object_id;
@@ -1044,9 +1081,9 @@ function simple_history_print_history($args = null) {
1044
  if ($user->first_name || $user->last_name) {
1045
  $who .= " (";
1046
  if ($user->first_name && $user->last_name) {
1047
- $who .= $user->first_name . " " . $user->last_name;
1048
  } else {
1049
- $who .= $user->first_name . $user->last_name; // just one of them, no space necessary
1050
  }
1051
  $who .= ")";
1052
  }
@@ -1088,7 +1125,7 @@ function simple_history_print_history($args = null) {
1088
  $post_out .= " " . __("deleted", 'simple-history') . " ";
1089
  } else {
1090
  */
1091
- $post_out .= " $action";
1092
  //}
1093
 
1094
  $post_out = ucfirst($post_out);
@@ -1123,17 +1160,7 @@ function simple_history_print_history($args = null) {
1123
  }
1124
  }
1125
 
1126
- /*
1127
- if ("added" == $action) {
1128
- $attachment_out .= " added ";
1129
- } elseif ("updated" == $action) {
1130
- $attachment_out .= " updated ";
1131
- } elseif ("deleted" == $action) {
1132
- $attachment_out .= " deleted ";
1133
- } else {
1134
- */
1135
- $attachment_out .= " $action ";
1136
- //}
1137
 
1138
  $attachment_out = ucfirst($attachment_out);
1139
  echo $attachment_out;
@@ -1152,9 +1179,9 @@ function simple_history_print_history($args = null) {
1152
  if ($user->first_name || $user->last_name) {
1153
  $user_out .= " (";
1154
  if ($user->first_name && $user->last_name) {
1155
- $user_out .= $user->first_name . " " . $user->last_name;
1156
  } else {
1157
- $user_out .= $user->first_name . $user->last_name; // just one of them, no space necessary
1158
  }
1159
  $user_out .= ")";
1160
  }
@@ -1163,7 +1190,7 @@ function simple_history_print_history($args = null) {
1163
  } else {
1164
  // most likely deleted user
1165
  $user_link = "";
1166
- $user_out .= " \"$object_name\"";
1167
  }
1168
 
1169
  $user_avatar = get_avatar($user->user_email, "50");
@@ -1186,7 +1213,7 @@ function simple_history_print_history($args = null) {
1186
  $user_out .= " " . __("logged out", 'simple-history') . " ";
1187
  } else {
1188
  */
1189
- $user_out .= " $action";
1190
  //}
1191
 
1192
  $user_out = ucfirst($user_out);
@@ -1195,7 +1222,7 @@ function simple_history_print_history($args = null) {
1195
  } elseif ("comment" == $object_type) {
1196
 
1197
  $comment_link = get_edit_comment_link($object_id);
1198
- echo ucwords($object_type) . " $object_subtype <a href='$comment_link'><span class='simple-history-title'>$object_name\"</span></a> $action";
1199
 
1200
  } else {
1201
 
@@ -1218,7 +1245,7 @@ function simple_history_print_history($args = null) {
1218
  default:
1219
  $unknown_action = $unknown_action; // dah!
1220
  }
1221
- echo ucwords($object_type) . " $object_subtype <span class='simple-history-title'>\"$object_name\"</span> $unknown_action";
1222
 
1223
  }
1224
  echo "</div>";
@@ -1280,7 +1307,7 @@ function simple_history_print_history($args = null) {
1280
  //$show_more = sprintf(__("Show %s more", 'simple-history'), $show_more);
1281
  $loading = __("Loading...", 'simple-history');
1282
  $no_more_found = __("No more history items found.", 'simple-history');
1283
- $view_rss = __("Simple History RSS feed", 'simple-history');
1284
  $view_rss_link = simple_history_get_rss_address();
1285
  $str_show = __("Show", 'simple-history');
1286
  echo "</ol>
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: 0.6
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", "0.6");
31
  define( "SIMPLE_HISTORY_NAME", "Simple History");
32
  define( "SIMPLE_HISTORY_URL", WP_PLUGIN_URL . '/simple-history/');
33
 
34
+ /**
35
+ * Let's begin on a class, since they rule so much more than functions.
36
+ */
37
+ class simple_history {
38
+
39
+ function __construct() {
40
+
41
+ add_action( 'admin_init', array($this, 'admin_init') ); // start listening to changes
42
+ add_action( 'init', array($this, 'init') ); // start listening to changes
43
+ add_action( 'admin_menu', array($this, 'admin_menu') );
44
+ add_action( 'wp_dashboard_setup', array($this, 'wp_dashboard_setup') );
45
+ add_action( 'wp_ajax_simple_history_ajax', array($this, 'ajax') );
46
+
47
+ }
48
 
49
+ function wp_dashboard_setup() {
50
+ if (simple_history_setting_show_on_dashboard()) {
51
+ if (current_user_can("edit_pages")) {
52
+ wp_add_dashboard_widget("simple_history_dashboard_widget", __("History", 'simple-history'), "simple_history_dashboard");
53
+ }
54
+ }
55
  }
56
 
57
+ // stuff that happens in the admin
58
+ // "admin_init is triggered before any other hook when a user access the admin area"
59
+ function admin_init() {
60
+
61
+ // posts
62
+ add_action("save_post", "simple_history_save_post");
63
+ add_action("transition_post_status", "simple_history_transition_post_status", 10, 3);
64
+ add_action("delete_post", "simple_history_delete_post");
65
+
66
+ // attachments/media
67
+ add_action("add_attachment", "simple_history_add_attachment");
68
+ add_action("edit_attachment", "simple_history_edit_attachment");
69
+ add_action("delete_attachment", "simple_history_delete_attachment");
70
+
71
+ // comments
72
+ add_action("edit_comment", "simple_history_edit_comment");
73
+ add_action("delete_comment", "simple_history_delete_comment");
74
+ add_action("wp_set_comment_status", "simple_history_set_comment_status", 10, 2);
75
+
76
+ // other things
77
+ add_settings_section("simple_history_settings_general", SIMPLE_HISTORY_NAME, "simple_history_settings_page", "general");
78
+ add_settings_field("simple_history_settings_field_1", "Show Simple History", "simple_history_settings_field", "general", "simple_history_settings_general");
79
+ add_settings_field("simple_history_settings_field_2", "RSS feed", "simple_history_settings_field_rss", "general", "simple_history_settings_general");
80
+ register_setting("general", "simple_history_show_on_dashboard");
81
+ register_setting("general", "simple_history_show_as_page");
82
+
83
+ $this->check_upgrade_stuff();
84
+
85
+ wp_enqueue_style( "simple_history_styles", SIMPLE_HISTORY_URL . "styles.css", false, SIMPLE_HISTORY_VERSION );
86
+ wp_enqueue_script("simple_history", SIMPLE_HISTORY_URL . "scripts.js", array("jquery"), SIMPLE_HISTORY_VERSION);
87
+
88
  }
89
+
90
+ // check some things regarding update
91
+ function check_upgrade_stuff() {
92
 
93
+ global $wpdb;
94
 
95
+ $db_version = get_option("simple_history_db_version");
96
+ // $db_version = FALSE;
97
+
98
+ if ($db_version === FALSE) {
99
+ // db fix has never been run
100
+ // user is on version 0.4 or earlier
101
+ // = database is not using utf-8
102
+ // so fix that
103
+ $table_name = $wpdb->prefix . "simple_history";
104
+ require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
105
+ #echo "begin upgrading database";
106
+ // We change the varchar size to add one num just to force update of encoding. dbdelta didn't see it otherwise.
107
+ $sql = "CREATE TABLE " . $table_name . " (
108
+ id int(10) NOT NULL AUTO_INCREMENT,
109
+ date datetime NOT NULL,
110
+ action VARCHAR(256) NOT NULL COLLATE utf8_general_ci,
111
+ object_type VARCHAR(256) NOT NULL COLLATE utf8_general_ci,
112
+ object_subtype VARCHAR(256) NOT NULL COLLATE utf8_general_ci,
113
+ user_id int(10) NOT NULL,
114
+ object_id int(10) NOT NULL,
115
+ object_name VARCHAR(256) NOT NULL COLLATE utf8_general_ci,
116
+ PRIMARY KEY (id)
117
+ ) CHARACTER SET=utf8;";
118
+
119
+ // Upgrade db / fix utf for varchars
120
+ dbDelta($sql);
121
+
122
+ // Fix UTF-8 for table
123
+ $sql = sprintf('alter table %1$s charset=utf8;', $table_name);
124
+ $wpdb->query($sql);
125
+
126
+ // Store this upgrade in ourself :)
127
+ simple_history_add("action=" . __( 'upgraded it\'s database', 'simple-history' ) . "&object_type=" . __('Plugin') . "&object_name=" . SIMPLE_HISTORY_NAME);
128
 
129
+ #echo "done upgrading database";
130
+
131
+ update_option("simple_history_db_version", 1);
132
+ } else {
133
+ // echo "db up to date";
134
  }
135
+
136
  }
137
+
138
+ function admin_menu() {
139
+
140
+ #define( "SIMPLE_HISTORY_PAGE_FILE", menu_page_url("simple_history_page", false)); // no need yet
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
 
142
+ // show as page?
143
+ if (simple_history_setting_show_as_page()) {
144
+ add_dashboard_page(SIMPLE_HISTORY_NAME, __("History", 'simple-history'), "edit_pages", "simple_history_page", "simple_history_management_page");
145
+ }
146
+
147
+ }
148
 
149
+ function init() {
 
 
150
 
151
+ // users and stuff
152
+ add_action("wp_login", "simple_history_wp_login");
153
+ add_action("wp_logout", "simple_history_wp_logout");
154
+ add_action("delete_user", "simple_history_delete_user");
155
+ add_action("user_register", "simple_history_user_register");
156
+ add_action("profile_update", "simple_history_profile_update");
157
+
158
+ // options
159
+ #add_action("updated_option", "simple_history_updated_option", 10, 3);
160
+ #add_action("updated_option", "simple_history_updated_option2", 10, 2);
161
+ #add_action("updated_option", "simple_history_updated_option3", 10, 1);
162
+ #add_action("update_option", "simple_history_update_option", 10, 3);
163
+
164
+ // plugin
165
+ add_action("activated_plugin", "simple_history_activated_plugin");
166
+ add_action("deactivated_plugin", "simple_history_deactivated_plugin");
167
+
168
+ // check for RSS
169
+ // don't know if this is the right way to do this, but it seems to work!
170
+ if (isset($_GET["simple_history_get_rss"])) {
171
+
172
+ $rss_secret_option = get_option("simple_history_rss_secret");
173
+ $rss_secret_get = $_GET["rss_secret"];
174
+
175
+ echo '<?xml version="1.0"?>';
176
+ $self_link = simple_history_get_rss_address();
177
+
178
+ if ($rss_secret_option == $rss_secret_get) {
179
+ ?>
180
+ <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
181
+ <channel>
182
+ <title><?php printf(__("History for %s", 'simple-history'), get_bloginfo("name")) ?></title>
183
+ <description><?php printf(__("WordPress History for %s", 'simple-history'), get_bloginfo("name")) ?></description>
184
+ <link><?php echo get_bloginfo("url") ?></link>
185
+ <atom:link href="<?php echo $self_link; ?>" rel="self" type="application/rss+xml" />
186
+ <?php
187
+ $arr_items = simple_history_get_items_array("items=10");
188
+ foreach ($arr_items as $one_item) {
189
+ $object_type = ucwords($one_item->object_type);
190
+ $object_name = esc_html($one_item->object_name);
191
+ $user = get_user_by("id", $one_item->user_id);
192
+ $user_nicename = esc_html($user->user_nicename);
193
+ $description = "";
194
+ if ($user_nicename) {
195
+ $description .= sprintf(__("By %s", 'simple-history'), $user_nicename);
196
+ $description .= "<br />";
197
+ }
198
+ if ($one_item->occasions) {
199
+ $description .= sprintf(__("%d occasions", 'simple-history'), sizeof($one_item->occasions));
200
+ $description .= "<br />";
201
+ }
202
+
203
+ $item_title = esc_html($object_type) . " \"" . esc_html($object_name) . "\" {$one_item->action}";
204
+ $item_title = html_entity_decode($item_title, ENT_COMPAT, "UTF-8");
205
+ $item_guid = get_bloginfo("siteurl") . "?simple-history-guid=" . $one_item->id;
206
+ ?>
207
+ <item>
208
+ <title><![CDATA[<?php echo $item_title; ?>]]></title>
209
+ <description><![CDATA[<?php echo $description ?>]]></description>
210
+ <author><?php echo $user_nicename ?></author>
211
+ <pubDate><?php echo date("D, d M Y H:i:s", strtotime($one_item->date)) ?> GMT</pubDate>
212
+ <guid isPermaLink="false"><?php echo $item_guid ?></guid>
213
+ </item>
214
+ <?php
215
  }
 
 
 
 
216
  ?>
217
+ </channel>
218
+ </rss>
219
+ <?php
220
+ } else {
221
+ // not ok rss secret
222
+ ?>
223
+ <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
224
+ <channel>
225
+ <title><?php printf(__("History for %s", 'simple-history'), get_bloginfo("name")) ?></title>
226
+ <description><?php printf(__("WordPress History for %s", 'simple-history'), get_bloginfo("name")) ?></description>
227
+ <link><?php echo get_bloginfo("siteurl") ?></link>
228
+ <atom:link href="<?php echo $self_link; ?>" rel="self" type="application/rss+xml" />
229
+ <item>
230
+ <title><?php _e("Wrong RSS secret", 'simple-history')?></title>
231
+ <description><?php _e("Your RSS secret for Simple History RSS feed is wrong. Please see WordPress settings for current link to the RSS feed.", 'simple-history')?></description>
232
+ <pubDate><?php echo date("D, d M Y H:i:s", time()) ?> GMT</pubDate>
233
+ <guid><?php echo get_bloginfo("siteurl") . "?simple-history-guid=wrong-secret" ?></guid>
234
+ </item>
235
+ </channel>
236
+ </rss>
237
+ <?php
238
+
239
+ }
240
+ exit;
241
+ }
242
+
243
+ }
 
 
 
 
244
 
245
+ function ajax() {
246
+
247
+ $type = $_POST["type"];
248
+ if ($type == __( "All types", 'simple-history' )) { $type = ""; }
249
+
250
+ $user = $_POST["user"];
251
+ if ($user == __( "By all users", 'simple-history' )) { $user = ""; }
252
+
253
+ $page = 0;
254
+ if (isset($_POST["page"])) {
255
+ $page = (int) $_POST["page"];
256
  }
257
+
258
+ $items = (int) (isset($_POST["items"])) ? $_POST["items"] : 5;
259
+
260
+ $search = (isset($_POST["search"])) ? $_POST["search"] : "";
261
+
262
+ $args = array(
263
+ "is_ajax" => true,
264
+ "filter_type" => $type,
265
+ "filter_user" => $user,
266
+ "page" => $page,
267
+ "items" => $items,
268
+ "search" => $search
269
+ );
270
+ simple_history_print_history($args);
271
  exit;
 
272
 
273
+ }
 
 
 
274
 
275
+ } // class
276
 
277
+ $simple_history = new simple_history;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
278
 
 
 
 
 
279
 
 
 
 
 
 
280
 
 
 
 
281
 
282
+ function simple_history_dashboard() {
283
+ simple_history_purge_db();
284
+ simple_history_print_nav();
285
+ simple_history_print_history();
286
  }
287
+
288
  function simple_history_settings_page() {
289
  // never remove this function, it must exist.
290
  echo "<div id='simple-history-settings-page'></div>";
297
  return (bool) get_option("simple_history_show_as_page", 1);
298
  }
299
 
 
300
  function simple_history_settings_field() {
301
  $show_on_dashboard = simple_history_setting_show_on_dashboard();
302
  $show_as_page = simple_history_setting_show_as_page();
654
 
655
  $args = wp_parse_args( $args, $defaults );
656
 
657
+ $action = mysql_real_escape_string($args["action"]);
658
  $object_type = $args["object_type"];
659
  $object_subtype = $args["object_subtype"];
660
  $object_id = $args["object_id"];
695
  ?>
696
 
697
  <div class="wrap">
698
+ <h2><?php echo __("History", 'simple-history') ?></h2>
699
  <?php
700
  simple_history_print_nav();
701
  simple_history_print_history();
717
  // when activating plugin: create tables
718
  // __FILE__ doesnt work for me because of soft linkes directories
719
  register_activation_hook( WP_PLUGIN_DIR . "/simple-history/index.php" , 'simple_history_install' );
720
+
721
+ /*
722
+ The theory behind the right way to do this. The proper way to handle an upgrade path is to only
723
+ run an upgrade procedure when you need to. Ideally, you would store a “version” in your
724
+ plugin’s database option, and then a version in the code. If they do not match, you
725
+ would fire your upgrade procedure, and then set the database option to equal the version in
726
+ the code. This is how many plugins handle upgrades, and this is how core works as well.
727
+ */
728
+
729
+ // when installing plugin: create table
730
  function simple_history_install() {
731
 
732
  global $wpdb;
737
  $sql = "CREATE TABLE " . $table_name . " (
738
  id int(10) NOT NULL AUTO_INCREMENT,
739
  date datetime NOT NULL,
740
+ action varchar(255) NOT NULL COLLATE utf8_general_ci,
741
+ object_type varchar(255) NOT NULL COLLATE utf8_general_ci,
742
+ object_subtype VARCHAR(255) NOT NULL COLLATE utf8_general_ci,
743
  user_id int(10) NOT NULL,
744
  object_id int(10) NOT NULL,
745
+ object_name varchar(255) NOT NULL COLLATE utf8_general_ci,
746
+ PRIMARY KEY (id)
747
+ ) CHARACTER SET=utf8;";
748
+
749
  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
750
  dbDelta($sql);
751
 
756
 
757
  simple_history_add("action=" . __( 'activated', 'simple-history' ) . "&object_type=" . __('Plugin') . "&object_name=$plugin_name");
758
 
 
759
  // also generate a rss secret, if it does not exist
760
  if (!get_option("simple_history_rss_secret")) {
761
  simple_history_update_rss_secret();
789
  // add_query_arg(
790
  $link = esc_html(add_query_arg("simple_history_type_to_show", ""));
791
  $str_types_desc = __("All types", 'simple-history');
792
+ $str_types .= "<li $css><a href='$link'>" . esc_html($str_types_desc) . "</a> | </li>";
793
  foreach ($arr_types as $one_type) {
794
  $css = "";
795
  if ($one_type->object_subtype && $simple_history_type_to_show == ($one_type->object_type."/".$one_type->object_subtype)) {
806
  }
807
  $link = esc_html(add_query_arg("simple_history_type_to_show", $arg));
808
  $str_types .= "<a href='$link'>";
809
+ $str_types .= esc_html($one_type->object_type);
810
  if ($one_type->object_subtype) {
811
+ $str_types .= "/". esc_html($one_type->object_subtype);
812
  }
813
  $str_types .= "</a> | ";
814
  $str_types .= "</li>";
1038
 
1039
  $real_loop_num++;
1040
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1041
  $object_type = $one_row->object_type;
1042
  $object_subtype = $one_row->object_subtype;
1043
  $object_id = $one_row->object_id;
1081
  if ($user->first_name || $user->last_name) {
1082
  $who .= " (";
1083
  if ($user->first_name && $user->last_name) {
1084
+ $who .= esc_html($user->first_name) . " " . esc_html($user->last_name);
1085
  } else {
1086
+ $who .= esc_html($user->first_name) . esc_html($user->last_name); // just one of them, no space necessary
1087
  }
1088
  $who .= ")";
1089
  }
1125
  $post_out .= " " . __("deleted", 'simple-history') . " ";
1126
  } else {
1127
  */
1128
+ $post_out .= " " . esc_html($action);
1129
  //}
1130
 
1131
  $post_out = ucfirst($post_out);
1160
  }
1161
  }
1162
 
1163
+ $attachment_out .= " $action ";
 
 
 
 
 
 
 
 
 
 
1164
 
1165
  $attachment_out = ucfirst($attachment_out);
1166
  echo $attachment_out;
1179
  if ($user->first_name || $user->last_name) {
1180
  $user_out .= " (";
1181
  if ($user->first_name && $user->last_name) {
1182
+ $user_out .= esc_html($user->first_name) . " " . esc_html($user->last_name);
1183
  } else {
1184
+ $user_out .= esc_html($user->first_name) . esc_html($user->last_name); // just one of them, no space necessary
1185
  }
1186
  $user_out .= ")";
1187
  }
1190
  } else {
1191
  // most likely deleted user
1192
  $user_link = "";
1193
+ $user_out .= " \"" . esc_html($object_name) . "\"";
1194
  }
1195
 
1196
  $user_avatar = get_avatar($user->user_email, "50");
1213
  $user_out .= " " . __("logged out", 'simple-history') . " ";
1214
  } else {
1215
  */
1216
+ $user_out .= " " . esc_html($action);
1217
  //}
1218
 
1219
  $user_out = ucfirst($user_out);
1222
  } elseif ("comment" == $object_type) {
1223
 
1224
  $comment_link = get_edit_comment_link($object_id);
1225
+ echo esc_html(ucwords($object_type)) . " " . esc_html($object_subtype) . " <a href='$comment_link'><span class='simple-history-title'>" . esc_html($object_name) . "\"</span></a> " . esc_html($action);
1226
 
1227
  } else {
1228
 
1245
  default:
1246
  $unknown_action = $unknown_action; // dah!
1247
  }
1248
+ echo esc_html(ucwords($object_type)) . " " . esc_html($object_subtype) . " <span class='simple-history-title'>\"" . esc_html($object_name) . "\"</span> " . esc_html($unknown_action);
1249
 
1250
  }
1251
  echo "</div>";
1307
  //$show_more = sprintf(__("Show %s more", 'simple-history'), $show_more);
1308
  $loading = __("Loading...", 'simple-history');
1309
  $no_more_found = __("No more history items found.", 'simple-history');
1310
+ $view_rss = __("RSS feed", 'simple-history');
1311
  $view_rss_link = simple_history_get_rss_address();
1312
  $str_show = __("Show", 'simple-history');
1313
  echo "</ol>
languages/simple-history.pot CHANGED
@@ -1,144 +1,245 @@
1
- # Translation of the WordPress plugin by .
2
- # Copyright (C) 2010
3
  # This file is distributed under the same license as the package.
4
- # FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
5
- #
6
- #, fuzzy
7
  msgid ""
8
  msgstr ""
9
  "Project-Id-Version: \n"
10
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/simple-history\n"
11
- "POT-Creation-Date: 2010-09-19 18:24+0000\n"
12
- "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
13
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
- "Language-Team: LANGUAGE <LL@li.org>\n"
15
  "MIME-Version: 1.0\n"
16
- "Content-Type: text/plain; charset=utf-8\n"
17
  "Content-Transfer-Encoding: 8bit\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
19
- #: index.php:126 index.php:168
20
- #, php-format
21
- msgid "Simple History for %s"
22
  msgstr ""
23
 
24
- #: index.php:127 index.php:169
25
- #, php-format
26
  msgid "WordPress History for %s"
27
  msgstr ""
28
 
29
- #: index.php:139
30
- #, php-format
31
  msgid "By %s"
32
  msgstr ""
33
 
34
- #: index.php:143
35
- #, php-format
36
  msgid "%d occasions"
37
  msgstr ""
38
 
39
- #: index.php:173
40
  msgid "Wrong RSS secret"
41
  msgstr ""
42
 
43
- #: index.php:174
44
  msgid ""
45
  "Your RSS secret for Simple History RSS feed is wrong. Please see WordPress "
46
  "settings for current link to the RSS feed."
47
  msgstr ""
48
 
49
- #: index.php:247
 
 
 
 
 
 
 
 
50
  msgid "on the dashboard"
51
  msgstr ""
52
 
53
- #: index.php:252
54
  msgid "as a page under the tools menu"
55
  msgstr ""
56
 
57
- #: index.php:283
58
  msgid "Created new secret RSS adress"
59
  msgstr ""
60
 
61
- #: index.php:294
62
  msgid ""
63
  "This is a secret RSS feed for Simple History. Only share the link with "
64
  "people you trust"
65
  msgstr ""
66
 
67
- #: index.php:297
68
- #, php-format
69
  msgid ""
70
- "You can <a href='%s'>generate a new address</a> for the RSS feed. This is "
71
- "useful if you think that the address has fallen into the wrong hands."
 
72
  msgstr ""
73
 
74
- #: index.php:320 index.php:335 index.php:366
75
- #, php-format
76
- msgid "From %1$s on %2$s"
77
  msgstr ""
78
 
79
- #: index.php:811
80
- msgid "By all users"
81
  msgstr ""
82
 
83
- #: index.php:1031
84
- msgid "Unknown or deleted user"
85
  msgstr ""
86
 
87
- #: index.php:1058
88
- msgid "created"
89
  msgstr ""
90
 
91
- #: index.php:1060 index.php:1153
92
- msgid "updated"
93
  msgstr ""
94
 
95
- #: index.php:1062 index.php:1155
96
  msgid "deleted"
97
  msgstr ""
98
 
99
- #: index.php:1151
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  msgid "added"
101
  msgstr ""
102
 
103
- #: index.php:1157
104
- msgid "logged in"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  msgstr ""
106
 
107
- #: index.php:1159
108
- msgid "logged out"
109
  msgstr ""
110
 
111
- #: index.php:1193
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  msgid "+ 1 occasion"
113
  msgstr ""
114
 
115
- #: index.php:1196
116
- #, php-format
117
  msgid "+ %d occasions"
118
  msgstr ""
119
 
120
- #: index.php:1225
121
- #, php-format
122
- msgid "Show %d more"
 
 
 
123
  msgstr ""
124
 
125
- #: index.php:1226
 
 
 
 
 
 
 
 
 
 
 
 
126
  msgid "Loading..."
127
  msgstr ""
128
 
129
- #: index.php:1227
130
  msgid "No more history items found."
131
  msgstr ""
132
 
133
- #: index.php:1228
134
- msgid "Simple History RSS feed"
 
 
 
 
135
  msgstr ""
136
 
137
- #: index.php:1244
138
  msgid "No history items found."
139
  msgstr ""
140
 
141
- #: index.php:1245
142
  msgid ""
143
  "Please note that Simple History only records things that happen after this "
144
  "plugin have been installed."
1
+ # Copyright (C) 2012
 
2
  # This file is distributed under the same license as the package.
 
 
 
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: \n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/simple-history\n"
7
+ "POT-Creation-Date: 2012-09-11 06:08:27+00:00\n"
 
 
 
8
  "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2012-MO-DA HO:MI+ZONE\n"
12
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
+
15
+ #: index.php:52 index.php:144 index.php:698
16
+ msgid "History"
17
+ msgstr ""
18
+
19
+ #: index.php:127
20
+ msgid "upgraded it's database"
21
+ msgstr ""
22
+
23
+ #: index.php:127 index.php:369 index.php:373 index.php:757
24
+ msgid "Plugin"
25
+ msgstr ""
26
 
27
+ #: index.php:182 index.php:225
28
+ msgid "History for %s"
 
29
  msgstr ""
30
 
31
+ #: index.php:183 index.php:226
 
32
  msgid "WordPress History for %s"
33
  msgstr ""
34
 
35
+ #: index.php:195 index.php:1257
 
36
  msgid "By %s"
37
  msgstr ""
38
 
39
+ #: index.php:199
 
40
  msgid "%d occasions"
41
  msgstr ""
42
 
43
+ #: index.php:230
44
  msgid "Wrong RSS secret"
45
  msgstr ""
46
 
47
+ #: index.php:231
48
  msgid ""
49
  "Your RSS secret for Simple History RSS feed is wrong. Please see WordPress "
50
  "settings for current link to the RSS feed."
51
  msgstr ""
52
 
53
+ #: index.php:248 index.php:791
54
+ msgid "All types"
55
+ msgstr ""
56
+
57
+ #: index.php:251 index.php:857
58
+ msgid "By all users"
59
+ msgstr ""
60
+
61
+ #: index.php:306
62
  msgid "on the dashboard"
63
  msgstr ""
64
 
65
+ #: index.php:311
66
  msgid "as a page under the tools menu"
67
  msgstr ""
68
 
69
+ #: index.php:348
70
  msgid "Created new secret RSS adress"
71
  msgstr ""
72
 
73
+ #: index.php:359
74
  msgid ""
75
  "This is a secret RSS feed for Simple History. Only share the link with "
76
  "people you trust"
77
  msgstr ""
78
 
79
+ #: index.php:362
 
80
  msgid ""
81
+ "You can <a href='%s#simple-history-settings-page'>generate a new address</a> "
82
+ "for the RSS feed. This is useful if you think that the address has fallen "
83
+ "into the wrong hands."
84
  msgstr ""
85
 
86
+ #: index.php:369 index.php:757 index.php:1234
87
+ msgid "activated"
 
88
  msgstr ""
89
 
90
+ #: index.php:373 index.php:1237
91
+ msgid "deactivated"
92
  msgstr ""
93
 
94
+ #: index.php:385 index.php:401 index.php:433
95
+ msgid "From %1$s on %2$s"
96
  msgstr ""
97
 
98
+ #: index.php:388
99
+ msgid "edited"
100
  msgstr ""
101
 
102
+ #: index.php:388 index.php:404 index.php:436
103
+ msgid "Comment"
104
  msgstr ""
105
 
106
+ #: index.php:404 index.php:518 index.php:539 index.php:568 index.php:610
107
  msgid "deleted"
108
  msgstr ""
109
 
110
+ #: index.php:420
111
+ msgid "approved"
112
+ msgstr ""
113
+
114
+ #: index.php:422
115
+ msgid "unapproved"
116
+ msgstr ""
117
+
118
+ #: index.php:424
119
+ msgid "marked as spam"
120
+ msgstr ""
121
+
122
+ #: index.php:426
123
+ msgid "trashed"
124
+ msgstr ""
125
+
126
+ #: index.php:428
127
+ msgid "untrashed"
128
+ msgstr ""
129
+
130
+ #: index.php:506
131
  msgid "added"
132
  msgstr ""
133
 
134
+ #: index.php:506 index.php:513 index.php:518
135
+ msgid "Attachment"
136
+ msgstr ""
137
+
138
+ #: index.php:513 index.php:525 index.php:613
139
+ msgid "updated"
140
+ msgstr ""
141
+
142
+ #: index.php:525 index.php:539 index.php:553 index.php:560
143
+ msgid "User"
144
+ msgstr ""
145
+
146
+ #: index.php:553
147
+ msgid "logged_in"
148
+ msgstr ""
149
+
150
+ #: index.php:560
151
+ msgid "logged_out"
152
+ msgstr ""
153
+
154
+ #: index.php:568
155
+ msgid "Post"
156
+ msgstr ""
157
+
158
+ #: index.php:605
159
+ msgid "created"
160
  msgstr ""
161
 
162
+ #: index.php:876
163
+ msgid "Search"
164
  msgstr ""
165
 
166
+ #: index.php:1092
167
+ msgid "Unknown or deleted user"
168
+ msgstr ""
169
+
170
+ #: index.php:1138
171
+ msgid "attachment"
172
+ msgstr ""
173
+
174
+ #: index.php:1170
175
+ msgid "user"
176
+ msgstr ""
177
+
178
+ #: index.php:1240
179
+ msgid "enabled"
180
+ msgstr ""
181
+
182
+ #: index.php:1243
183
+ msgid "disabled"
184
+ msgstr ""
185
+
186
+ #: index.php:1259
187
+ msgid "%s ago"
188
+ msgstr ""
189
+
190
+ #: index.php:1261
191
+ msgid "%s at %s"
192
+ msgstr ""
193
+
194
+ #: index.php:1268
195
  msgid "+ 1 occasion"
196
  msgstr ""
197
 
198
+ #: index.php:1271
 
199
  msgid "+ %d occasions"
200
  msgstr ""
201
 
202
+ #: index.php:1279
203
+ msgid "%s ago (%s at %s)"
204
+ msgstr ""
205
+
206
+ #: index.php:1302
207
+ msgid "Show 5 more"
208
  msgstr ""
209
 
210
+ #: index.php:1303
211
+ msgid "Show 15 more"
212
+ msgstr ""
213
+
214
+ #: index.php:1304
215
+ msgid "Show 50 more"
216
+ msgstr ""
217
+
218
+ #: index.php:1305
219
+ msgid "Show 100 more"
220
+ msgstr ""
221
+
222
+ #: index.php:1308
223
  msgid "Loading..."
224
  msgstr ""
225
 
226
+ #: index.php:1309
227
  msgid "No more history items found."
228
  msgstr ""
229
 
230
+ #: index.php:1310
231
+ msgid "RSS feed"
232
+ msgstr ""
233
+
234
+ #: index.php:1312
235
+ msgid "Show"
236
  msgstr ""
237
 
238
+ #: index.php:1326
239
  msgid "No history items found."
240
  msgstr ""
241
 
242
+ #: index.php:1327
243
  msgid ""
244
  "Please note that Simple History only records things that happen after this "
245
  "plugin have been installed."
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: eskapism, MarsApril
3
  Donate link: http://eskapism.se/sida/donate/
4
  Tags: history, log, changes, changelog, audit, trail, pages, attachments, users, cms, dashboard, admin
5
- Requires at least: 2.9.2
6
- Tested up to: 3.3.1
7
- Stable tag: 0.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
 
@@ -85,6 +85,13 @@ to only use the secret RSS feed to keep track of the changes on you web site/Wor
85
 
86
  == Changelog ==
87
 
 
 
 
 
 
 
 
88
  = 0.5 =
89
  - Added author to RSS
90
  - Added german translation, thanks http://www.fuerther-freiheit.info/
2
  Contributors: eskapism, MarsApril
3
  Donate link: http://eskapism.se/sida/donate/
4
  Tags: history, log, changes, changelog, audit, trail, pages, attachments, users, cms, dashboard, admin
5
+ Requires at least: 3.0
6
+ Tested up to: 3.4.2
7
+ Stable tag: 0.6
8
 
9
  View changes made by users within WordPress. See who created a page, uploaded an attachment or approved an comment, and more.
10
 
85
 
86
  == Changelog ==
87
 
88
+ = 0.6 =
89
+ - Changed widget name to just "History" instead of "Simple History". Keep it simple. Previous name implied there also was an "Advanced History" somewhere.
90
+ - Made the widget look a bit WordPress-ish by borrwing some of the looks from the comments widget.
91
+ - Fix for database that didn't use UTF-8 (sorry international users!)
92
+ - Some security fixes
93
+ - Updated POT-file
94
+
95
  = 0.5 =
96
  - Added author to RSS
97
  - Added german translation, thanks http://www.fuerther-freiheit.info/
styles.css CHANGED
@@ -14,18 +14,18 @@
14
 
15
  ol.simple-history {
16
  list-style-type: none;
17
- margin: 0;
18
  padding: 0;
19
  }
20
- ol.simple-history li {
21
- margin-bottom: 1.5em;
22
- margin-top: 1.5em;
23
- /*
24
- xpadding-bottom: 1em;
25
- xborder-bottom: 1px solid #eee;
26
- */
27
  position: relative;
28
  line-height: 1.5;
 
 
 
 
29
  }
30
  ol.simple-history .first {
31
  font-size: 13px;
14
 
15
  ol.simple-history {
16
  list-style-type: none;
17
+ margin: 0 -10px;
18
  padding: 0;
19
  }
20
+ ol.simple-history > li {
21
+ margin: 0;
22
+ padding: 10px 10px;
 
 
 
 
23
  position: relative;
24
  line-height: 1.5;
25
+ border-top: 1px solid #DFDFDF;
26
+ }
27
+ ol.simple-history > li:nth-child(odd) {
28
+ background-color: #FCFCFC;
29
  }
30
  ol.simple-history .first {
31
  font-size: 13px;