Version Description
November 27, 2015 =
Tweak: Better descriptions when a post changes status (0eada10)
Fix: Stream no longer crashes every time it tries to use a Jetpack (#798)
Fix: You may now actually choose an item from the filter dropdown menus, instead of having everything greyed out (#800)
Fix: Logging in / out of a Multisite install is now possible (#801)
Fix: The Settings connector now works with WP CLI (78a56b2)
Download this release
Release Info
Developer | lukecarbis |
Plugin | Stream |
Version | 3.0.4 |
Comparing to | |
See all releases |
Code changes from version 3.0.3 to 3.0.4
- classes/class-author.php +2 -26
- classes/class-db.php +1 -1
- classes/class-list-table.php +9 -1
- classes/class-log.php +5 -0
- classes/class-plugin.php +1 -1
- connectors/class-connector-jetpack.php +6 -6
- connectors/class-connector-posts.php +6 -6
- connectors/class-connector-settings.php +128 -105
- readme.md +9 -2
- readme.txt +10 -2
- stream.php +1 -1
- tests/tests/test-class-author.php +0 -5
classes/class-author.php
CHANGED
@@ -2,12 +2,6 @@
|
|
2 |
namespace WP_Stream;
|
3 |
|
4 |
class Author {
|
5 |
-
/**
|
6 |
-
* Hold Plugin class
|
7 |
-
* @var Plugin
|
8 |
-
*/
|
9 |
-
public $plugin;
|
10 |
-
|
11 |
/**
|
12 |
* @var int
|
13 |
*/
|
@@ -36,8 +30,6 @@ class Author {
|
|
36 |
if ( $this->id ) {
|
37 |
$this->user = new \WP_User( $this->id );
|
38 |
}
|
39 |
-
|
40 |
-
$this->plugin = wp_stream_get_instance();
|
41 |
}
|
42 |
|
43 |
/**
|
@@ -129,7 +121,8 @@ class Author {
|
|
129 |
}
|
130 |
|
131 |
if ( 0 === $this->id ) {
|
132 |
-
$
|
|
|
133 |
$avatar = sprintf( '<img alt="%1$s" src="%2$s" class="avatar avatar-%3$s photo" height="%3$s" width="%3$s">', esc_attr( $this->get_display_name() ), esc_url( $url ), esc_attr( $size ) );
|
134 |
} else {
|
135 |
if ( $this->is_deleted() && isset( $this->meta['user_email'] ) ) {
|
@@ -193,23 +186,6 @@ class Author {
|
|
193 |
return $user_role;
|
194 |
}
|
195 |
|
196 |
-
/**
|
197 |
-
* Construct a URL for viewing user-specific records
|
198 |
-
*
|
199 |
-
* @return string
|
200 |
-
*/
|
201 |
-
function get_records_page_url() {
|
202 |
-
$url = add_query_arg(
|
203 |
-
array(
|
204 |
-
'page' => $this->plugin->admin->records_page_slug,
|
205 |
-
'user_id' => absint( $this->id ),
|
206 |
-
),
|
207 |
-
self_admin_url( $this->plugin->admin->admin_parent_page )
|
208 |
-
);
|
209 |
-
|
210 |
-
return $url;
|
211 |
-
}
|
212 |
-
|
213 |
/**
|
214 |
* True if user no longer exists, otherwise false
|
215 |
*
|
2 |
namespace WP_Stream;
|
3 |
|
4 |
class Author {
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
/**
|
6 |
* @var int
|
7 |
*/
|
30 |
if ( $this->id ) {
|
31 |
$this->user = new \WP_User( $this->id );
|
32 |
}
|
|
|
|
|
33 |
}
|
34 |
|
35 |
/**
|
121 |
}
|
122 |
|
123 |
if ( 0 === $this->id ) {
|
124 |
+
$stream = wp_stream_get_instance();
|
125 |
+
$url = $stream->locations['url'] . 'ui/stream-icons/wp-cli.png';
|
126 |
$avatar = sprintf( '<img alt="%1$s" src="%2$s" class="avatar avatar-%3$s photo" height="%3$s" width="%3$s">', esc_attr( $this->get_display_name() ), esc_url( $url ), esc_attr( $size ) );
|
127 |
} else {
|
128 |
if ( $this->is_deleted() && isset( $this->meta['user_email'] ) ) {
|
186 |
return $user_role;
|
187 |
}
|
188 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
/**
|
190 |
* True if user no longer exists, otherwise false
|
191 |
*
|
classes/class-db.php
CHANGED
@@ -187,7 +187,7 @@ class DB {
|
|
187 |
}
|
188 |
|
189 |
$rows = $wpdb->get_results(
|
190 |
-
|
191 |
'ARRAY_A'
|
192 |
);
|
193 |
|
187 |
}
|
188 |
|
189 |
$rows = $wpdb->get_results(
|
190 |
+
"SELECT DISTINCT $column FROM $wpdb->stream", // @codingStandardsIgnoreLine can't prepare column name
|
191 |
'ARRAY_A'
|
192 |
);
|
193 |
|
classes/class-list-table.php
CHANGED
@@ -257,9 +257,17 @@ class List_Table extends \WP_List_Table {
|
|
257 |
case 'user_id' :
|
258 |
$user = new Author( (int) $record->user_id, (array) maybe_unserialize( $record->user_meta ) );
|
259 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
260 |
$out = sprintf(
|
261 |
'<a href="%s">%s <span>%s</span></a>%s%s%s',
|
262 |
-
$
|
263 |
$user->get_avatar_img( 80 ),
|
264 |
$user->get_display_name(),
|
265 |
$user->is_deleted() ? sprintf( '<br /><small class="deleted">%s</small>', esc_html__( 'Deleted User', 'stream' ) ) : '',
|
257 |
case 'user_id' :
|
258 |
$user = new Author( (int) $record->user_id, (array) maybe_unserialize( $record->user_meta ) );
|
259 |
|
260 |
+
$filtered_records_url = add_query_arg(
|
261 |
+
array(
|
262 |
+
'page' => $this->plugin->admin->records_page_slug,
|
263 |
+
'user_id' => absint( $user->id ),
|
264 |
+
),
|
265 |
+
self_admin_url( $this->plugin->admin->admin_parent_page )
|
266 |
+
);
|
267 |
+
|
268 |
$out = sprintf(
|
269 |
'<a href="%s">%s <span>%s</span></a>%s%s%s',
|
270 |
+
$filtered_records_url,
|
271 |
$user->get_avatar_img( 80 ),
|
272 |
$user->get_display_name(),
|
273 |
$user->is_deleted() ? sprintf( '<br /><small class="deleted">%s</small>', esc_html__( 'Deleted User', 'stream' ) ) : '',
|
classes/class-log.php
CHANGED
@@ -22,6 +22,11 @@ class Log {
|
|
22 |
*/
|
23 |
public function __construct( $plugin ) {
|
24 |
$this->plugin = $plugin;
|
|
|
|
|
|
|
|
|
|
|
25 |
}
|
26 |
|
27 |
/**
|
22 |
*/
|
23 |
public function __construct( $plugin ) {
|
24 |
$this->plugin = $plugin;
|
25 |
+
|
26 |
+
// Ensure function used in various methods is pre-loaded
|
27 |
+
if ( ! function_exists( 'is_plugin_active_for_network' ) ) {
|
28 |
+
require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
|
29 |
+
}
|
30 |
}
|
31 |
|
32 |
/**
|
classes/class-plugin.php
CHANGED
@@ -7,7 +7,7 @@ class Plugin {
|
|
7 |
*
|
8 |
* @const string
|
9 |
*/
|
10 |
-
const VERSION = '3.0.
|
11 |
|
12 |
/**
|
13 |
* WP-CLI command
|
7 |
*
|
8 |
* @const string
|
9 |
*/
|
10 |
+
const VERSION = '3.0.4';
|
11 |
|
12 |
/**
|
13 |
* WP-CLI command
|
connectors/class-connector-jetpack.php
CHANGED
@@ -141,9 +141,9 @@ class Connector_Jetpack extends Connector {
|
|
141 |
$slug = current( $slug );
|
142 |
}
|
143 |
|
144 |
-
if ( Jetpack::is_module_active( $slug ) ) {
|
145 |
if ( apply_filters( 'jetpack_module_configurable_' . $slug, false ) ) {
|
146 |
-
$links[ esc_html__( 'Configure', 'stream' ) ] = Jetpack::module_configuration_url( $slug );
|
147 |
}
|
148 |
|
149 |
$links[ esc_html__( 'Deactivate', 'stream' ) ] = wp_nonce_url(
|
@@ -152,7 +152,7 @@ class Connector_Jetpack extends Connector {
|
|
152 |
'action' => 'deactivate',
|
153 |
'module' => $slug,
|
154 |
),
|
155 |
-
Jetpack::admin_url()
|
156 |
),
|
157 |
'jetpack_deactivate-' . sanitize_title( $slug )
|
158 |
);
|
@@ -163,16 +163,16 @@ class Connector_Jetpack extends Connector {
|
|
163 |
'action' => 'activate',
|
164 |
'module' => $slug,
|
165 |
),
|
166 |
-
Jetpack::admin_url()
|
167 |
),
|
168 |
'jetpack_activate-' . sanitize_title( $slug )
|
169 |
);
|
170 |
}
|
171 |
-
} elseif ( Jetpack::is_module_active( str_replace( 'jetpack-', '', $record->context ) ) ) {
|
172 |
$slug = str_replace( 'jetpack-', '', $record->context ); // handling jetpack-comment anomaly
|
173 |
|
174 |
if ( apply_filters( 'jetpack_module_configurable_' . $slug, false ) ) {
|
175 |
-
$links[ esc_html__( 'Configure module', 'stream' ) ] = Jetpack::module_configuration_url( $slug );
|
176 |
}
|
177 |
}
|
178 |
}
|
141 |
$slug = current( $slug );
|
142 |
}
|
143 |
|
144 |
+
if ( \Jetpack::is_module_active( $slug ) ) {
|
145 |
if ( apply_filters( 'jetpack_module_configurable_' . $slug, false ) ) {
|
146 |
+
$links[ esc_html__( 'Configure', 'stream' ) ] = \Jetpack::module_configuration_url( $slug );
|
147 |
}
|
148 |
|
149 |
$links[ esc_html__( 'Deactivate', 'stream' ) ] = wp_nonce_url(
|
152 |
'action' => 'deactivate',
|
153 |
'module' => $slug,
|
154 |
),
|
155 |
+
\Jetpack::admin_url()
|
156 |
),
|
157 |
'jetpack_deactivate-' . sanitize_title( $slug )
|
158 |
);
|
163 |
'action' => 'activate',
|
164 |
'module' => $slug,
|
165 |
),
|
166 |
+
\Jetpack::admin_url()
|
167 |
),
|
168 |
'jetpack_activate-' . sanitize_title( $slug )
|
169 |
);
|
170 |
}
|
171 |
+
} elseif ( \Jetpack::is_module_active( str_replace( 'jetpack-', '', $record->context ) ) ) {
|
172 |
$slug = str_replace( 'jetpack-', '', $record->context ); // handling jetpack-comment anomaly
|
173 |
|
174 |
if ( apply_filters( 'jetpack_module_configurable_' . $slug, false ) ) {
|
175 |
+
$links[ esc_html__( 'Configure module', 'stream' ) ] = \Jetpack::module_configuration_url( $slug );
|
176 |
}
|
177 |
}
|
178 |
}
|
connectors/class-connector-posts.php
CHANGED
@@ -173,6 +173,12 @@ class Connector_Posts extends Connector {
|
|
173 |
'1: Post title, 2: Post type singular name',
|
174 |
'stream'
|
175 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
} elseif ( 'draft' === $new ) {
|
177 |
$summary = _x(
|
178 |
'"%1$s" %2$s drafted',
|
@@ -197,12 +203,6 @@ class Connector_Posts extends Connector {
|
|
197 |
'1: Post title, 2: Post type singular name',
|
198 |
'stream'
|
199 |
);
|
200 |
-
} elseif ( 'publish' === $new ) {
|
201 |
-
$summary = _x(
|
202 |
-
'"%1$s" %2$s published',
|
203 |
-
'1: Post title, 2: Post type singular name',
|
204 |
-
'stream'
|
205 |
-
);
|
206 |
} elseif ( 'private' === $new ) {
|
207 |
$summary = _x(
|
208 |
'"%1$s" %2$s privately published',
|
173 |
'1: Post title, 2: Post type singular name',
|
174 |
'stream'
|
175 |
);
|
176 |
+
} elseif ( 'publish' === $new && 'draft' === $old ) {
|
177 |
+
$summary = _x(
|
178 |
+
'"%1$s" %2$s published',
|
179 |
+
'1: Post title, 2: Post type singular name',
|
180 |
+
'stream'
|
181 |
+
);
|
182 |
} elseif ( 'draft' === $new ) {
|
183 |
$summary = _x(
|
184 |
'"%1$s" %2$s drafted',
|
203 |
'1: Post title, 2: Post type singular name',
|
204 |
'stream'
|
205 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
} elseif ( 'private' === $new ) {
|
207 |
$summary = _x(
|
208 |
'"%1$s" %2$s privately published',
|
connectors/class-connector-settings.php
CHANGED
@@ -23,12 +23,20 @@ class Connector_Settings extends Connector {
|
|
23 |
*/
|
24 |
public $actions = array(
|
25 |
'whitelist_options',
|
|
|
26 |
'update_site_option',
|
27 |
'update_option_permalink_structure',
|
28 |
'update_option_category_base',
|
29 |
'update_option_tag_base',
|
30 |
);
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
/**
|
33 |
* Option names used in options-permalink.php
|
34 |
*
|
@@ -81,6 +89,109 @@ class Connector_Settings extends Connector {
|
|
81 |
public function register() {
|
82 |
parent::register();
|
83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
add_action( 'admin_head', array( $this, 'highlight_field' ) );
|
85 |
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_jquery_color' ) );
|
86 |
add_action( sprintf( 'update_option_theme_mods_%s', get_option( 'stylesheet' ) ), array( $this, 'log_theme_modification' ), 10, 2 );
|
@@ -237,111 +348,8 @@ class Connector_Settings extends Connector {
|
|
237 |
* @return array Field label translations
|
238 |
*/
|
239 |
public function get_field_label( $field_key ) {
|
240 |
-
$labels
|
241 |
-
|
242 |
-
'blogname' => esc_html__( 'Site Title', 'stream' ),
|
243 |
-
'blogdescription' => esc_html__( 'Tagline', 'stream' ),
|
244 |
-
'admin_email' => esc_html__( 'E-mail Address', 'stream' ),
|
245 |
-
'new_admin_email' => esc_html__( 'E-mail Address', 'stream' ),
|
246 |
-
'siteurl' => esc_html__( 'WordPress Address (URL)', 'stream' ),
|
247 |
-
'home' => esc_html__( 'Site Address (URL)', 'stream' ),
|
248 |
-
'users_can_register' => esc_html__( 'Membership', 'stream' ),
|
249 |
-
'default_role' => esc_html__( 'New User Default Role', 'stream' ),
|
250 |
-
'timezone_string' => esc_html__( 'Timezone', 'stream' ),
|
251 |
-
'date_format' => esc_html__( 'Date Format', 'stream' ),
|
252 |
-
'time_format' => esc_html__( 'Time Format', 'stream' ),
|
253 |
-
'start_of_week' => esc_html__( 'Week Starts On', 'stream' ),
|
254 |
-
// Writing
|
255 |
-
'use_smilies' => esc_html__( 'Formatting', 'stream' ),
|
256 |
-
'use_balanceTags' => esc_html__( 'Formatting', 'stream' ),
|
257 |
-
'default_category' => esc_html__( 'Default Post Category', 'stream' ),
|
258 |
-
'default_post_format' => esc_html__( 'Default Post Format', 'stream' ),
|
259 |
-
'mailserver_url' => esc_html__( 'Mail Server', 'stream' ),
|
260 |
-
'mailserver_login' => esc_html__( 'Login Name', 'stream' ),
|
261 |
-
'mailserver_pass' => esc_html__( 'Password', 'stream' ),
|
262 |
-
'default_email_category' => esc_html__( 'Default Mail Category', 'stream' ),
|
263 |
-
'ping_sites' => esc_html__( 'Update Services', 'stream' ),
|
264 |
-
// Reading
|
265 |
-
'show_on_front' => esc_html__( 'Front page displays', 'stream' ),
|
266 |
-
'page_on_front' => esc_html__( 'Front page displays', 'stream' ),
|
267 |
-
'page_for_posts' => esc_html__( 'Front page displays', 'stream' ),
|
268 |
-
'posts_per_page' => esc_html__( 'Blog pages show at most', 'stream' ),
|
269 |
-
'posts_per_rss' => esc_html__( 'Syndication feeds show the most recent', 'stream' ),
|
270 |
-
'rss_use_excerpt' => esc_html__( 'For each article in a feed, show', 'stream' ),
|
271 |
-
'blog_public' => esc_html__( 'Search Engine Visibility', 'stream' ),
|
272 |
-
// Discussion
|
273 |
-
'default_pingback_flag' => esc_html__( 'Default article settings', 'stream' ),
|
274 |
-
'default_ping_status' => esc_html__( 'Default article settings', 'stream' ),
|
275 |
-
'default_comment_status' => esc_html__( 'Default article settings', 'stream' ),
|
276 |
-
'require_name_email' => esc_html__( 'Other comment settings', 'stream' ),
|
277 |
-
'comment_registration' => esc_html__( 'Other comment settings', 'stream' ),
|
278 |
-
'close_comments_for_old_posts' => esc_html__( 'Other comment settings', 'stream' ),
|
279 |
-
'close_comments_days_old' => esc_html__( 'Other comment settings', 'stream' ),
|
280 |
-
'thread_comments' => esc_html__( 'Other comment settings', 'stream' ),
|
281 |
-
'thread_comments_depth' => esc_html__( 'Other comment settings', 'stream' ),
|
282 |
-
'page_comments' => esc_html__( 'Other comment settings', 'stream' ),
|
283 |
-
'comments_per_page' => esc_html__( 'Other comment settings', 'stream' ),
|
284 |
-
'default_comments_page' => esc_html__( 'Other comment settings', 'stream' ),
|
285 |
-
'comment_order' => esc_html__( 'Other comment settings', 'stream' ),
|
286 |
-
'comments_notify' => esc_html__( 'E-mail me whenever', 'stream' ),
|
287 |
-
'moderation_notify' => esc_html__( 'E-mail me whenever', 'stream' ),
|
288 |
-
'comment_moderation' => esc_html__( 'Before a comment appears', 'stream' ),
|
289 |
-
'comment_whitelist' => esc_html__( 'Before a comment appears', 'stream' ),
|
290 |
-
'comment_max_links' => esc_html__( 'Comment Moderation', 'stream' ),
|
291 |
-
'moderation_keys' => esc_html__( 'Comment Moderation', 'stream' ),
|
292 |
-
'blacklist_keys' => esc_html__( 'Comment Blacklist', 'stream' ),
|
293 |
-
'show_avatars' => esc_html__( 'Show Avatars', 'stream' ),
|
294 |
-
'avatar_rating' => esc_html__( 'Maximum Rating', 'stream' ),
|
295 |
-
'avatar_default' => esc_html__( 'Default Avatar', 'stream' ),
|
296 |
-
// Media
|
297 |
-
'thumbnail_size_w' => esc_html__( 'Thumbnail size', 'stream' ),
|
298 |
-
'thumbnail_size_h' => esc_html__( 'Thumbnail size', 'stream' ),
|
299 |
-
'thumbnail_crop' => esc_html__( 'Thumbnail size', 'stream' ),
|
300 |
-
'medium_size_w' => esc_html__( 'Medium size', 'stream' ),
|
301 |
-
'medium_size_h' => esc_html__( 'Medium size', 'stream' ),
|
302 |
-
'large_size_w' => esc_html__( 'Large size', 'stream' ),
|
303 |
-
'large_size_h' => esc_html__( 'Large size', 'stream' ),
|
304 |
-
'uploads_use_yearmonth_folders' => esc_html__( 'Uploading Files', 'stream' ),
|
305 |
-
// Permalinks
|
306 |
-
'permalink_structure' => esc_html__( 'Permalink Settings', 'stream' ),
|
307 |
-
'category_base' => esc_html__( 'Category base', 'stream' ),
|
308 |
-
'tag_base' => esc_html__( 'Tag base', 'stream' ),
|
309 |
-
// Network
|
310 |
-
'registrationnotification' => esc_html__( 'Registration notification', 'stream' ),
|
311 |
-
'registration' => esc_html__( 'Allow new registrations', 'stream' ),
|
312 |
-
'add_new_users' => esc_html__( 'Add New Users', 'stream' ),
|
313 |
-
'menu_items' => esc_html__( 'Enable administration menus', 'stream' ),
|
314 |
-
'upload_space_check_disabled' => esc_html__( 'Site upload space check', 'stream' ),
|
315 |
-
'blog_upload_space' => esc_html__( 'Site upload space', 'stream' ),
|
316 |
-
'upload_filetypes' => esc_html__( 'Upload file types', 'stream' ),
|
317 |
-
'site_name' => esc_html__( 'Network Title', 'stream' ),
|
318 |
-
'first_post' => esc_html__( 'First Post', 'stream' ),
|
319 |
-
'first_page' => esc_html__( 'First Page', 'stream' ),
|
320 |
-
'first_comment' => esc_html__( 'First Comment', 'stream' ),
|
321 |
-
'first_comment_url' => esc_html__( 'First Comment URL', 'stream' ),
|
322 |
-
'first_comment_author' => esc_html__( 'First Comment Author', 'stream' ),
|
323 |
-
'welcome_email' => esc_html__( 'Welcome Email', 'stream' ),
|
324 |
-
'welcome_user_email' => esc_html__( 'Welcome User Email', 'stream' ),
|
325 |
-
'fileupload_maxk' => esc_html__( 'Max upload file size', 'stream' ),
|
326 |
-
'global_terms_enabled' => esc_html__( 'Terms Enabled', 'stream' ),
|
327 |
-
'illegal_names' => esc_html__( 'Banned Names', 'stream' ),
|
328 |
-
'limited_email_domains' => esc_html__( 'Limited Email Registrations', 'stream' ),
|
329 |
-
'banned_email_domains' => esc_html__( 'Banned Email Domains', 'stream' ),
|
330 |
-
'WPLANG' => esc_html__( 'Network Language', 'stream' ),
|
331 |
-
'blog_count' => esc_html__( 'Blog Count', 'stream' ),
|
332 |
-
'user_count' => esc_html__( 'User Count', 'stream' ),
|
333 |
-
// Other
|
334 |
-
'wp_stream_db' => esc_html__( 'Stream Database Version', 'stream' ),
|
335 |
-
);
|
336 |
-
|
337 |
-
// These option labels are special and need to change based on multisite context
|
338 |
-
if ( is_network_admin() ) {
|
339 |
-
$labels['admin_email'] = esc_html__( 'Network Admin Email', 'stream' );
|
340 |
-
$labels['new_admin_email'] = esc_html__( 'Network Admin Email', 'stream' );
|
341 |
-
}
|
342 |
-
|
343 |
-
if ( isset( $labels[ $field_key ] ) ) {
|
344 |
-
return $labels[ $field_key ];
|
345 |
}
|
346 |
|
347 |
return $field_key;
|
@@ -532,6 +540,21 @@ class Connector_Settings extends Connector {
|
|
532 |
return $links;
|
533 |
}
|
534 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
535 |
/**
|
536 |
* Trigger this connector core tracker, only on options.php page
|
537 |
*
|
23 |
*/
|
24 |
public $actions = array(
|
25 |
'whitelist_options',
|
26 |
+
'update_option',
|
27 |
'update_site_option',
|
28 |
'update_option_permalink_structure',
|
29 |
'update_option_category_base',
|
30 |
'update_option_tag_base',
|
31 |
);
|
32 |
|
33 |
+
/**
|
34 |
+
* Labels used for WordPress Settings
|
35 |
+
*
|
36 |
+
* @var array
|
37 |
+
*/
|
38 |
+
public $labels = array();
|
39 |
+
|
40 |
/**
|
41 |
* Option names used in options-permalink.php
|
42 |
*
|
89 |
public function register() {
|
90 |
parent::register();
|
91 |
|
92 |
+
$this->labels = array(
|
93 |
+
// General
|
94 |
+
'blogname' => esc_html__( 'Site Title', 'stream' ),
|
95 |
+
'blogdescription' => esc_html__( 'Tagline', 'stream' ),
|
96 |
+
'admin_email' => esc_html__( 'E-mail Address', 'stream' ),
|
97 |
+
'new_admin_email' => esc_html__( 'E-mail Address', 'stream' ),
|
98 |
+
'siteurl' => esc_html__( 'WordPress Address (URL)', 'stream' ),
|
99 |
+
'home' => esc_html__( 'Site Address (URL)', 'stream' ),
|
100 |
+
'users_can_register' => esc_html__( 'Membership', 'stream' ),
|
101 |
+
'default_role' => esc_html__( 'New User Default Role', 'stream' ),
|
102 |
+
'timezone_string' => esc_html__( 'Timezone', 'stream' ),
|
103 |
+
'date_format' => esc_html__( 'Date Format', 'stream' ),
|
104 |
+
'time_format' => esc_html__( 'Time Format', 'stream' ),
|
105 |
+
'start_of_week' => esc_html__( 'Week Starts On', 'stream' ),
|
106 |
+
// Writing
|
107 |
+
'use_smilies' => esc_html__( 'Formatting', 'stream' ),
|
108 |
+
'use_balanceTags' => esc_html__( 'Formatting', 'stream' ),
|
109 |
+
'default_category' => esc_html__( 'Default Post Category', 'stream' ),
|
110 |
+
'default_post_format' => esc_html__( 'Default Post Format', 'stream' ),
|
111 |
+
'mailserver_url' => esc_html__( 'Mail Server', 'stream' ),
|
112 |
+
'mailserver_login' => esc_html__( 'Login Name', 'stream' ),
|
113 |
+
'mailserver_pass' => esc_html__( 'Password', 'stream' ),
|
114 |
+
'default_email_category' => esc_html__( 'Default Mail Category', 'stream' ),
|
115 |
+
'ping_sites' => esc_html__( 'Update Services', 'stream' ),
|
116 |
+
// Reading
|
117 |
+
'show_on_front' => esc_html__( 'Front page displays', 'stream' ),
|
118 |
+
'page_on_front' => esc_html__( 'Front page displays', 'stream' ),
|
119 |
+
'page_for_posts' => esc_html__( 'Front page displays', 'stream' ),
|
120 |
+
'posts_per_page' => esc_html__( 'Blog pages show at most', 'stream' ),
|
121 |
+
'posts_per_rss' => esc_html__( 'Syndication feeds show the most recent', 'stream' ),
|
122 |
+
'rss_use_excerpt' => esc_html__( 'For each article in a feed, show', 'stream' ),
|
123 |
+
'blog_public' => esc_html__( 'Search Engine Visibility', 'stream' ),
|
124 |
+
// Discussion
|
125 |
+
'default_pingback_flag' => esc_html__( 'Default article settings', 'stream' ),
|
126 |
+
'default_ping_status' => esc_html__( 'Default article settings', 'stream' ),
|
127 |
+
'default_comment_status' => esc_html__( 'Default article settings', 'stream' ),
|
128 |
+
'require_name_email' => esc_html__( 'Other comment settings', 'stream' ),
|
129 |
+
'comment_registration' => esc_html__( 'Other comment settings', 'stream' ),
|
130 |
+
'close_comments_for_old_posts' => esc_html__( 'Other comment settings', 'stream' ),
|
131 |
+
'close_comments_days_old' => esc_html__( 'Other comment settings', 'stream' ),
|
132 |
+
'thread_comments' => esc_html__( 'Other comment settings', 'stream' ),
|
133 |
+
'thread_comments_depth' => esc_html__( 'Other comment settings', 'stream' ),
|
134 |
+
'page_comments' => esc_html__( 'Other comment settings', 'stream' ),
|
135 |
+
'comments_per_page' => esc_html__( 'Other comment settings', 'stream' ),
|
136 |
+
'default_comments_page' => esc_html__( 'Other comment settings', 'stream' ),
|
137 |
+
'comment_order' => esc_html__( 'Other comment settings', 'stream' ),
|
138 |
+
'comments_notify' => esc_html__( 'E-mail me whenever', 'stream' ),
|
139 |
+
'moderation_notify' => esc_html__( 'E-mail me whenever', 'stream' ),
|
140 |
+
'comment_moderation' => esc_html__( 'Before a comment appears', 'stream' ),
|
141 |
+
'comment_whitelist' => esc_html__( 'Before a comment appears', 'stream' ),
|
142 |
+
'comment_max_links' => esc_html__( 'Comment Moderation', 'stream' ),
|
143 |
+
'moderation_keys' => esc_html__( 'Comment Moderation', 'stream' ),
|
144 |
+
'blacklist_keys' => esc_html__( 'Comment Blacklist', 'stream' ),
|
145 |
+
'show_avatars' => esc_html__( 'Show Avatars', 'stream' ),
|
146 |
+
'avatar_rating' => esc_html__( 'Maximum Rating', 'stream' ),
|
147 |
+
'avatar_default' => esc_html__( 'Default Avatar', 'stream' ),
|
148 |
+
// Media
|
149 |
+
'thumbnail_size_w' => esc_html__( 'Thumbnail size', 'stream' ),
|
150 |
+
'thumbnail_size_h' => esc_html__( 'Thumbnail size', 'stream' ),
|
151 |
+
'thumbnail_crop' => esc_html__( 'Thumbnail size', 'stream' ),
|
152 |
+
'medium_size_w' => esc_html__( 'Medium size', 'stream' ),
|
153 |
+
'medium_size_h' => esc_html__( 'Medium size', 'stream' ),
|
154 |
+
'large_size_w' => esc_html__( 'Large size', 'stream' ),
|
155 |
+
'large_size_h' => esc_html__( 'Large size', 'stream' ),
|
156 |
+
'uploads_use_yearmonth_folders' => esc_html__( 'Uploading Files', 'stream' ),
|
157 |
+
// Permalinks
|
158 |
+
'permalink_structure' => esc_html__( 'Permalink Settings', 'stream' ),
|
159 |
+
'category_base' => esc_html__( 'Category base', 'stream' ),
|
160 |
+
'tag_base' => esc_html__( 'Tag base', 'stream' ),
|
161 |
+
// Network
|
162 |
+
'registrationnotification' => esc_html__( 'Registration notification', 'stream' ),
|
163 |
+
'registration' => esc_html__( 'Allow new registrations', 'stream' ),
|
164 |
+
'add_new_users' => esc_html__( 'Add New Users', 'stream' ),
|
165 |
+
'menu_items' => esc_html__( 'Enable administration menus', 'stream' ),
|
166 |
+
'upload_space_check_disabled' => esc_html__( 'Site upload space check', 'stream' ),
|
167 |
+
'blog_upload_space' => esc_html__( 'Site upload space', 'stream' ),
|
168 |
+
'upload_filetypes' => esc_html__( 'Upload file types', 'stream' ),
|
169 |
+
'site_name' => esc_html__( 'Network Title', 'stream' ),
|
170 |
+
'first_post' => esc_html__( 'First Post', 'stream' ),
|
171 |
+
'first_page' => esc_html__( 'First Page', 'stream' ),
|
172 |
+
'first_comment' => esc_html__( 'First Comment', 'stream' ),
|
173 |
+
'first_comment_url' => esc_html__( 'First Comment URL', 'stream' ),
|
174 |
+
'first_comment_author' => esc_html__( 'First Comment Author', 'stream' ),
|
175 |
+
'welcome_email' => esc_html__( 'Welcome Email', 'stream' ),
|
176 |
+
'welcome_user_email' => esc_html__( 'Welcome User Email', 'stream' ),
|
177 |
+
'fileupload_maxk' => esc_html__( 'Max upload file size', 'stream' ),
|
178 |
+
'global_terms_enabled' => esc_html__( 'Terms Enabled', 'stream' ),
|
179 |
+
'illegal_names' => esc_html__( 'Banned Names', 'stream' ),
|
180 |
+
'limited_email_domains' => esc_html__( 'Limited Email Registrations', 'stream' ),
|
181 |
+
'banned_email_domains' => esc_html__( 'Banned Email Domains', 'stream' ),
|
182 |
+
'WPLANG' => esc_html__( 'Network Language', 'stream' ),
|
183 |
+
'blog_count' => esc_html__( 'Blog Count', 'stream' ),
|
184 |
+
'user_count' => esc_html__( 'User Count', 'stream' ),
|
185 |
+
// Other
|
186 |
+
'wp_stream_db' => esc_html__( 'Stream Database Version', 'stream' ),
|
187 |
+
);
|
188 |
+
|
189 |
+
// These option labels are special and need to change based on multisite context
|
190 |
+
if ( is_network_admin() ) {
|
191 |
+
$this->labels['admin_email'] = esc_html__( 'Network Admin Email', 'stream' );
|
192 |
+
$this->labels['new_admin_email'] = esc_html__( 'Network Admin Email', 'stream' );
|
193 |
+
}
|
194 |
+
|
195 |
add_action( 'admin_head', array( $this, 'highlight_field' ) );
|
196 |
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_jquery_color' ) );
|
197 |
add_action( sprintf( 'update_option_theme_mods_%s', get_option( 'stylesheet' ) ), array( $this, 'log_theme_modification' ), 10, 2 );
|
348 |
* @return array Field label translations
|
349 |
*/
|
350 |
public function get_field_label( $field_key ) {
|
351 |
+
if ( isset( $this->labels[ $field_key ] ) ) {
|
352 |
+
return $this->labels[ $field_key ];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
353 |
}
|
354 |
|
355 |
return $field_key;
|
540 |
return $links;
|
541 |
}
|
542 |
|
543 |
+
/**
|
544 |
+
* Trigger this connector from WP CLI, only for known Settings
|
545 |
+
*
|
546 |
+
* @action update_option
|
547 |
+
*
|
548 |
+
* @param string $option
|
549 |
+
* @param mixed $old_value
|
550 |
+
* @param mixed $value
|
551 |
+
*/
|
552 |
+
public function callback_update_option( $option, $value, $old_value ) {
|
553 |
+
if ( defined( '\WP_CLI' ) && \WP_CLI && array_key_exists( $option, $this->labels ) ) {
|
554 |
+
$this->callback_updated_option( $option, $value, $old_value );
|
555 |
+
}
|
556 |
+
}
|
557 |
+
|
558 |
/**
|
559 |
* Trigger this connector core tracker, only on options.php page
|
560 |
*
|
readme.md
CHANGED
@@ -7,8 +7,8 @@ Stream is the easiest and safest way to track content changes happening to your
|
|
7 |
**Contributors:** [fjarrett](https://profiles.wordpress.org/fjarrett), [lukecarbis](https://profiles.wordpress.org/lukecarbis), [shadyvb](https://profiles.wordpress.org/shadyvb), [westonruter](https://profiles.wordpress.org/westonruter), [stream](https://profiles.wordpress.org/stream), [xwp](https://profiles.wordpress.org/xwp)
|
8 |
**Tags:** [actions](https://wordpress.org/plugins/tags/actions), [activity](https://wordpress.org/plugins/tags/activity), [activity log](https://wordpress.org/plugins/tags/activity log), [activity logs](https://wordpress.org/plugins/tags/activity logs), [admin actions](https://wordpress.org/plugins/tags/admin actions), [analytics](https://wordpress.org/plugins/tags/analytics), [audit](https://wordpress.org/plugins/tags/audit), [audit log](https://wordpress.org/plugins/tags/audit log), [audit logs](https://wordpress.org/plugins/tags/audit logs), [change](https://wordpress.org/plugins/tags/change), [changes](https://wordpress.org/plugins/tags/changes), [dashboard](https://wordpress.org/plugins/tags/dashboard), [log](https://wordpress.org/plugins/tags/log), [logs](https://wordpress.org/plugins/tags/logs), [stream](https://wordpress.org/plugins/tags/stream), [tracking](https://wordpress.org/plugins/tags/tracking), [troubleshooting](https://wordpress.org/plugins/tags/troubleshooting), [wp stream](https://wordpress.org/plugins/tags/wp stream)
|
9 |
**Requires at least:** 3.7
|
10 |
-
**Tested up to:** 4.
|
11 |
-
**Stable tag:** 3.0.
|
12 |
**License:** [GPLv2 or later](https://www.gnu.org/licenses/gpl-2.0.html)
|
13 |
|
14 |
[![Build Status](https://travis-ci.org/xwp/stream.png?branch=master)](https://travis-ci.org/xwp/stream) [![Join the chat at https://gitter.im/xwp/stream](https://badges.gitter.im/Joinhat.svg)](https://gitter.im/xwp/stream)
|
@@ -89,6 +89,13 @@ Thank you for wanting to make Stream better for everyone! We salute you.
|
|
89 |
|
90 |
## Changelog ##
|
91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
### 3.0.3 - November 6, 2015 ###
|
93 |
* Tweak: Better compatibility with upcoming WordPress 4.4 ([2b2493c](https://github.com/xwp/stream/commit/2b2493ccb3ef6cba5aeb773433fdb5f0d414e8f3))
|
94 |
* Tweak: Minor security improvements
|
7 |
**Contributors:** [fjarrett](https://profiles.wordpress.org/fjarrett), [lukecarbis](https://profiles.wordpress.org/lukecarbis), [shadyvb](https://profiles.wordpress.org/shadyvb), [westonruter](https://profiles.wordpress.org/westonruter), [stream](https://profiles.wordpress.org/stream), [xwp](https://profiles.wordpress.org/xwp)
|
8 |
**Tags:** [actions](https://wordpress.org/plugins/tags/actions), [activity](https://wordpress.org/plugins/tags/activity), [activity log](https://wordpress.org/plugins/tags/activity log), [activity logs](https://wordpress.org/plugins/tags/activity logs), [admin actions](https://wordpress.org/plugins/tags/admin actions), [analytics](https://wordpress.org/plugins/tags/analytics), [audit](https://wordpress.org/plugins/tags/audit), [audit log](https://wordpress.org/plugins/tags/audit log), [audit logs](https://wordpress.org/plugins/tags/audit logs), [change](https://wordpress.org/plugins/tags/change), [changes](https://wordpress.org/plugins/tags/changes), [dashboard](https://wordpress.org/plugins/tags/dashboard), [log](https://wordpress.org/plugins/tags/log), [logs](https://wordpress.org/plugins/tags/logs), [stream](https://wordpress.org/plugins/tags/stream), [tracking](https://wordpress.org/plugins/tags/tracking), [troubleshooting](https://wordpress.org/plugins/tags/troubleshooting), [wp stream](https://wordpress.org/plugins/tags/wp stream)
|
9 |
**Requires at least:** 3.7
|
10 |
+
**Tested up to:** 4.4
|
11 |
+
**Stable tag:** 3.0.4
|
12 |
**License:** [GPLv2 or later](https://www.gnu.org/licenses/gpl-2.0.html)
|
13 |
|
14 |
[![Build Status](https://travis-ci.org/xwp/stream.png?branch=master)](https://travis-ci.org/xwp/stream) [![Join the chat at https://gitter.im/xwp/stream](https://badges.gitter.im/Joinhat.svg)](https://gitter.im/xwp/stream)
|
89 |
|
90 |
## Changelog ##
|
91 |
|
92 |
+
### 3.0.4 - November 27, 2015 ###
|
93 |
+
* Tweak: Better descriptions when a post changes status ([0eada10](https://github.com/xwp/stream/commit/0eada108b443ed3b6f9bdae3f1e4c87c77128a0a))
|
94 |
+
* Fix: Stream no longer crashes every time it tries to use a Jetpack ([#798](https://github.com/xwp/stream/pull/798))
|
95 |
+
* Fix: You may now actually choose an item from the filter dropdown menus, instead of having everything greyed out ([#800](https://github.com/xwp/stream/pull/800))
|
96 |
+
* Fix: Logging in / out of a Multisite install is now possible ([#801](https://github.com/xwp/stream/pull/801))
|
97 |
+
* Fix: The Settings connector now works with WP CLI ([78a56b2](https://github.com/xwp/stream/commit/78a56b2c6b33b4f41c7b4f1f256a4d03ad42b2cb))
|
98 |
+
|
99 |
### 3.0.3 - November 6, 2015 ###
|
100 |
* Tweak: Better compatibility with upcoming WordPress 4.4 ([2b2493c](https://github.com/xwp/stream/commit/2b2493ccb3ef6cba5aeb773433fdb5f0d414e8f3))
|
101 |
* Tweak: Minor security improvements
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: fjarrett, lukecarbis, shadyvb, westonruter, stream, xwp
|
3 |
Tags: actions, activity, activity log, activity logs, admin actions, analytics, audit, audit log, audit logs, change, changes, dashboard, log, logs, stream, tracking, troubleshooting, wp stream
|
4 |
Requires at least: 3.7
|
5 |
-
Tested up to: 4.
|
6 |
-
Stable tag: 3.0.
|
7 |
License: GPLv2 or later
|
8 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -77,6 +77,14 @@ Thank you for wanting to make Stream better for everyone! We salute you.
|
|
77 |
|
78 |
== Changelog ==
|
79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
= 3.0.3 - November 6, 2015 =
|
81 |
|
82 |
* Tweak: Better compatibility with upcoming WordPress 4.4 ([2b2493c](https://github.com/xwp/stream/commit/2b2493ccb3ef6cba5aeb773433fdb5f0d414e8f3))
|
2 |
Contributors: fjarrett, lukecarbis, shadyvb, westonruter, stream, xwp
|
3 |
Tags: actions, activity, activity log, activity logs, admin actions, analytics, audit, audit log, audit logs, change, changes, dashboard, log, logs, stream, tracking, troubleshooting, wp stream
|
4 |
Requires at least: 3.7
|
5 |
+
Tested up to: 4.4
|
6 |
+
Stable tag: 3.0.4
|
7 |
License: GPLv2 or later
|
8 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
77 |
|
78 |
== Changelog ==
|
79 |
|
80 |
+
= 3.0.4 - November 27, 2015 =
|
81 |
+
|
82 |
+
* Tweak: Better descriptions when a post changes status ([0eada10](https://github.com/xwp/stream/commit/0eada108b443ed3b6f9bdae3f1e4c87c77128a0a))
|
83 |
+
* Fix: Stream no longer crashes every time it tries to use a Jetpack ([#798](https://github.com/xwp/stream/pull/798))
|
84 |
+
* Fix: You may now actually choose an item from the filter dropdown menus, instead of having everything greyed out ([#800](https://github.com/xwp/stream/pull/800))
|
85 |
+
* Fix: Logging in / out of a Multisite install is now possible ([#801](https://github.com/xwp/stream/pull/801))
|
86 |
+
* Fix: The Settings connector now works with WP CLI ([78a56b2](https://github.com/xwp/stream/commit/78a56b2c6b33b4f41c7b4f1f256a4d03ad42b2cb))
|
87 |
+
|
88 |
= 3.0.3 - November 6, 2015 =
|
89 |
|
90 |
* Tweak: Better compatibility with upcoming WordPress 4.4 ([2b2493c](https://github.com/xwp/stream/commit/2b2493ccb3ef6cba5aeb773433fdb5f0d414e8f3))
|
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.0.
|
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.0.4
|
7 |
* Author: XWP
|
8 |
* Author URI: https://xwp.co/
|
9 |
* License: GPLv2+
|
tests/tests/test-class-author.php
CHANGED
@@ -35,7 +35,6 @@ class Test_Author extends WP_StreamTestCase {
|
|
35 |
$this->assertNotEmpty( $this->author->id );
|
36 |
$this->assertInternalType( 'array', $this->author->meta );
|
37 |
$this->assertNotEmpty( $this->author->meta );
|
38 |
-
$this->assertInstanceOf( '\WP_Stream\Plugin', $this->author->plugin );
|
39 |
}
|
40 |
|
41 |
public function test_get() {
|
@@ -75,10 +74,6 @@ class Test_Author extends WP_StreamTestCase {
|
|
75 |
$this->assertEquals( 'Administrator', $this->author->get_role() );
|
76 |
}
|
77 |
|
78 |
-
public function test_get_records_page_url() {
|
79 |
-
$this->assertNotFalse( parse_url( $this->author->get_records_page_url() ) );
|
80 |
-
}
|
81 |
-
|
82 |
public function test_is_deleted() {
|
83 |
$this->assertFalse( $this->author->is_deleted() );
|
84 |
}
|
35 |
$this->assertNotEmpty( $this->author->id );
|
36 |
$this->assertInternalType( 'array', $this->author->meta );
|
37 |
$this->assertNotEmpty( $this->author->meta );
|
|
|
38 |
}
|
39 |
|
40 |
public function test_get() {
|
74 |
$this->assertEquals( 'Administrator', $this->author->get_role() );
|
75 |
}
|
76 |
|
|
|
|
|
|
|
|
|
77 |
public function test_is_deleted() {
|
78 |
$this->assertFalse( $this->author->is_deleted() );
|
79 |
}
|