Version Description
August 14, 2020 =
Fix: Use the correct timestamp format when saving Stream records to ensure correct dates on newer versions of MySQL #1149, props @kidunot89.
Development: Include
composer.json
file in the release bundles to ensure they can be pulled using Composer from the Stream distribution repository.Development: Automatically store plugin release bundles when tagging a new release on GitHub #1074.
Development: Update the local development environment to support multisite installs for testing #1136.
Download this release
Release Info
Developer | kasparsd |
Plugin | Stream |
Version | 3.5.1 |
Comparing to | |
See all releases |
Code changes from version 3.5.0 to 3.5.1
- classes/class-cli.php +2 -2
- classes/class-connector.php +39 -0
- classes/class-connectors.php +40 -0
- classes/class-log.php +1 -4
- classes/class-plugin.php +1 -1
- composer.json +53 -0
- readme.md +1 -1
- readme.txt +41 -34
- stream.php +2 -2
- ui/js/admin.min.js +1 -1
- ui/js/alerts.min.js +1 -1
- ui/js/exclude.min.js +1 -1
- ui/js/live-updates.min.js +1 -1
- ui/js/settings.min.js +1 -1
classes/class-cli.php
CHANGED
@@ -90,8 +90,8 @@ class CLI extends \WP_CLI_Command {
|
|
90 |
* wp stream query --user_id=1 --action=login --records_per_page=50 --fields=created
|
91 |
*
|
92 |
* @see WP_Stream_Query
|
93 |
-
* @see https://github.com/
|
94 |
-
* @see https://github.com/
|
95 |
*
|
96 |
* @param array $args Unused.
|
97 |
* @param array $assoc_args Fields to return data for.
|
90 |
* wp stream query --user_id=1 --action=login --records_per_page=50 --fields=created
|
91 |
*
|
92 |
* @see WP_Stream_Query
|
93 |
+
* @see https://github.com/xwp/stream/wiki/WP-CLI-Command
|
94 |
+
* @see https://github.com/xwp/stream/wiki/Query-Reference
|
95 |
*
|
96 |
* @param array $args Unused.
|
97 |
* @param array $assoc_args Fields to return data for.
|
classes/class-connector.php
CHANGED
@@ -54,15 +54,54 @@ abstract class Connector {
|
|
54 |
*/
|
55 |
public $register_frontend = true;
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
/**
|
58 |
* Register all context hooks
|
59 |
*/
|
60 |
public function register() {
|
|
|
|
|
|
|
|
|
61 |
foreach ( $this->actions as $action ) {
|
62 |
add_action( $action, array( $this, 'callback' ), 10, 99 );
|
63 |
}
|
64 |
|
65 |
add_filter( 'wp_stream_action_links_' . $this->name, array( $this, 'action_links' ), 10, 2 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
}
|
67 |
|
68 |
/**
|
54 |
*/
|
55 |
public $register_frontend = true;
|
56 |
|
57 |
+
/**
|
58 |
+
* Holds connector registration status flag.
|
59 |
+
*
|
60 |
+
* @var bool
|
61 |
+
*/
|
62 |
+
private $is_registered = false;
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Is the connector currently registered?
|
66 |
+
*
|
67 |
+
* @return boolean
|
68 |
+
*/
|
69 |
+
public function is_registered() {
|
70 |
+
return $this->is_registered;
|
71 |
+
}
|
72 |
+
|
73 |
/**
|
74 |
* Register all context hooks
|
75 |
*/
|
76 |
public function register() {
|
77 |
+
if ( $this->is_registered ) {
|
78 |
+
return;
|
79 |
+
}
|
80 |
+
|
81 |
foreach ( $this->actions as $action ) {
|
82 |
add_action( $action, array( $this, 'callback' ), 10, 99 );
|
83 |
}
|
84 |
|
85 |
add_filter( 'wp_stream_action_links_' . $this->name, array( $this, 'action_links' ), 10, 2 );
|
86 |
+
|
87 |
+
$this->is_registered = true;
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Unregister all context hooks
|
92 |
+
*/
|
93 |
+
public function unregister() {
|
94 |
+
if ( ! $this->is_registered ) {
|
95 |
+
return;
|
96 |
+
}
|
97 |
+
|
98 |
+
foreach ( $this->actions as $action ) {
|
99 |
+
remove_action( $action, array( $this, 'callback' ), 10, 99 );
|
100 |
+
}
|
101 |
+
|
102 |
+
remove_filter( 'wp_stream_action_links_' . $this->name, array( $this, 'action_links' ), 10, 2 );
|
103 |
+
|
104 |
+
$this->is_registered = false;
|
105 |
}
|
106 |
|
107 |
/**
|
classes/class-connectors.php
CHANGED
@@ -234,4 +234,44 @@ class Connectors {
|
|
234 |
*/
|
235 |
do_action( 'wp_stream_after_connectors_registration', $labels, $this );
|
236 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
}
|
234 |
*/
|
235 |
do_action( 'wp_stream_after_connectors_registration', $labels, $this );
|
236 |
}
|
237 |
+
|
238 |
+
/**
|
239 |
+
* Unregisters the context hooks for all connectors.
|
240 |
+
*/
|
241 |
+
public function unload_connectors() {
|
242 |
+
foreach ( $this->connectors as $connector ) {
|
243 |
+
$connector->unregister();
|
244 |
+
}
|
245 |
+
}
|
246 |
+
|
247 |
+
/**
|
248 |
+
* Reregisters the context hooks for all connectors.
|
249 |
+
*/
|
250 |
+
public function reload_connectors() {
|
251 |
+
foreach ( $this->connectors as $connector ) {
|
252 |
+
$connector->register();
|
253 |
+
}
|
254 |
+
}
|
255 |
+
|
256 |
+
/**
|
257 |
+
* Unregisters the context hooks for a connectors.
|
258 |
+
*
|
259 |
+
* @param string $name Name of the connector.
|
260 |
+
*/
|
261 |
+
public function unload_connector( $name ) {
|
262 |
+
if ( ! empty( $this->connectors[ $name ] ) ) {
|
263 |
+
$this->connectors[ $name ]->unregister();
|
264 |
+
}
|
265 |
+
}
|
266 |
+
|
267 |
+
/**
|
268 |
+
* Reregisters the context hooks for a connector.
|
269 |
+
*
|
270 |
+
* @param string $name Name of the connector.
|
271 |
+
*/
|
272 |
+
public function reload_connector( $name ) {
|
273 |
+
if ( ! empty( $this->connectors[ $name ] ) ) {
|
274 |
+
$this->connectors[ $name ]->register();
|
275 |
+
}
|
276 |
+
}
|
277 |
}
|
classes/class-log.php
CHANGED
@@ -120,9 +120,6 @@ class Log {
|
|
120 |
// Add user meta to Stream meta.
|
121 |
$stream_meta['user_meta'] = $user_meta;
|
122 |
|
123 |
-
// Get the current time in milliseconds.
|
124 |
-
$iso_8601_extended_date = wp_stream_get_iso_8601_extended_date();
|
125 |
-
|
126 |
if ( ! empty( $user->roles ) ) {
|
127 |
$roles = array_values( $user->roles );
|
128 |
$role = $roles[0];
|
@@ -138,7 +135,7 @@ class Log {
|
|
138 |
'blog_id' => (int) apply_filters( 'wp_stream_blog_id_logged', get_current_blog_id() ),
|
139 |
'user_id' => (int) $user_id,
|
140 |
'user_role' => (string) $role,
|
141 |
-
'created' => (string)
|
142 |
'summary' => (string) vsprintf( $message, $args ),
|
143 |
'connector' => (string) $connector,
|
144 |
'context' => (string) $context,
|
120 |
// Add user meta to Stream meta.
|
121 |
$stream_meta['user_meta'] = $user_meta;
|
122 |
|
|
|
|
|
|
|
123 |
if ( ! empty( $user->roles ) ) {
|
124 |
$roles = array_values( $user->roles );
|
125 |
$role = $roles[0];
|
135 |
'blog_id' => (int) apply_filters( 'wp_stream_blog_id_logged', get_current_blog_id() ),
|
136 |
'user_id' => (int) $user_id,
|
137 |
'user_role' => (string) $role,
|
138 |
+
'created' => (string) current_time( 'mysql', true ),
|
139 |
'summary' => (string) vsprintf( $message, $args ),
|
140 |
'connector' => (string) $connector,
|
141 |
'context' => (string) $context,
|
classes/class-plugin.php
CHANGED
@@ -18,7 +18,7 @@ class Plugin {
|
|
18 |
*
|
19 |
* @const string
|
20 |
*/
|
21 |
-
const VERSION = '3.5.
|
22 |
|
23 |
/**
|
24 |
* WP-CLI command
|
18 |
*
|
19 |
* @const string
|
20 |
*/
|
21 |
+
const VERSION = '3.5.1';
|
22 |
|
23 |
/**
|
24 |
* WP-CLI command
|
composer.json
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "xwp/stream",
|
3 |
+
"description": "Track WordPress user and system actions for debugging, logging and compliance purposes",
|
4 |
+
"homepage": "https://wordpress.org/plugins/stream/",
|
5 |
+
"type": "wordpress-plugin",
|
6 |
+
"license": "GPL-2.0-or-later",
|
7 |
+
"require": {
|
8 |
+
"composer/installers": "~1.0"
|
9 |
+
},
|
10 |
+
"require-dev": {
|
11 |
+
"johnpbloch/wordpress": "^5.4",
|
12 |
+
"automattic/vipwpcs": "^2.0.0",
|
13 |
+
"php-coveralls/php-coveralls": "^2.1",
|
14 |
+
"phpunit/phpunit": "^5.7",
|
15 |
+
"wp-cli/wp-cli-bundle": "^2.2",
|
16 |
+
"wp-coding-standards/wpcs": "^2.2",
|
17 |
+
"wp-phpunit/wp-phpunit": "^5.4",
|
18 |
+
"wpsh/local": "^0.2.3"
|
19 |
+
},
|
20 |
+
"config": {
|
21 |
+
"process-timeout": 600,
|
22 |
+
"sort-packages": true,
|
23 |
+
"platform": {
|
24 |
+
"php": "5.6.20"
|
25 |
+
}
|
26 |
+
},
|
27 |
+
"extra": {
|
28 |
+
"wordpress-install-dir": "local/public"
|
29 |
+
},
|
30 |
+
"scripts": {
|
31 |
+
"release": [
|
32 |
+
"composer install --no-dev --prefer-dist --optimize-autoloader"
|
33 |
+
],
|
34 |
+
"lint-php": [
|
35 |
+
"phpcs ."
|
36 |
+
],
|
37 |
+
"lint": [
|
38 |
+
"@composer validate",
|
39 |
+
"@lint-php"
|
40 |
+
],
|
41 |
+
"test": [
|
42 |
+
"phpunit --coverage-text",
|
43 |
+
"php local/scripts/make-clover-relative.php ./tests/reports/clover.xml"
|
44 |
+
],
|
45 |
+
"test-multisite": [
|
46 |
+
"WP_MULTISITE=1 phpunit --coverage-text",
|
47 |
+
"php local/scripts/make-clover-relative.php ./tests/reports/clover.xml"
|
48 |
+
],
|
49 |
+
"test-report": [
|
50 |
+
"php-coveralls --verbose"
|
51 |
+
]
|
52 |
+
}
|
53 |
+
}
|
readme.md
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
|
6 |
**Track WordPress user and system actions for debugging, logging and compliance purposes.**
|
7 |
|
8 |
-
- [Product Website](
|
9 |
- [Plugin on WordPress.org](https://wordpress.org/plugins/stream/)
|
10 |
|
11 |
|
5 |
|
6 |
**Track WordPress user and system actions for debugging, logging and compliance purposes.**
|
7 |
|
8 |
+
- [Product Website](https://xwp.co/work/stream/)
|
9 |
- [Plugin on WordPress.org](https://wordpress.org/plugins/stream/)
|
10 |
|
11 |
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: xwp
|
3 |
Tags: wp stream, stream, activity, logs, track
|
4 |
Requires at least: 4.5
|
5 |
-
Tested up to: 5.
|
6 |
-
Stable tag: 3.5.
|
7 |
License: GPLv2 or later
|
8 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -91,6 +91,13 @@ Past Contributors: fjarrett, shadyvb, chacha, westonruter, johnregan3, jacobschw
|
|
91 |
|
92 |
== Changelog ==
|
93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
= 3.5.0 - July 8, 2020 =
|
95 |
|
96 |
* Fix: Stream records now show the correct timestamp instead of dates like `-0001/11/30` [#1091](https://github.com/xwp/stream/issues/1091), props [@kidunot89](https://github.com/kidunot89).
|
@@ -274,62 +281,62 @@ Props [@fjarrett](https://github.com/fjarrett), [@lukecarbis](https://github.com
|
|
274 |
|
275 |
= 2.0.5 - April 23, 2015 =
|
276 |
|
277 |
-
* Tweak: Compatibility with split terms introduced in WordPress 4.2 ([#702](https://github.com/
|
278 |
-
* Tweak: Add support for future and pending post transitions ([#716](https://github.com/
|
279 |
-
* Tweak: Match new default admin colors introduced in WordPress 4.2 ([#718](https://github.com/
|
280 |
-
* Fix: Compatibility issues with WP-Cron Control plugin and system crons ([#715](https://github.com/
|
281 |
-
* Fix: Broken date range filter on Reports screen ([#717](https://github.com/
|
282 |
|
283 |
Props [@fjarrett](https://github.com/fjarrett)
|
284 |
|
285 |
= 2.0.4 - April 16, 2015 =
|
286 |
|
287 |
-
* New: Add reset button to reset search filters ([#144](https://github.com/
|
288 |
-
* Tweak: WP-CLI command output improvements via `--format` option for table view, JSON and CSV ([#705](https://github.com/
|
289 |
-
* Tweak: Add link to https://wp-stream.com in README ([#709](https://github.com/
|
290 |
* Tweak: Better highlighting on multiple live update rows
|
291 |
* Tweak: Limit custom range datepickers based on the Stream plan type
|
292 |
* Tweak: Limit legacy record migrations based on the Stream plan type
|
293 |
-
* Fix: Allow properties with values of zero to be included in queries ([#698](https://github.com/
|
294 |
-
* Fix: Properly return record success/failure in log and store methods ([#711](https://github.com/
|
295 |
|
296 |
Props [@fjarrett](https://github.com/fjarrett), [@szepeviktor](https://github.com/szepeviktor)
|
297 |
|
298 |
= 2.0.3 - January 23, 2015 =
|
299 |
|
300 |
-
* New: WP-CLI command now available for querying records via the command line ([#499](https://github.com/
|
301 |
-
* Tweak: Silently disable Stream during content import ([#672](https://github.com/
|
302 |
-
* Tweak: Search results now ordered by date instead of relevance ([#689](https://github.com/
|
303 |
-
* Fix: Handle boolean values appropriately during wp_stream_log_data filter ([#680](https://github.com/
|
304 |
-
* Fix: Hook into external class load methods on init rather than plugins_loaded ([#686](https://github.com/
|
305 |
-
* Fix: N/A user not working in exclude rules ([#688](https://github.com/
|
306 |
-
* Fix: Prevent Notification Rule meta from being saved to all post types ([#693](https://github.com/
|
307 |
-
* Fix: PHP warning shown for some users when deleting plugins ([#695](https://github.com/
|
308 |
|
309 |
Props [@fjarrett](https://github.com/fjarrett)
|
310 |
|
311 |
= 2.0.2 - January 15, 2015 =
|
312 |
|
313 |
-
* New: Full record backtrace now available to developers for debugging ([#467](https://github.com/
|
314 |
-
* New: Unread count badge added to Stream menu, opt-out available in User Profile ([#588](https://github.com/
|
315 |
-
* New: Stream connector to track Stream-specific contexts and actions ([#622](https://github.com/
|
316 |
-
* Tweak: Inherit role access from Stream Settings for Notifications and Reports ([#641](https://github.com/
|
317 |
-
* Tweak: Opt-in required for Akismet tracking ([#649](https://github.com/
|
318 |
-
* Tweak: Ignore comments deleted when deleting parent post ([#652](https://github.com/
|
319 |
-
* Tweak: Opt-in required for comment flood tracking ([#656](https://github.com/
|
320 |
-
* Tweak: Opt-in required for WP Cron tracking ([#673](https://github.com/
|
321 |
-
* Fix: Post revision action link pointing to wrong revision ID ([#585](https://github.com/
|
322 |
-
* Fix: PHP warnings caused by Menu connector ([#663](https://github.com/
|
323 |
-
* Fix: Non-static method called statically in WPSEO connector ([#668](https://github.com/
|
324 |
-
* Fix: Prevent live updates from tampering with filtered results ([#675](https://github.com/
|
325 |
|
326 |
Props [@fjarrett](https://github.com/fjarrett), [@lukecarbis](https://github.com/lukecarbis), [@shadyvb](https://github.com/shadyvb), [@jonathanbardo](https://github.com/jonathanbardo), [@westonruter](https://github.com/westonruter)
|
327 |
|
328 |
= 2.0.1 - September 30, 2014 =
|
329 |
|
330 |
-
* Tweak: Improved localization strings throughout the plugin ([#644](https://github.com/
|
331 |
* Tweak: Improved tooltip text explaining WP.com sign in
|
332 |
-
* Fix: ACF Pro doesn't save custom field values when Stream enabled ([#642](https://github.com/
|
333 |
|
334 |
Props [@lukecarbis](https://github.com/lukecarbis), [@fjarrett](https://github.com/fjarrett)
|
335 |
|
2 |
Contributors: xwp
|
3 |
Tags: wp stream, stream, activity, logs, track
|
4 |
Requires at least: 4.5
|
5 |
+
Tested up to: 5.5
|
6 |
+
Stable tag: 3.5.1
|
7 |
License: GPLv2 or later
|
8 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
91 |
|
92 |
== Changelog ==
|
93 |
|
94 |
+
= 3.5.1 - August 14, 2020 =
|
95 |
+
|
96 |
+
* Fix: Use the correct timestamp format when saving Stream records to ensure correct dates on newer versions of MySQL [#1149](https://github.com/xwp/stream/issues/1149), props [@kidunot89](https://github.com/kidunot89).
|
97 |
+
* Development: Include `composer.json` file in the release bundles to ensure they can be pulled using Composer from the [Stream distribution repository](https://github.com/xwp/stream-dist).
|
98 |
+
* Development: Automatically store plugin release bundles when tagging a new release on GitHub [#1074](https://github.com/xwp/stream/pull/1074).
|
99 |
+
* Development: Update the local development environment to support multisite installs for testing [#1136](https://github.com/xwp/stream/pull/1136).
|
100 |
+
|
101 |
= 3.5.0 - July 8, 2020 =
|
102 |
|
103 |
* Fix: Stream records now show the correct timestamp instead of dates like `-0001/11/30` [#1091](https://github.com/xwp/stream/issues/1091), props [@kidunot89](https://github.com/kidunot89).
|
281 |
|
282 |
= 2.0.5 - April 23, 2015 =
|
283 |
|
284 |
+
* Tweak: Compatibility with split terms introduced in WordPress 4.2 ([#702](https://github.com/xwp/stream/issues/702))
|
285 |
+
* Tweak: Add support for future and pending post transitions ([#716](https://github.com/xwp/stream/pull/716))
|
286 |
+
* Tweak: Match new default admin colors introduced in WordPress 4.2 ([#718](https://github.com/xwp/stream/pull/718))
|
287 |
+
* Fix: Compatibility issues with WP-Cron Control plugin and system crons ([#715](https://github.com/xwp/stream/issues/715))
|
288 |
+
* Fix: Broken date range filter on Reports screen ([#717](https://github.com/xwp/stream/pull/717))
|
289 |
|
290 |
Props [@fjarrett](https://github.com/fjarrett)
|
291 |
|
292 |
= 2.0.4 - April 16, 2015 =
|
293 |
|
294 |
+
* New: Add reset button to reset search filters ([#144](https://github.com/xwp/stream/issues/144))
|
295 |
+
* Tweak: WP-CLI command output improvements via `--format` option for table view, JSON and CSV ([#705](https://github.com/xwp/stream/pull/705))
|
296 |
+
* Tweak: Add link to https://wp-stream.com in README ([#709](https://github.com/xwp/stream/issues/709))
|
297 |
* Tweak: Better highlighting on multiple live update rows
|
298 |
* Tweak: Limit custom range datepickers based on the Stream plan type
|
299 |
* Tweak: Limit legacy record migrations based on the Stream plan type
|
300 |
+
* Fix: Allow properties with values of zero to be included in queries ([#698](https://github.com/xwp/stream/issues/698))
|
301 |
+
* Fix: Properly return record success/failure in log and store methods ([#711](https://github.com/xwp/stream/issues/711))
|
302 |
|
303 |
Props [@fjarrett](https://github.com/fjarrett), [@szepeviktor](https://github.com/szepeviktor)
|
304 |
|
305 |
= 2.0.3 - January 23, 2015 =
|
306 |
|
307 |
+
* New: WP-CLI command now available for querying records via the command line ([#499](https://github.com/xwp/stream/issues/499))
|
308 |
+
* Tweak: Silently disable Stream during content import ([#672](https://github.com/xwp/stream/issues/672))
|
309 |
+
* Tweak: Search results now ordered by date instead of relevance ([#689](https://github.com/xwp/stream/issues/689))
|
310 |
+
* Fix: Handle boolean values appropriately during wp_stream_log_data filter ([#680](https://github.com/xwp/stream/issues/680))
|
311 |
+
* Fix: Hook into external class load methods on init rather than plugins_loaded ([#686](https://github.com/xwp/stream/issues/686))
|
312 |
+
* Fix: N/A user not working in exclude rules ([#688](https://github.com/xwp/stream/issues/688))
|
313 |
+
* Fix: Prevent Notification Rule meta from being saved to all post types ([#693](https://github.com/xwp/stream/issues/693))
|
314 |
+
* Fix: PHP warning shown for some users when deleting plugins ([#695](https://github.com/xwp/stream/issues/695))
|
315 |
|
316 |
Props [@fjarrett](https://github.com/fjarrett)
|
317 |
|
318 |
= 2.0.2 - January 15, 2015 =
|
319 |
|
320 |
+
* New: Full record backtrace now available to developers for debugging ([#467](https://github.com/xwp/stream/issues/467))
|
321 |
+
* New: Unread count badge added to Stream menu, opt-out available in User Profile ([#588](https://github.com/xwp/stream/issues/588))
|
322 |
+
* New: Stream connector to track Stream-specific contexts and actions ([#622](https://github.com/xwp/stream/issues/622))
|
323 |
+
* Tweak: Inherit role access from Stream Settings for Notifications and Reports ([#641](https://github.com/xwp/stream/issues/641))
|
324 |
+
* Tweak: Opt-in required for Akismet tracking ([#649](https://github.com/xwp/stream/issues/649))
|
325 |
+
* Tweak: Ignore comments deleted when deleting parent post ([#652](https://github.com/xwp/stream/issues/652))
|
326 |
+
* Tweak: Opt-in required for comment flood tracking ([#656](https://github.com/xwp/stream/issues/656))
|
327 |
+
* Tweak: Opt-in required for WP Cron tracking ([#673](https://github.com/xwp/stream/issues/673))
|
328 |
+
* Fix: Post revision action link pointing to wrong revision ID ([#585](https://github.com/xwp/stream/issues/585))
|
329 |
+
* Fix: PHP warnings caused by Menu connector ([#663](https://github.com/xwp/stream/issues/663))
|
330 |
+
* Fix: Non-static method called statically in WPSEO connector ([#668](https://github.com/xwp/stream/issues/668))
|
331 |
+
* Fix: Prevent live updates from tampering with filtered results ([#675](https://github.com/xwp/stream/issues/675))
|
332 |
|
333 |
Props [@fjarrett](https://github.com/fjarrett), [@lukecarbis](https://github.com/lukecarbis), [@shadyvb](https://github.com/shadyvb), [@jonathanbardo](https://github.com/jonathanbardo), [@westonruter](https://github.com/westonruter)
|
334 |
|
335 |
= 2.0.1 - September 30, 2014 =
|
336 |
|
337 |
+
* Tweak: Improved localization strings throughout the plugin ([#644](https://github.com/xwp/stream/pull/644))
|
338 |
* Tweak: Improved tooltip text explaining WP.com sign in
|
339 |
+
* Fix: ACF Pro doesn't save custom field values when Stream enabled ([#642](https://github.com/xwp/stream/issues/642))
|
340 |
|
341 |
Props [@lukecarbis](https://github.com/lukecarbis), [@fjarrett](https://github.com/fjarrett)
|
342 |
|
stream.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: Stream
|
4 |
-
* Plugin URI: https://
|
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.5.
|
7 |
* Author: XWP
|
8 |
* Author URI: https://xwp.co
|
9 |
* License: GPLv2+
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: Stream
|
4 |
+
* Plugin URI: https://xwp.co/work/stream/
|
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.5.1
|
7 |
* Author: XWP
|
8 |
* Author URI: https://xwp.co
|
9 |
* License: GPLv2+
|
ui/js/admin.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(function(m){"en"===wp_stream.locale&&void 0!==m.timeago&&(m.timeago.settings.strings.seconds="seconds",m.timeago.settings.strings.minute="a minute",m.timeago.settings.strings.hour="an hour",m.timeago.settings.strings.hours="%d hours",m.timeago.settings.strings.month="a month",m.timeago.settings.strings.year="a year"),m("li.toplevel_page_wp_stream ul li.wp-first-item.current").parent().parent().find(".update-plugins").remove(),m(".toplevel_page_wp_stream :input.chosen-select").each(function(e,t){function a(e){var t=m("<span>"),a=m(e.element),i="";return"- "===e.text.substring(0,2)&&(e.text=e.text.substring(2)),void 0!==e.id&&"string"==typeof e.id&&(0===e.id.indexOf("group-")?t.addClass("parent"):a.hasClass("level-2")&&t.addClass("child")),void 0!==e.icon?i=e.icon:void 0!==a&&""!==a.data("icon")&&(i=a.data("icon")),i&&t.html('<img src="'+i+'" class="wp-stream-select2-icon">'),t.append(e.text),t}function i(e){return"- "===e.text.substring(0,2)&&(e.text=e.text.substring(2)),e.text}var n={}
|
1 |
+
jQuery(function(m){"en"===wp_stream.locale&&void 0!==m.timeago&&(m.timeago.settings.strings.seconds="seconds",m.timeago.settings.strings.minute="a minute",m.timeago.settings.strings.hour="an hour",m.timeago.settings.strings.hours="%d hours",m.timeago.settings.strings.month="a month",m.timeago.settings.strings.year="a year"),m("li.toplevel_page_wp_stream ul li.wp-first-item.current").parent().parent().find(".update-plugins").remove(),m(".toplevel_page_wp_stream :input.chosen-select").each(function(e,t){function a(e){var t=m("<span>"),a=m(e.element),i="";return"- "===e.text.substring(0,2)&&(e.text=e.text.substring(2)),void 0!==e.id&&"string"==typeof e.id&&(0===e.id.indexOf("group-")?t.addClass("parent"):a.hasClass("level-2")&&t.addClass("child")),void 0!==e.icon?i=e.icon:void 0!==a&&""!==a.data("icon")&&(i=a.data("icon")),i&&t.html('<img src="'+i+'" class="wp-stream-select2-icon">'),t.append(e.text),t}function i(e){return"- "===e.text.substring(0,2)&&(e.text=e.text.substring(2)),e.text}var n={},n=0<m(t).find("option").not(":selected").not(":empty").length?{minimumResultsForSearch:10,templateResult:a,templateSelection:i,allowClear:!0,width:"165px"}:{minimumInputLength:3,allowClear:!0,width:"165px",ajax:{url:ajaxurl,delay:500,dataType:"json",quietMillis:100,data:function(e){return{action:"wp_stream_filters",nonce:m("#stream_filters_user_search_nonce").val(),filter:m(t).attr("name"),q:e.term}},processResults:function(e){var a=[];return m.each(e,function(e,t){a.push({id:t.id,text:t.label})}),{results:a}}},templateResult:a,templateSelection:i};m(t).select2(n)});var e=m.streamGetQueryVars(),t=m('.toplevel_page_wp_stream select.chosen-select[name="context"]');void 0!==e.context&&""!==e.context||void 0===e.connector||(t.val("group-"+e.connector),t.trigger("change")),m("input[type=submit]","#record-filter-form").click(function(){m("input[type=submit]",m(this).parents("form")).removeAttr("clicked"),m(this).attr("clicked","true")}),m("#record-filter-form").submit(function(){var e=m('.toplevel_page_wp_stream :input.chosen-select[name="context"]'),t=e.find("option:selected"),a=e.parent().find(".record-filter-connector"),i=t.data("group"),n=t.prop("class"),r=m(".recordactions select");"true"!==m("#record-actions-submit").attr("clicked")&&r.val(""),a.val(i),"level-1"===n&&t.val("")}),m(window).load(function(){m('.toplevel_page_wp_stream input[type="search"]').off("mousedown")}),m("body").on("click","#wp_stream_advanced_delete_all_records, #wp_stream_network_advanced_delete_all_records",function(e){window.confirm(wp_stream.i18n.confirm_purge)||e.preventDefault()}),m("body").on("click","#wp_stream_advanced_reset_site_settings, #wp_stream_network_advanced_reset_site_settings",function(e){window.confirm(wp_stream.i18n.confirm_defaults)||e.preventDefault()}),m("body").on("click","#wp_stream_uninstall",function(e){window.confirm(wp_stream.i18n.confirm_uninstall)||e.preventDefault()});var r=m(".wp_stream_screen .nav-tab-wrapper"),s=m(".wp_stream_screen .nav-tab-content table.form-table"),a=r.find(".nav-tab-active"),i=0<a.length?r.find("a").index(a):0,n=window.location.hash.match(/^#(\d+)$/),o=null!==n?n[1]:i;r.on("click","a",function(){var e,t,a,i=r.find("a").index(m(this)),n=window.location.hash.match(/^#(\d+)$/);return s.hide().eq(i).show(),r.find("a").removeClass("nav-tab-active").filter(m(this)).addClass("nav-tab-active"),""!==window.location.hash&&null===n||(window.location.hash=i),e=i,0!==(a=m('input[name="option_page"][value^="wp_stream"]').closest("form")).length&&(t=a.attr("action"),a.prop("action",t.replace(/(^[^#]*).*$/,"$1#"+e))),!1}),r.children().eq(o).trigger("click"),m(document).ready(function(){function t(){var e=!0;m('div.metabox-prefs [name="date-hide"]').is(":checked")&&(e=!1),m("div.alignleft.actions div.select2-container").each(function(){if(!m(this).is(":hidden"))return e=!1}),e?(m("input#record-query-submit").hide(),m("span.filter_info").show()):(m("input#record-query-submit").show(),m("span.filter_info").hide())}m("#enable_live_update").click(function(){var e,t=m("#stream_live_update_nonce").val(),a=m("#enable_live_update_user").val(),i="unchecked";m("#enable_live_update").is(":checked")&&(i="checked"),e=m("#enable_live_update").data("heartbeat"),m.ajax({type:"POST",url:ajaxurl,data:{action:"stream_enable_live_update",nonce:t,user:a,checked:i,heartbeat:e},dataType:"json",beforeSend:function(){m(".stream-live-update-checkbox .spinner").show().css({display:"inline-block"})},success:function(e){m(".stream-live-update-checkbox .spinner").hide(),!1===e.success&&(m("#enable_live_update").prop("checked",!1),e.data&&window.alert(e.data))}})}),m('div.metabox-prefs [name="date-hide"]').is(":checked")?m("div.date-interval").show():m("div.date-interval").hide(),m("div.actions select.chosen-select").each(function(){var e=m(this).prop("name");m('div.metabox-prefs [name="'+e+'-hide"]').is(":checked")?m(this).prev(".select2-container").show():m(this).prev(".select2-container").hide()}),t(),m('div.metabox-prefs [type="checkbox"]').click(function(){var e=m(this).prop("id");"date-hide"===e?m(this).is(":checked")?m("div.date-interval").show():m("div.date-interval").hide():(e=e.replace("-hide",""),m(this).is(":checked")?m('[name="'+e+'"]').prev(".select2-container").show():m('[name="'+e+'"]').prev(".select2-container").hide()),t()}),m("#ui-datepicker-div").addClass("stream-datepicker")}),m("table.wp-list-table").on("updated",function(){m(this).find("time.relative-time").each(function(e,t){var a=m(t);a.removeClass("relative-time"),m('<strong><time datetime="'+a.attr("datetime")+'" class="timeago"/></time></strong><br/>').prependTo(a.parent().parent()).find("time.timeago").timeago()})}).trigger("updated");var c={init:function(e){this.wrapper=e,this.save_interval(this.wrapper.find(".button-primary"),this.wrapper),this.$=this.wrapper.each(function(e,t){var a,i,n,r,s=m(t),o=s.find(".date-inputs"),c=s.find(".field-from"),d=s.find(".field-to"),l=d.prev(".date-remove"),p=c.prev(".date-remove"),u=s.children(".field-predefined"),h=m("").add(d).add(c);jQuery.datepicker&&(a=parseFloat(wp_stream.gmt_offset)-(new Date).getTimezoneOffset()/60*-1,i=new Date,n=new Date(i.getTime()+60*a*60*1e3),r=0,i.getDate()===n.getDate()&&i.getMonth()===n.getMonth()||(r=i.getTime()<n.getTime()?"+1d":"-1d"),h.datepicker({dateFormat:"yy/mm/dd",minDate:null,maxDate:r,defaultDate:n,beforeShow:function(){m(this).prop("disabled",!0)},onClose:function(){m(this).prop("disabled",!1)}}),h.datepicker("widget").addClass("stream-datepicker")),u.select2({allowClear:!0}),""!==c.val()&&p.show(),""!==d.val()&&l.show(),u.on({change:function(){var e=m(this).val(),t=u.find('[value="'+e+'"]'),a=t.data("to"),i=t.data("from");if("custom"===e)return o.show(),!1;o.hide(),h.datepicker("hide"),c.val(i).trigger("change",[!0]),d.val(a).trigger("change",[!0]),jQuery.datepicker&&h.datepicker("widget").is(":visible")&&h.datepicker("refresh").datepicker("hide")},"select2-removed":function(){u.val("").trigger("change")},check_options:function(){var e;""!==d.val()&&""!==c.val()?0!==(e=u.find("option").filter('[data-to="'+d.val()+'"]').filter('[data-from="'+c.val()+'"]')).length?u.val(e.attr("value")).trigger("change",[!0]):u.val("custom").trigger("change",[!0]):""===d.val()&&""===c.val()?u.val("").trigger("change",[!0]):u.val("custom").trigger("change",[!0])}}),c.on("change",function(){return""!==c.val()?(p.show(),d.datepicker("option","minDate",c.val())):p.hide(),!0!==arguments[arguments.length-1]&&void u.trigger("check_options")}),d.on("change",function(){return""!==d.val()?(l.show(),c.datepicker("option","maxDate",d.val())):l.hide(),!0!==arguments[arguments.length-1]&&void u.trigger("check_options")}),u.trigger("change"),m("").add(p).add(l).on("click",function(){m(this).next("input").val("").trigger("change")})})},save_interval:function(e){var t=this.wrapper;e.click(function(){var e={key:t.find("select.field-predefined").find(":selected").val(),start:t.find(".date-inputs .field-from").val(),end:t.find(".date-inputs .field-to").val()};m(this).attr("href",m(this).attr("href")+"&"+m.param(e))})}};m(document).ready(function(){c.init(m(".date-interval")),m('select[name="context"] .level-1').each(function(){var e=!0;m(this).nextUntil(".level-1").each(function(){if(m(this).is(":not(:disabled)"))return e=!1}),!0===e&&m(this).prop("disabled",!0)})})}),jQuery.extend({streamGetQueryVars:function(e){return(e||document.location.search).replace(/(^\?)/,"").split("&").map(function(e){return this[(e=e.split("="))[0]]=e[1],this}.bind({}))[0]}});
|
ui/js/alerts.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(function(o){"use strict";function c(t){var e=o(t);e.find(".select2-select.connector_or_context").each(function(t,e){o(e).select2({allowClear:!0,placeholder:streamAlerts.anyContext,templateResult:function(t){return void 0===t.id?t.text:-1===t.id.indexOf("-")?o('<span class="parent">'+t.text+"</span>"):o('<span class="child">'+t.text+"</span>")},matcher:function(t,e){var n=o.extend(!0,{},e);if(null===t.term||""===o.trim(t.term))return n;var a=t.term.toLowerCase();if(n.id=n.id.replace("blogs","sites"),0<=n.id.toLowerCase().indexOf(a))return n;if(n.children){for(var i=n.children.length-1;0<=i;i--){-1===n.children[i].id.toLowerCase().indexOf(a)&&n.children.splice(i,1)}if(0<n.children.length)return n}return null}}).change(function(){var t=o(this).val();
|
1 |
+
jQuery(function(o){"use strict";function c(t){var e=o(t);e.find(".select2-select.connector_or_context").each(function(t,e){o(e).select2({allowClear:!0,placeholder:streamAlerts.anyContext,templateResult:function(t){return void 0===t.id?t.text:-1===t.id.indexOf("-")?o('<span class="parent">'+t.text+"</span>"):o('<span class="child">'+t.text+"</span>")},matcher:function(t,e){var n=o.extend(!0,{},e);if(null===t.term||""===o.trim(t.term))return n;var a=t.term.toLowerCase();if(n.id=n.id.replace("blogs","sites"),0<=n.id.toLowerCase().indexOf(a))return n;if(n.children){for(var i=n.children.length-1;0<=i;i--){-1===n.children[i].id.toLowerCase().indexOf(a)&&n.children.splice(i,1)}if(0<n.children.length)return n}return null}}).change(function(){var t,e=o(this).val();e&&(t=e.split("-"),o(this).siblings(".connector").val(t[0]),o(this).siblings(".context").val(t[1]))});var n=[o(e).siblings(".connector").val(),o(e).siblings(".context").val()];""===n[1]&&n.splice(1,1),o(e).val(n.join("-")).trigger("change")}),e.find("select.select2-select:not(.connector_or_context)").each(function(){var t=o(this).attr("id").split("_"),e=t[t.length-1].charAt(0).toUpperCase()+t[t.length-1].slice(1);o(this).select2({allowClear:!0,placeholder:streamAlerts.any+" "+e})})}function i(t){var e={action:"load_alerts_settings",alert_type:t},n=o("#wp_stream_alert_type").closest("tr").attr("id");e.post_id=n.split("-")[1],o.post(window.ajaxurl,e,function(t){var e=o("#wp_stream_alert_type_form");"none"!==o("#wp_stream_alert_type").val()?(e.html(t.data.html),e.show()):e.hide()})}var p,_,t=o("#wp_stream_alert_type");o("#the-list").on("change","#wp_stream_trigger_connector_or_context",function(){var t;"wp_stream_trigger_connector_or_context"===o(this).attr("id")&&((t=o(this).val())&&0<t.indexOf("-")&&(t=t.split("-")[0]),e(t))});var e=function(t){var s=o("#wp_stream_trigger_action");s.empty(),s.prop("disabled",!0);var e=o("<option/>",{value:"",text:""});s.append(e);var n={action:"get_actions",connector:t};o.post(window.ajaxurl,n,function(t){var e,n,a=t.success,i=t.data;if(a){for(var r in i){i.hasOwnProperty(r)&&(e=i[r],n=o("<option/>",{value:r,text:e}),s.append(n))}s.prop("disabled",!1),o(document).trigger("alert-actions-updated")}})};t.change(function(){i(o(this).val())}),o("#wpbody-content").on("click","a.page-title-action",function(t){t.preventDefault(),o("#add-new-alert").remove(),0<o(".inline-edit-wp_stream_alerts").length&&o(".inline-edit-wp_stream_alerts .inline-edit-save button.button-secondary.cancel").trigger("click");var a;o.post(window.ajaxurl,{action:"get_new_alert_triggers_notifications"},function(t){var e,n;!0===t.success&&(a=t.data.html,o("tbody#the-list").prepend('<tr id="add-new-alert" class="inline-edit-row inline-edit-row-page inline-edit-page quick-edit-row quick-edit-row-page inline-edit-page inline-editor" style=""><td colspan="4" class="colspanchange">'+a+'<p class="submit inline-edit-save"> <button type="button" class="button-secondary cancel alignleft">Cancel</button> <input type="hidden" id="_inline_edit" name="_inline_edit" value="3550d271fe"> <button type="button" class="button-primary save alignright">Save</button> <span class="spinner"></span><span class="error" style="display:none"></span> <br class="clear"></p></td></tr>'),e=o("#add-new-alert"),n=e.css("background-color"),e.css("background-color","#C1E1B9"),setTimeout(function(){e.css("background-color",n)},250),o("#wp_stream_alert_type").change(function(){i(o(this).val())}),e.on("click",".button-secondary.cancel",function(){o("#add-new-alert").remove()}),e.on("click",".button-primary.save",r),c("#add-new-alert"))})});var n,a,r=function(t){t.preventDefault(),o("#add-new-alert").find("p.submit.inline-edit-save span.spinner").css("visibility","visible");var e={action:"save_new_alert",wp_stream_alerts_nonce:o("#wp_stream_alerts_nonce").val(),wp_stream_trigger_author:o("#wp_stream_trigger_author").val(),wp_stream_trigger_context:o("#wp_stream_trigger_connector_or_context").val(),wp_stream_trigger_action:o("#wp_stream_trigger_action").val(),wp_stream_alert_type:o("#wp_stream_alert_type").val(),wp_stream_alert_status:o("#wp_stream_alert_status").val()};o("#wp_stream_alert_type_form").find(":input").each(function(){var t=o(this).attr("id");o(this).val()&&(e[t]=o(this).val())}),o.post(window.ajaxurl,e,function(t){!0===t.success&&(o("#add-new-alert").find("p.submit.inline-edit-save span.spinner").css("visibility","hidden"),location.reload())})},d=inlineEditPost.edit;inlineEditPost.edit=function(t){d.apply(this,arguments);var e,n,a,i,r,s,l=0;"object"==typeof t&&(l=parseInt(this.getId(t),10)),0<l&&(_=o("#edit-"+l),a=(e=(p=o("#post-"+l)).find('input[name="wp_stream_trigger_connector"]').val())+"-"+(n=p.find('input[name="wp_stream_trigger_context"]').val()),i=p.find('input[name="wp_stream_trigger_action"]').val(),r=p.find('input[name="wp_stream_alert_status"]').val(),_.find('input[name="wp_stream_trigger_connector"]').attr("value",e),_.find('input[name="wp_stream_trigger_context"]').attr("value",n),_.find('select[name="wp_stream_trigger_connector_or_context"] option[value="'+a+'"]').attr("selected","selected"),o(document).one("alert-actions-updated",function(){_.find('input[name="wp_stream_trigger_action"]').attr("value",i),_.find('select[name="wp_stream_trigger_action"] option[value="'+i+'"]').attr("selected","selected").trigger("change")}),_.find('select[name="wp_stream_alert_status"] option[value="'+r+'"]').attr("selected","selected"),c("#edit-"+l),o("#wp_stream_alert_type_form").hide(),s=p.find('input[name="wp_stream_alert_type"]').val(),_.find('select[name="wp_stream_alert_type"] option[value="'+s+'"]').attr("selected","selected").trigger("change"))},!window.location.hash||(n=o(window.location.hash)).length&&(a=n.offset().top-o("#wpadminbar").height(),o("html, body").animate({scrollTop:a},1e3),n.find(".row-actions a.editinline").trigger("click"))});
|
ui/js/exclude.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(function(a){function t(e){var s;a("select.select2-select.connector_or_context",e).each(function(e,t){a(t).select2({allowClear:!0,templateResult:function(e){return void 0===e.id?e.text:-1===e.id.indexOf("-")?a('<span class="parent">'+e.text+"</span>"):a('<span class="child">'+e.text+"</span>")},matcher:function(e,t){var s=a.extend(!0,{},t);if(null===e.term||""===a.trim(e.term))return s;var n=e.term.toLowerCase();if(s.id=s.id.replace("blogs","sites"),0<=s.id.toLowerCase().indexOf(n))return s;if(s.children){for(var i=s.children.length-1;0<=i;i--){-1===s.children[i].id.toLowerCase().indexOf(n)&&s.children.splice(i,1)}if(0<s.children.length)return s}return null}}).on("change",function(){var e=a(this).closest("tr"),t=a(this).val();t&&0<t.indexOf("-")&&(t=t.split("-")[0])
|
1 |
+
jQuery(function(a){function t(e){var s;a("select.select2-select.connector_or_context",e).each(function(e,t){a(t).select2({allowClear:!0,templateResult:function(e){return void 0===e.id?e.text:-1===e.id.indexOf("-")?a('<span class="parent">'+e.text+"</span>"):a('<span class="child">'+e.text+"</span>")},matcher:function(e,t){var s=a.extend(!0,{},t);if(null===e.term||""===a.trim(e.term))return s;var n=e.term.toLowerCase();if(s.id=s.id.replace("blogs","sites"),0<=s.id.toLowerCase().indexOf(n))return s;if(s.children){for(var i=s.children.length-1;0<=i;i--){-1===s.children[i].id.toLowerCase().indexOf(n)&&s.children.splice(i,1)}if(0<s.children.length)return s}return null}}).on("change",function(){var e=a(this).closest("tr"),t=a(this).val();t&&0<t.indexOf("-")&&(t=t.split("-")[0]),function(e,t){var c=a(".select2-select.action",e),r=c.val();c.empty(),c.prop("disabled",!0);var s=a("<option/>",{value:"",text:""});c.append(s);var n={action:"get_actions",connector:t};a.post(window.ajaxurl,n,function(e){var t,s,n=e.success,i=e.data;if(n){for(var l in i){i.hasOwnProperty(l)&&(t=i[l],s=a("<option/>",{value:l,text:t}),c.append(s))}c.val(r),c.prop("disabled",!1),a(document).trigger("alert-actions-updated")}})}(e,t)})}),a("select.select2-select.action",e).each(function(e,t){a(t).select2({allowClear:!0})}),a("select.select2-select.author_or_role",e).each(function(e,t){(s=a(t)).select2({ajax:{type:"POST",url:ajaxurl,dataType:"json",quietMillis:500,data:function(e,t){return{find:e,limit:10,pager:t,action:"stream_get_users",nonce:s.data("nonce")}},processResults:function(e){var t={results:[{text:"",id:""},{text:"Roles",children:[]},{text:"Users",children:[]}]};if(!0!==e.success||void 0===e.data||!0!==e.data.status)return t;if(void 0===e.data.users||void 0===e.data.roles)return t;var s=[];return a.each(e.data.roles,function(e,t){s.push({id:e,text:t})}),t.results[1].children=s,t.results[2].children=e.data.users,t}},templateResult:function(e){var t=a("<div>").text(e.text);return void 0!==e.icon&&e.icon&&(t.prepend(a('<img src="'+e.icon+'" class="wp-stream-select2-icon">')),t.attr("title",e.tooltip)),void 0!==e.tooltip?t.attr("title",e.tooltip):void 0!==e.user_count&&t.attr("title",e.user_count),t},templateSelection:function(e){var t=a("<div>").text(e.text);return a.isNumeric(e.id)&&e.text.indexOf("icon-users")<0&&t.append(a('<i class="icon16 icon-users"></i>')),t},allowClear:!0,placeholder:s.data("placeholder")}).on("change",function(){var e=a(this).select2("data");a(this).data("selected-id",e.id),a(this).data("selected-text",e.text)})}),a("select.select2-select.ip_address",e).each(function(e,t){var s=a(t),n="";s.select2({ajax:{type:"POST",url:ajaxurl,dataType:"json",quietMillis:500,data:function(e){return n=e.term,{find:e,limit:10,action:"stream_get_ips",nonce:s.data("nonce")}},processResults:function(e){var s={results:[]},t=[];return!0===e.success&&void 0!==e.data&&a.each(e.data,function(e,t){s.results.push({id:t,text:t})}),void 0===n||null===(t=n.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/))||(t.shift(),4<=(t=a.grep(t,function(e){var t=parseInt(e,10);return t<=255&&t.toString()===e})).length&&s.results.push({id:n,text:n})),s}},allowClear:!1,multiple:!0,maximumSelectionSize:1,placeholder:s.data("placeholder"),tags:!0})}).on("change",function(){a(this).prev(".select2-container").find("input.select2-input").blur()}),a("ul.select2-choices, ul.select2-choices li, input.select2-input",".stream-exclude-list tr:not(.hidden) .ip_address").on("mousedown click focus",function(){var e=a(this).closest(".select2-container"),t=e.find("input.select2-input");if(1<=e.select2("data").length)return t.blur(),!1}),a(".exclude_rules_remove_rule_row",e).on("click",function(e){a(this).closest("tr").remove(),i(),n(),e.preventDefault()})}var e=a(".stream-exclude-list tbody tr:not(.hidden)"),s=a(".stream-exclude-list tr.helper");function n(){var e=a("table.stream-exclude-list tbody tr:not( .hidden ) input.cb-select:checked"),t=a("#exclude_rules_remove_rules");0===e.length?t.prop("disabled",!0):t.prop("disabled",!1)}function i(){var e=a("table.stream-exclude-list tbody tr:not( .hidden )"),t=a("table.stream-exclude-list tbody tr.no-items"),s=a(".check-column.manage-column input.cb-select"),n=a("#exclude_rules_remove_rules");0===e.length?(t.show(),s.prop("disabled",!0),n.prop("disabled",!0)):(t.hide(),s.prop("disabled",!1)),wp_stream_regenerate_alt_rows(e)}t(e),a("select.select2-select.author_or_role",e).each(function(){var e=a("<option selected>"+a(this).data("selected-text")+"</option>").val(a(this).data("selected-id"));a(this).append(e).trigger("change")}),a("select.select2-select.connector_or_context",e).each(function(){var e=[a(this).siblings(".connector").val(),a(this).siblings(".context").val()];""===e[1]&&e.splice(1,1),a(this).val(e.join("-")).trigger("change")}),a("#exclude_rules_new_rule").on("click",function(){var e=s.clone();e.removeAttr("class"),e.insertBefore(s),t(e),i(),n()}),a("#exclude_rules_remove_rules").on("click",function(){var e=a("table.stream-exclude-list"),t=a("tbody input.cb-select:checked",e).closest("tr");2<=a("tbody tr",e).length-t.length?t.remove():(a(":input",t).val(""),a(t).not(":first").remove(),a(".select2-select",t).select2("val","")),e.find("input.cb-select").prop("checked",!1),i(),n()}),a(".stream-exclude-list").closest("form").submit(function(){a(".stream-exclude-list tbody tr.hidden",this).each(function(){a(this).find(":input").removeAttr("name")}),a(".stream-exclude-list tbody tr:not(.hidden) select.select2-select.connector_or_context",this).each(function(){var e=a(this).val().split("-");a(this).siblings(".connector").val(e[0]),a(this).siblings(".context").val(e[1]),a(this).removeAttr("name")}),a(".stream-exclude-list tbody tr:not(.hidden) select.select2-select.ip_address",this).each(function(){var e=a("option:selected",this).first();e.length||a(this).append('<option selected="selected"></option>'),a("option:selected:not(:first)",this).each(function(){e.attr("value",e.attr("value")+","+a(this).attr("value")),a(this).removeAttr("selected")})})}),a(".stream-exclude-list").closest("td").prev("th").hide(),a("table.stream-exclude-list").on("click","input.cb-select",function(){n()}),a(document).ready(function(){i(),n()})});
|
ui/js/live-updates.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(function(d){d(document).ready(function(){
|
1 |
+
jQuery(function(d){d(document).ready(function(){var _;"toplevel_page_wp_stream"===wp_stream_live_updates.current_screen&&"1"===wp_stream_live_updates.current_page&&"asc"!==wp_stream_live_updates.current_order&&(1<parseInt(wp_stream_live_updates.current_query_count,10)||(_=".toplevel_page_wp_stream #the-list",wp.heartbeat.interval("fast"),d(document).on("heartbeat-send.stream",function(e,t){t["wp-stream-heartbeat"]="live-update";var a=d(_+" tr:first .column-date time"),r=1;0!==a.length&&(r=""===a.attr("datetime")?1:a.attr("datetime")),t["wp-stream-heartbeat-last-time"]=r,t["wp-stream-heartbeat-query"]=wp_stream_live_updates.current_query}),d(document).on("heartbeat-tick.stream",function(e,t){var a,r,s,n,l,p,i;t["wp-stream-heartbeat"]&&0!==t["wp-stream-heartbeat"].length&&(a=d("#edit_stream_per_page").val(),r=d(_+" tr"),(s=d(t["wp-stream-heartbeat"])).addClass("new-row"),n=r.first().hasClass("alternate"),1!==s.length||n?(l=0!=s.length%2||n?"odd":"even",s.filter(":nth-child("+l+")").addClass("alternate")):s.addClass("alternate"),d(_).prepend(s),d(".metabox-prefs input").each(function(){var e;!0!==d(this).prop("checked")&&(e=d(this).val(),d("td.column-"+e).hide())}),(p=a-(s.length+r.length))<0&&d(_+" tr").slice(p).remove(),d(_+" tr.no-items").remove(),(i=t.total_items_i18n||"")&&(d(".displaying-num").text(i),d(".total-pages").text(t.total_pages_i18n),d(".tablenav-pages").find(".next-page, .last-page").toggleClass("disabled",t.total_pages===d(".current-page").val()),d(".tablenav-pages .last-page").attr("href",t.last_page_link)),d(_).parent().trigger("updated"),wp_stream_regenerate_alt_rows(d(_+" tr")),setTimeout(function(){d(".new-row").addClass("fadeout"),setTimeout(function(){d(_+" tr").removeClass("new-row fadeout")},500)},3e3))})))})});
|
ui/js/settings.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(function(
|
1 |
+
jQuery(function(o){var e="wp_stream_network"===o('input[name="option_page"]').val()?"_network_affix":"",a=o("#wp_stream"+e+"\\[general_keep_records_indefinitely\\]"),n=o("#wp_stream"+e+"_general_records_ttl"),t=n.closest("tr");function i(){a.is(":checked")?(t.addClass("hidden"),n.addClass("hidden")):(t.removeClass("hidden"),n.removeClass("hidden"))}a.on("change",function(){i()}),i(),o("#wp_stream_general_reset_site_settings").click(function(e){confirm(wp_stream.i18n.confirm_defaults)||e.preventDefault()});var r=o(".nav-tab-wrapper"),s=o(".nav-tab-content table.form-table"),l=r.find(".nav-tab-active"),c=0<l.length?r.find("a").index(l):0,d=window.location.hash.match(/^#(\d+)$/),h=null!==d?d[1]:c;r.on("click","a",function(){var e,a,n,t=r.find("a").index(o(this)),i=window.location.hash.match(/^#(\d+)$/);return s.hide().eq(t).show(),r.find("a").removeClass("nav-tab-active").filter(o(this)).addClass("nav-tab-active"),""!==window.location.hash&&null===i||(window.location.hash=t),e=t,0!==(n=o('input[name="option_page"][value^="wp_stream"]').closest("form")).length&&(a=n.attr("action"),n.prop("action",a.replace(/(^[^#]*).*$/,"$1#"+e))),!1}),r.children().eq(h).trigger("click")});
|