Version Description
(September 2016) =
- Added support for plugin Redirection. Redirects and groups that are created, changed, enabled and disabled will be logged. Also when the plugin global settings are changed that will be logged.
- Fix possible notice error from User logger.
- "View changelog" link now works on multisite.
Download this release
Release Info
Developer | eskapism |
Plugin | Simple History |
Version | 2.11 |
Comparing to | |
See all releases |
Code changes from version 2.10 to 2.11
- inc/SimpleHistory.php +2 -1
- index.php +2 -2
- loggers/Plugin_Redirection.php +462 -0
- loggers/SimplePluginLogger.php +8 -1
- loggers/SimpleUserLogger.php +1 -2
- readme.txt +8 -1
inc/SimpleHistory.php
CHANGED
@@ -847,7 +847,8 @@ class SimpleHistory {
|
|
847 |
$loggersDir . "PluginUserSwitchingLogger.php",
|
848 |
$loggersDir . "PluginEnableMediaReplaceLogger.php",
|
849 |
$loggersDir . "Plugin_UltimateMembers_Logger.php",
|
850 |
-
$loggersDir . "Plugin_LimitLoginAttempts.php"
|
|
|
851 |
);
|
852 |
|
853 |
// SimpleLogger.php must be loaded first and always since the other loggers extend it
|
847 |
$loggersDir . "PluginUserSwitchingLogger.php",
|
848 |
$loggersDir . "PluginEnableMediaReplaceLogger.php",
|
849 |
$loggersDir . "Plugin_UltimateMembers_Logger.php",
|
850 |
+
$loggersDir . "Plugin_LimitLoginAttempts.php",
|
851 |
+
$loggersDir . "Plugin_Redirection.php",
|
852 |
);
|
853 |
|
854 |
// SimpleLogger.php must be loaded first and always since the other loggers extend it
|
index.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://simple-history.com
|
|
5 |
Text Domain: simple-history
|
6 |
Domain Path: /languages
|
7 |
Description: Plugin that logs various things that occur in WordPress and then presents those events in a very nice GUI.
|
8 |
-
Version: 2.
|
9 |
Author: Pär Thernström
|
10 |
Author URI: http://simple-history.com/
|
11 |
License: GPL2
|
@@ -42,7 +42,7 @@ if ( version_compare( phpversion(), "5.3", ">=") ) {
|
|
42 |
// register_activation_hook( trailingslashit(WP_PLUGIN_DIR) . trailingslashit( plugin_basename(__DIR__) ) . "index.php" , array("SimpleHistory", "on_plugin_activate" ) );
|
43 |
|
44 |
if ( ! defined( 'SIMPLE_HISTORY_VERSION' ) ) {
|
45 |
-
define( 'SIMPLE_HISTORY_VERSION', '2.
|
46 |
}
|
47 |
|
48 |
if ( ! defined( 'SIMPLE_HISTORY_PATH' ) ) {
|
5 |
Text Domain: simple-history
|
6 |
Domain Path: /languages
|
7 |
Description: Plugin that logs various things that occur in WordPress and then presents those events in a very nice GUI.
|
8 |
+
Version: 2.11
|
9 |
Author: Pär Thernström
|
10 |
Author URI: http://simple-history.com/
|
11 |
License: GPL2
|
42 |
// register_activation_hook( trailingslashit(WP_PLUGIN_DIR) . trailingslashit( plugin_basename(__DIR__) ) . "index.php" , array("SimpleHistory", "on_plugin_activate" ) );
|
43 |
|
44 |
if ( ! defined( 'SIMPLE_HISTORY_VERSION' ) ) {
|
45 |
+
define( 'SIMPLE_HISTORY_VERSION', '2.11' );
|
46 |
}
|
47 |
|
48 |
if ( ! defined( 'SIMPLE_HISTORY_PATH' ) ) {
|
loggers/Plugin_Redirection.php
ADDED
@@ -0,0 +1,462 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
defined( 'ABSPATH' ) or die();
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Logger for the Redirection plugin
|
7 |
+
* https://sv.wordpress.org/plugins/redirection/
|
8 |
+
*/
|
9 |
+
if ( ! class_exists("Plugin_Redirection") ) {
|
10 |
+
|
11 |
+
class Plugin_Redirection extends SimpleLogger {
|
12 |
+
|
13 |
+
public $slug = __CLASS__;
|
14 |
+
|
15 |
+
function getInfo() {
|
16 |
+
|
17 |
+
$arr_info = array(
|
18 |
+
"name" => "Redirection",
|
19 |
+
"description" => _x("Text", "Logger: Redirection", "simple-history"),
|
20 |
+
"name_via" => _x("In plugin Redirection", "Logger: Redirection", "simple-history"),
|
21 |
+
"capability" => "manage_options",
|
22 |
+
"messages" => array(
|
23 |
+
'redirection_redirection_added' => _x( 'Added a redirection for URL "{source_url}"', "Logger: Redirection", 'simple-history' ),
|
24 |
+
'redirection_redirection_edited' => _x( 'Edited the redirection for URL "{source_url}', "Logger: Redirection", 'simple-history' ),
|
25 |
+
'redirection_redirection_enabled' => _x( 'Enabled the redirection for {items_count} URL(s)', "Logger: Redirection", 'simple-history' ),
|
26 |
+
'redirection_redirection_disabled' => _x( 'Disabled the redirection for {items_count} URL(s)', "Logger: Redirection", 'simple-history' ),
|
27 |
+
'redirection_redirection_removed' => _x( 'Removed redirection for {items_count} URL(s)', "Logger: Redirection", 'simple-history' ),
|
28 |
+
'redirection_options_saved' => _x( 'Updated options', "Logger: Redirection", 'simple-history' ),
|
29 |
+
'redirection_options_removed_all' => _x( 'Removed all options and deactivated plugin', "Logger: Redirection", 'simple-history' ),
|
30 |
+
'redirection_group_added' => _x( 'Added group "{group_name}"', "Logger: Redirection", 'simple-history' ),
|
31 |
+
'redirection_group_deleted' => _x( 'Deleted {items_count} group(s)', "Logger: Redirection", 'simple-history' ),
|
32 |
+
),
|
33 |
+
/*
|
34 |
+
"labels" => array(
|
35 |
+
"search" => array(
|
36 |
+
"label" => _x("Plugin Redirection", "Logger: Redirection", "simple-history"),
|
37 |
+
"label_all" => _x("All posts & pages activity", "Logger: Redirection", "simple-history"),
|
38 |
+
"options" => array(
|
39 |
+
_x("Posts created", "Logger: Redirection", "simple-history") => array(
|
40 |
+
"post_created"
|
41 |
+
),
|
42 |
+
_x("Posts updated", "Logger: Redirection", "simple-history") => array(
|
43 |
+
"post_updated"
|
44 |
+
),
|
45 |
+
_x("Posts trashed", "Logger: Redirection", "simple-history") => array(
|
46 |
+
"post_trashed"
|
47 |
+
),
|
48 |
+
_x("Posts deleted", "Logger: Redirection", "simple-history") => array(
|
49 |
+
"post_deleted"
|
50 |
+
),
|
51 |
+
_x("Posts restored", "Logger: Redirection", "simple-history") => array(
|
52 |
+
"post_restored"
|
53 |
+
),
|
54 |
+
)
|
55 |
+
) // end search array
|
56 |
+
) // end labels
|
57 |
+
*/
|
58 |
+
|
59 |
+
);
|
60 |
+
|
61 |
+
return $arr_info;
|
62 |
+
|
63 |
+
}
|
64 |
+
|
65 |
+
function loaded() {
|
66 |
+
|
67 |
+
// Catch redirection create, enable, disable
|
68 |
+
add_action( "admin_init", array( $this, "on_admin_init" ) );
|
69 |
+
|
70 |
+
// Catch edit existing redirect
|
71 |
+
add_action( "wp_ajax_red_redirect_save", array( $this, "on_edit_save_redirect" ) );
|
72 |
+
|
73 |
+
} // loaded
|
74 |
+
|
75 |
+
function on_edit_save_redirect() {
|
76 |
+
|
77 |
+
/*
|
78 |
+
Edit and save redirection
|
79 |
+
{
|
80 |
+
"old": "\/my-edited-old-page-again\/",
|
81 |
+
"title": "",
|
82 |
+
"group_id": "1",
|
83 |
+
"target": "\/my-edited-new-page-again\/",
|
84 |
+
"action_code": "301",
|
85 |
+
"action": "red_redirect_save",
|
86 |
+
"id": "7",
|
87 |
+
"_wpnonce": "732a2bb825",
|
88 |
+
"_wp_http_referer": "\/wp-admin\/admin-ajax.php"
|
89 |
+
}
|
90 |
+
_wpnonce:abfaeae905
|
91 |
+
_wp_http_referer:/wp-admin/admin-ajax.php
|
92 |
+
*/
|
93 |
+
$this->log_redirection_edit( $_REQUEST );
|
94 |
+
|
95 |
+
}
|
96 |
+
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Check if request is an create or enable/disable redirection
|
100 |
+
*/
|
101 |
+
function on_admin_init() {
|
102 |
+
|
103 |
+
$referer = wp_get_raw_referer();
|
104 |
+
|
105 |
+
// We only continue if referer contains page=redirection.php
|
106 |
+
if ( false === strpos( $referer, "page=redirection.php" ) ) {
|
107 |
+
return;
|
108 |
+
}
|
109 |
+
|
110 |
+
$referer_parsed = parse_url( $referer );
|
111 |
+
|
112 |
+
error_log( "-----" );
|
113 |
+
// error_log( SimpleHistory::json_encode( $referer_parsed ) );
|
114 |
+
error_log( SimpleHistory::json_encode( $_REQUEST ) );
|
115 |
+
|
116 |
+
/*
|
117 |
+
Create redirection
|
118 |
+
{
|
119 |
+
"source": "source yo",
|
120 |
+
"match": "url",
|
121 |
+
"red_action": "url",
|
122 |
+
"target": "dest yo",
|
123 |
+
"group_id": "1",
|
124 |
+
"add": "Add Redirection",
|
125 |
+
"group": "0",
|
126 |
+
"action": "red_redirect_add",
|
127 |
+
"_wpnonce": "cdadb5a4ca",
|
128 |
+
"_wp_http_referer": "\/wp-admin\/tools.php?page=redirection.php"
|
129 |
+
}
|
130 |
+
*/
|
131 |
+
if ( isset( $_REQUEST["action"] ) && $_REQUEST["action"] == "red_redirect_add" ) {
|
132 |
+
$this->log_redirection_add( $_REQUEST );
|
133 |
+
return;
|
134 |
+
}
|
135 |
+
|
136 |
+
/*
|
137 |
+
Enable/disable single or multiple direction(s)
|
138 |
+
{
|
139 |
+
"page": "redirection.php",
|
140 |
+
"_wpnonce": "290f261024",
|
141 |
+
"_wp_http_referer": "\/wp-admin\/tools.php?page=redirection.php",
|
142 |
+
"action": "enable", or "disable"
|
143 |
+
"id": "0",
|
144 |
+
"paged": "1",
|
145 |
+
"item": [
|
146 |
+
"3",
|
147 |
+
"2",
|
148 |
+
"1"
|
149 |
+
],
|
150 |
+
"action2": "-1"
|
151 |
+
}
|
152 |
+
*/
|
153 |
+
if ( isset( $_REQUEST["action"] ) && $_REQUEST["action"] == "enable" && empty( $_REQUEST["sub"] ) ) {
|
154 |
+
$this->log_redirection_enable_or_disable( $_REQUEST );
|
155 |
+
return;
|
156 |
+
} else if ( isset( $_REQUEST["action"] ) && $_REQUEST["action"] == "disable" && empty( $_REQUEST["sub"] )) {
|
157 |
+
$this->log_redirection_enable_or_disable( $_REQUEST );
|
158 |
+
return;
|
159 |
+
}
|
160 |
+
|
161 |
+
/*
|
162 |
+
Delete item(s)
|
163 |
+
{
|
164 |
+
"page": "redirection.php",
|
165 |
+
"edit": "4",
|
166 |
+
"_wpnonce": "290f261024",
|
167 |
+
"_wp_http_referer": "\/wp-admin\/tools.php?page=redirection.php&edit=4",
|
168 |
+
"action": "delete",
|
169 |
+
"id": "0",
|
170 |
+
"paged": "1",
|
171 |
+
"item": [
|
172 |
+
"6"
|
173 |
+
],
|
174 |
+
"action2": "-1"
|
175 |
+
}
|
176 |
+
*/
|
177 |
+
if ( isset( $_REQUEST["action"] ) && $_REQUEST["action"] == "delete" && empty( $_REQUEST["sub"] ) ) {
|
178 |
+
$this->log_redirection_delete( $_REQUEST );
|
179 |
+
return;
|
180 |
+
}
|
181 |
+
|
182 |
+
/*
|
183 |
+
Options
|
184 |
+
- delete all options and deactivate plugin
|
185 |
+
{
|
186 |
+
"page": "redirection.php",
|
187 |
+
"sub": "options",
|
188 |
+
"_wpnonce": "e2c008ca25",
|
189 |
+
"_wp_http_referer": "\/wp-admin\/tools.php?page=redirection.php&sub=options",
|
190 |
+
"delete": "Delete"
|
191 |
+
}
|
192 |
+
*/
|
193 |
+
if ( isset( $_REQUEST["sub"] ) && $_REQUEST["sub"] == "options" && isset( $_REQUEST["delete"] ) && $_REQUEST["delete"] == "Delete" ) {
|
194 |
+
$this->log_options_delete_all( $_REQUEST );
|
195 |
+
return;
|
196 |
+
}
|
197 |
+
|
198 |
+
/*
|
199 |
+
Save options {
|
200 |
+
"page": "redirection.php",
|
201 |
+
"sub": "options",
|
202 |
+
"_wpnonce": "8fe9b57662",
|
203 |
+
"_wp_http_referer": "\/wp-admin\/tools.php?page=redirection.php&sub=options",
|
204 |
+
"support": "on",
|
205 |
+
"expire_redirect": "7",
|
206 |
+
"expire_404": "7",
|
207 |
+
"monitor_post": "0",
|
208 |
+
"token": "acf88715b12038e3aca1ae1b3d82132a",
|
209 |
+
"auto_target": "",
|
210 |
+
"update": "Update"
|
211 |
+
}
|
212 |
+
*/
|
213 |
+
if (
|
214 |
+
isset( $_REQUEST["sub"] ) && $_REQUEST["sub"] == "options" &&
|
215 |
+
isset( $_REQUEST["update"] ) && $_REQUEST["update"] == "Update"
|
216 |
+
|
217 |
+
) {
|
218 |
+
$this->log_options_save( $_REQUEST );
|
219 |
+
return;
|
220 |
+
}
|
221 |
+
|
222 |
+
/*
|
223 |
+
Add group
|
224 |
+
{
|
225 |
+
"page": "redirection.php",
|
226 |
+
"sub": "groups",
|
227 |
+
"_wpnonce": "4cac237744",
|
228 |
+
"_wp_http_referer": "\/wp-admin\/tools.php?page=redirection.php&sub=groups",
|
229 |
+
"name": "new group yo",
|
230 |
+
"module_id": "1",
|
231 |
+
"add": "Add"
|
232 |
+
}
|
233 |
+
*/
|
234 |
+
if (
|
235 |
+
isset( $_REQUEST["sub"] ) && $_REQUEST["sub"] == "groups" &&
|
236 |
+
isset( $_REQUEST["add"] ) && $_REQUEST["add"] == "Add"
|
237 |
+
) {
|
238 |
+
$this->log_group_add( $_REQUEST );
|
239 |
+
return;
|
240 |
+
}
|
241 |
+
|
242 |
+
|
243 |
+
/*
|
244 |
+
Delete group(s)
|
245 |
+
{
|
246 |
+
"page": "redirection.php",
|
247 |
+
"sub": "groups",
|
248 |
+
"_wpnonce": "290f261024",
|
249 |
+
"_wp_http_referer": "\/wp-admin\/tools.php?page=redirection.php&sub=groups",
|
250 |
+
"action": "-1",
|
251 |
+
"id": "0",
|
252 |
+
"paged": "1",
|
253 |
+
"item": [
|
254 |
+
"3",
|
255 |
+
"2"
|
256 |
+
],
|
257 |
+
"action2": "delete"
|
258 |
+
}
|
259 |
+
*/
|
260 |
+
if (
|
261 |
+
isset( $_REQUEST["sub"] ) && $_REQUEST["sub"] == "groups" &&
|
262 |
+
isset( $_REQUEST["action"] ) && $_REQUEST["action"] == "delete"
|
263 |
+
) {
|
264 |
+
$this->log_group_delete( $_REQUEST );
|
265 |
+
return;
|
266 |
+
}
|
267 |
+
|
268 |
+
/*
|
269 |
+
Disable group(s)
|
270 |
+
{
|
271 |
+
"path": "\/wp-admin\/tools.php",
|
272 |
+
"query": "page=redirection.php&sub=groups"
|
273 |
+
}
|
274 |
+
{
|
275 |
+
"page": "redirection.php",
|
276 |
+
"sub": "groups",
|
277 |
+
"_wpnonce": "290f261024",
|
278 |
+
"_wp_http_referer": "\/wp-admin\/tools.php?page=redirection.php&sub=groups",
|
279 |
+
"action": "disable",
|
280 |
+
"id": "0",
|
281 |
+
"paged": "1",
|
282 |
+
"item": [
|
283 |
+
"1"
|
284 |
+
],
|
285 |
+
"action2": "-1"
|
286 |
+
}
|
287 |
+
*/
|
288 |
+
if (
|
289 |
+
isset( $_REQUEST["sub"] ) && $_REQUEST["sub"] == "groups" &&
|
290 |
+
isset( $_REQUEST["action"] ) && $_REQUEST["action"] == "enable"
|
291 |
+
) {
|
292 |
+
$this->log_group_enable_or_disable( $_REQUEST );
|
293 |
+
return;
|
294 |
+
} else if (
|
295 |
+
isset( $_REQUEST["sub"] ) && $_REQUEST["sub"] == "groups" &&
|
296 |
+
isset( $_REQUEST["action"] ) && $_REQUEST["action"] == "disable"
|
297 |
+
) {
|
298 |
+
$this->log_group_enable_or_disable( $_REQUEST );
|
299 |
+
return;
|
300 |
+
}
|
301 |
+
|
302 |
+
} // on admin init
|
303 |
+
|
304 |
+
|
305 |
+
function log_group_enable_or_disable() {
|
306 |
+
// @HERE
|
307 |
+
}
|
308 |
+
|
309 |
+
function log_group_delete( $req ) {
|
310 |
+
|
311 |
+
$items = isset( $req["item"] ) ? (array) $req["item"] : array();
|
312 |
+
|
313 |
+
$context = array(
|
314 |
+
"items" => $items,
|
315 |
+
"items_count" => count( $items ),
|
316 |
+
);
|
317 |
+
|
318 |
+
$this->infoMessage(
|
319 |
+
"redirection_group_deleted",
|
320 |
+
$context
|
321 |
+
);
|
322 |
+
|
323 |
+
}
|
324 |
+
|
325 |
+
function log_group_add( $req ) {
|
326 |
+
|
327 |
+
$group_name = isset( $req["name"] ) ? $req["name"] : null;
|
328 |
+
|
329 |
+
if ( ! $group_name ) {
|
330 |
+
return;
|
331 |
+
}
|
332 |
+
|
333 |
+
$context = array(
|
334 |
+
"group_name" => $group_name
|
335 |
+
);
|
336 |
+
|
337 |
+
$this->infoMessage(
|
338 |
+
"redirection_group_added",
|
339 |
+
$context
|
340 |
+
);
|
341 |
+
|
342 |
+
}
|
343 |
+
|
344 |
+
function log_options_save( $req ) {
|
345 |
+
|
346 |
+
$this->infoMessage("redirection_options_saved");
|
347 |
+
|
348 |
+
}
|
349 |
+
|
350 |
+
function log_options_delete_all( $req ) {
|
351 |
+
|
352 |
+
$this->infoMessage("redirection_options_removed_all");
|
353 |
+
|
354 |
+
}
|
355 |
+
|
356 |
+
function log_redirection_delete( $req ) {
|
357 |
+
|
358 |
+
$items = isset( $req["item"] ) ? (array) $req["item"] : array();
|
359 |
+
|
360 |
+
$context = array(
|
361 |
+
"items" => $items,
|
362 |
+
"items_count" => count( $items )
|
363 |
+
);
|
364 |
+
|
365 |
+
$message_key = "redirection_redirection_removed";
|
366 |
+
|
367 |
+
$this->infoMessage(
|
368 |
+
$message_key,
|
369 |
+
$context
|
370 |
+
);
|
371 |
+
|
372 |
+
}
|
373 |
+
|
374 |
+
function log_redirection_edit( $req ) {
|
375 |
+
|
376 |
+
/*
|
377 |
+
log_redirection_edit
|
378 |
+
{
|
379 |
+
"old": "ddd changedaa",
|
380 |
+
"regex": "on",
|
381 |
+
"title": "this is descriptionaa",
|
382 |
+
"group_id": "12",
|
383 |
+
"user_agent": "Firefoxaa",
|
384 |
+
"url_from": "eee changedaa",
|
385 |
+
"url_notfrom": "not matched straa",
|
386 |
+
"action": "red_redirect_save",
|
387 |
+
"id": "7",
|
388 |
+
"_wpnonce": "f15cdcdaea",
|
389 |
+
"_wp_http_referer": "\/wp-admin\/admin-ajax.php"
|
390 |
+
}
|
391 |
+
*/
|
392 |
+
#error_log( "log_redirection_edit\n" . SimpleHistory::json_encode( $_REQUEST ) );
|
393 |
+
|
394 |
+
$context = array(
|
395 |
+
"source_url" => isset( $req["old"] ) ? $req["old"] : null,
|
396 |
+
"target_url" => isset( $req["target"] ) ? $req["target"] : null,
|
397 |
+
"item_id" => isset( $req["id"] ) ? $req["id"] : null,
|
398 |
+
"title" => isset( $req["title"] ) ? $req["title"] : null,
|
399 |
+
"regex" => isset( $req["regex"] ) ? true : false,
|
400 |
+
"group_id" => isset( $req["group_id"] ) ? $req["group_id"] : null,
|
401 |
+
"user_agent" => isset( $req["user_agent"] ) ? $req["user_agent"] : null,
|
402 |
+
"url_from" => isset( $req["url_from"] ) ? $req["url_from"] : null,
|
403 |
+
"url_notfrom" => isset( $req["url_notfrom"] ) ? $req["url_notfrom"] : null,
|
404 |
+
"action_code" => isset( $req["action_code"] ) ? $req["action_code"] : null,
|
405 |
+
);
|
406 |
+
|
407 |
+
$message_key = "redirection_redirection_edited";
|
408 |
+
|
409 |
+
$this->infoMessage(
|
410 |
+
$message_key,
|
411 |
+
$context
|
412 |
+
);
|
413 |
+
|
414 |
+
}
|
415 |
+
|
416 |
+
function log_redirection_enable_or_disable( $req ) {
|
417 |
+
|
418 |
+
$message_key = $req["action"] == "enable" ? "redirection_redirection_enabled" : "redirection_redirection_disabled";
|
419 |
+
|
420 |
+
$items = isset( $req["item"] ) ? (array) $req["item"] : array();
|
421 |
+
|
422 |
+
$context = array(
|
423 |
+
"items" => $items,
|
424 |
+
"items_count" => count( $items )
|
425 |
+
);
|
426 |
+
|
427 |
+
$this->infoMessage(
|
428 |
+
$message_key,
|
429 |
+
$context
|
430 |
+
);
|
431 |
+
|
432 |
+
}
|
433 |
+
|
434 |
+
function log_redirection_add( $req ) {
|
435 |
+
|
436 |
+
if ( ! isset( $req["group_id"] ) ) {
|
437 |
+
return;
|
438 |
+
}
|
439 |
+
|
440 |
+
$source = isset( $req["source"] ) ? $req["source"] : null;
|
441 |
+
$target = isset( $req["target"] ) ? $req["target"] : null;
|
442 |
+
$match = isset( $req["match"] ) ? $req["match"] : null;
|
443 |
+
$action = isset( $req["action"] ) ? $req["action"] : null;
|
444 |
+
$group_id = isset( $req["group_id"] ) ? $req["group_id"] : null;
|
445 |
+
$regex = isset( $req["regex"] ) ? true : false;
|
446 |
+
|
447 |
+
$context = array(
|
448 |
+
"source_url" => $source,
|
449 |
+
"target_url" => $target,
|
450 |
+
"match" => $match,
|
451 |
+
"action" => $action,
|
452 |
+
"group_id" => $group_id,
|
453 |
+
"regex" => $regex,
|
454 |
+
);
|
455 |
+
|
456 |
+
$this->infoMessage("redirection_redirection_added", $context);
|
457 |
+
|
458 |
+
}
|
459 |
+
|
460 |
+
} // class
|
461 |
+
|
462 |
+
} // class exists
|
loggers/SimplePluginLogger.php
CHANGED
@@ -1182,8 +1182,15 @@ class SimplePluginLogger extends SimpleLogger {
|
|
1182 |
$url = admin_url( "plugin-install.php?tab=plugin-information&plugin={$plugin_slug}&section=&TB_iframe=true&width=640&height=550" );
|
1183 |
|
1184 |
if ( "plugin_updated" == $message_key || "plugin_bulk_updated" == $message_key ) {
|
|
|
1185 |
$link_title = esc_html_x("View changelog", "plugin logger: plugin info thickbox title", "simple-history");
|
1186 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1187 |
}
|
1188 |
|
1189 |
$output .= sprintf(
|
1182 |
$url = admin_url( "plugin-install.php?tab=plugin-information&plugin={$plugin_slug}&section=&TB_iframe=true&width=640&height=550" );
|
1183 |
|
1184 |
if ( "plugin_updated" == $message_key || "plugin_bulk_updated" == $message_key ) {
|
1185 |
+
|
1186 |
$link_title = esc_html_x("View changelog", "plugin logger: plugin info thickbox title", "simple-history");
|
1187 |
+
|
1188 |
+
if ( is_multisite() ) {
|
1189 |
+
$url = network_admin_url( "plugin-install.php?tab=plugin-information&plugin={$plugin_slug}&section=changelog&TB_iframe=true&width=772&height=550" );
|
1190 |
+
} else {
|
1191 |
+
$url = admin_url( "plugin-install.php?tab=plugin-information&plugin={$plugin_slug}&section=changelog&TB_iframe=true&width=772&height=550" );
|
1192 |
+
}
|
1193 |
+
|
1194 |
}
|
1195 |
|
1196 |
$output .= sprintf(
|
loggers/SimpleUserLogger.php
CHANGED
@@ -828,6 +828,7 @@ class SimpleUserLogger extends SimpleLogger {
|
|
828 |
$message_key = $context["_message_key"];
|
829 |
|
830 |
$out = "";
|
|
|
831 |
|
832 |
if ( "user_updated_profile" == $message_key ) {
|
833 |
|
@@ -885,8 +886,6 @@ class SimpleUserLogger extends SimpleLogger {
|
|
885 |
)
|
886 |
);
|
887 |
|
888 |
-
$diff_table_output = "";
|
889 |
-
|
890 |
foreach ( $arr_user_keys_to_show_diff_for as $key => $val ) {
|
891 |
|
892 |
if ( isset( $context["user_prev_{$key}"] ) && isset( $context["user_new_{$key}"] ) ) {
|
828 |
$message_key = $context["_message_key"];
|
829 |
|
830 |
$out = "";
|
831 |
+
$diff_table_output = "";
|
832 |
|
833 |
if ( "user_updated_profile" == $message_key ) {
|
834 |
|
886 |
)
|
887 |
);
|
888 |
|
|
|
|
|
889 |
foreach ( $arr_user_keys_to_show_diff_for as $key => $val ) {
|
890 |
|
891 |
if ( isset( $context["user_prev_{$key}"] ) && isset( $context["user_new_{$key}"] ) ) {
|
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, dashboard, admin, syslog, feed, activity, stream, audit trail, brute-force
|
5 |
Requires at least: 4.5.1
|
6 |
Tested up to: 4.6
|
7 |
-
Stable tag: 2.
|
8 |
|
9 |
View changes made by users within WordPress. See who created a page, uploaded an attachment or approved an comment, and more.
|
10 |
|
@@ -153,6 +153,13 @@ A simple way to see any uncommon activity, for example an increased number of lo
|
|
153 |
|
154 |
## Changelog
|
155 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
= 2.10 (September 2016) =
|
157 |
|
158 |
- Available updates to plugins, themes, and WordPress itself is now logged.
|
4 |
Tags: history, log, changes, changelog, audit, trail, pages, attachments, users, dashboard, admin, syslog, feed, activity, stream, audit trail, brute-force
|
5 |
Requires at least: 4.5.1
|
6 |
Tested up to: 4.6
|
7 |
+
Stable tag: 2.11
|
8 |
|
9 |
View changes made by users within WordPress. See who created a page, uploaded an attachment or approved an comment, and more.
|
10 |
|
153 |
|
154 |
## Changelog
|
155 |
|
156 |
+
= 2.11 (September 2016) =
|
157 |
+
|
158 |
+
- Added support for plugin [Redirection](https://wordpress.org/plugins/redirection/).
|
159 |
+
Redirects and groups that are created, changed, enabled and disabled will be logged. Also when the plugin global settings are changed that will be logged.
|
160 |
+
- Fix possible notice error from User logger.
|
161 |
+
- "View changelog" link now works on multisite.
|
162 |
+
|
163 |
= 2.10 (September 2016) =
|
164 |
|
165 |
- Available updates to plugins, themes, and WordPress itself is now logged.
|