Version Description
September 8, 2017 =
New: Support for the ACF Options page. (#931)
New: Added minimal composer file. (#932
Tweak: Remove dependence on serializing functions. (#939)
Tweak: Add wp_stream_is_record_excluded filter. (#921)
Fix: Readme spelling fixes (localised [sic] for en_US). (#928)
Fix: Undefined index ID issue when trashing post with customize-posts. (#936)
Fix: Stream fails to install properly (sometimes) due to database error. (#934)
Download this release
Release Info
Developer | lukecarbis |
Plugin | Stream |
Version | 3.2.1 |
Comparing to | |
See all releases |
Code changes from version 3.2.0 to 3.2.1
- classes/class-alert.php +1 -1
- classes/class-alerts-list.php +1 -1
- classes/class-alerts.php +5 -6
- classes/class-author.php +3 -3
- classes/class-connector.php +2 -1
- classes/class-db.php +1 -14
- classes/class-export.php +1 -1
- classes/class-install.php +2 -2
- classes/class-list-table.php +2 -2
- classes/class-log.php +19 -15
- classes/class-plugin.php +2 -2
- classes/class-query.php +5 -41
- classes/class-record.php +4 -4
- connectors/class-connector-acf.php +19 -3
- connectors/class-connector-buddypress.php +4 -4
- connectors/class-connector-edd.php +2 -2
- connectors/class-connector-jetpack.php +2 -2
- connectors/class-connector-settings.php +4 -5
- connectors/class-connector-woocommerce.php +2 -3
- readme.txt +20 -10
- stream.php +1 -1
- ui/css/admin.css +2 -0
classes/class-alert.php
CHANGED
@@ -162,7 +162,7 @@ class Alert {
|
|
162 |
* @return mixed Single value if $single is true, array if false.
|
163 |
*/
|
164 |
public function get_meta( $meta_key = '', $single = false ) {
|
165 |
-
return
|
166 |
}
|
167 |
|
168 |
/**
|
162 |
* @return mixed Single value if $single is true, array if false.
|
163 |
*/
|
164 |
public function get_meta( $meta_key = '', $single = false ) {
|
165 |
+
return get_post_meta( $this->ID, $meta_key, $single );
|
166 |
}
|
167 |
|
168 |
/**
|
classes/class-alerts-list.php
CHANGED
@@ -334,7 +334,7 @@ class Alerts_List {
|
|
334 |
* @return array
|
335 |
*/
|
336 |
function save_alert_inline_edit( $data, $postarr ) {
|
337 |
-
if ( did_action( 'customize_preview_init' ) ) {
|
338 |
return $data;
|
339 |
}
|
340 |
|
334 |
* @return array
|
335 |
*/
|
336 |
function save_alert_inline_edit( $data, $postarr ) {
|
337 |
+
if ( did_action( 'customize_preview_init' ) || empty( $postarr['ID'] ) ) {
|
338 |
return $data;
|
339 |
}
|
340 |
|
classes/class-alerts.php
CHANGED
@@ -366,18 +366,17 @@ class Alerts {
|
|
366 |
}
|
367 |
|
368 |
$post = get_post( $post_id );
|
369 |
-
|
|
|
|
|
370 |
|
371 |
$obj = (object) array(
|
372 |
'ID' => $post->ID,
|
373 |
'status' => $post->post_status,
|
374 |
'date' => $post->post_date,
|
375 |
'author' => $post->post_author,
|
376 |
-
'
|
377 |
-
'
|
378 |
-
'filter_context' => isset( $meta['filter_context'] ) ? $meta['filter_context'][0] : null,
|
379 |
-
'alert_type' => isset( $meta['alert_type'] ) ? $meta['alert_type'][0] : null,
|
380 |
-
'alert_meta' => isset( $meta['alert_meta'] ) ? (array) maybe_unserialize( $meta['alert_meta'][0] ) : array(),
|
381 |
);
|
382 |
|
383 |
return new Alert( $obj, $this->plugin );
|
366 |
}
|
367 |
|
368 |
$post = get_post( $post_id );
|
369 |
+
|
370 |
+
$alert_type = get_post_meta( $post_id, 'alert_type', true );
|
371 |
+
$alert_meta = get_post_meta( $post_id, 'alert_meta', true );
|
372 |
|
373 |
$obj = (object) array(
|
374 |
'ID' => $post->ID,
|
375 |
'status' => $post->post_status,
|
376 |
'date' => $post->post_date,
|
377 |
'author' => $post->post_author,
|
378 |
+
'alert_type' => $alert_type,
|
379 |
+
'alert_meta' => $alert_meta,
|
|
|
|
|
|
|
380 |
);
|
381 |
|
382 |
return new Alert( $obj, $this->plugin );
|
classes/class-author.php
CHANGED
@@ -20,12 +20,12 @@ class Author {
|
|
20 |
/**
|
21 |
* Class constructor.
|
22 |
*
|
23 |
-
* @param int
|
24 |
-
* @param array
|
25 |
*/
|
26 |
function __construct( $user_id, $user_meta = array() ) {
|
27 |
$this->id = absint( $user_id );
|
28 |
-
$this->meta =
|
29 |
|
30 |
if ( $this->id ) {
|
31 |
$this->user = new \WP_User( $this->id );
|
20 |
/**
|
21 |
* Class constructor.
|
22 |
*
|
23 |
+
* @param int $user_id The user ID.
|
24 |
+
* @param array $user_meta The user meta array.
|
25 |
*/
|
26 |
function __construct( $user_id, $user_meta = array() ) {
|
27 |
$this->id = absint( $user_id );
|
28 |
+
$this->meta = $user_meta;
|
29 |
|
30 |
if ( $this->id ) {
|
31 |
$this->user = new \WP_User( $this->id );
|
classes/class-connector.php
CHANGED
@@ -181,7 +181,8 @@ abstract class Connector {
|
|
181 |
$old_value,
|
182 |
$new_value,
|
183 |
function( $value1, $value2 ) {
|
184 |
-
|
|
|
185 |
}
|
186 |
);
|
187 |
|
181 |
$old_value,
|
182 |
$new_value,
|
183 |
function( $value1, $value2 ) {
|
184 |
+
// Compare potentially complex nested arrays
|
185 |
+
return wp_json_encode( $value1 ) !== wp_json_encode( $value2 );
|
186 |
}
|
187 |
);
|
188 |
|
classes/class-db.php
CHANGED
@@ -56,22 +56,9 @@ class DB {
|
|
56 |
return false;
|
57 |
}
|
58 |
|
59 |
-
$fields = array( 'object_id', 'site_id', 'blog_id', 'user_id', 'user_role', 'created', 'summary', 'ip', 'connector', 'context', 'action' );
|
60 |
$data = array_intersect_key( $record, array_flip( $fields ) );
|
61 |
|
62 |
-
$meta = array();
|
63 |
-
foreach ( (array) $record['meta'] as $key => $vals ) {
|
64 |
-
// If associative array, serialize it, otherwise loop on its members
|
65 |
-
$vals = ( is_array( $vals ) && 0 !== key( $vals ) ) ? array( $vals ) : $vals;
|
66 |
-
|
67 |
-
foreach ( (array) $vals as $num => $val ) {
|
68 |
-
$vals[ $num ] = maybe_serialize( $val );
|
69 |
-
}
|
70 |
-
$meta[ $key ] = $vals;
|
71 |
-
}
|
72 |
-
|
73 |
-
$data['meta'] = $meta;
|
74 |
-
|
75 |
$record_id = $this->driver->insert_record( $data );
|
76 |
|
77 |
if ( ! $record_id ) {
|
56 |
return false;
|
57 |
}
|
58 |
|
59 |
+
$fields = array( 'object_id', 'site_id', 'blog_id', 'user_id', 'user_role', 'created', 'summary', 'ip', 'connector', 'context', 'action', 'meta' );
|
60 |
$data = array_intersect_key( $record, array_flip( $fields ) );
|
61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
$record_id = $this->driver->insert_record( $data );
|
63 |
|
64 |
if ( ! $record_id ) {
|
classes/class-export.php
CHANGED
@@ -108,7 +108,7 @@ class Export {
|
|
108 |
break;
|
109 |
|
110 |
case 'user_id' :
|
111 |
-
$user = new Author( (int) $record->user_id, (array)
|
112 |
$row_out[ $column_name ] = $user->get_display_name();
|
113 |
break;
|
114 |
|
108 |
break;
|
109 |
|
110 |
case 'user_id' :
|
111 |
+
$user = new Author( (int) $record->user_id, (array) $record->user_meta );
|
112 |
$row_out[ $column_name ] = $user->get_display_name();
|
113 |
break;
|
114 |
|
classes/class-install.php
CHANGED
@@ -448,8 +448,8 @@ class Install {
|
|
448 |
meta_value varchar(200) NOT NULL,
|
449 |
PRIMARY KEY (meta_id),
|
450 |
KEY record_id (record_id),
|
451 |
-
KEY meta_key (meta_key),
|
452 |
-
KEY meta_value (meta_value)
|
453 |
)";
|
454 |
|
455 |
if ( ! empty( $wpdb->charset ) ) {
|
448 |
meta_value varchar(200) NOT NULL,
|
449 |
PRIMARY KEY (meta_id),
|
450 |
KEY record_id (record_id),
|
451 |
+
KEY meta_key (meta_key(191)),
|
452 |
+
KEY meta_value (meta_value(191))
|
453 |
)";
|
454 |
|
455 |
if ( ! empty( $wpdb->charset ) ) {
|
classes/class-list-table.php
CHANGED
@@ -256,7 +256,7 @@ class List_Table extends \WP_List_Table {
|
|
256 |
break;
|
257 |
|
258 |
case 'user_id' :
|
259 |
-
$user = new Author( (int) $record->user_id, (array)
|
260 |
|
261 |
$filtered_records_url = add_query_arg(
|
262 |
array(
|
@@ -772,7 +772,7 @@ class List_Table extends \WP_List_Table {
|
|
772 |
?>
|
773 |
<div class="date-interval">
|
774 |
|
775 |
-
<select class="field-predefined hide-if-no-js" name="date_predefined" data-placeholder="<?php esc_attr_e( 'All Time', 'stream' ) ?>">
|
776 |
<option></option>
|
777 |
<option value="custom" <?php selected( 'custom' === $date_predefined ); ?>><?php esc_attr_e( 'Custom', 'stream' ) ?></option>
|
778 |
<?php
|
256 |
break;
|
257 |
|
258 |
case 'user_id' :
|
259 |
+
$user = new Author( (int) $record->user_id, (array) $record->user_meta );
|
260 |
|
261 |
$filtered_records_url = add_query_arg(
|
262 |
array(
|
772 |
?>
|
773 |
<div class="date-interval">
|
774 |
|
775 |
+
<select class="field-predefined hide-if-no-js chosen-select" name="date_predefined" data-placeholder="<?php esc_attr_e( 'All Time', 'stream' ) ?>">
|
776 |
<option></option>
|
777 |
<option value="custom" <?php selected( 'custom' === $date_predefined ); ?>><?php esc_attr_e( 'Custom', 'stream' ) ?></option>
|
778 |
<?php
|
classes/class-log.php
CHANGED
@@ -95,14 +95,6 @@ class Log {
|
|
95 |
// Add user meta to Stream meta
|
96 |
$stream_meta['user_meta'] = $user_meta;
|
97 |
|
98 |
-
// All meta must be strings, so we will serialize any array meta values
|
99 |
-
array_walk(
|
100 |
-
$stream_meta,
|
101 |
-
function( &$v ) {
|
102 |
-
$v = (string) maybe_serialize( $v );
|
103 |
-
}
|
104 |
-
);
|
105 |
-
|
106 |
// Get the current time in milliseconds
|
107 |
$iso_8601_extended_date = wp_stream_get_iso_8601_extended_date();
|
108 |
|
@@ -196,6 +188,8 @@ class Log {
|
|
196 |
}
|
197 |
}
|
198 |
|
|
|
|
|
199 |
if ( isset( $exclude_settings['exclude_row'] ) && ! empty( $exclude_settings['exclude_row'] ) ) {
|
200 |
foreach ( $exclude_settings['exclude_row'] as $key => $value ) {
|
201 |
// Prepare values
|
@@ -217,29 +211,39 @@ class Log {
|
|
217 |
$exclude_rules = array_filter( $exclude, 'strlen' );
|
218 |
|
219 |
if ( ! empty( $exclude_rules ) ) {
|
220 |
-
$
|
221 |
|
222 |
foreach ( $exclude_rules as $exclude_key => $exclude_value ) {
|
223 |
if ( 'ip_address' === $exclude_key ) {
|
224 |
$ip_addresses = explode( ',', $exclude_value );
|
225 |
if ( ! in_array( $record['ip_address'], $ip_addresses, true ) ) {
|
226 |
-
$
|
227 |
break;
|
228 |
}
|
229 |
} elseif ( $record[ $exclude_key ] !== $exclude_value ) {
|
230 |
-
$
|
231 |
break;
|
232 |
}
|
233 |
}
|
234 |
|
235 |
-
if ( $
|
236 |
-
|
|
|
237 |
}
|
238 |
}
|
239 |
}
|
240 |
}
|
241 |
-
|
242 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
243 |
}
|
244 |
|
245 |
/**
|
95 |
// Add user meta to Stream meta
|
96 |
$stream_meta['user_meta'] = $user_meta;
|
97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
// Get the current time in milliseconds
|
99 |
$iso_8601_extended_date = wp_stream_get_iso_8601_extended_date();
|
100 |
|
188 |
}
|
189 |
}
|
190 |
|
191 |
+
$exclude_record = false;
|
192 |
+
|
193 |
if ( isset( $exclude_settings['exclude_row'] ) && ! empty( $exclude_settings['exclude_row'] ) ) {
|
194 |
foreach ( $exclude_settings['exclude_row'] as $key => $value ) {
|
195 |
// Prepare values
|
211 |
$exclude_rules = array_filter( $exclude, 'strlen' );
|
212 |
|
213 |
if ( ! empty( $exclude_rules ) ) {
|
214 |
+
$matches_exclusion_rule = true;
|
215 |
|
216 |
foreach ( $exclude_rules as $exclude_key => $exclude_value ) {
|
217 |
if ( 'ip_address' === $exclude_key ) {
|
218 |
$ip_addresses = explode( ',', $exclude_value );
|
219 |
if ( ! in_array( $record['ip_address'], $ip_addresses, true ) ) {
|
220 |
+
$matches_exclusion_rule = false;
|
221 |
break;
|
222 |
}
|
223 |
} elseif ( $record[ $exclude_key ] !== $exclude_value ) {
|
224 |
+
$matches_exclusion_rule = false;
|
225 |
break;
|
226 |
}
|
227 |
}
|
228 |
|
229 |
+
if ( $matches_exclusion_rule ) {
|
230 |
+
$exclude_record = true;
|
231 |
+
break;
|
232 |
}
|
233 |
}
|
234 |
}
|
235 |
}
|
236 |
+
/**
|
237 |
+
* Filters whether or not a record should be excluded from the log
|
238 |
+
*
|
239 |
+
* If true, the record is not logged.
|
240 |
+
*
|
241 |
+
* @param array $exclude_record Whether the record should excluded
|
242 |
+
* @param array $recordarr The record to log
|
243 |
+
*
|
244 |
+
* @return bool
|
245 |
+
*/
|
246 |
+
return apply_filters( 'wp_stream_is_record_excluded', $exclude_record, $record );
|
247 |
}
|
248 |
|
249 |
/**
|
classes/class-plugin.php
CHANGED
@@ -7,7 +7,7 @@ class Plugin {
|
|
7 |
*
|
8 |
* @const string
|
9 |
*/
|
10 |
-
const VERSION = '3.2.
|
11 |
|
12 |
/**
|
13 |
* WP-CLI command
|
@@ -118,7 +118,7 @@ class Plugin {
|
|
118 |
add_action( 'wp_head', array( $this, 'frontend_indicator' ) );
|
119 |
|
120 |
// Change DB driver after plugin loaded if any add-ons want to replace
|
121 |
-
add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ) );
|
122 |
|
123 |
// Load admin area classes
|
124 |
if ( is_admin() || ( defined( 'WP_STREAM_DEV_DEBUG' ) && WP_STREAM_DEV_DEBUG ) || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
|
7 |
*
|
8 |
* @const string
|
9 |
*/
|
10 |
+
const VERSION = '3.2.1';
|
11 |
|
12 |
/**
|
13 |
* WP-CLI command
|
118 |
add_action( 'wp_head', array( $this, 'frontend_indicator' ) );
|
119 |
|
120 |
// Change DB driver after plugin loaded if any add-ons want to replace
|
121 |
+
add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ), 20 );
|
122 |
|
123 |
// Load admin area classes
|
124 |
if ( is_admin() || ( defined( 'WP_STREAM_DEV_DEBUG' ) && WP_STREAM_DEV_DEBUG ) || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
|
classes/class-query.php
CHANGED
@@ -74,6 +74,11 @@ class Query {
|
|
74 |
/**
|
75 |
* PARSE DATE PARAM FAMILY
|
76 |
*/
|
|
|
|
|
|
|
|
|
|
|
77 |
if ( ! empty( $args['date_from'] ) ) {
|
78 |
$date = get_gmt_from_date( date( 'Y-m-d H:i:s', strtotime( $args['date_from'] . ' 00:00:00' ) ) );
|
79 |
$where .= $wpdb->prepare( " AND DATE($wpdb->stream.created) >= %s", $date );
|
@@ -94,11 +99,6 @@ class Query {
|
|
94 |
$where .= $wpdb->prepare( " AND DATE($wpdb->stream.created) < %s", $date );
|
95 |
}
|
96 |
|
97 |
-
if ( ! empty( $args['date'] ) ) {
|
98 |
-
$args['date_from'] = date( 'Y-m-d', strtotime( $args['date'] ) ) . ' 00:00:00';
|
99 |
-
$args['date_to'] = date( 'Y-m-d', strtotime( $args['date'] ) ) . ' 23:59:59';
|
100 |
-
}
|
101 |
-
|
102 |
/**
|
103 |
* PARSE __IN PARAM FAMILY
|
104 |
*/
|
@@ -234,42 +234,6 @@ class Query {
|
|
234 |
$result['items'] = $wpdb->get_results( $query ); // @codingStandardsIgnoreLine $query already prepared
|
235 |
$result['count'] = $result['items'] ? absint( $wpdb->get_var( 'SELECT FOUND_ROWS()' ) ) : 0;
|
236 |
|
237 |
-
// Add meta to the records, when applicable
|
238 |
-
if ( empty( $fields ) || in_array( 'meta', $fields, true ) ) {
|
239 |
-
$result['items'] = $this->add_record_meta( $result['items'] );
|
240 |
-
}
|
241 |
-
|
242 |
return $result;
|
243 |
}
|
244 |
-
|
245 |
-
/**
|
246 |
-
* Add meta to a set of records
|
247 |
-
*
|
248 |
-
* @param array $records
|
249 |
-
*
|
250 |
-
* @return array
|
251 |
-
*/
|
252 |
-
public function add_record_meta( $records ) {
|
253 |
-
global $wpdb;
|
254 |
-
|
255 |
-
$record_ids = array_map( 'absint', wp_list_pluck( $records, 'ID' ) );
|
256 |
-
|
257 |
-
if ( empty( $record_ids ) ) {
|
258 |
-
return (array) $records;
|
259 |
-
}
|
260 |
-
|
261 |
-
$sql_meta = sprintf(
|
262 |
-
"SELECT * FROM $wpdb->streammeta WHERE record_id IN ( %s )",
|
263 |
-
implode( ',', $record_ids )
|
264 |
-
);
|
265 |
-
|
266 |
-
$meta = $wpdb->get_results( $sql_meta ); // @codingStandardsIgnoreLine prepare okay
|
267 |
-
$ids_f = array_flip( $record_ids );
|
268 |
-
|
269 |
-
foreach ( $meta as $meta_record ) {
|
270 |
-
$records[ $ids_f[ $meta_record->record_id ] ]->meta[ $meta_record->meta_key ] = maybe_unserialize( $meta_record->meta_value );
|
271 |
-
}
|
272 |
-
|
273 |
-
return (array) $records;
|
274 |
-
}
|
275 |
}
|
74 |
/**
|
75 |
* PARSE DATE PARAM FAMILY
|
76 |
*/
|
77 |
+
if ( ! empty( $args['date'] ) ) {
|
78 |
+
$args['date_from'] = $args['date'];
|
79 |
+
$args['date_to'] = $args['date'];
|
80 |
+
}
|
81 |
+
|
82 |
if ( ! empty( $args['date_from'] ) ) {
|
83 |
$date = get_gmt_from_date( date( 'Y-m-d H:i:s', strtotime( $args['date_from'] . ' 00:00:00' ) ) );
|
84 |
$where .= $wpdb->prepare( " AND DATE($wpdb->stream.created) >= %s", $date );
|
99 |
$where .= $wpdb->prepare( " AND DATE($wpdb->stream.created) < %s", $date );
|
100 |
}
|
101 |
|
|
|
|
|
|
|
|
|
|
|
102 |
/**
|
103 |
* PARSE __IN PARAM FAMILY
|
104 |
*/
|
234 |
$result['items'] = $wpdb->get_results( $query ); // @codingStandardsIgnoreLine $query already prepared
|
235 |
$result['count'] = $result['items'] ? absint( $wpdb->get_var( 'SELECT FOUND_ROWS()' ) ) : 0;
|
236 |
|
|
|
|
|
|
|
|
|
|
|
237 |
return $result;
|
238 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
239 |
}
|
classes/class-record.php
CHANGED
@@ -67,17 +67,17 @@ class Record {
|
|
67 |
* @return array
|
68 |
*/
|
69 |
public function get_meta( $meta_key = '', $single = false ) {
|
70 |
-
return
|
71 |
}
|
72 |
|
73 |
/**
|
74 |
* Update record meta
|
75 |
*
|
76 |
* @param string $meta_key
|
77 |
-
* @param
|
78 |
-
* @param
|
79 |
*
|
80 |
-
* @return
|
81 |
*/
|
82 |
public function update_meta( $meta_key, $meta_value, $prev_value = '' ) {
|
83 |
return update_metadata( 'record', $this->ID, $meta_key, $meta_value, $prev_value );
|
67 |
* @return array
|
68 |
*/
|
69 |
public function get_meta( $meta_key = '', $single = false ) {
|
70 |
+
return get_metadata( 'record', $this->ID, $meta_key, $single );
|
71 |
}
|
72 |
|
73 |
/**
|
74 |
* Update record meta
|
75 |
*
|
76 |
* @param string $meta_key
|
77 |
+
* @param mixed $meta_value
|
78 |
+
* @param mixed $prev_value (optional)
|
79 |
*
|
80 |
+
* @return bool
|
81 |
*/
|
82 |
public function update_meta( $meta_key, $meta_value, $prev_value = '' ) {
|
83 |
return update_metadata( 'record', $this->ID, $meta_key, $meta_value, $prev_value );
|
connectors/class-connector-acf.php
CHANGED
@@ -367,6 +367,9 @@ class Connector_ACF extends Connector {
|
|
367 |
list( , $taxonomy, $term_id, $key ) = $matches; // Skips 0 index
|
368 |
|
369 |
$object_key = $taxonomy . '_' . $term_id;
|
|
|
|
|
|
|
370 |
}
|
371 |
|
372 |
if ( isset( $this->cached_field_values_updates[ $object_key ][ $key ] ) ) {
|
@@ -385,6 +388,9 @@ class Connector_ACF extends Connector {
|
|
385 |
$title = $term->name;
|
386 |
$tax_obj = get_taxonomy( $taxonomy );
|
387 |
$type_name = strtolower( get_taxonomy_labels( $tax_obj )->singular_name );
|
|
|
|
|
|
|
388 |
} else {
|
389 |
return false;
|
390 |
}
|
@@ -517,7 +523,7 @@ class Connector_ACF extends Connector {
|
|
517 |
* @param string $value Option value
|
518 |
*/
|
519 |
public function callback_added_option( $key, $value ) {
|
520 |
-
$this->check_meta_values(
|
521 |
}
|
522 |
|
523 |
/**
|
@@ -529,7 +535,7 @@ class Connector_ACF extends Connector {
|
|
529 |
*/
|
530 |
public function callback_updated_option( $key, $old, $value ) {
|
531 |
unset( $old );
|
532 |
-
$this->check_meta_values(
|
533 |
}
|
534 |
|
535 |
/**
|
@@ -538,6 +544,16 @@ class Connector_ACF extends Connector {
|
|
538 |
* @param $key
|
539 |
*/
|
540 |
public function callback_deleted_option( $key ) {
|
541 |
-
$this->check_meta_values(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
542 |
}
|
543 |
}
|
367 |
list( , $taxonomy, $term_id, $key ) = $matches; // Skips 0 index
|
368 |
|
369 |
$object_key = $taxonomy . '_' . $term_id;
|
370 |
+
} elseif ( 'option' === $type ) {
|
371 |
+
$object_key = 'options';
|
372 |
+
$key = preg_replace( '/^options_/', '', $key );
|
373 |
}
|
374 |
|
375 |
if ( isset( $this->cached_field_values_updates[ $object_key ][ $key ] ) ) {
|
388 |
$title = $term->name;
|
389 |
$tax_obj = get_taxonomy( $taxonomy );
|
390 |
$type_name = strtolower( get_taxonomy_labels( $tax_obj )->singular_name );
|
391 |
+
} elseif ( 'option' === $type ) {
|
392 |
+
$title = 'settings page';
|
393 |
+
$type_name = 'option';
|
394 |
} else {
|
395 |
return false;
|
396 |
}
|
523 |
* @param string $value Option value
|
524 |
*/
|
525 |
public function callback_added_option( $key, $value ) {
|
526 |
+
$this->check_meta_values( self::get_saved_option_type( $key ), 'added', null, null, $key, $value );
|
527 |
}
|
528 |
|
529 |
/**
|
535 |
*/
|
536 |
public function callback_updated_option( $key, $old, $value ) {
|
537 |
unset( $old );
|
538 |
+
$this->check_meta_values( self::get_saved_option_type( $key ), 'updated', null, null, $key, $value );
|
539 |
}
|
540 |
|
541 |
/**
|
544 |
* @param $key
|
545 |
*/
|
546 |
public function callback_deleted_option( $key ) {
|
547 |
+
$this->check_meta_values( self::get_saved_option_type( $key ), 'deleted', null, null, $key, null );
|
548 |
+
}
|
549 |
+
|
550 |
+
/**
|
551 |
+
* Determines the type of option that is saved
|
552 |
+
*
|
553 |
+
* @param $key
|
554 |
+
* @return string
|
555 |
+
*/
|
556 |
+
private function get_saved_option_type( $key ) {
|
557 |
+
return substr( $key,0, 8 ) === 'options_' ? 'option' : 'taxonomy';
|
558 |
}
|
559 |
}
|
connectors/class-connector-buddypress.php
CHANGED
@@ -405,8 +405,8 @@ class Connector_BuddyPress extends Connector {
|
|
405 |
array(
|
406 |
'option' => $option,
|
407 |
'option_key' => 'bp-active-components',
|
408 |
-
'old_value' =>
|
409 |
-
'value' =>
|
410 |
),
|
411 |
null,
|
412 |
'components',
|
@@ -450,8 +450,8 @@ class Connector_BuddyPress extends Connector {
|
|
450 |
array(
|
451 |
'option' => $option,
|
452 |
'option_key' => 'bp-pages',
|
453 |
-
'old_value' =>
|
454 |
-
'value' =>
|
455 |
'page_id' => empty( $new_value[ $option ] ) ? 0 : $new_value[ $option ],
|
456 |
),
|
457 |
null,
|
405 |
array(
|
406 |
'option' => $option,
|
407 |
'option_key' => 'bp-active-components',
|
408 |
+
'old_value' => $old_value,
|
409 |
+
'value' => $new_value,
|
410 |
),
|
411 |
null,
|
412 |
'components',
|
450 |
array(
|
451 |
'option' => $option,
|
452 |
'option_key' => 'bp-pages',
|
453 |
+
'old_value' => $old_value,
|
454 |
+
'value' => $new_value,
|
455 |
'page_id' => empty( $new_value[ $option ] ) ? 0 : $new_value[ $option ],
|
456 |
),
|
457 |
null,
|
connectors/class-connector-edd.php
CHANGED
@@ -294,8 +294,8 @@ class Connector_EDD extends Connector {
|
|
294 |
array(
|
295 |
'option_title' => $field['name'],
|
296 |
'option' => $option,
|
297 |
-
'old_value' =>
|
298 |
-
'value' =>
|
299 |
'tab' => $tab,
|
300 |
),
|
301 |
null,
|
294 |
array(
|
295 |
'option_title' => $field['name'],
|
296 |
'option' => $option,
|
297 |
+
'old_value' => $old_value,
|
298 |
+
'value' => $new_value,
|
299 |
'tab' => $tab,
|
300 |
),
|
301 |
null,
|
connectors/class-connector-jetpack.php
CHANGED
@@ -539,8 +539,8 @@ class Connector_Jetpack extends Connector {
|
|
539 |
|
540 |
$settings['meta'] += array(
|
541 |
'option' => $option,
|
542 |
-
'old_value' =>
|
543 |
-
'value' =>
|
544 |
);
|
545 |
|
546 |
$this->log(
|
539 |
|
540 |
$settings['meta'] += array(
|
541 |
'option' => $option,
|
542 |
+
'old_value' => $old_value,
|
543 |
+
'value' => $new_value,
|
544 |
);
|
545 |
|
546 |
$this->log(
|
connectors/class-connector-settings.php
CHANGED
@@ -709,8 +709,8 @@ class Connector_Settings extends Connector {
|
|
709 |
'option_key' => $field_key,
|
710 |
'context' => ( false !== $key_context ? $key_context : $context ),
|
711 |
// Prevent fatal error when saving option as array
|
712 |
-
'old_value' => isset( $old_value[ $field_key ] ) ? (string)
|
713 |
-
'value' => isset( $value[ $field_key ] ) ? (string)
|
714 |
);
|
715 |
}
|
716 |
}
|
@@ -719,9 +719,8 @@ class Connector_Settings extends Connector {
|
|
719 |
'label' => $this->get_field_label( $option ),
|
720 |
'option' => $option,
|
721 |
'context' => $context,
|
722 |
-
|
723 |
-
'
|
724 |
-
'value' => (string) maybe_serialize( $value ),
|
725 |
);
|
726 |
}
|
727 |
|
709 |
'option_key' => $field_key,
|
710 |
'context' => ( false !== $key_context ? $key_context : $context ),
|
711 |
// Prevent fatal error when saving option as array
|
712 |
+
'old_value' => isset( $old_value[ $field_key ] ) ? (string) $old_value[ $field_key ] : null,
|
713 |
+
'value' => isset( $value[ $field_key ] ) ? (string) $value[ $field_key ] : null,
|
714 |
);
|
715 |
}
|
716 |
}
|
719 |
'label' => $this->get_field_label( $option ),
|
720 |
'option' => $option,
|
721 |
'context' => $context,
|
722 |
+
'old_value' => (string) $old_value,
|
723 |
+
'value' => (string) $value,
|
|
|
724 |
);
|
725 |
}
|
726 |
|
connectors/class-connector-woocommerce.php
CHANGED
@@ -659,9 +659,8 @@ class Connector_Woocommerce extends Connector {
|
|
659 |
'tab' => $this->settings[ $option ]['tab'],
|
660 |
'section' => $this->settings[ $option ]['section'],
|
661 |
'option' => $option,
|
662 |
-
|
663 |
-
'
|
664 |
-
'value' => maybe_serialize( $value ),
|
665 |
),
|
666 |
null,
|
667 |
$this->settings[ $option ]['tab'],
|
659 |
'tab' => $this->settings[ $option ]['tab'],
|
660 |
'section' => $this->settings[ $option ]['section'],
|
661 |
'option' => $option,
|
662 |
+
'old_value' => $old_value,
|
663 |
+
'value' => $value,
|
|
|
664 |
),
|
665 |
null,
|
666 |
$this->settings[ $option ]['tab'],
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== Stream ===
|
2 |
-
Contributors:
|
3 |
-
Tags:
|
4 |
Requires at least: 3.9
|
5 |
-
Tested up to: 4.8
|
6 |
-
Stable tag: 3.2
|
7 |
License: GPLv2 or later
|
8 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -13,7 +13,7 @@ Planes have a black box, WordPress has Stream. When something goes wrong, you ne
|
|
13 |
|
14 |
With Stream, you're never left in the dark about WordPress Admin activity.
|
15 |
|
16 |
-
Every logged-in user action is displayed in an activity stream and
|
17 |
|
18 |
For advanced users, Stream also supports a Multisite view of all activity records on your network, the ability to set exclude rules to ignore certain kinds of user activity, and a WP‑CLI command for querying records.
|
19 |
|
@@ -79,6 +79,16 @@ Thank you for wanting to make Stream better for everyone!
|
|
79 |
|
80 |
== Changelog ==
|
81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
= 3.2.0 - March 15, 2017 =
|
83 |
|
84 |
* New: Stream now support alternate Database Drivers. ([#889](https://github.com/xwp/stream/pull/889))
|
@@ -98,7 +108,7 @@ Thank you for wanting to make Stream better for everyone!
|
|
98 |
* New: Stream Alerts is here! Get notified when something happens in your WP-Admin, so that you don't miss a thing. ([#844](https://github.com/xwp/stream/pull/844))
|
99 |
* Tweak: Better support for the latest version of Yoast SEO ([#838](https://github.com/xwp/stream/pull/838))
|
100 |
* Tweak: Better support for the latest version of WooCommerce ([#851](https://github.com/xwp/stream/pull/851)[#864](https://github.com/xwp/stream/pull/864))
|
101 |
-
* Tweak: Better taxonomy
|
102 |
* Fix: Fatal error caused by conflict with Yoast SEO ([#879](https://github.com/xwp/stream/pull/879))
|
103 |
* Fix: Activating Stream through WP CLI now works ([#880](https://github.com/xwp/stream/pull/880))
|
104 |
* Fix: Custom roles track properly ([#836](https://github.com/xwp/stream/pull/836))
|
@@ -135,7 +145,7 @@ Props [@chacha](https://github.com/chacha), [@lukecarbis](https://github.com/luk
|
|
135 |
* Tweak: Minor styling updates. It's about attention to detail. ([#826](https://github.com/xwp/stream/pull/826))
|
136 |
* Fix: Gravity Forms error when adding a note ([#811](https://github.com/xwp/stream/pull/811))
|
137 |
* Fix: In some instances, custom roles weren't being logged by Stream ([#824](https://github.com/xwp/stream/pull/824))
|
138 |
-
* Fix: The
|
139 |
|
140 |
Props [@chacha](https://github.com/chacha), [@lukecarbis](https://github.com/lukecarbis), [@Stayallive](https://github.com/Stayallive), [@barryceelen](https://github.com/barryceelen), Jonathan Desrosiers, [@marcin-lawrowski](https://github.com/marcin-lawrowski)
|
141 |
|
@@ -251,7 +261,7 @@ Props [@fjarrett](https://github.com/fjarrett), [@lukecarbis](https://github.com
|
|
251 |
|
252 |
= 2.0.1 - September 30, 2014 =
|
253 |
|
254 |
-
* Tweak: Improved
|
255 |
* Tweak: Improved tooltip text explaining WP.com sign in
|
256 |
* Fix: ACF Pro doesn't save custom field values when Stream enabled ([#642](https://github.com/wp-stream/stream/issues/642))
|
257 |
|
@@ -402,7 +412,7 @@ Props [@fjarrett](https://github.com/fjarrett), [@lukecarbis](https://github.com
|
|
402 |
* Tweak: Now showing user Gravatars in Exclude Authors & Roles settings field ([#333](https://github.com/x-team/wp-stream/issues/333))
|
403 |
* Tweak: ID column is now hidden by default in Screen Options ([#348](https://github.com/x-team/wp-stream/issues/348))
|
404 |
* Tweak: Widget updated summary message improvement ([8818976](https://github.com/x-team/wp-stream/commit/88189761d4a8836038e8d9ec348096a0aab3072d))
|
405 |
-
* Fix: Autocomplete not working correctly in Exclude IP
|
406 |
* Fix: Reset Stream Database link not clearing everything in all cases ([#347](https://github.com/x-team/wp-stream/issues/347))
|
407 |
* Fix: PHP 5.3.3 compatibility issue with filter constant ([#351](https://github.com/x-team/wp-stream/issues/351))
|
408 |
* Fix: Predefined date range intervals not honoring the site timezone setting ([#353](https://github.com/x-team/wp-stream/issues/353))
|
@@ -452,7 +462,7 @@ Replacement function for filter_input family to avoid PHP bug. Filter added to m
|
|
452 |
Prevent records of disabled connectors from appearing in the Stream. Bug fixes. Props [@kucrut](https://github.com/kucrut), [@johnregan3](https://github.com/johnregan3)
|
453 |
|
454 |
= 1.2.1 - February 17, 2014 =
|
455 |
-
Translation updates.
|
456 |
|
457 |
= 1.2.0 - February 12, 2014 =
|
458 |
Awesome datepicker styles. Performance optimizations. Bug fixes. Props [@johnregan3](https://github.com/johnregan3), [@shadyvb](https://github.com/shadyvb), [@fjarrett](https://github.com/fjarrett), [@jonathanbardo](https://github.com/jonathanbardo)
|
1 |
=== Stream ===
|
2 |
+
Contributors: lukecarbis, fjarrett, stream, xwp
|
3 |
+
Tags: wp stream, stream, activity, logs, track
|
4 |
Requires at least: 3.9
|
5 |
+
Tested up to: 4.8.1
|
6 |
+
Stable tag: 3.2.1
|
7 |
License: GPLv2 or later
|
8 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
13 |
|
14 |
With Stream, you're never left in the dark about WordPress Admin activity.
|
15 |
|
16 |
+
Every logged-in user action is displayed in an activity stream and organized for easy filtering by User, Role, Context, Action or IP address.
|
17 |
|
18 |
For advanced users, Stream also supports a Multisite view of all activity records on your network, the ability to set exclude rules to ignore certain kinds of user activity, and a WP‑CLI command for querying records.
|
19 |
|
79 |
|
80 |
== Changelog ==
|
81 |
|
82 |
+
= 3.2.1 - September 8, 2017 =
|
83 |
+
|
84 |
+
* New: Support for the ACF Options page. ([#931](https://github.com/xwp/stream/pull/931))
|
85 |
+
* New: Added minimal composer file. ([#932](https://github.com/xwp/stream/pull/932)
|
86 |
+
* Tweak: Remove dependence on serializing functions. ([#939](https://github.com/xwp/stream/pull/939))
|
87 |
+
* Tweak: Add wp_stream_is_record_excluded filter. ([#921](https://github.com/xwp/stream/pull/921))
|
88 |
+
* Fix: Readme spelling fixes (localised [sic] for en_US). ([#928](https://github.com/xwp/stream/pull/928))
|
89 |
+
* Fix: Undefined index ID issue when trashing post with customize-posts. ([#936](https://github.com/xwp/stream/pull/936))
|
90 |
+
* Fix: Stream fails to install properly (sometimes) due to database error. ([#934](https://github.com/xwp/stream/pull/934))
|
91 |
+
|
92 |
= 3.2.0 - March 15, 2017 =
|
93 |
|
94 |
* New: Stream now support alternate Database Drivers. ([#889](https://github.com/xwp/stream/pull/889))
|
108 |
* New: Stream Alerts is here! Get notified when something happens in your WP-Admin, so that you don't miss a thing. ([#844](https://github.com/xwp/stream/pull/844))
|
109 |
* Tweak: Better support for the latest version of Yoast SEO ([#838](https://github.com/xwp/stream/pull/838))
|
110 |
* Tweak: Better support for the latest version of WooCommerce ([#851](https://github.com/xwp/stream/pull/851)[#864](https://github.com/xwp/stream/pull/864))
|
111 |
+
* Tweak: Better taxonomy labeling ([#859](https://github.com/xwp/stream/pull/859))
|
112 |
* Fix: Fatal error caused by conflict with Yoast SEO ([#879](https://github.com/xwp/stream/pull/879))
|
113 |
* Fix: Activating Stream through WP CLI now works ([#880](https://github.com/xwp/stream/pull/880))
|
114 |
* Fix: Custom roles track properly ([#836](https://github.com/xwp/stream/pull/836))
|
145 |
* Tweak: Minor styling updates. It's about attention to detail. ([#826](https://github.com/xwp/stream/pull/826))
|
146 |
* Fix: Gravity Forms error when adding a note ([#811](https://github.com/xwp/stream/pull/811))
|
147 |
* Fix: In some instances, custom roles weren't being logged by Stream ([#824](https://github.com/xwp/stream/pull/824))
|
148 |
+
* Fix: The Customizer fix you've been waiting for! Stream now properly records changes made from the Customizer. ([#827](https://github.com/xwp/stream/pull/827))
|
149 |
|
150 |
Props [@chacha](https://github.com/chacha), [@lukecarbis](https://github.com/lukecarbis), [@Stayallive](https://github.com/Stayallive), [@barryceelen](https://github.com/barryceelen), Jonathan Desrosiers, [@marcin-lawrowski](https://github.com/marcin-lawrowski)
|
151 |
|
261 |
|
262 |
= 2.0.1 - September 30, 2014 =
|
263 |
|
264 |
+
* Tweak: Improved localization strings throughout the plugin ([#644](https://github.com/wp-stream/stream/pull/644))
|
265 |
* Tweak: Improved tooltip text explaining WP.com sign in
|
266 |
* Fix: ACF Pro doesn't save custom field values when Stream enabled ([#642](https://github.com/wp-stream/stream/issues/642))
|
267 |
|
412 |
* Tweak: Now showing user Gravatars in Exclude Authors & Roles settings field ([#333](https://github.com/x-team/wp-stream/issues/333))
|
413 |
* Tweak: ID column is now hidden by default in Screen Options ([#348](https://github.com/x-team/wp-stream/issues/348))
|
414 |
* Tweak: Widget updated summary message improvement ([8818976](https://github.com/x-team/wp-stream/commit/88189761d4a8836038e8d9ec348096a0aab3072d))
|
415 |
+
* Fix: Autocomplete not working correctly in Exclude IP Addresses settings field ([#335](https://github.com/x-team/wp-stream/issues/335))
|
416 |
* Fix: Reset Stream Database link not clearing everything in all cases ([#347](https://github.com/x-team/wp-stream/issues/347))
|
417 |
* Fix: PHP 5.3.3 compatibility issue with filter constant ([#351](https://github.com/x-team/wp-stream/issues/351))
|
418 |
* Fix: Predefined date range intervals not honoring the site timezone setting ([#353](https://github.com/x-team/wp-stream/issues/353))
|
462 |
Prevent records of disabled connectors from appearing in the Stream. Bug fixes. Props [@kucrut](https://github.com/kucrut), [@johnregan3](https://github.com/johnregan3)
|
463 |
|
464 |
= 1.2.1 - February 17, 2014 =
|
465 |
+
Translation updates. Language packs for pt_BR and id_ID. Bug fixes. Props [@kucrut](https://github.com/kucrut), [@shadyvb](https://github.com/shadyvb), [@bordoni](https://github.com/bordoni), [@powelski](https://github.com/powelski), [omniwired](https://github.com/omniwired), [@fjarrett](https://github.com/fjarrett)
|
466 |
|
467 |
= 1.2.0 - February 12, 2014 =
|
468 |
Awesome datepicker styles. Performance optimizations. Bug fixes. Props [@johnregan3](https://github.com/johnregan3), [@shadyvb](https://github.com/shadyvb), [@fjarrett](https://github.com/fjarrett), [@jonathanbardo](https://github.com/jonathanbardo)
|
stream.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Stream
|
4 |
* Plugin URI: https://wp-stream.com/
|
5 |
* Description: Stream tracks logged-in user activity so you can monitor every change made on your WordPress site in beautifully organized detail. All activity is organized by context, action and IP address for easy filtering. Developers can extend Stream with custom connectors to log any kind of action.
|
6 |
-
* Version: 3.2.
|
7 |
* Author: XWP
|
8 |
* Author URI: https://xwp.co/
|
9 |
* License: GPLv2+
|
3 |
* Plugin Name: Stream
|
4 |
* Plugin URI: https://wp-stream.com/
|
5 |
* Description: Stream tracks logged-in user activity so you can monitor every change made on your WordPress site in beautifully organized detail. All activity is organized by context, action and IP address for easy filtering. Developers can extend Stream with custom connectors to log any kind of action.
|
6 |
+
* Version: 3.2.1
|
7 |
* Author: XWP
|
8 |
* Author URI: https://xwp.co/
|
9 |
* License: GPLv2+
|
ui/css/admin.css
CHANGED
@@ -104,6 +104,8 @@
|
|
104 |
|
105 |
.toplevel_page_wp_stream .column-ip {
|
106 |
white-space: nowrap;
|
|
|
|
|
107 |
}
|
108 |
|
109 |
.toplevel_page_wp_stream .stream-filter-object-id {
|
104 |
|
105 |
.toplevel_page_wp_stream .column-ip {
|
106 |
white-space: nowrap;
|
107 |
+
overflow: hidden;
|
108 |
+
text-overflow: ellipsis;
|
109 |
}
|
110 |
|
111 |
.toplevel_page_wp_stream .stream-filter-object-id {
|