Skip to content

Commit

Permalink
Merging develop into deep-options-tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiejarrett committed Jul 18, 2014
2 parents f84704a + bf12bba commit 8e87e26
Show file tree
Hide file tree
Showing 15 changed files with 2,768 additions and 828 deletions.
2 changes: 1 addition & 1 deletion .ci-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ export PHPCS_GITHUB_SRC=x-team/PHP_CodeSniffer
export PHPCS_GIT_TREE=subset-selection
export WPCS_GIT_TREE=rule-subset-with-phpcs-pr
export WPCS_STANDARD=WordPress:core-extra
export PHPCS_IGNORE='tests/*,includes/vendor/*'
export PHPCS_IGNORE='tests/*,includes/vendor/*,bin/*'
15 changes: 12 additions & 3 deletions connectors/comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static function get_action_labels() {
'unspammed' => __( 'Unmarked as Spam', 'stream' ),
'deleted' => __( 'Deleted', 'stream' ),
'duplicate' => __( 'Duplicate', 'stream' ),
'throttled' => __( 'Throttled', 'stream' ),
'flood' => __( 'Throttled', 'stream' ),
);
}

Expand Down Expand Up @@ -225,6 +225,15 @@ public static function callback_wp_insert_comment( $comment_id, $comment ) {
$post_type = get_post_type( $post_id );
$post_title = ( $post = get_post( $post_id ) ) ? "\"$post->post_title\"" : __( 'a post', 'stream' );
$comment_status = ( 1 == $comment->comment_approved ) ? __( 'approved automatically', 'stream' ) : __( 'pending approval', 'stream' );
$is_spam = false;
// Auto-marked spam comments
if ( class_exists( 'Akismet' ) && Akismet::matches_last_comment( $comment ) ) {
$ak_last_comment = Akismet::get_last_comment();
if ( 'true' == $ak_last_comment['akismet_result'] ) {
$is_spam = true;
$comment_status = __( 'automatically marked as spam by Akismet', 'stream' );
}
}
$comment_type = mb_strtolower( self::get_comment_type_label( $comment_id ) );

if ( $comment->comment_parent ) {
Expand All @@ -249,9 +258,9 @@ public static function callback_wp_insert_comment( $comment_id, $comment ) {
'1: Comment author, 2: Post title 3: Comment status, 4: Comment type',
'stream'
),
compact( 'user_name', 'post_title', 'comment_status', 'comment_type', 'post_id' ),
compact( 'user_name', 'post_title', 'comment_status', 'comment_type', 'post_id', 'is_spam' ),
$comment_id,
array( $post_type => 'created' ),
array( $post_type => $is_spam ? 'spammed' : 'created' ),
$user_id
);
}
Expand Down
2 changes: 2 additions & 0 deletions connectors/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class WP_Stream_Connector_Settings extends WP_Stream_Connector {
'banned_email_domains',
'WPLANG',
'admin_email',
'user_count',
);

/**
Expand Down Expand Up @@ -288,6 +289,7 @@ public static function get_field_label( $field_key ) {
'banned_email_domains' => __( 'Banned Email Domains', 'default' ),
'WPLANG' => __( 'Network Language', 'default' ),
'admin_email' => __( 'Network Admin Email', 'default' ),
'user_count' => __( 'User Count', 'stream' ),
// Other
'wp_stream_db' => __( 'Stream Database Version', 'stream' ),
);
Expand Down
2 changes: 1 addition & 1 deletion connectors/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public static function get_role_labels( $user ) {
}

if ( ! is_a( $user, 'WP_User' ) ) {
return;
return array();
}

global $wp_roles;
Expand Down
Loading

0 comments on commit 8e87e26

Please sign in to comment.