Index: bp-activity/bp-activity-actions.php
--- bp-activity/bp-activity-actions.php
+++ bp-activity/bp-activity-actions.php
@@ -91,7 +91,7 @@
 		}
 
 	// Set redirect to users' activity stream
-	} else if ( ! empty( $activity->user_id ) ) {
+	} elseif ( ! empty( $activity->user_id ) ) {
 		$redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . bp_get_activity_slug() . '/' . $activity->id . '/';
 	}
 
@@ -339,7 +339,7 @@
 		$activity_id = bp_activity_post_update( array( 'content' => $content ) );
 
 	// Post to groups object
-	} else if ( 'groups' == $object && bp_is_active( 'groups' ) ) {
+	} elseif ( 'groups' == $object && bp_is_active( 'groups' ) ) {
 		if ( (int) $item_id ) {
 			$activity_id = groups_post_update( array( 'content' => $content, 'group_id' => $item_id ) );
 		}
Index: bp-activity/bp-activity-classes.php
--- bp-activity/bp-activity-classes.php
+++ bp-activity/bp-activity-classes.php
@@ -169,7 +169,7 @@
 
 		// If no callback is available, use the literal string from
 		// the database row
-		} else if ( ! empty( $row->action ) ) {
+		} elseif ( ! empty( $row->action ) ) {
 			$this->action = $row->action;
 
 		// Provide a fallback to avoid PHP notices
@@ -1110,7 +1110,7 @@
 			$comments = false;
 
 		// A true cache miss
-		} else if ( empty( $comments ) ) {
+		} elseif ( empty( $comments ) ) {
 
 			// Select the user's fullname with the query
 			if ( bp_is_active( 'xprofile' ) ) {
Index: bp-activity/bp-activity-template.php
--- bp-activity/bp-activity-template.php
+++ bp-activity/bp-activity-template.php
@@ -662,7 +662,7 @@
 	// into bp-custom.php or your theme's functions.php
 	if ( isset( $_GET['afilter'] ) && apply_filters( 'bp_activity_enable_afilter_support', false ) )
 		$filter = array( 'object' => $_GET['afilter'] );
-	else if ( ! empty( $user_id ) || ! empty( $object ) || ! empty( $action ) || ! empty( $primary_id ) || ! empty( $secondary_id ) || ! empty( $offset ) || ! empty( $since ) )
+	elseif ( ! empty( $user_id ) || ! empty( $object ) || ! empty( $action ) || ! empty( $primary_id ) || ! empty( $secondary_id ) || ! empty( $offset ) || ! empty( $since ) )
 		$filter = array( 'user_id' => $user_id, 'object' => $object, 'action' => $action, 'primary_id' => $primary_id, 'secondary_id' => $secondary_id, 'offset' => $offset, 'since' => $since );
 	else
 		$filter = false;
@@ -3673,7 +3673,7 @@
 				}
 
 			// On individual group pages, default to 'group'
-			} else if ( bp_is_active( 'groups' ) && bp_is_group() ) {
+			} elseif ( bp_is_active( 'groups' ) && bp_is_group() ) {
 				$context = 'group';
 
 			// 'activity' everywhere else
Index: bp-blogs/bp-blogs-functions.php
--- bp-blogs/bp-blogs-functions.php
+++ bp-blogs/bp-blogs-functions.php
@@ -438,7 +438,7 @@
 		bp_blogs_record_post( $post->ID, $post );
 
 	// Unpublishing a previously published post
-	} else if ( 'publish' === $old_status ) {
+	} elseif ( 'publish' === $old_status ) {
 		// Some form of pending status
 		// Only remove the activity entry
 		bp_blogs_delete_activity( array(
Index: bp-core/bp-core-avatars.php
--- bp-core/bp-core-avatars.php
+++ bp-core/bp-core-avatars.php
@@ -423,16 +423,16 @@
 		// Set gravatar size
 		if ( false !== $width ) {
 			$grav_size = $width;
-		} else if ( 'full' == $type ) {
+		} elseif ( 'full' == $type ) {
 			$grav_size = bp_core_avatar_full_width();
-		} else if ( 'thumb' == $type ) {
+		} elseif ( 'thumb' == $type ) {
 			$grav_size = bp_core_avatar_thumb_width();
 		}
 
 		// Set gravatar type
 		if ( empty( $bp->grav_default->{$object} ) ) {
 			$default_grav = 'wavatar';
-		} else if ( 'mystery' == $bp->grav_default->{$object} ) {
+		} elseif ( 'mystery' == $bp->grav_default->{$object} ) {
 			$default_grav = apply_filters( 'bp_core_mysteryman_src', 'mm', $grav_size );
 		} else {
 			$default_grav = $bp->grav_default->{$object};
@@ -442,7 +442,7 @@
 		if ( empty( $email ) ) {
 			if ( 'user' == $object ) {
 				$email = bp_core_get_user_email( $item_id );
-			} else if ( 'group' == $object || 'blog' == $object ) {
+			} elseif ( 'group' == $object || 'blog' == $object ) {
 				$email = "{$item_id}-{$object}@{bp_get_root_domain()}";
 			}
 		}
@@ -504,9 +504,9 @@
 	if ( empty( $item_id ) ) {
 		if ( 'user' == $object )
 			$item_id = bp_displayed_user_id();
-		else if ( 'group' == $object )
+		elseif ( 'group' == $object )
 			$item_id = buddypress()->groups->current_group->id;
-		else if ( 'blog' == $object )
+		elseif ( 'blog' == $object )
 			$item_id = $current_blog->id;
 
 		$item_id = apply_filters( 'bp_core_avatar_item_id', $item_id, $object );
@@ -517,9 +517,9 @@
 	if ( empty( $avatar_dir ) ) {
 		if ( 'user' == $object )
 			$avatar_dir = 'avatars';
-		else if ( 'group' == $object )
+		elseif ( 'group' == $object )
 			$avatar_dir = 'group-avatars';
-		else if ( 'blog' == $object )
+		elseif ( 'blog' == $object )
 			$avatar_dir = 'blog-avatars';
 
 		$avatar_dir = apply_filters( 'bp_core_avatar_dir', $avatar_dir, $object );
@@ -838,7 +838,7 @@
 		}
 
 	// If passed a number, assume it was a $user_id
-	} else if ( is_numeric( $user ) ) {
+	} elseif ( is_numeric( $user ) ) {
 		$id = $user;
 
 	// If passed a string and that string returns a user, get the $id
@@ -1152,7 +1152,7 @@
 		$avatar = BP_AVATAR_DEFAULT;
 
 	// Use the local default image
-	} else if ( 'local' === $type ) {
+	} elseif ( 'local' === $type ) {
 		$avatar = buddypress()->plugin_url . 'bp-core/images/mystery-man.jpg';
 
 	// Use Gravatar's mystery man as fallback
@@ -1188,7 +1188,7 @@
 		$avatar = BP_AVATAR_DEFAULT_THUMB;
 
 	// Use the local default image
-	} else if ( 'local' === $type ) {
+	} elseif ( 'local' === $type ) {
 		$avatar = buddypress()->plugin_url . 'bp-core/images/mystery-man-50.jpg';
 
 	// Use Gravatar's mystery man as fallback
Index: bp-core/bp-core-buddybar.php
--- bp-core/bp-core-buddybar.php
+++ bp-core/bp-core-buddybar.php
@@ -385,7 +385,7 @@
 
 			// In the case of a user page, we try to assume a
 			// redirect URL
-			} else if ( bp_is_user() ) {
+			} elseif ( bp_is_user() ) {
 
 				// Redirect to the displayed user's default
 				// component, as long as that component is
Index: bp-core/bp-core-catchuri.php
--- bp-core/bp-core-catchuri.php
+++ bp-core/bp-core-catchuri.php
@@ -670,7 +670,7 @@
 		// Except when the front page is set to the registration page
 		// and the current user is logged in. In this case we send to
 		// the members directory to avoid redirect loops
-		} else if ( bp_is_register_page() && 'register' == $front_page_component && is_user_logged_in() ) {
+		} elseif ( bp_is_register_page() && 'register' == $front_page_component && is_user_logged_in() ) {
 			$bp->canonical_stack['canonical_url'] = apply_filters( 'bp_loggedin_register_page_redirect_to', trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ) );
 		}
 	}
Index: bp-core/bp-core-classes.php
--- bp-core/bp-core-classes.php
+++ bp-core/bp-core-classes.php
@@ -269,7 +269,7 @@
 				if ( 'newest' == $type ) {
 					$sql['orderby'] = "ORDER BY u.user_id";
 					$sql['order'] = "DESC";
-				} else if ( 'random' == $type ) {
+				} elseif ( 'random' == $type ) {
 					$sql['orderby'] = "ORDER BY rand()";
 				} else {
 					$sql['orderby'] = "ORDER BY u.date_recorded";
@@ -1981,7 +1981,7 @@
 
 			// No button if viewing your own profile (and not in
 			// a members loop)
-			} else if ( bp_is_my_profile() ) {
+			} elseif ( bp_is_my_profile() ) {
 				return false;
 			}
 		}
Index: bp-core/bp-core-cssjs.php
--- bp-core/bp-core-cssjs.php
+++ bp-core/bp-core-cssjs.php
@@ -125,7 +125,7 @@
 		$crop_right = $image[0];
 
 	// Less than 2x full-width: cropper defaults to full-width
-	} else if ( $image[0] < ( $full_width * 2 ) ) {
+	} elseif ( $image[0] < ( $full_width * 2 ) ) {
 		$padding_w  = round( ( $image[0] - $full_width ) / 2 );
 		$crop_left  = $padding_w;
 		$crop_right = $image[0] - $padding_w;
@@ -142,7 +142,7 @@
 		$crop_bottom = $image[1];
 
 	// Less than double full-height: cropper defaults to full-height
-	} else if ( $image[1] < ( $full_height * 2 ) ) {
+	} elseif ( $image[1] < ( $full_height * 2 ) ) {
 		$padding_h   = round( ( $image[1] - $full_height ) / 2 );
 		$crop_top    = $padding_h;
 		$crop_bottom = $image[1] - $padding_h;
Index: bp-core/bp-core-filters.php
--- bp-core/bp-core-filters.php
+++ bp-core/bp-core-filters.php
@@ -375,7 +375,7 @@
 		 * And the super admin goes in pending accounts to resend it. In this case, as the
 		 * meta['password'] is not set, the activation url must be WordPress one
 		 */
-		} else if ( buddypress()->members->admin->signups_page == get_current_screen()->id ) {
+		} elseif ( buddypress()->members->admin->signups_page == get_current_screen()->id ) {
 			$is_hashpass_in_meta = maybe_unserialize( $meta );
 
 			if ( empty( $is_hashpass_in_meta['password'] ) ) {
Index: bp-core/bp-core-functions.php
--- bp-core/bp-core-functions.php
+++ bp-core/bp-core-functions.php
@@ -116,7 +116,7 @@
 		foreach ( $func_args as $indexi => $index ) {
 			if ( isset( $index->' . $key . ' ) ) {
 				$values[ $indexi ] = $index->' . $key . ';
-			} else if ( isset( $index["' . $key . '"] ) ) {
+			} elseif ( isset( $index["' . $key . '"] ) ) {
 				$values[ $indexi ] = $index["' . $key . '"];
 			}
 		}
@@ -125,7 +125,7 @@
 			$cmp = strcmp( $values[0], $values[1] );
 			if ( 0 > $cmp ) {
 				$retval = -1;
-			} else if ( 0 < $cmp ) {
\ No newline at end of file
+			} elseif ( 0 < $cmp ) {
\ No newline at end of file
 				$retval = 1;
 			} else {
 				$retval = 0;
Index: bp-core/bp-core-theme-compatibility.php
--- bp-core/bp-core-theme-compatibility.php
+++ bp-core/bp-core-theme-compatibility.php
@@ -288,7 +288,7 @@
 
 		// Bruteforce check for a BP template
 		// Examples are clones of bp-default
-		} else if ( locate_template( 'members/members-loop.php', false, false ) ) {
+		} elseif ( locate_template( 'members/members-loop.php', false, false ) ) {
 			$theme_compat = false;
 		}
 	}
Index: bp-friends/bp-friends-actions.php
--- bp-friends/bp-friends-actions.php
+++ bp-friends/bp-friends-actions.php
@@ -40,7 +40,7 @@
 			bp_core_add_message( __( 'Friendship requested', 'buddypress' ) );
 		}
 
-	} else if ( 'is_friend' == $friendship_status ) {
+	} elseif ( 'is_friend' == $friendship_status ) {
 		bp_core_add_message( __( 'You are already friends with this user', 'buddypress' ), 'error' );
 	} else {
 		bp_core_add_message( __( 'You already have a pending friendship request with this user', 'buddypress' ), 'error' );
@@ -78,7 +78,7 @@
 			bp_core_add_message( __( 'Friendship canceled', 'buddypress' ) );
 		}
 
-	} else if ( 'is_friends' == $friendship_status ) {
+	} elseif ( 'is_friends' == $friendship_status ) {
 		bp_core_add_message( __( 'You are not yet friends with this user', 'buddypress' ), 'error' );
 	} else {
 		bp_core_add_message( __( 'You have a pending friendship request with this user', 'buddypress' ), 'error' );
Index: bp-friends/bp-friends-template.php
--- bp-friends/bp-friends-template.php
+++ bp-friends/bp-friends-template.php
@@ -242,7 +242,7 @@
 
 		if ( empty( $user_id ) && isset( $friends_template->friendship->friend ) )
 			$user_id = $friends_template->friendship->friend->id;
-		else if ( empty( $user_id ) && !isset( $friends_template->friendship->friend ) )
+		elseif ( empty( $user_id ) && !isset( $friends_template->friendship->friend ) )
 			$user_id = bp_displayed_user_id();
 
 		return apply_filters( 'bp_get_potential_friend_id', (int) $user_id );
Index: bp-groups/bp-groups-actions.php
--- bp-groups/bp-groups-actions.php
+++ bp-groups/bp-groups-actions.php
@@ -34,7 +34,7 @@
 			$user_has_access = true;
 
 		// User doesn't have access, so set up redirect args
-		} else if ( is_user_logged_in() ) {
+		} elseif ( is_user_logged_in() ) {
 			$no_access_args = array(
 				'message'  => __( 'You do not have access to this group.', 'buddypress' ),
 				'root'     => bp_get_group_permalink( $current_group ) . 'home/',
@@ -183,7 +183,7 @@
 
 			if ( 'private' == $_POST['group-status'] )
 				$group_status = 'private';
-			else if ( 'hidden' == $_POST['group-status'] )
+			elseif ( 'hidden' == $_POST['group-status'] )
 				$group_status = 'hidden';
 
 			if ( !$bp->groups->new_group_id = groups_create_group( array( 'group_id' => $bp->groups->new_group_id, 'status' => $group_status, 'enable_forum' => $group_enable_forum ) ) ) {
Index: bp-groups/bp-groups-admin.php
--- bp-groups/bp-groups-admin.php
+++ bp-groups/bp-groups-admin.php
@@ -102,7 +102,7 @@
 
 		bp_core_redirect( $redirect_to );
 
-	} else if ( 'edit' == $doaction && ! empty( $_GET['gid'] ) ) {
+	} elseif ( 'edit' == $doaction && ! empty( $_GET['gid'] ) ) {
 		// columns screen option
 		add_screen_option( 'layout_columns', array( 'default' => 2, 'max' => 2, ) );
 
@@ -308,7 +308,7 @@
 
 								if ( 'admin' == $existing_role || 'mod' == $existing_role ) {
 									$result = groups_demote_member( $user_id, $group_id );
-								} else if ( 'banned' == $existing_role ) {
+								} elseif ( 'banned' == $existing_role ) {
 									$result = groups_unban_member( $user_id, $group_id );
 								}
 
@@ -419,7 +419,7 @@
 		bp_groups_admin_edit();
 
 	// Display the group deletion confirmation screen
-	} else if ( 'delete' == $doaction && ! empty( $_GET['gid'] ) ) {
+	} elseif ( 'delete' == $doaction && ! empty( $_GET['gid'] ) ) {
 		bp_groups_admin_delete();
 
 	// Otherwise, display the groups index screen
@@ -456,7 +456,7 @@
 
 		if ( ! empty( $errors ) ) {
 			$messages[] = __( 'An error occurred when trying to update your group details.', 'buddypress' );
-		} else if ( ! empty( $updated ) ) {
+		} elseif ( ! empty( $updated ) ) {
 			$messages[] = __( 'The group has been updated successfully.', 'buddypress' );
 		}
 
Index: bp-groups/bp-groups-classes.php
--- bp-groups/bp-groups-classes.php
+++ bp-groups/bp-groups-classes.php
@@ -1296,7 +1296,7 @@
 					$is_member = '1';
 
 				// invite_sent means the user has been invited
-				} else if ( $user_status[ $gid ]->invite_sent ) {
+				} elseif ( $user_status[ $gid ]->invite_sent ) {
 					$is_invited = '1';
 
 				// User has sent request, but has not been confirmed
@@ -1612,7 +1612,7 @@
 				$sql['where'][] = "inviter_id = 0";
 
 			// The string 'any' matches any non-zero value (inviter_id != 0)
-			} else if ( 'any' === $inviter_id ) {
+			} elseif ( 'any' === $inviter_id ) {
 				$sql['where'][] = "inviter_id != 0";
 
 			// Assume that a list of inviter IDs has been passed
@@ -3370,7 +3370,7 @@
 				// constructor. So we always trust this value
 				$this->params['show_tab'] = 'noone';
 
-			} else if ( isset( $this->params_raw['enable_nav_item'] ) || isset( $this->params_raw['visibility'] ) ) {
+			} elseif ( isset( $this->params_raw['enable_nav_item'] ) || isset( $this->params_raw['visibility'] ) ) {
 				// If enable_nav_item or visibility is passed,
 				// we assume this  is a legacy extension.
 				// Legacy behavior is that enable_nav_item=true +
Index: bp-groups/bp-groups-functions.php
--- bp-groups/bp-groups-functions.php
+++ bp-groups/bp-groups-functions.php
@@ -906,7 +906,7 @@
 		groups_accept_membership_request( $membership_id, $user_id, $group_id );
 
 	// Otherwise, create a new invitation
-	} else if ( ! groups_is_user_member( $user_id, $group_id ) && ! groups_check_user_has_invite( $user_id, $group_id, 'all' ) ) {
+	} elseif ( ! groups_is_user_member( $user_id, $group_id ) && ! groups_check_user_has_invite( $user_id, $group_id, 'all' ) ) {
 		$invite                = new BP_Groups_Member;
 		$invite->group_id      = $group_id;
 		$invite->user_id       = $user_id;
Index: bp-groups/bp-groups-loader.php
--- bp-groups/bp-groups-loader.php
+++ bp-groups/bp-groups-loader.php
@@ -597,7 +597,7 @@
 			if ( bp_is_my_profile() && !bp_is_single_item() ) {
 				$bp->bp_options_title = _x( 'Memberships', 'My Groups page <title>', 'buddypress' );
 
-			} else if ( !bp_is_my_profile() && !bp_is_single_item() ) {
+			} elseif ( !bp_is_my_profile() && !bp_is_single_item() ) {
 				$bp->bp_options_avatar = bp_core_fetch_avatar( array(
 					'item_id' => bp_displayed_user_id(),
 					'type'    => 'thumb',
@@ -607,7 +607,7 @@
 
 			// We are viewing a single group, so set up the
 			// group navigation menu using the $this->current_group global.
-			} else if ( bp_is_single_item() ) {
+			} elseif ( bp_is_single_item() ) {
 				$bp->bp_options_title  = $this->current_group->name;
 				$bp->bp_options_avatar = bp_core_fetch_avatar( array(
 					'item_id'    => $this->current_group->id,
Index: bp-groups/bp-groups-screens.php
--- bp-groups/bp-groups-screens.php
+++ bp-groups/bp-groups-screens.php
@@ -71,7 +71,7 @@
 
 		bp_core_redirect( $redirect_to );
 
-	} else if ( bp_is_action_variable( 'reject' ) && is_numeric( $group_id ) ) {
+	} elseif ( bp_is_action_variable( 'reject' ) && is_numeric( $group_id ) ) {
 		// Check the nonce
 		if ( !check_admin_referer( 'groups_reject_invite' ) )
 			return false;
@@ -179,7 +179,7 @@
 		}
 
 		// Sticky a topic
-		else if ( bp_is_action_variable( 'stick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
+		elseif ( bp_is_action_variable( 'stick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
 			// Check the nonce
 			check_admin_referer( 'bp_forums_stick_topic' );
 
@@ -194,7 +194,7 @@
 		}
 
 		// Un-Sticky a topic
-		else if ( bp_is_action_variable( 'unstick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
+		elseif ( bp_is_action_variable( 'unstick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
 			// Check the nonce
 			check_admin_referer( 'bp_forums_unstick_topic' );
 
@@ -209,7 +209,7 @@
 		}
 
 		// Close a topic
-		else if ( bp_is_action_variable( 'close', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
+		elseif ( bp_is_action_variable( 'close', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
 			// Check the nonce
 			check_admin_referer( 'bp_forums_close_topic' );
 
@@ -224,7 +224,7 @@
 		}
 
 		// Open a topic
-		else if ( bp_is_action_variable( 'open', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
+		elseif ( bp_is_action_variable( 'open', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
 			// Check the nonce
 			check_admin_referer( 'bp_forums_open_topic' );
 
@@ -239,7 +239,7 @@
 		}
 
 		// Delete a topic
-		else if ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && !bp_action_variable( 3 ) ) {
+		elseif ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && !bp_action_variable( 3 ) ) {
 			// Fetch the topic
 			$topic = bp_forums_get_topic_details( $topic_id );
 
@@ -264,7 +264,7 @@
 		}
 
 		// Editing a topic
-		else if ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && !bp_action_variable( 3 ) ) {
+		elseif ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && !bp_action_variable( 3 ) ) {
 			// Fetch the topic
 			$topic = bp_forums_get_topic_details( $topic_id );
 
@@ -292,7 +292,7 @@
 			bp_core_load_template( apply_filters( 'groups_template_group_forum_topic_edit', 'groups/single/home' ) );
 
 		// Delete a post
-		} else if ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && $post_id = bp_action_variable( 4 ) ) {
+		} elseif ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && $post_id = bp_action_variable( 4 ) ) {
 			// Fetch the post
 			$post = bp_forums_get_post( $post_id );
 
@@ -316,7 +316,7 @@
 			bp_core_redirect( wp_get_referer() );
 
 		// Editing a post
-		} else if ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && $post_id = bp_action_variable( 4 ) ) {
+		} elseif ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && $post_id = bp_action_variable( 4 ) ) {
 
 			// Fetch the post
 			$post = bp_forums_get_post( $post_id );
@@ -379,7 +379,7 @@
 
 			if ( empty( $_POST['topic_title'] ) ) {
 				$error_message = __( 'Please provide a title for your forum topic.', 'buddypress' );
-			} else if ( empty( $_POST['topic_text'] ) ) {
+			} elseif ( empty( $_POST['topic_text'] ) ) {
 				$error_message = __( 'Forum posts cannot be empty. Please enter some text.', 'buddypress' );
 			}
 
@@ -492,10 +492,10 @@
 	if ( ! bp_groups_user_can_send_invites( $group_id ) ) {
 		$message = __( 'You are not allowed to send or remove invites', 'buddypress' );
 		$error = 'error';
-	} else if ( BP_Groups_Member::check_for_membership_request( $friend_id, $group_id ) ) {
+	} elseif ( BP_Groups_Member::check_for_membership_request( $friend_id, $group_id ) ) {
 		$message = __( 'The member requested to join the group', 'buddypress' );
 		$error = 'error';
-	} else if ( ! groups_uninvite_user( $friend_id, $group_id ) ) {
+	} elseif ( ! groups_uninvite_user( $friend_id, $group_id ) ) {
 		$message = __( 'There was an error removing the invite', 'buddypress' );
 		$error = 'error';
 	}
Index: bp-groups/bp-groups-template.php
--- bp-groups/bp-groups-template.php
+++ bp-groups/bp-groups-template.php
@@ -233,7 +233,7 @@
 
 		if ( 'invites' == $type ) {
 			$this->groups = groups_get_invites_for_user( $user_id, $this->pag_num, $this->pag_page, $exclude );
-		} else if ( 'single-group' == $type ) {
+		} elseif ( 'single-group' == $type ) {
 			$this->single_group = true;
 
 			if ( groups_get_current_group() ) {
@@ -279,7 +279,7 @@
 			$this->total_group_count = (int) $this->groups['total'];
 			$this->group_count       = (int) $this->groups['total'];
 			$this->groups            = $this->groups['groups'];
-		} else if ( 'single-group' == $type ) {
+		} elseif ( 'single-group' == $type ) {
 			if ( empty( $group->id ) ) {
 				$this->total_group_count = 0;
 				$this->group_count       = 0;
@@ -706,9 +706,9 @@
 
 		if ( 'public' == $group->status ) {
 			$type = __( "Public Group", "buddypress" );
-		} else if ( 'hidden' == $group->status ) {
+		} elseif ( 'hidden' == $group->status ) {
 			$type = __( "Hidden Group", "buddypress" );
-		} else if ( 'private' == $group->status ) {
+		} elseif ( 'private' == $group->status ) {
 			$type = __( "Private Group", "buddypress" );
 		} else {
 			$type = ucwords( $group->status ) . ' ' . __( 'Group', 'buddypress' );
@@ -1858,7 +1858,7 @@
 		if ( isset( $bp->groups->current_group->id ) ) {
 			// Default to the current group first
 			$group_id = $bp->groups->current_group->id;
-		} else if ( isset( $groups_template->group->id ) ) {
+		} elseif ( isset( $groups_template->group->id ) ) {
 			// Then see if we're in the loop
 			$group_id = $groups_template->group->id;
 		} else {
@@ -2866,7 +2866,7 @@
  		if ( ! bp_group_has_requested_membership() ) {
 			if ( is_user_logged_in() && bp_group_is_invited() ) {
 				$message = __( 'You must accept your pending invitation before you can access this private group.', 'buddypress' );
-			} else if ( is_user_logged_in() ) {
+			} elseif ( is_user_logged_in() ) {
 				$message = __( 'This is a private group and you must request group membership in order to join.', 'buddypress' );
 			} else {
 				$message = __( 'This is a private group. To join you must be a registered site member and request group membership.', 'buddypress' );
Index: bp-groups/bp-groups-widgets.php
--- bp-groups/bp-groups-widgets.php
+++ bp-groups/bp-groups-widgets.php
@@ -92,7 +92,7 @@
 										printf( __( 'created %s', 'buddypress' ), bp_get_group_date_created() );
 									if ( 'active' == $instance['group_default'] )
 										printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() );
-									else if ( 'popular' == $instance['group_default'] )
+									elseif ( 'popular' == $instance['group_default'] )
 										bp_group_member_count();
 								?>
 								</span>
@@ -202,9 +202,9 @@
 							<?php
 							if ( 'newest-groups' == $_POST['filter'] ) {
 								printf( __( 'created %s', 'buddypress' ), bp_get_group_date_created() );
-							} else if ( 'recently-active-groups' == $_POST['filter'] ) {
+							} elseif ( 'recently-active-groups' == $_POST['filter'] ) {
 								printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() );
-							} else if ( 'popular-groups' == $_POST['filter'] ) {
+							} elseif ( 'popular-groups' == $_POST['filter'] ) {
 								bp_group_member_count();
 							}
 							?>
Index: bp-members/bp-members-admin.php
--- bp-members/bp-members-admin.php
+++ bp-members/bp-members-admin.php
@@ -1307,7 +1307,7 @@
 				bp_core_redirect( $redirect_to );
 
 			// Handle activated accounts
-			} else if ( 'do_activate' == $doaction ) {
+			} elseif ( 'do_activate' == $doaction ) {
 
 				// nonce check
 				check_admin_referer( 'signups_activate' );
@@ -1334,7 +1334,7 @@
 				bp_core_redirect( $redirect_to );
 
 			// Handle sign-ups delete
-			} else if ( 'do_delete' == $doaction ) {
+			} elseif ( 'do_delete' == $doaction ) {
 
 				// nonce check
 				check_admin_referer( 'signups_delete' );
@@ -1703,7 +1703,7 @@
 		$ids = false;
 		if ( ! empty( $_POST['allsignups'] ) ) {
 			$ids = wp_parse_id_list( $_POST['allsignups'] );
-		} else if ( ! empty( $_GET['signup_id'] ) ) {
+		} elseif ( ! empty( $_GET['signup_id'] ) ) {
 			$ids = absint( $_GET['signup_id'] );
 		}
 
Index: bp-members/bp-members-functions.php
--- bp-members/bp-members-functions.php
+++ bp-members/bp-members-functions.php
@@ -1677,7 +1677,7 @@
 
 		// If a user ID is found, this may be a legacy signup, or one
 		// created locally for backward compatibility. Process it.
-		} else if ( $key == wp_hash( $user_id ) ) {
+		} elseif ( $key == wp_hash( $user_id ) ) {
 			// Change the user's status so they become active
 			if ( ! $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_status = 0 WHERE ID = %d", $user_id ) ) ) {
 				return new WP_Error( 'invalid_key', __( 'Invalid activation key', 'buddypress' ) );
@@ -2100,7 +2100,7 @@
 	$is_login = false;
 	if ( isset( $_GLOBALS['pagenow'] ) && false !== strpos( $GLOBALS['pagenow'], 'wp-login.php' ) ) {
 		$is_login = true;
-	} else if ( isset( $_SERVER['SCRIPT_NAME'] ) && false !== strpos( $_SERVER['SCRIPT_NAME'], 'wp-login.php' ) ) {
+	} elseif ( isset( $_SERVER['SCRIPT_NAME'] ) && false !== strpos( $_SERVER['SCRIPT_NAME'], 'wp-login.php' ) ) {
 		$is_login = true;
 	}
 
Index: bp-members/bp-members-template.php
--- bp-members/bp-members-template.php
+++ bp-members/bp-members-template.php
@@ -535,9 +535,9 @@
 
 		if ( 'active' == $members_template->type )
 			$pag = sprintf( _n( 'Viewing 1 active member', 'Viewing %1$s - %2$s of %3$s active members', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total );
-		else if ( 'popular' == $members_template->type )
+		elseif ( 'popular' == $members_template->type )
 			$pag = sprintf( _n( 'Viewing 1 member with friends', 'Viewing %1$s - %2$s of %3$s members with friends', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total );
-		else if ( 'online' == $members_template->type )
+		elseif ( 'online' == $members_template->type )
 			$pag = sprintf( _n( 'Viewing 1 online member', 'Viewing %1$s - %2$s of %3$s online members', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total );
 		else
 			$pag = sprintf( _n( 'Viewing 1 member', 'Viewing %1$s - %2$s of %3$s members', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total );
@@ -1773,7 +1773,7 @@
 			// Set default gravatar type
 			if ( empty( $bp->grav_default->user ) )
 				$default_grav = 'wavatar';
-			else if ( 'mystery' == $bp->grav_default->user )
+			elseif ( 'mystery' == $bp->grav_default->user )
 				$default_grav = $bp->plugin_url . 'bp-core/images/mystery-man.jpg';
 			else
 				$default_grav = $bp->grav_default->user;
Index: bp-messages/bp-messages-classes.php
--- bp-messages/bp-messages-classes.php
+++ bp-messages/bp-messages-classes.php
@@ -349,7 +349,7 @@
 
 		if ( $type == 'unread' )
 			$type_sql = " AND unread_count != 0 ";
-		else if ( $type == 'read' )
+		elseif ( $type == 'read' )
 			$type_sql = " AND unread_count = 0 ";
 
 		return (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(thread_id) FROM {$bp->messages->table_name_recipients} WHERE user_id = %d AND is_deleted = 0{$exclude_sender} {$type_sql}", $user_id ) );
Index: bp-messages/bp-messages-screens.php
--- bp-messages/bp-messages-screens.php
+++ bp-messages/bp-messages-screens.php
@@ -152,13 +152,13 @@
 			} else {
 				bp_core_add_message( __('Notice deactivated.', 'buddypress') );
 			}
-		} else if ( bp_is_action_variable( 'activate', 0 ) ) {
+		} elseif ( bp_is_action_variable( 'activate', 0 ) ) {
 			if ( !$notice->activate() ) {
 				bp_core_add_message( __('There was a problem activating that notice.', 'buddypress'), 'error' );
 			} else {
 				bp_core_add_message( __('Notice activated.', 'buddypress') );
 			}
-		} else if ( bp_is_action_variable( 'delete' ) ) {
+		} elseif ( bp_is_action_variable( 'delete' ) ) {
 			if ( !$notice->delete() ) {
 				bp_core_add_message( __('There was a problem deleting that notice.', 'buddypress'), 'buddypress' );
 			} else {
Index: bp-messages/bp-messages-template.php
--- bp-messages/bp-messages-template.php
+++ bp-messages/bp-messages-template.php
@@ -800,7 +800,7 @@
 	function bp_get_messages_username_value() {
 		if ( isset( $_COOKIE['bp_messages_send_to'] ) ) {
 			return apply_filters( 'bp_get_messages_username_value', $_COOKIE['bp_messages_send_to'] );
-		} else if ( isset( $_GET['r'] ) && !isset( $_COOKIE['bp_messages_send_to'] ) ) {
+		} elseif ( isset( $_GET['r'] ) && !isset( $_COOKIE['bp_messages_send_to'] ) ) {
 			return apply_filters( 'bp_get_messages_username_value', $_GET['r'] );
 		}
 	}
Index: bp-templates/bp-legacy/buddypress-functions.php
--- bp-templates/bp-legacy/buddypress-functions.php
+++ bp-templates/bp-legacy/buddypress-functions.php
@@ -1044,7 +1044,7 @@
 			$user_status = 'is_pending';
 
 		// Create the user invitation
-		} else if ( groups_invite_user( array( 'user_id' => $friend_id, 'group_id' => $group_id ) ) ) {
+		} elseif ( groups_invite_user( array( 'user_id' => $friend_id, 'group_id' => $group_id ) ) ) {
 			$user_status = 'is_invited';
 
 		// Miscellaneous failure
Index: bp-xprofile/bp-xprofile-admin.php
--- bp-xprofile/bp-xprofile-admin.php
+++ bp-xprofile/bp-xprofile-admin.php
@@ -43,22 +43,22 @@
 	if ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && 'add_field' == $_GET['mode'] )
 		xprofile_admin_manage_field( $_GET['group_id'] );
 
-	else if ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && isset( $_GET['field_id'] ) && 'edit_field' == $_GET['mode'] )
+	elseif ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && isset( $_GET['field_id'] ) && 'edit_field' == $_GET['mode'] )
 		xprofile_admin_manage_field( $_GET['group_id'], $_GET['field_id'] );
 
-	else if ( isset( $_GET['mode'] ) && isset( $_GET['field_id'] ) && 'delete_field' == $_GET['mode'] )
+	elseif ( isset( $_GET['mode'] ) && isset( $_GET['field_id'] ) && 'delete_field' == $_GET['mode'] )
 		xprofile_admin_delete_field( $_GET['field_id'], 'field');
 
-	else if ( isset( $_GET['mode'] ) && isset( $_GET['option_id'] ) && 'delete_option' == $_GET['mode'] )
+	elseif ( isset( $_GET['mode'] ) && isset( $_GET['option_id'] ) && 'delete_option' == $_GET['mode'] )
 		xprofile_admin_delete_field( $_GET['option_id'], 'option' );
 
-	else if ( isset( $_GET['mode'] ) && 'add_group' == $_GET['mode'] )
+	elseif ( isset( $_GET['mode'] ) && 'add_group' == $_GET['mode'] )
 		xprofile_admin_manage_group();
 
-	else if ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && 'delete_group' == $_GET['mode'] )
+	elseif ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && 'delete_group' == $_GET['mode'] )
 		xprofile_admin_delete_group( $_GET['group_id'] );
 
-	else if ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && 'edit_group' == $_GET['mode'] )
+	elseif ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && 'edit_group' == $_GET['mode'] )
 		xprofile_admin_manage_group( $_GET['group_id'] );
 
 	else { ?>
Index: bp-xprofile/bp-xprofile-classes.php
--- bp-xprofile/bp-xprofile-classes.php
+++ bp-xprofile/bp-xprofile-classes.php
@@ -161,7 +161,7 @@
 
 		if ( ! empty( $profile_group_id ) ) {
 			$where_sql = $wpdb->prepare( 'WHERE g.id = %d', $profile_group_id );
-		} else if ( $exclude_groups ) {
+		} elseif ( $exclude_groups ) {
 			$exclude_groups = join( ',', wp_parse_id_list( $exclude_groups ) );
 			$where_sql = "WHERE g.id NOT IN ({$exclude_groups})";
 		}
@@ -454,7 +454,7 @@
 			foreach ( $levels as $level ) {
 				if ( 'default_visibility' == $level->meta_key ) {
 					$default_visibility_levels[ $level->object_id ]['default'] = $level->meta_value;
-				} else if ( 'allow_custom_visibility' == $level->meta_key ) {
+				} elseif ( 'allow_custom_visibility' == $level->meta_key ) {
 					$default_visibility_levels[ $level->object_id ]['allow_custom'] = $level->meta_value;
 				}
 			}
@@ -1195,7 +1195,7 @@
 			if ( $this->exists() && strlen( trim( $this->value ) ) ) {
 				$result   = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_data} SET value = %s, last_updated = %s WHERE user_id = %d AND field_id = %d", $this->value, $this->last_updated, $this->user_id, $this->field_id ) );
 
-			} else if ( $this->exists() && empty( $this->value ) ) {
+			} elseif ( $this->exists() && empty( $this->value ) ) {
 				// Data removed, delete the entry.
 				$result   = $this->delete();
 
@@ -1490,7 +1490,7 @@
 				for ( $j = 0; $j < count( $fields ); $j++ ) {
 					if ( $values[$i]->name == $fields[$j] ) {
 						$new_values[$fields[$j]] = $values[$i]->value;
-					} else if ( !array_key_exists( $fields[$j], $new_values ) ) {
+					} elseif ( !array_key_exists( $fields[$j], $new_values ) ) {
 						$new_values[$fields[$j]] = NULL;
 					}
 				}
