Version Description
(August 2017) =
- Set from_term_description correctly, fixes https://github.com/bonny/WordPress-Simple-History/issues/127.
- Add filter
simple_history/post_logger/skip_posttypes
. - Don't log post type
jetpack_migation
because for some users that post type filled the log. Fixes https://wordpress.org/support/topic/updated-jetpack_migration-sidebars_widgets/.
Download this release
Release Info
Developer | eskapism |
Plugin | Simple History |
Version | 2.18 |
Comparing to | |
See all releases |
Code changes from version 2.17 to 2.18
- examples/examples.php +1 -1
- index.php +2 -2
- loggers/SimpleCategoriesLogger.php +11 -11
- loggers/SimplePostLogger.php +20 -19
- readme.txt +8 -2
examples/examples.php
CHANGED
@@ -250,7 +250,7 @@ add_filter("simple_history/dropin/load_dropin_SimpleHistoryRSSDropin", "__return
|
|
250 |
|
251 |
// This is the easiest and safest way to add messages to the log:
|
252 |
apply_filters("simple_history_log", "This is a logged message");
|
253 |
-
apply_filters("simple_history_log", "This is a message with some context added",
|
254 |
apply_filters("simple_history_log", "This is another logged message, with another severity level", null, "debug");
|
255 |
|
256 |
// Below is the function way of adding things to the log
|
250 |
|
251 |
// This is the easiest and safest way to add messages to the log:
|
252 |
apply_filters("simple_history_log", "This is a logged message");
|
253 |
+
apply_filters("simple_history_log", "This is a message with some context added", array("isATestMessage" => "yup", "debugRequestData" => $_REQUEST));
|
254 |
apply_filters("simple_history_log", "This is another logged message, with another severity level", null, "debug");
|
255 |
|
256 |
// Below is the function way of adding things to the log
|
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.18
|
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.18' );
|
46 |
}
|
47 |
|
48 |
if ( ! defined( 'SIMPLE_HISTORY_PATH' ) ) {
|
loggers/SimpleCategoriesLogger.php
CHANGED
@@ -11,12 +11,12 @@ class SimpleCategoriesLogger extends SimpleLogger {
|
|
11 |
|
12 |
/**
|
13 |
* Get array with information about this logger
|
14 |
-
*
|
15 |
* @return array
|
16 |
*/
|
17 |
function getInfo() {
|
18 |
|
19 |
-
$arr_info = array(
|
20 |
"name" => __("Categories Logger", "simple-history"),
|
21 |
"description" => "Logs changes to categories, tags, and taxonomies",
|
22 |
"messages" => array(
|
@@ -31,13 +31,13 @@ class SimpleCategoriesLogger extends SimpleLogger {
|
|
31 |
_x("WordPress core updates", "User logger: search", "simple-history") => array(
|
32 |
"core_updated",
|
33 |
"core_auto_updated"
|
34 |
-
),
|
35 |
)
|
36 |
) // end search array
|
37 |
) // end labels
|
38 |
*/
|
39 |
);
|
40 |
-
|
41 |
return $arr_info;
|
42 |
|
43 |
}
|
@@ -63,7 +63,7 @@ class SimpleCategoriesLogger extends SimpleLogger {
|
|
63 |
* @param int $tt_id Term taxonomy ID.
|
64 |
* @param string $taxonomy Taxonomy slug.
|
65 |
do_action( "edited_term", $term_id, $tt_id, $taxonomy );
|
66 |
-
|
67 |
* Filter the term parent.
|
68 |
*
|
69 |
* Hook to this filter to see if it will cause a hierarchy loop.
|
@@ -84,14 +84,14 @@ class SimpleCategoriesLogger extends SimpleLogger {
|
|
84 |
add_action( 'created_term', array( $this, "on_created_term"), 10, 3 );
|
85 |
add_action( 'delete_term', array( $this, "on_delete_term"), 10, 4 );
|
86 |
add_action( 'wp_update_term_parent', array( $this, "on_wp_update_term_parent"), 10, 5 );
|
87 |
-
|
88 |
// This action does not contain enough info to know what the term was called before the update
|
89 |
-
// add_action( "edited_term", array( $this, "on_edited_term"), 10, 3 );
|
90 |
|
91 |
}
|
92 |
|
93 |
/*
|
94 |
-
* Filter the term parent.
|
95 |
* Only way for Simple History to get both old and new term name
|
96 |
*
|
97 |
* @param int $parent ID of the parent term.
|
@@ -109,7 +109,7 @@ class SimpleCategoriesLogger extends SimpleLogger {
|
|
109 |
}
|
110 |
|
111 |
$term_id = $term_before_edited->term_id;
|
112 |
-
|
113 |
$from_term_name = $term_before_edited->name;
|
114 |
$from_term_taxonomy = $term_before_edited->taxonomy;
|
115 |
$from_term_slug = $term_before_edited->slug;
|
@@ -127,7 +127,7 @@ class SimpleCategoriesLogger extends SimpleLogger {
|
|
127 |
"from_term_name" => $from_term_name,
|
128 |
"from_term_taxonomy" => $from_term_taxonomy,
|
129 |
"from_term_slug" => $from_term_slug,
|
130 |
-
"
|
131 |
"to_term_name" => $to_term_name,
|
132 |
"to_term_taxonomy" => $to_term_taxonomy,
|
133 |
"to_term_slug" => $to_term_slug,
|
@@ -145,7 +145,7 @@ class SimpleCategoriesLogger extends SimpleLogger {
|
|
145 |
|
146 |
}
|
147 |
|
148 |
-
/*
|
149 |
* Fires after a new term is created, and after the term cache has been cleaned.
|
150 |
*
|
151 |
* @since 2.3.0
|
11 |
|
12 |
/**
|
13 |
* Get array with information about this logger
|
14 |
+
*
|
15 |
* @return array
|
16 |
*/
|
17 |
function getInfo() {
|
18 |
|
19 |
+
$arr_info = array(
|
20 |
"name" => __("Categories Logger", "simple-history"),
|
21 |
"description" => "Logs changes to categories, tags, and taxonomies",
|
22 |
"messages" => array(
|
31 |
_x("WordPress core updates", "User logger: search", "simple-history") => array(
|
32 |
"core_updated",
|
33 |
"core_auto_updated"
|
34 |
+
),
|
35 |
)
|
36 |
) // end search array
|
37 |
) // end labels
|
38 |
*/
|
39 |
);
|
40 |
+
|
41 |
return $arr_info;
|
42 |
|
43 |
}
|
63 |
* @param int $tt_id Term taxonomy ID.
|
64 |
* @param string $taxonomy Taxonomy slug.
|
65 |
do_action( "edited_term", $term_id, $tt_id, $taxonomy );
|
66 |
+
|
67 |
* Filter the term parent.
|
68 |
*
|
69 |
* Hook to this filter to see if it will cause a hierarchy loop.
|
84 |
add_action( 'created_term', array( $this, "on_created_term"), 10, 3 );
|
85 |
add_action( 'delete_term', array( $this, "on_delete_term"), 10, 4 );
|
86 |
add_action( 'wp_update_term_parent', array( $this, "on_wp_update_term_parent"), 10, 5 );
|
87 |
+
|
88 |
// This action does not contain enough info to know what the term was called before the update
|
89 |
+
// add_action( "edited_term", array( $this, "on_edited_term"), 10, 3 );
|
90 |
|
91 |
}
|
92 |
|
93 |
/*
|
94 |
+
* Filter the term parent.
|
95 |
* Only way for Simple History to get both old and new term name
|
96 |
*
|
97 |
* @param int $parent ID of the parent term.
|
109 |
}
|
110 |
|
111 |
$term_id = $term_before_edited->term_id;
|
112 |
+
|
113 |
$from_term_name = $term_before_edited->name;
|
114 |
$from_term_taxonomy = $term_before_edited->taxonomy;
|
115 |
$from_term_slug = $term_before_edited->slug;
|
127 |
"from_term_name" => $from_term_name,
|
128 |
"from_term_taxonomy" => $from_term_taxonomy,
|
129 |
"from_term_slug" => $from_term_slug,
|
130 |
+
"from_term_description" => $from_term_description,
|
131 |
"to_term_name" => $to_term_name,
|
132 |
"to_term_taxonomy" => $to_term_taxonomy,
|
133 |
"to_term_slug" => $to_term_slug,
|
145 |
|
146 |
}
|
147 |
|
148 |
+
/*
|
149 |
* Fires after a new term is created, and after the term cache has been cleaned.
|
150 |
*
|
151 |
* @since 2.3.0
|
loggers/SimplePostLogger.php
CHANGED
@@ -342,31 +342,32 @@ class SimplePostLogger extends SimpleLogger
|
|
342 |
$ok_to_log = true;
|
343 |
}
|
344 |
|
345 |
-
// Don't log revisions
|
346 |
if ( wp_is_post_revision( $post ) ) {
|
347 |
$ok_to_log = false;
|
348 |
}
|
349 |
|
350 |
-
|
351 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
352 |
}
|
353 |
|
354 |
-
|
355 |
-
/*
|
356 |
-
$post_types = get_post_types();
|
357 |
-
Array
|
358 |
-
(
|
359 |
-
[post] => post
|
360 |
-
[page] => page
|
361 |
-
[attachment] => attachment
|
362 |
-
[revision] => revision
|
363 |
-
[nav_menu_item] => nav_menu_item
|
364 |
-
[texts] => texts
|
365 |
-
[products] => products
|
366 |
-
[book] => book
|
367 |
-
)
|
368 |
-
*/
|
369 |
-
if ( "nav_menu_item" == get_post_type( $post ) ) {
|
370 |
return;
|
371 |
}
|
372 |
|
342 |
$ok_to_log = true;
|
343 |
}
|
344 |
|
345 |
+
// Don't log revisions.
|
346 |
if ( wp_is_post_revision( $post ) ) {
|
347 |
$ok_to_log = false;
|
348 |
}
|
349 |
|
350 |
+
// Don't log some post types.
|
351 |
+
$skip_posttypes = array(
|
352 |
+
// Don't log nav_menu_updates.
|
353 |
+
'nav_menu_item',
|
354 |
+
// Don't log jetpack migration-things.
|
355 |
+
// https://wordpress.org/support/topic/updated-jetpack_migration-sidebars_widgets/.
|
356 |
+
'jetpack_migration',
|
357 |
+
);
|
358 |
+
|
359 |
+
/**
|
360 |
+
* Filter to log what post types not to log
|
361 |
+
*
|
362 |
+
* @since 2.18
|
363 |
+
*/
|
364 |
+
$skip_posttypes = apply_filters( 'simple_history/post_logger/skip_posttypes', $skip_posttypes );
|
365 |
+
|
366 |
+
if ( in_array( get_post_type( $post ), $skip_posttypes, true ) ) {
|
367 |
+
$ok_to_log = false;
|
368 |
}
|
369 |
|
370 |
+
if ( ! $ok_to_log ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
371 |
return;
|
372 |
}
|
373 |
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: eskapism
|
|
3 |
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.
|
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 |
|
@@ -162,6 +162,12 @@ A simple way to see any uncommon activity, for example an increased number of lo
|
|
162 |
|
163 |
## Changelog
|
164 |
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
= 2.17 (June 2017) =
|
166 |
|
167 |
- Fix search date range inputs not showing correctly.
|
3 |
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.8
|
7 |
+
Stable tag: 2.18
|
8 |
|
9 |
View changes made by users within WordPress. See who created a page, uploaded an attachment or approved an comment, and more.
|
10 |
|
162 |
|
163 |
## Changelog
|
164 |
|
165 |
+
= 2.18 (August 2017) =
|
166 |
+
|
167 |
+
- Set from_term_description correctly, fixes https://github.com/bonny/WordPress-Simple-History/issues/127.
|
168 |
+
- Add filter `simple_history/post_logger/skip_posttypes`.
|
169 |
+
- Don't log post type `jetpack_migation` because for some users that post type filled the log. Fixes https://wordpress.org/support/topic/updated-jetpack_migration-sidebars_widgets/.
|
170 |
+
|
171 |
= 2.17 (June 2017) =
|
172 |
|
173 |
- Fix search date range inputs not showing correctly.
|