Index: bp-xprofile-activity.php
===================================================================
--- bp-xprofile-activity.php	(revision 13516)
+++ bp-xprofile-activity.php	(working copy)
@@ -273,7 +273,7 @@
 function xprofile_activity_filter_options() {
 	?>
 
-	<option value="updated_profile"><?php _e( 'Profile Updates', 'buddypress' ) ?></option>
+	<option value="updated_profile"><?php esc_html_e( 'Profile Updates', 'buddypress' ) ?></option>
 
 	<?php
 }
Index: bp-xprofile-admin.php
===================================================================
--- bp-xprofile-admin.php	(revision 13516)
+++ bp-xprofile-admin.php	(working copy)
@@ -150,9 +150,9 @@
 	) ); ?>
 
 	<div class="wrap">
-		<h1 class="wp-heading-inline"><?php _ex( 'Profile Fields', 'Settings page header', 'buddypress'); ?></h1>
+		<h1 class="wp-heading-inline"><?php esc_html_x( 'Profile Fields', 'Settings page header', 'buddypress'); ?></h1>
 
-			<a id="add_group" class="page-title-action" href="<?php echo esc_url( $add_group_url ); ?>"><?php _e( 'Add New Field Group', 'buddypress' ); ?></a>
+			<a id="add_group" class="page-title-action" href="<?php echo esc_url( $add_group_url ); ?>"><?php esc_html_e( 'Add New Field Group', 'buddypress' ); ?></a>
 
 		<hr class="wp-header-end">
 
@@ -185,7 +185,7 @@
 								?>
 
 								<?php if ( ! $group->can_delete ) : ?>
-									<?php _e( '(Primary)', 'buddypress'); ?>
+									<?php esc_html_e( '(Primary)', 'buddypress'); ?>
 								<?php endif; ?>
 
 							</a>
@@ -234,13 +234,13 @@
 					<div id="tabs-<?php echo esc_attr( $group->id ); ?>" class="tab-wrapper">
 						<div class="tab-toolbar">
 							<div class="tab-toolbar-left">
-								<a class="button-primary" href="<?php echo esc_url( $add_field_url ); ?>"><?php _e( 'Add New Field', 'buddypress' ); ?></a>
-								<a class="button edit" href="<?php echo esc_url( $edit_group_url ); ?>"><?php _ex( 'Edit Group', 'Edit Profile Fields Group', 'buddypress' ); ?></a>
+								<a class="button-primary" href="<?php echo esc_url( $add_field_url ); ?>"><?php esc_html_e( 'Add New Field', 'buddypress' ); ?></a>
+								<a class="button edit" href="<?php echo esc_url( $edit_group_url ); ?>"><?php esc_html_x( 'Edit Group', 'Edit Profile Fields Group', 'buddypress' ); ?></a>
 
 								<?php if ( $group->can_delete ) : ?>
 
 									<div class="delete-button">
-										<a class="confirm submitdelete deletion ajax-option-delete" href="<?php echo esc_url( $delete_group_url ); ?>"><?php _ex( 'Delete Group', 'Delete Profile Fields Group', 'buddypress' ); ?></a>
+										<a class="confirm submitdelete deletion ajax-option-delete" href="<?php echo esc_url( $delete_group_url ); ?>"><?php esc_html_x( 'Delete Group', 'Delete Profile Fields Group', 'buddypress' ); ?></a>
 									</div>
 
 								<?php endif; ?>
@@ -299,7 +299,7 @@
 
 							else : // !$group->fields ?>
 
-								<p class="nodrag nofields"><?php _e( 'There are no fields in this group.', 'buddypress' ); ?></p>
+								<p class="nodrag nofields"><?php esc_html_e( 'There are no fields in this group.', 'buddypress' ); ?></p>
 
 							<?php endif; // End $group->fields. ?>
 
@@ -309,8 +309,8 @@
 
 				<?php endforeach; else : ?>
 
-					<div id="message" class="error notice is-dismissible"><p><?php _ex( 'You have no groups.', 'You have no profile fields groups.', 'buddypress' ); ?></p></div>
-					<p><a href="<?php echo esc_url( $add_group_url ); ?>"><?php _ex( 'Add New Group', 'Add New Profile Fields Group', 'buddypress' ); ?></a></p>
+					<div id="message" class="error notice is-dismissible"><p><?php esc_html_x( 'You have no groups.', 'You have no profile fields groups.', 'buddypress' ); ?></p></div>
+					<p><a href="<?php echo esc_url( $add_group_url ); ?>"><?php esc_html_x( 'Add New Group', 'Add New Profile Fields Group', 'buddypress' ); ?></a></p>
 
 				<?php endif; ?>
 
Index: classes/class-bp-xprofile-field-type-checkbox-acceptance.php
===================================================================
--- classes/class-bp-xprofile-field-type-checkbox-acceptance.php	(revision 13516)
+++ classes/class-bp-xprofile-field-type-checkbox-acceptance.php	(working copy)
@@ -86,7 +86,6 @@
 	 */
 	public function edit_field_html( array $raw_properties = array() ) {
 		$user_id   = bp_displayed_user_id();
-		$required  = false;
 		$default_r = array();
 
 		if ( isset( $raw_properties['user_id'] ) ) {
@@ -96,7 +95,6 @@
 
 		if ( bp_get_the_profile_field_is_required() ) {
 			$default_r['required'] = 'required'; // HTML5 required attribute.
-			$required              = true;
 		}
 
 		$r = bp_parse_args(
@@ -179,7 +177,7 @@
 			return;
 		}
 
-		$class   = $current_field->type != $type ? 'display: none;' : '';
+		$class   = $current_field->type !== $type ? 'display: none;' : '';
 		$page_id = bp_xprofile_get_meta( $current_field->id, 'field', 'bp_xprofile_checkbox_acceptance_page', true );
 		?>
 
Index: classes/class-bp-xprofile-field-type-radiobutton.php
===================================================================
--- classes/class-bp-xprofile-field-type-radiobutton.php	(revision 13516)
+++ classes/class-bp-xprofile-field-type-radiobutton.php	(working copy)
@@ -90,7 +90,7 @@
 				$js_clear = sprintf( 'javascript:%1$s( \'%2$s\' );', $clear, esc_js( bp_get_the_profile_field_input_name() ) );
 			?>
 
-				<a class="clear-value" href="<?php echo $js_clear; ?>">
+				<a class="clear-value" href="<?php echo esc_url( $js_clear ); ?>">
 					<?php esc_html_e( 'Clear', 'buddypress' ); ?>
 				</a>
 
@@ -124,7 +124,7 @@
 
 			// Check for updated posted values, but errors preventing them from
 			// being saved first time.
-			if ( isset( $_POST[ 'field_' . $this->field_obj->id ] ) && $option_value != $_POST[ 'field_' . $this->field_obj->id ] ) {
+			if ( isset( $_POST[ 'field_' . $this->field_obj->id ] ) && $option_value !== $_POST[ 'field_' . $this->field_obj->id ] ) {
 				if ( ! empty( $_POST[ 'field_' . $this->field_obj->id ] ) ) {
 					$option_value = sanitize_text_field( $_POST[ 'field_' . $this->field_obj->id ] );
 				}
Index: classes/class-bp-xprofile-field-type.php
===================================================================
--- classes/class-bp-xprofile-field-type.php	(revision 13516)
+++ classes/class-bp-xprofile-field-type.php	(working copy)
@@ -430,7 +430,7 @@
 							<input type="text" name="<?php echo esc_attr( "{$type}_option[{$j}]" ); ?>" id="<?php echo esc_attr( "{$type}_option{$j}" ); ?>" value="<?php echo esc_attr( stripslashes( $options[ $i ]->name ) ); ?>" />
 							<label for="<?php echo esc_attr( "{$type}_option{$default_name}" ); ?>">
 								<input type="<?php echo esc_attr( $control_type ); ?>" id="<?php echo esc_attr( "{$type}_option{$default_name}" ); ?>" name="<?php echo esc_attr( "isDefault_{$type}_option{$default_name}" ); ?>" <?php checked( $options[ $i ]->is_default_option, true ); ?> value="<?php echo esc_attr( $j ); ?>" />
-								<?php _e( 'Default Value', 'buddypress' ); ?>
+								<?php esc_attr_e( 'Default Value', 'buddypress' ); ?>
 							</label>
 
 							<?php if ( 1 !== $j ) : ?>
Index: classes/class-bp-xprofile-field.php
===================================================================
--- classes/class-bp-xprofile-field.php	(revision 13516)
+++ classes/class-bp-xprofile-field.php	(working copy)
@@ -1573,9 +1573,9 @@
 		?>
 
 		<div id="field-type-member-types" class="postbox">
-			<h2><?php _e( 'Member Types', 'buddypress' ); ?></h2>
+			<h2><?php esc_attr_e( 'Member Types', 'buddypress' ); ?></h2>
 			<div class="inside">
-				<p class="description"><?php _e( 'This field should be available to:', 'buddypress' ); ?></p>
+				<p class="description"><?php esc_attr_e( 'This field should be available to:', 'buddypress' ); ?></p>
 
 				<ul>
 					<?php foreach ( $member_types as $member_type ) : ?>
@@ -1590,12 +1590,12 @@
 					<li>
 						<label for="member-type-none">
 							<input name="member-types[]" id="member-type-none" class="member-type-selector" type="checkbox" value="null" <?php checked( in_array( 'null', $field_member_types ) ); ?>/>
-							<?php _e( 'Users with no member type', 'buddypress' ); ?>
+							<?php esc_attr_e( 'Users with no member type', 'buddypress' ); ?>
 						</label>
 					</li>
 
 				</ul>
-				<p class="description member-type-none-notice<?php if ( ! empty( $field_member_types ) ) : ?> hide<?php endif; ?>"><?php _e( 'Unavailable to all members.', 'buddypress' ) ?></p>
+				<p class="description member-type-none-notice<?php if ( ! empty( $field_member_types ) ) : ?> hide<?php endif; ?>"><?php esc_attr_e( 'Unavailable to all members.', 'buddypress' ) ?></p>
 			</div>
 
 			<input type="hidden" name="has-member-types" value="1" />
Index: classes/class-bp-xprofile-user-admin.php
===================================================================
--- classes/class-bp-xprofile-user-admin.php	(revision 13516)
+++ classes/class-bp-xprofile-user-admin.php	(working copy)
@@ -342,7 +342,7 @@
 
 						<div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>">
 							<fieldset>
-								<legend><?php _e( 'Who can see this field?', 'buddypress' ); ?></legend>
+								<legend><?php esc_html_e( 'Who can see this field?', 'buddypress' ); ?></legend>
 
 								<?php bp_profile_visibility_radio_buttons(); ?>
 
