Skip to:
Content

bbPress.org


Ignore:
Timestamp:
11/22/2025 06:05:25 AM (7 months ago)
Author:
johnjamesjacoby
Message:

Tools - Code Improvement: stop ignoring these PHPCS sniffs:

  • Generic.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition
  • Generic.CodeAnalysis.EmptyStatement.DetectedElseif
  • Generic.CodeAnalysis.EmptyStatement.DetectedIf
  • Generic.CodeAnalysis.UselessOverridingMethod.Found
  • Generic.ControlStructures.InlineControlStructure.NotAllowed
  • Generic.Files.LineEndings.InvalidEOLChar
  • Generic.Formatting.DisallowMultipleStatements.SameLine
  • Generic.Formatting.SpaceAfterCast.TooMuchSpace
  • Generic.Functions.OpeningFunctionBraceKernighanRitchie.ContentAfterBrace
  • Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed
  • NormalizedArrays.Arrays.ArrayBraceSpacing.SpaceAfterArrayOpenerMultiLine
  • NormalizedArrays.Arrays.ArrayBraceSpacing.SpaceAfterArrayOpenerSingleLine
  • NormalizedArrays.Arrays.ArrayBraceSpacing.SpaceBeforeArrayCloserMultiLine
  • NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLineCloserSameLine
  • PEAR.Functions.FunctionCallSignature.CloseBracketLine
  • PEAR.Functions.FunctionCallSignature.EmptyLine
  • PEAR.Functions.FunctionCallSignature.Indent
  • PEAR.Functions.FunctionCallSignature.MultipleArguments
  • PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection
  • PHPCompatibility.Syntax.RemovedCurlyBraceArrayAccess.Found
  • PSR2.Classes.ClassDeclaration.CloseBraceAfterBody
  • PSR2.Classes.PropertyDeclaration.ScopeMissing
  • PSR2.Classes.PropertyDeclaration.Underscore
  • PSR2.Classes.PropertyDeclaration.VarUsed
  • PSR2.ControlStructures.ElseIfDeclaration.NotAllowed
  • PSR2.ControlStructures.SwitchDeclaration.BreakIndent
  • PSR2.Methods.MethodDeclaration.Underscore
  • Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace
  • Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterOpen
  • Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingBeforeClose
  • Squiz.Functions.MultiLineFunctionDeclaration.ContentAfterBrace
  • Squiz.PHP.DisallowSizeFunctionsInLoops.Found
  • Squiz.Scope.MethodScope.Missing
  • Squiz.WhiteSpace.SuperfluousWhitespace.EndLine
  • Universal.NamingConventions.NoReservedKeywordParameterNames.arrayFound
  • Universal.NamingConventions.NoReservedKeywordParameterNames.echoFound
  • Universal.NamingConventions.NoReservedKeywordParameterNames.parentFound
  • Universal.Operators.DisallowStandalonePostIncrementDecrement.PostDecrementFound
  • Universal.Operators.DisallowStandalonePostIncrementDecrement.PostIncrementFound
  • Universal.Operators.StrictComparisons.LooseEqual
  • Universal.Operators.StrictComparisons.LooseNotEqual
  • WordPress.Arrays.ArrayKeySpacingRestrictions.TooMuchSpaceAfterKey
  • WordPress.DateTime.CurrentTimeTimestamp.Requested
  • WordPress.DateTime.RestrictedFunctions.date_date
  • WordPress.Files.FileName.NotHyphenatedLowercase
  • WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound
  • WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedConstantFound
  • WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound
  • WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
  • WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
  • WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
  • WordPress.PHP.IniSet.Risky
  • WordPress.PHP.PregQuoteDelimiter.Missing
  • WordPress.PHP.StrictInArray.MissingTrueStrict
  • WordPress.WP.AlternativeFunctions.parse_url_parse_url
  • WordPress.WP.AlternativeFunctions.rand_mt_rand
  • WordPress.WP.AlternativeFunctions.strip_tags_strip_tag
  • WordPress.WP.AlternativeFunctions.strip_tags_strip_tags
  • WordPress.WP.Capabilities.Unknown
  • WordPress.WP.DeprecatedParameters.Get_termsParam2Found
  • WordPress.WP.DeprecatedParameters.Wp_count_termsParam2Found
  • WordPress.WP.DiscouragedFunctions.query_posts_query_posts
  • WordPress.WP.DiscouragedFunctions.wp_reset_query_wp_reset_query
  • WordPress.WP.EnqueuedResourceParameters.NotInFooter
  • WordPress.WP.GlobalVariablesOverride.Prohibited
  • WordPress.WP.I18n.LowLevelTranslationFunction

This commit includes code formatting changes for the above sniffs.

See #3658.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/extend/akismet.php

    r7377 r7378  
    112112
    113113        $user_data['last_active'] = '';
    114         $user_data['registered']  = date( 'Y-m-d H:i:s');
     114        $user_data['registered']  = gmdate( 'Y-m-d H:i:s' );
    115115        $user_data['total_posts'] = (int) bbp_get_user_post_count( $post_data['post_author'] );
    116116
     
    149149            $reply_id = bbp_get_topic_last_reply_id( $post_data['post_parent'] );
    150150            if ( ! empty( $reply_id ) ) {
    151                 $user_data['last_active'] = get_post_field( 'post_date', $reply_id );
     151                $user_data['last_active'] = get_post_field( 'post_date_gmt', $reply_id );
    152152            }
    153153        }
     
    157157
    158158        // Check if the post data is spammy...
    159         $_post = $this->maybe_spam( array(
    160             'comment_author'                 => $user_data['name'],
    161             'comment_author_email'           => $user_data['email'],
    162             'comment_author_url'             => $user_data['website'],
    163             'comment_content'                => $_post_content,
    164             'comment_post_ID'                => $post_data['post_parent'],
    165             'comment_type'                   => $post_data['post_type'],
    166             'comment_total'                  => $user_data['total_posts'],
    167             'comment_last_active_gmt'        => $user_data['last_active'],
    168             'comment_account_registered_gmt' => $user_data['registered'],
    169             'permalink'                      => $post_permalink,
    170             'referrer'                       => wp_get_raw_referer(),
    171             'user_agent'                     => bbp_current_author_ua(),
    172             'user_ID'                        => $post_data['post_author'],
    173             'user_ip'                        => bbp_current_author_ip(),
    174             'user_role'                      => $this->get_user_roles( $post_data['post_author'] ),
    175         ) );
     159        $_post = $this->maybe_spam(
     160            array(
     161                'comment_author'                 => $user_data['name'],
     162                'comment_author_email'           => $user_data['email'],
     163                'comment_author_url'             => $user_data['website'],
     164                'comment_content'                => $_post_content,
     165                'comment_post_ID'                => $post_data['post_parent'],
     166                'comment_type'                   => $post_data['post_type'],
     167                'comment_total'                  => $user_data['total_posts'],
     168                'comment_last_active_gmt'        => $user_data['last_active'],
     169                'comment_account_registered_gmt' => $user_data['registered'],
     170                'permalink'                      => $post_permalink,
     171                'referrer'                       => wp_get_raw_referer(),
     172                'user_agent'                     => bbp_current_author_ua(),
     173                'user_ID'                        => $post_data['post_author'],
     174                'user_ip'                        => bbp_current_author_ip(),
     175                'user_role'                      => $this->get_user_roles( $post_data['post_author'] ),
     176            )
     177        );
    176178
    177179        // Set the results (from maybe_spam() above)
     
    984986                            <tr>
    985987                                <td style="color: #999; text-align: right; white-space: nowrap;">
    986                                     <span title="<?php echo esc_attr( date( 'D d M Y @ h:i:m a', $row['time'] ) . ' GMT' ); ?>">
     988                                    <span title="<?php echo esc_attr( gmdate( 'D d M Y @ h:i:m a', $row['time'] ) . ' GMT' ); ?>">
    987989                                        <?php bbp_time_since( $row['time'], false, true ); ?>
    988990                                    </span>
Note: See TracChangeset for help on using the changeset viewer.