Index: /trunk/.gitignore
===================================================================
--- /trunk/.gitignore	(revision 7005)
+++ /trunk/.gitignore	(revision 7006)
@@ -9,4 +9,5 @@
 /node_modules
 /npm-debug.log
+.phpcscache
 
 # Output directory.
Index: /trunk/Gruntfile.js
===================================================================
--- /trunk/Gruntfile.js	(revision 7005)
+++ /trunk/Gruntfile.js	(revision 7006)
@@ -222,4 +222,10 @@
 			}
 		},
+		phpcs: {
+			'default': {
+				cmd: 'phpcs',
+				args: [ '--standard=phpcs.xml.dist', '--report-summary', '--report-source', '--cache=.phpcscache' ]
+			}
+		},
 		phpunit: {
 			'default': {
@@ -390,4 +396,13 @@
 	grunt.registerTask( 'release', [ 'build' ] );
 
+	// PHPCS test task.
+	grunt.registerMultiTask( 'phpcs', 'Runs PHPCS tests.', function() {
+		grunt.util.spawn( {
+			cmd:  this.data.cmd,
+			args: this.data.args,
+			opts: { stdio: 'inherit' }
+		}, this.async() );
+	} );
+
 	// PHPUnit test task.
 	grunt.registerMultiTask( 'phpunit', 'Runs PHPUnit tests, including the BuddyPress and multisite tests.', function() {
Index: /trunk/phpcs.xml.dist
===================================================================
--- /trunk/phpcs.xml.dist	(revision 7006)
+++ /trunk/phpcs.xml.dist	(revision 7006)
@@ -0,0 +1,361 @@
+<?xml version="1.0"?>
+<ruleset name="WordPress Coding Standards">
+	<description>Apply WordPress Coding Standards to all Core files with scpecific bbPress exclusions</description>
+
+	<rule ref="WordPress-Core"/>
+
+	<arg name="extensions" value="php"/>
+
+	<!-- Strip the filepaths down to the relevant bit. -->
+	<arg name="basepath" value="./"/>
+
+	<!-- Check up to 20 files simultaneously. -->
+	<arg name="parallel" value="20"/>
+
+	<!-- Show sniff codes in all reports -->
+	<arg value="psv"/>
+
+	<file>.</file>
+
+	<!-- Test data and fixtures -->
+	<exclude-pattern>/tests/*</exclude-pattern>
+	<exclude-pattern>/tests/phpunit/build*</exclude-pattern>
+	<exclude-pattern>/tests/phpunit/data/*</exclude-pattern>
+
+	<!-- Directories and third party library exclusions -->
+	<exclude-pattern>/node_modules/*</exclude-pattern>
+	<exclude-pattern>/vendor/*</exclude-pattern>
+
+	<!-- Exclude the build folder in the current directory, as Travis puts the checkout in a build directory. -->
+	<exclude-pattern type="relative">^build/*</exclude-pattern>
+
+	<!-- Exclude the NBBC parser. See https://github.com/bbpress/nbbc -->
+	<exclude-pattern>/src/includes/admin/parser.php</exclude-pattern>
+
+	<!-- bbPress follows only a subset of the WordPress Coding Standards Rules -->
+
+
+	<!-- Rules that require further review, reviewed -->
+
+	<rule ref="Generic.Formatting.MultipleStatementAlignment.IncorrectWarning">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="Generic.Formatting.MultipleStatementAlignment.NotSameWarning">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="Generic.WhiteSpace.ScopeIndent.Incorrect">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="Generic.WhiteSpace.ScopeIndent.IncorrectExact">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="PEAR.NamingConventions.ValidClassName.StartWithCapital">
+		<exclude-pattern>/src/bbpress.php</exclude-pattern>
+		<exclude-pattern>/src/includes/admin/converters/bbPress1.php</exclude-pattern>
+		<exclude-pattern>/src/includes/admin/converters/e107v1.php</exclude-pattern>
+		<exclude-pattern>/src/includes/admin/converters/phpBB.php</exclude-pattern>
+		<exclude-pattern>/src/includes/admin/converters/vBulletin.php</exclude-pattern>
+		<exclude-pattern>/src/includes/admin/converters/vBulletin3.php</exclude-pattern>
+	</rule>
+
+	<rule ref="Squiz.PHP.EmbeddedPhp.ContentBeforeEnd">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="Squiz.PHP.EmbeddedPhp.ContentBeforeOpen">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.Arrays.CommaAfterArrayItem.NoComma">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<!-- Rules that require further review, partially reviewed -->
+
+	<rule ref="Generic.ControlStructures.InlineControlStructure.NotAllowed">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="Generic.Formatting.DisallowMultipleStatements.SameLine">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="Generic.Formatting.SpaceAfterCast.TooMuchSpace">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie.ContentAfterBrace">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="Generic.WhiteSpace.ArbitraryParenthesesSpacing.SpaceBeforeClose">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="PEAR.Functions.FunctionCallSignature.Indent">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="PEAR.Functions.FunctionCallSignature.EmptyLine">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="PSR2.ControlStructures.SwitchDeclaration.BreakIndent">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<!-- Rules that require further review, not yet reviewed -->
+
+	<rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="PEAR.Functions.FunctionCallSignature.MultipleArguments">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="PEAR.Functions.FunctionCallSignature.SpaceBeforeOpenBracket">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="PSR2.ControlStructures.ElseIfDeclaration.NotAllowed">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="PSR2.ControlStructures.SwitchDeclaration.BodyOnNextLineCASE">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="PSR2.ControlStructures.SwitchDeclaration.BodyOnNextLineDEFAULT">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="PSR2.ControlStructures.SwitchDeclaration.SpaceBeforeColonCASE">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="PSR2.ControlStructures.SwitchDeclaration.SpaceBeforeColonDEFAULT">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterOpen">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="Squiz.PHP.DisallowMultipleAssignments.Found">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="Squiz.PHP.EmbeddedPhp.ContentAfterEnd">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="Squiz.PHP.EmbeddedPhp.ContentAfterOpen">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="Squiz.PHP.EmbeddedPhp.MultipleStatements">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="Squiz.PHP.EmbeddedPhp.SpacingAfterOpen">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="Squiz.Strings.ConcatenationSpacing.PaddingFound">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.Arrays.ArrayDeclarationSpacing.ArrayItemNoNewLine">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.Arrays.ArrayDeclarationSpacing.CloseBraceNewLine">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.Arrays.ArrayDeclarationSpacing.NoSpaceAfterArrayOpener">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.Arrays.ArrayDeclarationSpacing.NoSpaceBeforeArrayCloser">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.Arrays.ArrayDeclarationSpacing.SpaceBeforeArrayCloser">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.Arrays.ArrayIndentation.CloseBraceNotAligned">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.Arrays.ArrayIndentation.ItemNotAligned">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.Arrays.ArrayIndentation.MultiLineArrayItemNotAligned">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.Arrays.ArrayKeySpacingRestrictions.NoSpacesAroundArrayKeys">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.Arrays.ArrayKeySpacingRestrictions.SpacesAroundArrayKeys">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.Arrays.CommaAfterArrayItem.SpaceAfterComma">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.Arrays.MultipleStatementAlignment.SpaceBeforeDoubleArrow">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.CodeAnalysis.AssignmentInCondition.Found">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.CodeAnalysis.EmptyStatement">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.DB.PreparedSQL.InterpolatedNotPrepared">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.DB.PreparedSQL.NotPrepared">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.Files.FileName.InvalidClassFileName">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.Files.FileName.NotHyphenatedLowercase">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.PHP.NoSilencedErrors.Discouraged">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.PHP.StrictComparisons.LooseComparison">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.PHP.StrictInArray.MissingTrueStrict">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.PHP.YodaConditions.NotYoda">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.WhiteSpace.ControlStructureSpacing.ExtraSpaceAfterCloseParenthesis">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.WhiteSpace.ControlStructureSpacing.ExtraSpaceAfterOpenParenthesis">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterOpenParenthesis">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeCloseParenthesis">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.WhiteSpace.DisallowInlineTabs.NonIndentTabsUsed">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.WhiteSpace.OperatorSpacing.NoSpaceAfter">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.WhiteSpace.OperatorSpacing.NoSpaceBefore">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.WhiteSpace.OperatorSpacing.SpacingAfter">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.WhiteSpace.OperatorSpacing.SpacingBefore">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.WhiteSpace.PrecisionAlignment.Found">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.WP.I18n.LowLevelTranslationFunction">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.WP.I18n.MissingTranslatorsComment">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+	<rule ref="WordPress.WP.I18n.NonSingularStringLiteralText">
+		<exclude-pattern>/src/*</exclude-pattern>
+	</rule>
+
+</ruleset>
Index: /trunk/src/bbpress.php
===================================================================
--- /trunk/src/bbpress.php	(revision 7005)
+++ /trunk/src/bbpress.php	(revision 7006)
@@ -170,5 +170,5 @@
 	 * @since 2.1.0 bbPress (r3951)
 	 */
-	public function __set( $key , $value ) { $this->data[ $key ] = $value; }
+	public function __set( $key, $value ) { $this->data[ $key ] = $value; }
 
 	/**
@@ -551,6 +551,6 @@
 				'menu_icon'           => '',
 				'source'              => 'bbpress',
-			)
-		) );
+			) )
+		);
 
 		/** Replies ***********************************************************/
Index: /trunk/src/includes/admin/classes/class-bbp-admin.php
===================================================================
--- /trunk/src/includes/admin/classes/class-bbp-admin.php	(revision 7005)
+++ /trunk/src/includes/admin/classes/class-bbp-admin.php	(revision 7006)
@@ -236,5 +236,5 @@
 			$bbp_dashicon = '<span class="bbpress-logo-icon"></span>';
 			$message      = $bbp_dashicon . sprintf(
-				esc_html__( 'bbPress requires a manual database upgrade. %s or %s.', 'bbpress' ),
+				esc_html__( 'bbPress requires a manual database upgrade. %1$s or %1$s.', 'bbpress' ),
 				$upgrade_link,
 				$dismiss_link
@@ -325,5 +325,5 @@
 		// Messages as objects
 		} elseif ( is_wp_error( $message ) ) {
-			$errors  = $message->get_error_messages();
+			$errors = $message->get_error_messages();
 
 			switch ( count( $errors ) ) {
@@ -914,5 +914,5 @@
 		if ( ! empty( $topics ) ) {
 			foreach ( (array) $topics as $post ) {
-				printf( esc_html__( '%s - %s', 'bbpress' ), bbp_get_topic_id( $post->ID ), bbp_get_topic_title( $post->ID ) . "\n" );
+				printf( esc_html__( '%1$s - %2$s', 'bbpress' ), bbp_get_topic_id( $post->ID ), bbp_get_topic_title( $post->ID ) . "\n" );
 			}
 		}
@@ -951,5 +951,5 @@
 		if ( ! empty( $users_query->results ) ) {
 			foreach ( (array) $users_query->results as $user ) {
-				printf( esc_html__( '%s - %s', 'bbpress' ), bbp_get_user_id( $user->ID ), bbp_get_user_nicename( $user->ID, array( 'force' => $user->user_nicename ) ) . "\n" );
+				printf( esc_html__( '%1$s - %2$s', 'bbpress' ), bbp_get_user_id( $user->ID ), bbp_get_user_nicename( $user->ID, array( 'force' => $user->user_nicename ) ) . "\n" );
 			}
 		}
@@ -1336,5 +1336,5 @@
 						<!--
 						function nextpage() {
-							location.href = 'update-core.php?page=bbpress-update&action=bbpress-update&n=<?php echo ( $n + 5 ) ?>';
+							location.href = 'update-core.php?page=bbpress-update&action=bbpress-update&n=<?php echo ( $n + 5 ); ?>';
 						}
 						setTimeout( 'nextpage()', 250 );
Index: /trunk/src/includes/admin/classes/class-bbp-converter-base.php
===================================================================
--- /trunk/src/includes/admin/classes/class-bbp-converter-base.php	(revision 7005)
+++ /trunk/src/includes/admin/classes/class-bbp-converter-base.php	(revision 7006)
@@ -392,10 +392,10 @@
 
 					// No 'WHERE' in expression
-					if ( stripos( $from_tablename, "WHERE" ) === false ) {
+					if ( stripos( $from_tablename, 'WHERE' ) === false ) {
 						$from_tablename .= ' ' . $item['from_expression'];
 
 					// 'WHERE' in expression, so replace with 'AND'
 					} else {
-						$from_tablename .= ' ' . str_replace( "WHERE", "AND", $item['from_expression'] );
+						$from_tablename .= ' ' . str_replace( 'WHERE', 'AND', $item['from_expression'] );
 					}
 				}
@@ -533,5 +533,5 @@
 							case 'tags' :
 								$post_id = wp_set_object_terms( $insert_postmeta['objectid'], $insert_postmeta['name'], 'topic-tag', true );
-								$term = get_term_by( 'name', $insert_postmeta['name'], 'topic-tag');
+								$term    = get_term_by( 'name', $insert_postmeta['name'], 'topic-tag');
 								if ( false !== $term ) {
 									wp_update_term( $term->term_id, 'topic-tag', array(
Index: /trunk/src/includes/admin/classes/class-bbp-topic-replies-list-table.php
===================================================================
--- /trunk/src/includes/admin/classes/class-bbp-topic-replies-list-table.php	(revision 7005)
+++ /trunk/src/includes/admin/classes/class-bbp-topic-replies-list-table.php	(revision 7006)
@@ -331,8 +331,8 @@
 		// Hierarchy
 		if ( ! empty( $item->post_parent ) ) {
-		    $count    = count( get_post_ancestors( $item->ID ) );
-		    $classes .= ' level-'. $count;
+			$count    = count( get_post_ancestors( $item->ID ) );
+			$classes .= ' level-'. $count;
 		} else {
-		    $classes .= ' level-0';
+			$classes .= ' level-0';
 		} ?>
 
Index: /trunk/src/includes/admin/converters/Invision.php
===================================================================
--- /trunk/src/includes/admin/converters/Invision.php	(revision 7005)
+++ /trunk/src/includes/admin/converters/Invision.php	(revision 7006)
@@ -541,14 +541,13 @@
 
 	private function to_char( $input ) {
-		$output = "";
+		$output = '';
 		for ( $i = 0; $i < strlen( $input ); $i++ ) {
 			$j = ord( $input{$i} );
 			if ( ( $j >= 65 && $j <= 90 )
 				|| ( $j >= 97 && $j <= 122 )
-				|| ( $j >= 48 && $j <= 57 ) )
-			{
+				|| ( $j >= 48 && $j <= 57 ) ) {
 				$output .= $input{$i};
 			} else {
-				$output .= "&#" . ord( $input{$i} ) . ";";
+				$output .= '&#' . ord( $input{$i} ) . '';
 			}
 		}
Index: /trunk/src/includes/admin/converters/Kunena2.php
===================================================================
--- /trunk/src/includes/admin/converters/Kunena2.php	(revision 7005)
+++ /trunk/src/includes/admin/converters/Kunena2.php	(revision 7006)
@@ -299,5 +299,5 @@
 		 */
 
- 		/** Reply Section *****************************************************/
+		/** Reply Section *****************************************************/
 
 		// Old reply id (Stored in postmeta)
Index: /trunk/src/includes/admin/converters/Mingle.php
===================================================================
--- /trunk/src/includes/admin/converters/Mingle.php	(revision 7005)
+++ /trunk/src/includes/admin/converters/Mingle.php	(revision 7006)
@@ -28,5 +28,5 @@
 	 * Sets up the field mappings
 	 */
-	public function setup_globals()	{
+	public function setup_globals() {
 
 		// Setup smiley URL & path
Index: /trunk/src/includes/admin/converters/SMF.php
===================================================================
--- /trunk/src/includes/admin/converters/SMF.php	(revision 7005)
+++ /trunk/src/includes/admin/converters/SMF.php	(revision 7006)
@@ -741,9 +741,9 @@
 
 		// Replace '[quote]' with '<blockquote>'
-		$SMF_markup = preg_replace( '/\[quote\]/',        '<blockquote>',  $SMF_markup );
+		$SMF_markup = preg_replace( '/\[quote\]/',       '<blockquote>',  $SMF_markup );
 		// Replace '[quote ($1)]' with '<blockquote>"
-		$SMF_markup = preg_replace( '/\[quote (.*?)\]/' , '<blockquote>',  $SMF_markup );
+		$SMF_markup = preg_replace( '/\[quote (.*?)\]/', '<blockquote>',  $SMF_markup );
 		// Replace '[/quote]' with '</blockquote>'
-		$SMF_markup = preg_replace( '/\[\/quote\]/',      '</blockquote>', $SMF_markup );
+		$SMF_markup = preg_replace( '/\[\/quote\]/',     '</blockquote>', $SMF_markup );
 
 		// Replace '[glow]' with ''
Index: /trunk/src/includes/admin/converters/SimplePress5.php
===================================================================
--- /trunk/src/includes/admin/converters/SimplePress5.php	(revision 7005)
+++ /trunk/src/includes/admin/converters/SimplePress5.php	(revision 7006)
@@ -587,8 +587,8 @@
 
 		// Replace any SimplePress smilies from path '/sp-resources/forum-smileys/sf-smily.gif' with the equivelant WordPress Smilie
-		$simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-confused\.gif(.*?)\" \/>/',     ':?' ,     $simplepress_markup );
+		$simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-confused\.gif(.*?)\" \/>/',     ':?',      $simplepress_markup );
 		$simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-cool\.gif(.*?)\" \/>/',        ':cool:',   $simplepress_markup );
 		$simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-cry\.gif(.*?)\" \/>/',         ':cry:',    $simplepress_markup );
-		$simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-embarassed\.gif(.*?)\" \/>/' , ':oops:',   $simplepress_markup );
+		$simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-embarassed\.gif(.*?)\" \/>/',  ':oops:',   $simplepress_markup );
 		$simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-frown\.gif(.*?)\" \/>/',       ':(',       $simplepress_markup );
 		$simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-kiss\.gif(.*?)\" \/>/',        ':P',       $simplepress_markup );
@@ -600,5 +600,5 @@
 
 		// Replace '<div class="sfcode">example code</div>' with '<code>*</code>'
-		$simplepress_markup = preg_replace( '/\<div class\=\"sfcode\"\>(.*?)\<\/div\>/' , '<code>$1</code>' , $simplepress_markup );
+		$simplepress_markup = preg_replace( '/\<div class\=\"sfcode\"\>(.*?)\<\/div\>/', '<code>$1</code>', $simplepress_markup );
 
 		// Replace '<strong>username said </strong>' with '@username said:'
Index: /trunk/src/includes/admin/converters/XenForo.php
===================================================================
--- /trunk/src/includes/admin/converters/XenForo.php	(revision 7005)
+++ /trunk/src/includes/admin/converters/XenForo.php	(revision 7006)
@@ -698,5 +698,5 @@
 	public function authenticate_pass( $password, $serialized_pass ) {
 		$pass_array = unserialize( $serialized_pass );
-		switch( $pass_array['hashFunc'] ) {
+		switch ( $pass_array['hashFunc'] ) {
 			case 'sha256':
 				return ( $pass_array['hash'] == hash( 'sha256', hash( 'sha256', $password ) . $pass_array['salt'] ) );
Index: /trunk/src/includes/admin/converters/e107v1.php
===================================================================
--- /trunk/src/includes/admin/converters/e107v1.php	(revision 7005)
+++ /trunk/src/includes/admin/converters/e107v1.php	(revision 7006)
@@ -613,5 +613,5 @@
 		$e107v1_markup = preg_replace( '/\[quote(.*?)=(.*?)\]/', '<em>@$2 wrote:</em><blockquote>', $e107v1_markup );
 		// Replace '[/quote$1]' with '</blockquote>"
-		$e107v1_markup = preg_replace( '/\[\/quote(.*?)\]/' ,    '</blockquote>',                   $e107v1_markup );
+		$e107v1_markup = preg_replace( '/\[\/quote(.*?)\]/',     '</blockquote>',                   $e107v1_markup );
 
 		// Remove '[justify]'
Index: /trunk/src/includes/admin/converters/phpBB.php
===================================================================
--- /trunk/src/includes/admin/converters/phpBB.php	(revision 7005)
+++ /trunk/src/includes/admin/converters/phpBB.php	(revision 7006)
@@ -830,5 +830,5 @@
 			}
 
-			$output .= $itoa64[($value >> 18) & 0x3f];
+			$output .= $itoa64[( $value >> 18 ) & 0x3f];
 		} while ( $i < $count );
 
Index: /trunk/src/includes/admin/converters/vBulletin3.php
===================================================================
--- /trunk/src/includes/admin/converters/vBulletin3.php	(revision 7005)
+++ /trunk/src/includes/admin/converters/vBulletin3.php	(revision 7006)
@@ -641,5 +641,5 @@
 	 */
 	public function callback_savepass( $field, $row ) {
-		$pass_array = array( 'hash'	 => $field, 'salt'	 => $row['salt'] );
+		$pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
 		return $pass_array;
 	}
@@ -737,5 +737,5 @@
 		$vbulletin_markup = preg_replace( '/\[QUOTE\]/', '<blockquote>', $vbulletin_markup );
 		// Replace '[QUOTE=User Name($1);PostID($2)]' with '<em>@$1 $2 wrote:</em><blockquote>"
-		$vbulletin_markup = preg_replace( '/\[QUOTE=(.*?);(.*?)\]/' , '<em>@$1 $2 wrote:</em><blockquote>', $vbulletin_markup );
+		$vbulletin_markup = preg_replace( '/\[QUOTE=(.*?);(.*?)\]/', '<em>@$1 $2 wrote:</em><blockquote>', $vbulletin_markup );
 		// Replace '[/QUOTE]' with '</blockquote>'
 		$vbulletin_markup = preg_replace( '/\[\/QUOTE\]/', '</blockquote>', $vbulletin_markup );
Index: /trunk/src/includes/admin/forums.php
===================================================================
--- /trunk/src/includes/admin/forums.php	(revision 7005)
+++ /trunk/src/includes/admin/forums.php	(revision 7006)
@@ -540,5 +540,5 @@
 			'bbp_forum_mods'        => esc_html__( 'Moderators', 'bbpress' ),
 			'author'                => esc_html__( 'Creator',    'bbpress' ),
-			'bbp_forum_created'     => esc_html__( 'Created' ,   'bbpress' ),
+			'bbp_forum_created'     => esc_html__( 'Created',    'bbpress' ),
 			'bbp_forum_freshness'   => esc_html__( 'Last Post',  'bbpress' )
 		);
@@ -694,8 +694,8 @@
 		// Messages array
 		$messages[ $this->post_type ] = array(
-			0 =>  '', // Left empty on purpose
+			0 => '', // Left empty on purpose
 
 			// Updated
-			1 =>  sprintf(
+			1 => sprintf(
 				'%1$s <a href="%2$s">%3$s</a>',
 				esc_html__( 'Forum updated.', 'bbpress' ),
Index: /trunk/src/includes/admin/metaboxes.php
===================================================================
--- /trunk/src/includes/admin/metaboxes.php	(revision 7005)
+++ /trunk/src/includes/admin/metaboxes.php	(revision 7006)
@@ -316,5 +316,5 @@
 	<p>
 		<strong class="label"><?php esc_html_e( 'Type:', 'bbpress' ); ?></strong>
-		<label class="screen-reader-text" for="bbp_forum_type_select"><?php esc_html_e( 'Type:', 'bbpress' ) ?></label>
+		<label class="screen-reader-text" for="bbp_forum_type_select"><?php esc_html_e( 'Type:', 'bbpress' ); ?></label>
 		<?php bbp_form_forum_type_dropdown( array( 'forum_id' => $post->ID ) ); ?>
 	</p>
@@ -328,5 +328,5 @@
 	<p>
 		<strong class="label"><?php esc_html_e( 'Status:', 'bbpress' ); ?></strong>
-		<label class="screen-reader-text" for="bbp_forum_status_select"><?php esc_html_e( 'Status:', 'bbpress' ) ?></label>
+		<label class="screen-reader-text" for="bbp_forum_status_select"><?php esc_html_e( 'Status:', 'bbpress' ); ?></label>
 		<?php bbp_form_forum_status_dropdown( array( 'forum_id' => $post->ID ) ); ?>
 	</p>
@@ -340,5 +340,5 @@
 	<p>
 		<strong class="label"><?php esc_html_e( 'Visibility:', 'bbpress' ); ?></strong>
-		<label class="screen-reader-text" for="bbp_forum_visibility_select"><?php esc_html_e( 'Visibility:', 'bbpress' ) ?></label>
+		<label class="screen-reader-text" for="bbp_forum_visibility_select"><?php esc_html_e( 'Visibility:', 'bbpress' ); ?></label>
 		<?php bbp_form_forum_visibility_dropdown( array( 'forum_id' => $post->ID ) ); ?>
 	</p>
Index: /trunk/src/includes/admin/replies.php
===================================================================
--- /trunk/src/includes/admin/replies.php	(revision 7005)
+++ /trunk/src/includes/admin/replies.php	(revision 7006)
@@ -270,5 +270,5 @@
 
 		$sendback = remove_query_arg( array( 'spam', 'unspam' ), $sendback );
-		$updated = $locked = 0;
+		$updated  = $locked = 0;
 
 		if ( 'spam' === $doaction ) {
@@ -814,7 +814,7 @@
 			// Show the 'spam' link on published and pending replies and 'not spam' on spammed replies
 			if ( in_array( $reply->post_status, array( bbp_get_public_status_id(), bbp_get_trash_status_id(), bbp_get_pending_status_id(), bbp_get_spam_status_id() ), true ) ) {
-				$spam_uri  = wp_nonce_url( add_query_arg( array( 'reply_id' => $reply->ID, 'action' => 'bbp_toggle_reply_spam' ), remove_query_arg( array( 'bbp_reply_toggle_notice', 'reply_id', 'failed', 'super' ) ) ), 'spam-reply_'  . $reply->ID );
+				$spam_uri = wp_nonce_url( add_query_arg( array( 'reply_id' => $reply->ID, 'action' => 'bbp_toggle_reply_spam' ), remove_query_arg( array( 'bbp_reply_toggle_notice', 'reply_id', 'failed', 'super' ) ) ), 'spam-reply_'  . $reply->ID );
 				if ( ! bbp_is_reply_spam( $reply->ID ) ) {
-					$actions['spam'] = '<a href="' . esc_url( $spam_uri ) . '" title="' . esc_attr__( 'Mark this reply as spam',    'bbpress' ) . '">' . esc_html__( 'Spam',     'bbpress' ) . '</a>';
+					$actions['spam']   = '<a href="' . esc_url( $spam_uri ) . '" title="' . esc_attr__( 'Mark this reply as spam',    'bbpress' ) . '">' . esc_html__( 'Spam',     'bbpress' ) . '</a>';
 				} else {
 					$actions['unspam'] = '<a href="' . esc_url( $spam_uri ) . '" title="' . esc_attr__( 'Mark the reply as not spam', 'bbpress' ) . '">' . esc_html__( 'Not Spam', 'bbpress' ) . '</a>';
@@ -829,11 +829,11 @@
 			if ( bbp_get_trash_status_id() === $reply->post_status ) {
 				$post_type_object   = get_post_type_object( bbp_get_reply_post_type() );
-				$actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . esc_url( wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $reply->ID ) ), 'untrash-post_' . $reply->ID ) ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . "</a>";
+				$actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . esc_url( wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $reply->ID ) ), 'untrash-post_' . $reply->ID ) ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . '</a>';
 			} elseif ( ! empty( $trash_days ) ) {
-				$actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . esc_url( get_delete_post_link( $reply->ID ) ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . "</a>";
+				$actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . esc_url( get_delete_post_link( $reply->ID ) ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . '</a>';
 			}
 
 			if ( ( bbp_get_trash_status_id() === $reply->post_status ) || empty( $trash_days ) ) {
-				$actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . esc_url( get_delete_post_link( $reply->ID, '', true ) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . "</a>";
+				$actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . esc_url( get_delete_post_link( $reply->ID, '', true ) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . '</a>';
 			}
 		}
@@ -964,8 +964,8 @@
 		// Messages array
 		$messages[ $this->post_type ] = array(
-			0 =>  '', // Left empty on purpose
+			0 => '', // Left empty on purpose
 
 			// Updated
-			1 =>  sprintf(
+			1 => sprintf(
 				'%1$s <a href="%2$s">%3$s</a>',
 				esc_html__( 'Reply updated.', 'bbpress' ),
Index: /trunk/src/includes/admin/settings.php
===================================================================
--- /trunk/src/includes/admin/settings.php	(revision 7005)
+++ /trunk/src/includes/admin/settings.php	(revision 7006)
@@ -969,5 +969,5 @@
 	if ( ! empty( $theme_options ) ) : ?>
 
-		<select name="_bbp_theme_package_id" id="_bbp_theme_package_id" <?php bbp_maybe_admin_setting_disabled( '_bbp_theme_package_id' ); ?>><?php echo $theme_options ?></select>
+		<select name="_bbp_theme_package_id" id="_bbp_theme_package_id" <?php bbp_maybe_admin_setting_disabled( '_bbp_theme_package_id' ); ?>><?php echo $theme_options; ?></select>
 		<label for="_bbp_theme_package_id"><?php esc_html_e( 'will serve all bbPress templates', 'bbpress' ); ?></label>
 
@@ -1465,5 +1465,5 @@
 		// Button & text
 		$button = '<a href="' . esc_url( $new_url ) . '">' . esc_html__( 'create a new one', 'bbpress' ) . '</a>';
-		$text   = esc_html__( 'Use %s to contain your group forums, or %s', 'bbpress' );
+		$text   = esc_html__( 'Use %s to contain your group forums, or %s', 'bbpress' ); //phpcs:ignore
 	} else {
 		$text = esc_html__( 'Use %s to contain your group forums', 'bbpress' );
@@ -1518,5 +1518,5 @@
 
 	<div class="wrap">
-		<h1 class="wp-heading-inline"><?php esc_html_e( 'Forums Settings', 'bbpress' ) ?></h1>
+		<h1 class="wp-heading-inline"><?php esc_html_e( 'Forums Settings', 'bbpress' ); ?></h1>
 		<hr class="wp-header-end">
 
@@ -1568,5 +1568,5 @@
 	} ?>
 
-	<select name="_bbp_converter_platform" id="_bbp_converter_platform"><?php echo $options ?></select>
+	<select name="_bbp_converter_platform" id="_bbp_converter_platform"><?php echo $options; ?></select>
 	<p class="description"><?php esc_html_e( 'The previous forum software', 'bbpress' ); ?></p>
 
@@ -1793,5 +1793,5 @@
 	// Starting or continuing?
 	$progress_text = ! empty( $step )
-		? sprintf( esc_html__( 'Previously stopped at step %d of %d', 'bbpress' ), $step, $max )
+		? sprintf( esc_html__( 'Previously stopped at step %1$d of %2$d', 'bbpress' ), $step, $max )
 		: esc_html__( 'Ready to go.', 'bbpress' ); ?>
 
@@ -1958,5 +1958,5 @@
  * @param bool $slug
  */
-function bbp_form_option( $option, $default = '' , $slug = false ) {
+function bbp_form_option( $option, $default = '', $slug = false ) {
 	echo bbp_get_form_option( $option, $default, $slug );
 }
Index: /trunk/src/includes/admin/tools.php
===================================================================
--- /trunk/src/includes/admin/tools.php	(revision 7005)
+++ /trunk/src/includes/admin/tools.php	(revision 7006)
@@ -28,5 +28,5 @@
 
 	<div class="card">
-		<h3 class="title"><?php esc_html_e( 'Forums', 'bbpress' ) ?></h3>
+		<h3 class="title"><?php esc_html_e( 'Forums', 'bbpress' ); ?></h3>
 		<p><?php esc_html_e( 'bbPress provides the following tools to help you manage your forums:', 'bbpress' ); ?></p>
 
Index: /trunk/src/includes/admin/tools/common.php
===================================================================
--- /trunk/src/includes/admin/tools/common.php	(revision 7005)
+++ /trunk/src/includes/admin/tools/common.php	(revision 7006)
@@ -220,5 +220,5 @@
 
 	// Get tools
-	$tools  = bbp_get_admin_repair_tools( bbp_get_admin_repair_tool_page_id() );
+	$tools = bbp_get_admin_repair_tools( bbp_get_admin_repair_tool_page_id() );
 
 	// Loop through tools
@@ -312,5 +312,5 @@
 
 	// Get tools
-	$tools  = bbp_get_admin_repair_tools( bbp_get_admin_repair_tool_page_id() );
+	$tools = bbp_get_admin_repair_tools( bbp_get_admin_repair_tool_page_id() );
 
 	// Loop through tools
@@ -525,5 +525,5 @@
 
 	// Overhead
-	$overhead  = ! empty( $_GET['overhead'] )
+	$overhead = ! empty( $_GET['overhead'] )
 		? sanitize_key( $_GET['overhead'] )
 		: '';
Index: /trunk/src/includes/admin/tools/repair.php
===================================================================
--- /trunk/src/includes/admin/tools/repair.php	(revision 7005)
+++ /trunk/src/includes/admin/tools/repair.php	(revision 7006)
@@ -426,5 +426,5 @@
 
 	if ( is_wp_error( $bbp_db->query( $sql_delete ) ) ) {
- 		return array( 1, sprintf( $statement, $result ) );
+		return array( 1, sprintf( $statement, $result ) );
 	}
 
@@ -468,5 +468,5 @@
 
 	if ( is_wp_error( $bbp_db->query( $sql_delete ) ) ) {
- 		return array( 1, sprintf( $statement, $result ) );
+		return array( 1, sprintf( $statement, $result ) );
 	}
 
@@ -992,6 +992,6 @@
 	}
 
- 	// Loop through forums
- 	foreach ( $forums as $forum_id ) {
+	// Loop through forums
+	foreach ( $forums as $forum_id ) {
 		if ( ! bbp_is_forum_category( $forum_id ) ) {
 			bbp_update_forum( array( 'forum_id' => $forum_id ) );
@@ -1107,5 +1107,5 @@
 
 		// If we don't have a postmeta _bbp_status value
-		if( empty( $topic_status ) ) {
+		if ( empty( $topic_status ) ) {
 			update_post_meta( $closed_topic, '_bbp_status', 'publish' );
 			++$changed; // Keep a count to display at the end
Index: /trunk/src/includes/admin/tools/reset.php
===================================================================
--- /trunk/src/includes/admin/tools/reset.php	(revision 7005)
+++ /trunk/src/includes/admin/tools/reset.php	(revision 7006)
@@ -30,5 +30,5 @@
 				<tbody>
 					<tr valign="top">
-						<th scope="row"><?php esc_html_e( 'The following data will be removed:', 'bbpress' ) ?></th>
+						<th scope="row"><?php esc_html_e( 'The following data will be removed:', 'bbpress' ); ?></th>
 						<td>
 							<?php esc_html_e( 'All Forums',           'bbpress' ); ?><br />
Index: /trunk/src/includes/admin/tools/upgrade.php
===================================================================
--- /trunk/src/includes/admin/tools/upgrade.php	(revision 7005)
+++ /trunk/src/includes/admin/tools/upgrade.php	(revision 7006)
@@ -386,5 +386,5 @@
 
 	// Complete results
-	$result = sprintf( esc_html__( 'Complete! %s groups updated; %s forums updated; %s forum statuses synced.', 'bbpress' ), bbp_number_format( $g_count ), bbp_number_format( $f_count ), bbp_number_format( $s_count ) );
+	$result = sprintf( esc_html__( 'Complete! %1$s groups updated; %2$s forums updated; %3$s forum statuses synced.', 'bbpress' ), bbp_number_format( $g_count ), bbp_number_format( $f_count ), bbp_number_format( $s_count ) );
 	return array( 0, sprintf( $statement, $result ) );
 }
Index: /trunk/src/includes/admin/topics.php
===================================================================
--- /trunk/src/includes/admin/topics.php	(revision 7005)
+++ /trunk/src/includes/admin/topics.php	(revision 7006)
@@ -275,5 +275,5 @@
 
 		$sendback = remove_query_arg( array( 'spam', 'unspam' ), $sendback );
-		$updated = $locked = 0;
+		$updated  = $locked = 0;
 
 		if ( 'spam' === $doaction ) {
@@ -619,5 +619,5 @@
 
 				$is_sticky = bbp_is_topic_sticky( $topic_id );
-				$is_super  = ( false === $is_sticky ) && ! empty( $_GET['super'] ) && ( "1" === $_GET['super'] )
+				$is_super  = ( false === $is_sticky ) && ! empty( $_GET['super'] ) && ( '1' === $_GET['super'] )
 					? true
 					: false;
@@ -693,5 +693,5 @@
 		// Bail if no topic_id or notice
 		$topic_id = bbp_get_topic_id( $_GET['topic_id'] );
-		if (  empty( $topic_id ) ) {
+		if ( empty( $topic_id ) ) {
 			return;
 		}
@@ -1033,11 +1033,11 @@
 			if ( bbp_get_trash_status_id() === $topic->post_status ) {
 				$post_type_object   = get_post_type_object( bbp_get_topic_post_type() );
-				$actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . esc_url( wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $topic->ID ) ), 'untrash-post_' . $topic->ID ) ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . "</a>";
+				$actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . esc_url( wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $topic->ID ) ), 'untrash-post_' . $topic->ID ) ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . '</a>';
 			} elseif ( ! empty( $trash_days ) ) {
-				$actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . esc_url( get_delete_post_link( $topic->ID ) ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . "</a>";
+				$actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . esc_url( get_delete_post_link( $topic->ID ) ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . '</a>';
 			}
 
 			if ( ( bbp_get_trash_status_id() === $topic->post_status ) || empty( $trash_days ) ) {
-				$actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . esc_url( get_delete_post_link( $topic->ID, '', true ) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . "</a>";
+				$actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . esc_url( get_delete_post_link( $topic->ID, '', true ) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . '</a>';
 			}
 		}
@@ -1168,8 +1168,8 @@
 		// Messages array
 		$messages[ $this->post_type ] = array(
-			0 =>  '', // Left empty on purpose
+			0 => '', // Left empty on purpose
 
 			// Updated
-			1 =>  sprintf(
+			1 => sprintf(
 				'%1$s <a href="%2$s">%3$s</a>',
 				esc_html__( 'Topic updated.', 'bbpress' ),
Index: /trunk/src/includes/admin/users.php
===================================================================
--- /trunk/src/includes/admin/users.php	(revision 7005)
+++ /trunk/src/includes/admin/users.php	(revision 7006)
@@ -162,7 +162,7 @@
 		?>
 
-		<label class="screen-reader-text" for="<?php echo $select_id; ?>"><?php esc_html_e( 'Change forum role to&hellip;', 'bbpress' ) ?></label>
+		<label class="screen-reader-text" for="<?php echo $select_id; ?>"><?php esc_html_e( 'Change forum role to&hellip;', 'bbpress' ); ?></label>
 		<select name="<?php echo $select_id; ?>" id="<?php echo $select_id; ?>" style="display:inline-block; float:none;">
-			<option value=''><?php esc_html_e( 'Change forum role to&hellip;', 'bbpress' ) ?></option>
+			<option value=''><?php esc_html_e( 'Change forum role to&hellip;', 'bbpress' ); ?></option>
 			<?php foreach ( $dynamic_roles as $role => $details ) : ?>
 				<option value="<?php echo esc_attr( $role ); ?>"><?php echo bbp_translate_user_role( $details['name'] ); ?></option>
Index: /trunk/src/includes/common/engagements.php
===================================================================
--- /trunk/src/includes/common/engagements.php	(revision 7005)
+++ /trunk/src/includes/common/engagements.php	(revision 7006)
@@ -811,5 +811,5 @@
 		// Try to delete caches, but only if everything else succeeded
 		if ( ! empty( $retval ) && ! empty( $object_ids ) ) {
-			foreach( $object_ids as $object_id ) {
+			foreach ( $object_ids as $object_id ) {
 				$this->cache_delete( $meta_key, $object_id );
 			}
Index: /trunk/src/includes/common/formatting.php
===================================================================
--- /trunk/src/includes/common/formatting.php	(revision 7005)
+++ /trunk/src/includes/common/formatting.php	(revision 7006)
@@ -97,5 +97,5 @@
  */
 function bbp_kses_data( $data = '' ) {
-	return wp_kses( $data , bbp_kses_allowed_tags() );
+	return wp_kses( $data, bbp_kses_allowed_tags() );
 }
 
@@ -112,5 +112,5 @@
 function bbp_code_trick( $content = '' ) {
 	$content = str_replace( array( "\r\n", "\r" ), "\n", $content );
-	$content = preg_replace_callback( "|(`)(.*?)`|",      'bbp_encode_callback', $content );
+	$content = preg_replace_callback('|(`)(.*?)`|',      'bbp_encode_callback', $content );
 	$content = preg_replace_callback( "!(^|\n)`(.*?)`!s", 'bbp_encode_callback', $content );
 
@@ -131,5 +131,5 @@
 	// Setup variables
 	$openers = array( '<p>', '<br />' );
-	$content = preg_replace_callback( "!(<pre><code>|<code>)(.*?)(</code></pre>|</code>)!s", 'bbp_decode_callback', $content );
+	$content = preg_replace_callback( '!(<pre><code>|<code>)(.*?)(</code></pre>|</code>)!s', 'bbp_decode_callback', $content );
 
 	// Do the do
@@ -197,5 +197,5 @@
 
 	// Trim inline code, not pre blocks (to prevent removing indentation)
-	if ( "`" === $matches[1] ) {
+	if ( '`' === $matches[1] ) {
 		$content = trim( $matches[2] );
 	} else {
@@ -215,5 +215,5 @@
 
 	// Wrap blocks in pre tags
-	if ( "`" !== $matches[1] ) {
+	if ('`' !== $matches[1] ) {
 		$content = "\n<pre>" . $content . "</pre>\n";
 	}
@@ -235,6 +235,6 @@
 	// Setup variables
 	$trans_table = array_flip( get_html_translation_table( HTML_ENTITIES ) );
-	$amps        = array( '&#38;','&#038;', '&amp;' );
-	$single      = array( '&#39;','&#039;'          );
+	$amps        = array( '&#38;', '&#038;', '&amp;' );
+	$single      = array( '&#39;', '&#039;'          );
 	$content     = $matches[2];
 	$content     = strtr( $content, $trans_table );
@@ -314,5 +314,5 @@
 	// Bail on links that match the current domain
 	if ( preg_match( '%href=["\'](' . preg_quote( set_url_scheme( $home_url, 'http'  ) ) . ')%i', $text ) ||
-	     preg_match( '%href=["\'](' . preg_quote( set_url_scheme( $home_url, 'https' ) ) . ')%i', $text )
+		 preg_match( '%href=["\'](' . preg_quote( set_url_scheme( $home_url, 'https' ) ) . ')%i', $text )
 	) {
 		return "<a {$text}>";
@@ -393,5 +393,5 @@
 
 	// Cleanup of accidental links within links
-	return preg_replace( '#(<a([ \r\n\t]+[^>]+?>|>))<a [^>]+?>([^>]+?)</a>([^<]*)</a>#i', "$1$3$4</a>", $r );
+	return preg_replace( '#(<a([ \r\n\t]+[^>]+?>|>))<a [^>]+?>([^>]+?)</a>([^<]*)</a>#i', '$1$3$4</a>', $r );
 }
 
Index: /trunk/src/includes/common/functions.php
===================================================================
--- /trunk/src/includes/common/functions.php	(revision 7005)
+++ /trunk/src/includes/common/functions.php	(revision 7006)
@@ -177,5 +177,5 @@
 	// Is the post by an anonymous user?
 	if ( ( bbp_get_topic_post_type() === $data['post_type'] && ! bbp_is_topic_anonymous( $postarr['ID'] ) ) ||
-	     ( bbp_get_reply_post_type() === $data['post_type'] && ! bbp_is_reply_anonymous( $postarr['ID'] ) ) ) {
+		 ( bbp_get_reply_post_type() === $data['post_type'] && ! bbp_is_reply_anonymous( $postarr['ID'] ) ) ) {
 		return $data;
 	}
@@ -223,5 +223,5 @@
 			$lockable = "+{$minutes} minutes";
 			if ( true === $utc ) {
-				$lockable .= " UTC";
+				$lockable .= ' UTC';
 			}
 
@@ -714,10 +714,10 @@
 	// Prepare duplicate check query
 	$query  = "SELECT ID FROM {$bbp_db->posts} {$join}";
-	$query .= $bbp_db->prepare( "WHERE post_type = %s AND post_status != %s AND post_author = %d AND post_content = %s", $r['post_type'], $r['post_status'], $r['post_author'], $r['post_content'] );
+	$query .= $bbp_db->prepare('WHERE post_type = %s AND post_status != %s AND post_author = %d AND post_content = %s', $r['post_type'], $r['post_status'], $r['post_author'], $r['post_content'] );
 	$query .= ! empty( $r['post_parent'] )
-		? $bbp_db->prepare( " AND post_parent = %d", $r['post_parent'] )
+		? $bbp_db->prepare( ' AND post_parent = %d', $r['post_parent'] )
 		: '';
 	$query .= $where;
-	$query .= " LIMIT 1";
+	$query .= ' LIMIT 1';
 	$dupe   = apply_filters( 'bbp_check_for_duplicate_query', $query, $r );
 
@@ -1149,5 +1149,5 @@
 	// Custom headers
 	$headers  = apply_filters( 'bbp_subscription_mail_headers', $headers  );
- 	$to_email = apply_filters( 'bbp_subscription_to_email',     $no_reply );
+	$to_email = apply_filters( 'bbp_subscription_to_email',     $no_reply );
 
 	// Before
@@ -2448,5 +2448,5 @@
 						$the_query = array(
 							'posts_per_page' => bbp_get_replies_per_rss_page(),
-							'meta_query'     => array( array( ) ),
+							'meta_query'     => array( array() ),
 							'feed'           => true
 						);
Index: /trunk/src/includes/common/template.php
===================================================================
--- /trunk/src/includes/common/template.php	(revision 7005)
+++ /trunk/src/includes/common/template.php	(revision 7006)
@@ -2085,5 +2085,5 @@
  * @return bool True if match, false if not
  */
-function bbp_is_query_name( $name = '' )  {
+function bbp_is_query_name( $name = '' ) {
 	return (bool) ( bbp_get_query_name() === $name );
 }
@@ -2096,5 +2096,5 @@
  * @return string To return the query var value
  */
-function bbp_get_query_name()  {
+function bbp_get_query_name() {
 	return get_query_var( '_bbp_query_name' );
 }
@@ -2107,5 +2107,5 @@
  * @param string $name What to set the query var to
  */
-function bbp_set_query_name( $name = '' )  {
+function bbp_set_query_name( $name = '' ) {
 	set_query_var( '_bbp_query_name', $name );
 }
@@ -2413,5 +2413,5 @@
 
 		// Build the trail
-		$trail  = ! empty( $crumbs ) ? ( $r['before'] . $r['crumb_before'] . implode( $sep . $r['crumb_after'] . $r['crumb_before'] , $crumbs ) . $r['crumb_after'] . $r['after'] ) : '';
+		$trail  = ! empty( $crumbs ) ? ( $r['before'] . $r['crumb_before'] . implode( $sep . $r['crumb_after'] . $r['crumb_before'], $crumbs ) . $r['crumb_after'] . $r['after'] ) : '';
 
 		// Filter & return
Index: /trunk/src/includes/core/template-functions.php
===================================================================
--- /trunk/src/includes/core/template-functions.php	(revision 7005)
+++ /trunk/src/includes/core/template-functions.php	(revision 7006)
@@ -383,5 +383,5 @@
 
 	// Filter & return
-	return (array) apply_filters( 'bbp_get_template_stack', $stack ) ;
+	return (array) apply_filters( 'bbp_get_template_stack', $stack );
 }
 
Index: /trunk/src/includes/core/template-loader.php
===================================================================
--- /trunk/src/includes/core/template-loader.php	(revision 7005)
+++ /trunk/src/includes/core/template-loader.php	(revision 7006)
@@ -30,5 +30,5 @@
 
 	// Editing a user
-	if     ( bbp_is_single_user_edit() && ( $new_template = bbp_get_single_user_edit_template() ) ) :
+	if     ( bbp_is_single_user_edit() && ( $new_template = bbp_get_single_user_edit_template() ) ) :  //phpcs:ignore
 
 	// User favorites
Index: /trunk/src/includes/core/theme-compat.php
===================================================================
--- /trunk/src/includes/core/theme-compat.php	(revision 7005)
+++ /trunk/src/includes/core/theme-compat.php	(revision 7006)
@@ -56,5 +56,5 @@
 	 * @param array $properties
 	 */
-	public function __construct( Array $properties = array() ) {
+	public function __construct( array $properties = array() ) {
 		$this->_data = $properties;
 	}
Index: /trunk/src/includes/extend/buddypress/groups.php
===================================================================
--- /trunk/src/includes/extend/buddypress/groups.php	(revision 7005)
+++ /trunk/src/includes/extend/buddypress/groups.php	(revision 7006)
@@ -323,5 +323,5 @@
 	public function edit_screen( $group = false ) {
 		$forum_id  = 0;
-		$group_id  = empty( $group->id ) ? bp_get_new_group_id() : $group->id ;
+		$group_id  = empty( $group->id ) ? bp_get_new_group_id() : $group->id;
 		$forum_ids = bbp_get_group_forum_ids( $group_id );
 
@@ -400,5 +400,5 @@
 			bbp_add_error( 'bbp_edit_group_forum_screen_save', __( '<strong>ERROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );
 			return;
- 		}
+		}
 
 		$edit_forum = ! empty( $_POST['bbp-edit-group-forum'] ) ? true : false;
@@ -963,5 +963,5 @@
 
 					// Single Topic
-					else:
+					else :
 						bbp_set_query_name( 'bbp_single_topic' );
 						bbp_get_template_part( 'content', 'single-topic' );
Index: /trunk/src/includes/extend/buddypress/loader.php
===================================================================
--- /trunk/src/includes/extend/buddypress/loader.php	(revision 7005)
+++ /trunk/src/includes/extend/buddypress/loader.php	(revision 7006)
@@ -243,5 +243,5 @@
 
 		// Favorite topics
-		if ( bbp_is_favorites_active() ){
+		if ( bbp_is_favorites_active() ) {
 			$sub_nav[] = array(
 				'name'            => esc_html__( 'Favorites', 'bbpress' ),
@@ -380,5 +380,5 @@
 					'type'    => 'thumb'
 				) );
-				$bp->bp_options_title = bp_get_displayed_user_fullname();
+				$bp->bp_options_title  = bp_get_displayed_user_fullname();
 			}
 		}
Index: /trunk/src/includes/extend/buddypress/notifications.php
===================================================================
--- /trunk/src/includes/extend/buddypress/notifications.php	(revision 7005)
+++ /trunk/src/includes/extend/buddypress/notifications.php	(revision 7006)
@@ -93,6 +93,6 @@
 		$filter = 'bbp_single_new_subscription_notification';
 		$text   = ! empty( $secondary_item_id )
-			? sprintf( esc_html__( 'You have %d new reply to %2$s from %3$s', 'bbpress' ), $action_item_count, $topic_title, bp_core_get_user_displayname( $secondary_item_id ) )
-			: sprintf( esc_html__( 'You have %d new reply to %s',             'bbpress' ), $action_item_count, $topic_title );
+			? sprintf( esc_html__( 'You have %1$d new reply to %2$s from %3$s', 'bbpress' ), $action_item_count, $topic_title, bp_core_get_user_displayname( $secondary_item_id ) )
+			: sprintf( esc_html__( 'You have %1$d new reply to %2$s',             'bbpress' ), $action_item_count, $topic_title );
 	}
 
@@ -155,5 +155,5 @@
 	// Notify the topic author if not the current reply author
 	if ( $author_id !== $topic_author_id ) {
-		$args['secondary_item_id'] = $secondary_item_id ;
+		$args['secondary_item_id'] = $secondary_item_id;
 
 		bp_notifications_add_notification( $args );
Index: /trunk/src/includes/forums/template.php
===================================================================
--- /trunk/src/includes/forums/template.php	(revision 7005)
+++ /trunk/src/includes/forums/template.php	(revision 7006)
@@ -1172,5 +1172,5 @@
 		// First link never has view=all
 		$retval = bbp_get_view_all( 'edit_others_topics' )
-			? "<a href='" . esc_url( bbp_remove_view_all( $link ) ) . "'>" . esc_html( $topics ) . "</a>"
+			? "<a href='" . esc_url( bbp_remove_view_all( $link ) ) . "'>" . esc_html( $topics ) . '</a>'
 			: esc_html( $topics );
 
@@ -1187,5 +1187,5 @@
 			// Hidden link
 			$retval .= ! bbp_get_view_all( 'edit_others_topics' )
-				? " <a href='" . esc_url( bbp_add_view_all( $link, true ) ) . "'>" . esc_html( $extra ) . "</a>"
+				? " <a href='" . esc_url( bbp_add_view_all( $link, true ) ) . "'>" . esc_html( $extra ) . '</a>'
 				: " {$extra}";
 		}
@@ -1571,5 +1571,5 @@
 
 		// Adjust the ancestor check based on the count
-		switch( $operator ) {
+		switch ( $operator ) {
 			default:
 			case 'AND':
@@ -2391,5 +2391,5 @@
 		ob_start(); ?>
 
-		<select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ) ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php bbp_tab_index_attribute( $r['tab'] ); ?>>
+		<select name="<?php echo esc_attr( $r['select_id'] ); ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php bbp_tab_index_attribute( $r['tab'] ); ?>>
 
 			<?php foreach ( bbp_get_forum_types( $r['forum_id'] ) as $key => $label ) : ?>
@@ -2477,5 +2477,5 @@
 		ob_start(); ?>
 
-		<select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ) ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php bbp_tab_index_attribute( $r['tab'] ); ?>>
+		<select name="<?php echo esc_attr( $r['select_id'] ); ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php bbp_tab_index_attribute( $r['tab'] ); ?>>
 
 			<?php foreach ( bbp_get_forum_statuses( $r['forum_id'] ) as $key => $label ) : ?>
@@ -2563,5 +2563,5 @@
 		ob_start(); ?>
 
-		<select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ) ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php bbp_tab_index_attribute( $r['tab'] ); ?>>
+		<select name="<?php echo esc_attr( $r['select_id'] ); ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php bbp_tab_index_attribute( $r['tab'] ); ?>>
 
 			<?php foreach ( bbp_get_forum_visibilities( $r['forum_id'] ) as $key => $label ) : ?>
Index: /trunk/src/includes/replies/functions.php
===================================================================
--- /trunk/src/includes/replies/functions.php	(revision 7005)
+++ /trunk/src/includes/replies/functions.php	(revision 7006)
@@ -717,5 +717,5 @@
 
 		// Update counts, etc...
-		do_action( 'bbp_edit_reply', $reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author , true, $reply_to );
+		do_action( 'bbp_edit_reply', $reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author, true, $reply_to );
 
 		/** Revisions *********************************************************/
@@ -731,5 +731,5 @@
 
 		// Update revision log
-		if ( ! empty( $_POST['bbp_log_reply_edit'] ) && ( "1" === $_POST['bbp_log_reply_edit'] ) ) {
+		if ( ! empty( $_POST['bbp_log_reply_edit'] ) && ( '1' === $_POST['bbp_log_reply_edit'] ) ) {
 			$revision_id = wp_save_post_revision( $reply_id );
 			if ( ! empty( $revision_id ) ) {
@@ -822,5 +822,4 @@
 			set_transient( '_bbp_' . bbp_current_author_ip() . '_last_posted', time() );
 		}
-
 	} else {
 		if ( empty( $is_edit ) && ! current_user_can( 'throttle' ) ) {
@@ -2080,5 +2079,5 @@
 	// The texts to search for
 	$search     = array(
-		"FROM {$table_name} " ,
+		"FROM {$table_name} ",
 		"WHERE 1=1  AND {$table_name}.post_parent = {$topic_id}",
 		") AND {$table_name}.post_parent = {$topic_id}"
@@ -2087,5 +2086,5 @@
 	// The texts to replace them with
 	$replace     = array(
-		$search[0] . "FORCE INDEX (PRIMARY, post_parent) " ,
+		$search[0] . 'FORCE INDEX (PRIMARY, post_parent) ',
 		"WHERE 1=1 AND ({$table_name}.ID = {$topic_id} OR {$table_name}.post_parent = {$topic_id})",
 		") AND ({$table_name}.ID = {$topic_id} OR {$table_name}.post_parent = {$topic_id})"
@@ -2147,5 +2146,5 @@
 		<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
 		<link><?php self_link(); ?></link>
-		<description><?php //?></description>
+		<description><?php //?></description><?php // phpcs:ignore ?>
 		<lastBuildDate><?php echo date( 'r' ); ?></lastBuildDate>
 		<generator><?php echo esc_url_raw( 'https://bbpress.org/?v=' . convert_chars( bbp_get_version() ) ); ?></generator>
@@ -2190,5 +2189,5 @@
 					<link><?php bbp_reply_url(); ?></link>
 					<pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>
-					<dc:creator><?php the_author() ?></dc:creator>
+					<dc:creator><?php the_author(); ?></dc:creator>
 
 					<description>
Index: /trunk/src/includes/replies/template.php
===================================================================
--- /trunk/src/includes/replies/template.php	(revision 7005)
+++ /trunk/src/includes/replies/template.php	(revision 7006)
@@ -1529,5 +1529,5 @@
 	 * Return the reply to id of a reply
 	 *
- 	 * @since 2.4.0 bbPress (r4944)
+	 * @since 2.4.0 bbPress (r4944)
 	 *
 	 * @param int $reply_id Optional. Reply id
@@ -2387,5 +2387,5 @@
 			// Several replies in a topic with several pages
 			} else {
-				$retstr = sprintf( _n( 'Viewing %2$s replies (of %4$s total)', 'Viewing %1$s replies - %2$s through %3$s (of %4$s total)', $count_int, 'bbpress' ), $count_num, $from_num, $to_num, $total_num );
+				$retstr = sprintf( _n( 'Viewing %2$s replies (of %4$s total)', 'Viewing %1$s replies - %2$s through %3$s (of %4$s total)', $count_int, 'bbpress' ), $count_num, $from_num, $to_num, $total_num );  //phpcs:ignore
 			}
 
@@ -2399,5 +2399,5 @@
 			// Several posts in a topic with several pages
 			} else {
-				$retstr = sprintf( _n( 'Viewing %2$s post (of %4$s total)', 'Viewing %1$s posts - %2$s through %3$s (of %4$s total)', $count_int, 'bbpress' ), $count_num, $from_num, $to_num, $total_num );
+				$retstr = sprintf( _n( 'Viewing %2$s post (of %4$s total)', 'Viewing %1$s posts - %2$s through %3$s (of %4$s total)', $count_int, 'bbpress' ), $count_num, $from_num, $to_num, $total_num );  //phpcs:ignore
 			}
 		}
@@ -2712,5 +2712,5 @@
 		ob_start(); ?>
 
-		<select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php bbp_tab_index_attribute( $r['tab'] ); ?>>
+		<select name="<?php echo esc_attr( $r['select_id'] ); ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php bbp_tab_index_attribute( $r['tab'] ); ?>>
 
 			<?php foreach ( bbp_get_reply_statuses( $r['reply_id'] ) as $key => $label ) : ?>
Index: /trunk/src/includes/search/template.php
===================================================================
--- /trunk/src/includes/search/template.php	(revision 7005)
+++ /trunk/src/includes/search/template.php	(revision 7006)
@@ -413,5 +413,5 @@
 		// Several pages of results
 		} else {
-			$retstr = sprintf( _n( 'Viewing %2$s results (of %4$s total)', 'Viewing %1$s results - %2$s through %3$s (of %4$s total)', $bbp->search_query->post_count, 'bbpress' ), $bbp->search_query->post_count, $from_num, $to_num, $total_num );
+			$retstr = sprintf( _n( 'Viewing %2$s results (of %4$s total)', 'Viewing %1$s results - %2$s through %3$s (of %4$s total)', $bbp->search_query->post_count, 'bbpress' ), $bbp->search_query->post_count, $from_num, $to_num, $total_num );  //phpcs:ignore
 		}
 
Index: /trunk/src/includes/topics/functions.php
===================================================================
--- /trunk/src/includes/topics/functions.php	(revision 7005)
+++ /trunk/src/includes/topics/functions.php	(revision 7006)
@@ -647,5 +647,5 @@
 
 		// Update counts, etc...
-		do_action( 'bbp_edit_topic', $topic_id, $forum_id, $anonymous_data, $topic_author , true /* Is edit */ );
+		do_action( 'bbp_edit_topic', $topic_id, $forum_id, $anonymous_data, $topic_author, true /* Is edit */ );
 
 		/** Revisions *********************************************************/
@@ -661,5 +661,5 @@
 
 		// Update revision log
-		if ( ! empty( $_POST['bbp_log_topic_edit'] ) && ( "1" === $_POST['bbp_log_topic_edit'] ) )  {
+		if ( ! empty( $_POST['bbp_log_topic_edit'] ) && ( '1' === $_POST['bbp_log_topic_edit'] ) ) {
 			$revision_id = wp_save_post_revision( $topic_id );
 			if ( ! empty( $revision_id ) ) {
@@ -790,4 +790,5 @@
 		}
 
+	// If not anonymous, then
 	} else {
 		if ( empty( $is_edit ) && ! current_user_can( 'throttle' ) ) {
@@ -868,5 +869,5 @@
 
 		// Get the forum ID if none was passed
-		if ( empty( $forum_id )  ) {
+		if ( empty( $forum_id ) ) {
 			$forum_id = bbp_get_topic_forum_id( $topic_id );
 		}
@@ -1195,5 +1196,5 @@
 
 		// Shift the tags if told to
-		if ( ! empty( $_POST['bbp_topic_tags'] ) && ( "1" === $_POST['bbp_topic_tags'] ) ) {
+		if ( ! empty( $_POST['bbp_topic_tags'] ) && ( '1' === $_POST['bbp_topic_tags'] ) ) {
 			wp_set_post_terms( $destination_topic->ID, $source_topic_tags, bbp_get_topic_tag_tax_id(), true );
 		}
@@ -1488,5 +1489,5 @@
 
 	// Copy the subscribers
-	if ( ! empty( $_POST['bbp_topic_subscribers'] ) && "1" === $_POST['bbp_topic_subscribers'] && bbp_is_subscriptions_active() ) {
+	if ( ! empty( $_POST['bbp_topic_subscribers'] ) && '1' === $_POST['bbp_topic_subscribers'] && bbp_is_subscriptions_active() ) {
 
 		// Get the subscribers
@@ -1505,5 +1506,5 @@
 
 	// Copy the favoriters if told to
-	if ( ! empty( $_POST['bbp_topic_favoriters'] ) && ( "1" === $_POST['bbp_topic_favoriters'] ) ) {
+	if ( ! empty( $_POST['bbp_topic_favoriters'] ) && ( '1' === $_POST['bbp_topic_favoriters'] ) ) {
 
 		// Get the favoriters
@@ -1522,5 +1523,5 @@
 
 	// Copy the tags if told to
-	if ( ! empty( $_POST['bbp_topic_tags'] ) && ( "1" === $_POST['bbp_topic_tags'] ) ) {
+	if ( ! empty( $_POST['bbp_topic_tags'] ) && ( '1' === $_POST['bbp_topic_tags'] ) ) {
 
 		// Get the source topic tags
@@ -2135,5 +2136,5 @@
 
 			$is_sticky = bbp_is_topic_sticky( $r['id'] );
-			$is_super  = false === $is_sticky && ! empty( $_GET['super'] ) && ( "1" === $_GET['super'] ) ? true : false;
+			$is_super  = false === $is_sticky && ! empty( $_GET['super'] ) && ( '1' === $_GET['super'] ) ? true : false;
 
 			// Toggle
@@ -3776,5 +3777,5 @@
 		<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
 		<link><?php self_link(); ?></link>
-		<description><?php //?></description>
+		<description><?php //?></description><?php // phpcs:ignore ?>
 		<lastBuildDate><?php echo date( 'r' ); ?></lastBuildDate>
 		<generator><?php echo esc_url_raw( 'https://bbpress.org/?v=' . convert_chars( bbp_get_version() ) ); ?></generator>
@@ -3792,5 +3793,5 @@
 					<link><?php bbp_topic_permalink(); ?></link>
 					<pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_meta( bbp_get_topic_id(), '_bbp_last_active_time', true ), false ); ?></pubDate>
-					<dc:creator><?php the_author() ?></dc:creator>
+					<dc:creator><?php the_author(); ?></dc:creator>
 
 					<?php if ( !post_password_required() ) : ?>
Index: /trunk/src/includes/topics/template.php
===================================================================
--- /trunk/src/includes/topics/template.php	(revision 7005)
+++ /trunk/src/includes/topics/template.php	(revision 7006)
@@ -638,6 +638,6 @@
 			// Default to topic post type name label
 			} else {
-				$tto    = get_post_type_object( bbp_get_topic_post_type() );
-				$title  = $tto->labels->name;
+				$tto   = get_post_type_object( bbp_get_topic_post_type() );
+				$title = $tto->labels->name;
 			}
 		}
@@ -1468,5 +1468,5 @@
 
 			// Filter sections
-			$sections    = apply_filters( 'bbp_get_topic_author_links', $author_links, $r, $args );
+			$sections = apply_filters( 'bbp_get_topic_author_links', $author_links, $r, $args );
 
 			// Assemble sections into author link
@@ -2018,5 +2018,5 @@
 		// First link never has view=all
 		$retval = bbp_get_view_all( 'edit_others_replies' )
-			? "<a href='" . esc_url( bbp_remove_view_all( $link ) ) . "'>" . esc_html( $replies ) . "</a>"
+			? "<a href='" . esc_url( bbp_remove_view_all( $link ) ) . "'>" . esc_html( $replies ) . '</a>'
 			: $replies;
 
@@ -2033,5 +2033,5 @@
 			// Hidden link
 			$retval .= ! bbp_get_view_all( 'edit_others_replies' )
-				? " <a href='" . esc_url( bbp_add_view_all( $link, true ) ) . "'>" . esc_html( $extra ) . "</a>"
+				? " <a href='" . esc_url( bbp_add_view_all( $link, true ) ) . "'>" . esc_html( $extra ) . '</a>'
 				: " {$extra}";
 		}
@@ -2990,5 +2990,5 @@
 			// Several topics in a forum with several pages
 			} else {
-				$retstr = sprintf( _n( 'Viewing topic %2$s (of %4$s total)', 'Viewing %1$s topics - %2$s through %3$s (of %4$s total)', $total_int, 'bbpress' ), $count_num, $from_num, $to_num, $total );
+				$retstr = sprintf( _n( 'Viewing topic %2$s (of %4$s total)', 'Viewing %1$s topics - %2$s through %3$s (of %4$s total)', $total_int, 'bbpress' ), $count_num, $from_num, $to_num, $total );  //phpcs:ignore
 			}
 
@@ -3242,5 +3242,5 @@
 		ob_start(); ?>
 
-		<select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php bbp_tab_index_attribute( $r['tab'] ); ?>>
+		<select name="<?php echo esc_attr( $r['select_id'] ); ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php bbp_tab_index_attribute( $r['tab'] ); ?>>
 
 			<?php foreach ( bbp_get_topic_statuses( $r['topic_id'] ) as $key => $label ) : ?>
Index: /trunk/src/includes/users/capabilities.php
===================================================================
--- /trunk/src/includes/users/capabilities.php	(revision 7005)
+++ /trunk/src/includes/users/capabilities.php	(revision 7006)
@@ -486,6 +486,6 @@
 
 	// Make array of post types to mark as spam
-	$post_types  = array( bbp_get_topic_post_type(), bbp_get_reply_post_type() );
-	$post_types  = "'" . implode( "', '", $post_types ) . "'";
+	$post_types = array( bbp_get_topic_post_type(), bbp_get_reply_post_type() );
+	$post_types = "'" . implode( "', '", $post_types ) . "'";
 
 	// Loop through blogs and remove their posts
Index: /trunk/src/templates/default/bbpress/content-statistics.php
===================================================================
--- /trunk/src/templates/default/bbpress/content-statistics.php	(revision 7005)
+++ /trunk/src/templates/default/bbpress/content-statistics.php	(revision 7006)
Index: /trunk/src/templates/default/bbpress/form-forum.php
===================================================================
--- /trunk/src/templates/default/bbpress/form-forum.php	(revision 7005)
+++ /trunk/src/templates/default/bbpress/form-forum.php	(revision 7006)
@@ -88,5 +88,5 @@
 
 						<p class="form-allowed-tags">
-							<label><?php esc_html_e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:','bbpress' ); ?></label><br />
+							<label><?php esc_html_e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:', 'bbpress' ); ?></label><br />
 							<code><?php bbp_allowed_tags(); ?></code>
 						</p>
Index: /trunk/src/templates/default/bbpress/form-protected.php
===================================================================
--- /trunk/src/templates/default/bbpress/form-protected.php	(revision 7005)
+++ /trunk/src/templates/default/bbpress/form-protected.php	(revision 7006)
Index: /trunk/src/templates/default/bbpress/form-reply.php
===================================================================
--- /trunk/src/templates/default/bbpress/form-reply.php	(revision 7005)
+++ /trunk/src/templates/default/bbpress/form-reply.php	(revision 7006)
@@ -77,5 +77,5 @@
 
 						<p class="form-allowed-tags">
-							<label><?php esc_html_e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:','bbpress' ); ?></label><br />
+							<label><?php esc_html_e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:', 'bbpress' ); ?></label><br />
 							<code><?php bbp_allowed_tags(); ?></code>
 						</p>
Index: /trunk/src/templates/default/bbpress/form-search.php
===================================================================
--- /trunk/src/templates/default/bbpress/form-search.php	(revision 7005)
+++ /trunk/src/templates/default/bbpress/form-search.php	(revision 7006)
@@ -2,5 +2,5 @@
 
 /**
- * Search 
+ * Search
  *
  * @package bbPress
Index: /trunk/src/templates/default/bbpress/form-user-edit.php
===================================================================
--- /trunk/src/templates/default/bbpress/form-user-edit.php	(revision 7005)
+++ /trunk/src/templates/default/bbpress/form-user-edit.php	(revision 7006)
@@ -15,20 +15,20 @@
 <form id="bbp-your-profile" method="post" enctype="multipart/form-data">
 
-	<h2 class="entry-title"><?php esc_html_e( 'Name', 'bbpress' ) ?></h2>
+	<h2 class="entry-title"><?php esc_html_e( 'Name', 'bbpress' ); ?></h2>
 
 	<?php do_action( 'bbp_user_edit_before' ); ?>
 
 	<fieldset class="bbp-form">
-		<legend><?php esc_html_e( 'Name', 'bbpress' ) ?></legend>
+		<legend><?php esc_html_e( 'Name', 'bbpress' ); ?></legend>
 
 		<?php do_action( 'bbp_user_edit_before_name' ); ?>
 
 		<div>
-			<label for="first_name"><?php esc_html_e( 'First Name', 'bbpress' ) ?></label>
+			<label for="first_name"><?php esc_html_e( 'First Name', 'bbpress' ); ?></label>
 			<input type="text" name="first_name" id="first_name" value="<?php bbp_displayed_user_field( 'first_name', 'edit' ); ?>" class="regular-text" />
 		</div>
 
 		<div>
-			<label for="last_name"><?php esc_html_e( 'Last Name', 'bbpress' ) ?></label>
+			<label for="last_name"><?php esc_html_e( 'Last Name', 'bbpress' ); ?></label>
 			<input type="text" name="last_name" id="last_name" value="<?php bbp_displayed_user_field( 'last_name', 'edit' ); ?>" class="regular-text" />
 		</div>
@@ -40,5 +40,5 @@
 
 		<div>
-			<label for="display_name"><?php esc_html_e( 'Display Name', 'bbpress' ) ?></label>
+			<label for="display_name"><?php esc_html_e( 'Display Name', 'bbpress' ); ?></label>
 
 			<?php bbp_edit_user_display_name(); ?>
@@ -50,13 +50,13 @@
 	</fieldset>
 
-	<h2 class="entry-title"><?php esc_html_e( 'Contact Info', 'bbpress' ) ?></h2>
+	<h2 class="entry-title"><?php esc_html_e( 'Contact Info', 'bbpress' ); ?></h2>
 
 	<fieldset class="bbp-form">
-		<legend><?php esc_html_e( 'Contact Info', 'bbpress' ) ?></legend>
+		<legend><?php esc_html_e( 'Contact Info', 'bbpress' ); ?></legend>
 
 		<?php do_action( 'bbp_user_edit_before_contact' ); ?>
 
 		<div>
-			<label for="url"><?php esc_html_e( 'Website', 'bbpress' ) ?></label>
+			<label for="url"><?php esc_html_e( 'Website', 'bbpress' ); ?></label>
 			<input type="text" name="url" id="url" value="<?php bbp_displayed_user_field( 'user_url', 'edit' ); ?>" maxlength="200" class="regular-text code" />
 		</div>
@@ -97,8 +97,8 @@
 	</fieldset>
 
-	<h2 class="entry-title"><?php esc_html_e( 'Account', 'bbpress' ) ?></h2>
+	<h2 class="entry-title"><?php esc_html_e( 'Account', 'bbpress' ); ?></h2>
 
 	<fieldset class="bbp-form">
-		<legend><?php esc_html_e( 'Account', 'bbpress' ) ?></legend>
+		<legend><?php esc_html_e( 'Account', 'bbpress' ); ?></legend>
 
 		<?php do_action( 'bbp_user_edit_before_account' ); ?>
@@ -117,5 +117,5 @@
 
 		<div>
-			<label for="url"><?php esc_html_e( 'Language', 'bbpress' ) ?></label>
+			<label for="url"><?php esc_html_e( 'Language', 'bbpress' ); ?></label>
 
 			<?php bbp_edit_user_language(); ?>
@@ -129,5 +129,5 @@
 	<?php if ( ! bbp_is_user_home_edit() && current_user_can( 'promote_user', bbp_get_displayed_user_id() ) ) : ?>
 
-		<h2 class="entry-title"><?php esc_html_e( 'User Role', 'bbpress' ) ?></h2>
+		<h2 class="entry-title"><?php esc_html_e( 'User Role', 'bbpress' ); ?></h2>
 
 		<fieldset class="bbp-form">
Index: /trunk/src/templates/default/bbpress/form-user-roles.php
===================================================================
--- /trunk/src/templates/default/bbpress/form-user-roles.php	(revision 7005)
+++ /trunk/src/templates/default/bbpress/form-user-roles.php	(revision 7006)
@@ -14,5 +14,5 @@
 
 <div>
-	<label for="role"><?php esc_html_e( 'Blog Role', 'bbpress' ) ?></label>
+	<label for="role"><?php esc_html_e( 'Blog Role', 'bbpress' ); ?></label>
 
 	<?php bbp_edit_user_blog_role(); ?>
@@ -21,5 +21,5 @@
 
 <div>
-	<label for="forum-role"><?php esc_html_e( 'Forum Role', 'bbpress' ) ?></label>
+	<label for="forum-role"><?php esc_html_e( 'Forum Role', 'bbpress' ); ?></label>
 
 	<?php bbp_edit_user_forums_role(); ?>
Index: /trunk/src/templates/default/bbpress/loop-search.php
===================================================================
--- /trunk/src/templates/default/bbpress/loop-search.php	(revision 7005)
+++ /trunk/src/templates/default/bbpress/loop-search.php	(revision 7006)
Index: /trunk/src/templates/default/bbpress/pagination-search.php
===================================================================
--- /trunk/src/templates/default/bbpress/pagination-search.php	(revision 7005)
+++ /trunk/src/templates/default/bbpress/pagination-search.php	(revision 7006)
@@ -2,5 +2,5 @@
 
 /**
- * Pagination for pages of search results 
+ * Pagination for pages of search results
  *
  * @package bbPress
Index: /trunk/src/templates/default/bbpress/user-details.php
===================================================================
--- /trunk/src/templates/default/bbpress/user-details.php	(revision 7005)
+++ /trunk/src/templates/default/bbpress/user-details.php	(revision 7006)
@@ -26,5 +26,5 @@
 	<div id="bbp-user-navigation">
 		<ul>
-			<li class="<?php if ( bbp_is_single_user_profile() ) :?>current<?php endif; ?>">
+			<li class="<?php if ( bbp_is_single_user_profile() ) : ?>current<?php endif; ?>">
 				<span class="vcard bbp-user-profile-link">
 					<a class="url fn n" href="<?php bbp_user_profile_url(); ?>" title="<?php printf( esc_attr__( "%s's Profile", 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?>" rel="me"><?php esc_html_e( 'Profile', 'bbpress' ); ?></a>
@@ -32,5 +32,5 @@
 			</li>
 
-			<li class="<?php if ( bbp_is_single_user_topics() ) :?>current<?php endif; ?>">
+			<li class="<?php if ( bbp_is_single_user_topics() ) : ?>current<?php endif; ?>">
 				<span class='bbp-user-topics-created-link'>
 					<a href="<?php bbp_user_topics_created_url(); ?>" title="<?php printf( esc_attr__( "%s's Topics Started", 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?>"><?php esc_html_e( 'Topics Started', 'bbpress' ); ?></a>
@@ -38,5 +38,5 @@
 			</li>
 
-			<li class="<?php if ( bbp_is_single_user_replies() ) :?>current<?php endif; ?>">
+			<li class="<?php if ( bbp_is_single_user_replies() ) : ?>current<?php endif; ?>">
 				<span class='bbp-user-replies-created-link'>
 					<a href="<?php bbp_user_replies_created_url(); ?>" title="<?php printf( esc_attr__( "%s's Replies Created", 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?>"><?php esc_html_e( 'Replies Created', 'bbpress' ); ?></a>
@@ -45,5 +45,5 @@
 
 			<?php if ( bbp_is_engagements_active() ) : ?>
-				<li class="<?php if ( bbp_is_single_user_engagements() ) :?>current<?php endif; ?>">
+				<li class="<?php if ( bbp_is_single_user_engagements() ) : ?>current<?php endif; ?>">
 					<span class='bbp-user-engagements-created-link'>
 						<a href="<?php bbp_user_engagements_url(); ?>" title="<?php printf( esc_attr__( "%s's Engagements", 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?>"><?php esc_html_e( 'Engagements', 'bbpress' ); ?></a>
@@ -53,5 +53,5 @@
 
 			<?php if ( bbp_is_favorites_active() ) : ?>
-				<li class="<?php if ( bbp_is_favorites() ) :?>current<?php endif; ?>">
+				<li class="<?php if ( bbp_is_favorites() ) : ?>current<?php endif; ?>">
 					<span class="bbp-user-favorites-link">
 						<a href="<?php bbp_favorites_permalink(); ?>" title="<?php printf( esc_attr__( "%s's Favorites", 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?>"><?php esc_html_e( 'Favorites', 'bbpress' ); ?></a>
@@ -63,5 +63,5 @@
 
 				<?php if ( bbp_is_subscriptions_active() ) : ?>
-					<li class="<?php if ( bbp_is_subscriptions() ) :?>current<?php endif; ?>">
+					<li class="<?php if ( bbp_is_subscriptions() ) : ?>current<?php endif; ?>">
 						<span class="bbp-user-subscriptions-link">
 							<a href="<?php bbp_subscriptions_permalink(); ?>" title="<?php printf( esc_attr__( "%s's Subscriptions", 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?>"><?php esc_html_e( 'Subscriptions', 'bbpress' ); ?></a>
@@ -70,5 +70,5 @@
 				<?php endif; ?>
 
-				<li class="<?php if ( bbp_is_single_user_edit() ) :?>current<?php endif; ?>">
+				<li class="<?php if ( bbp_is_single_user_edit() ) : ?>current<?php endif; ?>">
 					<span class="bbp-user-edit-link">
 						<a href="<?php bbp_user_profile_edit_url(); ?>" title="<?php printf( esc_attr__( "Edit %s's Profile", 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?>"><?php esc_html_e( 'Edit', 'bbpress' ); ?></a>
Index: /trunk/src/templates/default/bbpress/user-profile.php
===================================================================
--- /trunk/src/templates/default/bbpress/user-profile.php	(revision 7005)
+++ /trunk/src/templates/default/bbpress/user-profile.php	(revision 7006)
@@ -17,5 +17,5 @@
 	<div class="bbp-user-section">
 		<h3><?php esc_html_e( 'Profile', 'bbpress' ); ?></h3>
-		<p class="bbp-user-forum-role"><?php  printf( esc_html__( 'Registered: %s', 'bbpress' ), bbp_get_time_since( bbp_get_displayed_user_field( 'user_registered' ) ) ); ?></p>
+		<p class="bbp-user-forum-role"><?php printf( esc_html__( 'Registered: %s', 'bbpress' ), bbp_get_time_since( bbp_get_displayed_user_field( 'user_registered' ) ) ); ?></p>
 
 		<?php if ( bbp_get_displayed_user_field( 'description' ) ) : ?>
@@ -27,5 +27,5 @@
 		<?php if ( bbp_get_displayed_user_field( 'user_url' ) ) : ?>
 
-			<p class="bbp-user-website"><?php  printf( esc_html__( 'Website: %s', 'bbpress' ), bbp_rel_nofollow( bbp_make_clickable( bbp_get_displayed_user_field( 'user_url' ) ) ) ); ?></p>
+			<p class="bbp-user-website"><?php printf( esc_html__( 'Website: %s', 'bbpress' ), bbp_rel_nofollow( bbp_make_clickable( bbp_get_displayed_user_field( 'user_url' ) ) ) ); ?></p>
 
 		<?php endif; ?>
