Skip to:
Content

bbPress.org

Changeset 7006


Ignore:
Timestamp:
11/24/2019 01:38:37 PM (2 weeks ago)
Author:
netweb
Message:

Build Tools: Add PHPCS with custom bbPress ruleset

  • This changeset adds an initial bbPress PHPCS ruleset
  • Future iteration of the rules in the ruleset can follow later
  • To run the PHPCS check run `grunt phpcs

Fixes #3294.

Location:
trunk
Files:
1 added
51 edited

Legend:

Unmodified
Added
Removed
  • trunk/.gitignore

    r6498 r7006  
    99/node_modules
    1010/npm-debug.log
     11.phpcscache
    1112
    1213# Output directory.
  • trunk/Gruntfile.js

    r6912 r7006  
    222222            }
    223223        },
     224        phpcs: {
     225            'default': {
     226                cmd: 'phpcs',
     227                args: [ '--standard=phpcs.xml.dist', '--report-summary', '--report-source', '--cache=.phpcscache' ]
     228            }
     229        },
    224230        phpunit: {
    225231            'default': {
     
    390396    grunt.registerTask( 'release', [ 'build' ] );
    391397
     398    // PHPCS test task.
     399    grunt.registerMultiTask( 'phpcs', 'Runs PHPCS tests.', function() {
     400        grunt.util.spawn( {
     401            cmd:  this.data.cmd,
     402            args: this.data.args,
     403            opts: { stdio: 'inherit' }
     404        }, this.async() );
     405    } );
     406
    392407    // PHPUnit test task.
    393408    grunt.registerMultiTask( 'phpunit', 'Runs PHPUnit tests, including the BuddyPress and multisite tests.', function() {
  • trunk/src/bbpress.php

    r6967 r7006  
    170170     * @since 2.1.0 bbPress (r3951)
    171171     */
    172     public function __set( $key , $value ) { $this->data[ $key ] = $value; }
     172    public function __set( $key, $value ) { $this->data[ $key ] = $value; }
    173173
    174174    /**
     
    551551                'menu_icon'           => '',
    552552                'source'              => 'bbpress',
    553             )
    554         ) );
     553            ) )
     554        );
    555555
    556556        /** Replies ***********************************************************/
  • trunk/src/includes/admin/classes/class-bbp-admin.php

    r6937 r7006  
    236236            $bbp_dashicon = '<span class="bbpress-logo-icon"></span>';
    237237            $message      = $bbp_dashicon . sprintf(
    238                 esc_html__( 'bbPress requires a manual database upgrade. %s or %s.', 'bbpress' ),
     238                esc_html__( 'bbPress requires a manual database upgrade. %1$s or %1$s.', 'bbpress' ),
    239239                $upgrade_link,
    240240                $dismiss_link
     
    325325        // Messages as objects
    326326        } elseif ( is_wp_error( $message ) ) {
    327             $errors  = $message->get_error_messages();
     327            $errors = $message->get_error_messages();
    328328
    329329            switch ( count( $errors ) ) {
     
    914914        if ( ! empty( $topics ) ) {
    915915            foreach ( (array) $topics as $post ) {
    916                 printf( esc_html__( '%s - %s', 'bbpress' ), bbp_get_topic_id( $post->ID ), bbp_get_topic_title( $post->ID ) . "\n" );
     916                printf( esc_html__( '%1$s - %2$s', 'bbpress' ), bbp_get_topic_id( $post->ID ), bbp_get_topic_title( $post->ID ) . "\n" );
    917917            }
    918918        }
     
    951951        if ( ! empty( $users_query->results ) ) {
    952952            foreach ( (array) $users_query->results as $user ) {
    953                 printf( esc_html__( '%s - %s', 'bbpress' ), bbp_get_user_id( $user->ID ), bbp_get_user_nicename( $user->ID, array( 'force' => $user->user_nicename ) ) . "\n" );
     953                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" );
    954954            }
    955955        }
     
    13361336                        <!--
    13371337                        function nextpage() {
    1338                             location.href = 'update-core.php?page=bbpress-update&action=bbpress-update&n=<?php echo ( $n + 5 ) ?>';
     1338                            location.href = 'update-core.php?page=bbpress-update&action=bbpress-update&n=<?php echo ( $n + 5 ); ?>';
    13391339                        }
    13401340                        setTimeout( 'nextpage()', 250 );
  • trunk/src/includes/admin/classes/class-bbp-converter-base.php

    r6832 r7006  
    392392
    393393                    // No 'WHERE' in expression
    394                     if ( stripos( $from_tablename, "WHERE" ) === false ) {
     394                    if ( stripos( $from_tablename, 'WHERE' ) === false ) {
    395395                        $from_tablename .= ' ' . $item['from_expression'];
    396396
    397397                    // 'WHERE' in expression, so replace with 'AND'
    398398                    } else {
    399                         $from_tablename .= ' ' . str_replace( "WHERE", "AND", $item['from_expression'] );
     399                        $from_tablename .= ' ' . str_replace( 'WHERE', 'AND', $item['from_expression'] );
    400400                    }
    401401                }
     
    533533                            case 'tags' :
    534534                                $post_id = wp_set_object_terms( $insert_postmeta['objectid'], $insert_postmeta['name'], 'topic-tag', true );
    535                                 $term = get_term_by( 'name', $insert_postmeta['name'], 'topic-tag');
     535                                $term    = get_term_by( 'name', $insert_postmeta['name'], 'topic-tag');
    536536                                if ( false !== $term ) {
    537537                                    wp_update_term( $term->term_id, 'topic-tag', array(
  • trunk/src/includes/admin/classes/class-bbp-topic-replies-list-table.php

    r6770 r7006  
    331331        // Hierarchy
    332332        if ( ! empty( $item->post_parent ) ) {
    333             $count    = count( get_post_ancestors( $item->ID ) );
    334             $classes .= ' level-'. $count;
     333            $count    = count( get_post_ancestors( $item->ID ) );
     334            $classes .= ' level-'. $count;
    335335        } else {
    336             $classes .= ' level-0';
     336            $classes .= ' level-0';
    337337        } ?>
    338338
  • trunk/src/includes/admin/converters/Invision.php

    r6670 r7006  
    541541
    542542    private function to_char( $input ) {
    543         $output = "";
     543        $output = '';
    544544        for ( $i = 0; $i < strlen( $input ); $i++ ) {
    545545            $j = ord( $input{$i} );
    546546            if ( ( $j >= 65 && $j <= 90 )
    547547                || ( $j >= 97 && $j <= 122 )
    548                 || ( $j >= 48 && $j <= 57 ) )
    549             {
     548                || ( $j >= 48 && $j <= 57 ) ) {
    550549                $output .= $input{$i};
    551550            } else {
    552                 $output .= "&#" . ord( $input{$i} ) . ";";
     551                $output .= '&#' . ord( $input{$i} ) . '';
    553552            }
    554553        }
  • trunk/src/includes/admin/converters/Kunena2.php

    r6670 r7006  
    299299         */
    300300
    301         /** Reply Section *****************************************************/
     301        /** Reply Section *****************************************************/
    302302
    303303        // Old reply id (Stored in postmeta)
  • trunk/src/includes/admin/converters/Mingle.php

    r6670 r7006  
    2828     * Sets up the field mappings
    2929     */
    30     public function setup_globals() {
     30    public function setup_globals() {
    3131
    3232        // Setup smiley URL & path
  • trunk/src/includes/admin/converters/SMF.php

    r6670 r7006  
    741741
    742742        // Replace '[quote]' with '<blockquote>'
    743         $SMF_markup = preg_replace( '/\[quote\]/',        '<blockquote>',  $SMF_markup );
     743        $SMF_markup = preg_replace( '/\[quote\]/',       '<blockquote>',  $SMF_markup );
    744744        // Replace '[quote ($1)]' with '<blockquote>"
    745         $SMF_markup = preg_replace( '/\[quote (.*?)\]/' , '<blockquote>',  $SMF_markup );
     745        $SMF_markup = preg_replace( '/\[quote (.*?)\]/', '<blockquote>',  $SMF_markup );
    746746        // Replace '[/quote]' with '</blockquote>'
    747         $SMF_markup = preg_replace( '/\[\/quote\]/',      '</blockquote>', $SMF_markup );
     747        $SMF_markup = preg_replace( '/\[\/quote\]/',     '</blockquote>', $SMF_markup );
    748748
    749749        // Replace '[glow]' with ''
  • trunk/src/includes/admin/converters/SimplePress5.php

    r6670 r7006  
    587587
    588588        // Replace any SimplePress smilies from path '/sp-resources/forum-smileys/sf-smily.gif' with the equivelant WordPress Smilie
    589         $simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-confused\.gif(.*?)\" \/>/',     ':?' ,     $simplepress_markup );
     589        $simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-confused\.gif(.*?)\" \/>/',     ':?',      $simplepress_markup );
    590590        $simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-cool\.gif(.*?)\" \/>/',        ':cool:',   $simplepress_markup );
    591591        $simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-cry\.gif(.*?)\" \/>/',         ':cry:',    $simplepress_markup );
    592         $simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-embarassed\.gif(.*?)\" \/>/' , ':oops:',   $simplepress_markup );
     592        $simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-embarassed\.gif(.*?)\" \/>/', ':oops:',   $simplepress_markup );
    593593        $simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-frown\.gif(.*?)\" \/>/',       ':(',       $simplepress_markup );
    594594        $simplepress_markup = preg_replace( '/\<img src=(.*?)\/sp-resources\/forum-smileys\/sf-kiss\.gif(.*?)\" \/>/',        ':P',       $simplepress_markup );
     
    600600
    601601        // Replace '<div class="sfcode">example code</div>' with '<code>*</code>'
    602         $simplepress_markup = preg_replace( '/\<div class\=\"sfcode\"\>(.*?)\<\/div\>/' , '<code>$1</code>' , $simplepress_markup );
     602        $simplepress_markup = preg_replace( '/\<div class\=\"sfcode\"\>(.*?)\<\/div\>/', '<code>$1</code>', $simplepress_markup );
    603603
    604604        // Replace '<strong>username said </strong>' with '@username said:'
  • trunk/src/includes/admin/converters/XenForo.php

    r6749 r7006  
    698698    public function authenticate_pass( $password, $serialized_pass ) {
    699699        $pass_array = unserialize( $serialized_pass );
    700         switch( $pass_array['hashFunc'] ) {
     700        switch ( $pass_array['hashFunc'] ) {
    701701            case 'sha256':
    702702                return ( $pass_array['hash'] == hash( 'sha256', hash( 'sha256', $password ) . $pass_array['salt'] ) );
  • trunk/src/includes/admin/converters/e107v1.php

    r6670 r7006  
    613613        $e107v1_markup = preg_replace( '/\[quote(.*?)=(.*?)\]/', '<em>@$2 wrote:</em><blockquote>', $e107v1_markup );
    614614        // Replace '[/quote$1]' with '</blockquote>"
    615         $e107v1_markup = preg_replace( '/\[\/quote(.*?)\]/' ,    '</blockquote>',                   $e107v1_markup );
     615        $e107v1_markup = preg_replace( '/\[\/quote(.*?)\]/',     '</blockquote>',                   $e107v1_markup );
    616616
    617617        // Remove '[justify]'
  • trunk/src/includes/admin/converters/phpBB.php

    r6809 r7006  
    830830            }
    831831
    832             $output .= $itoa64[($value >> 18) & 0x3f];
     832            $output .= $itoa64[( $value >> 18 ) & 0x3f];
    833833        } while ( $i < $count );
    834834
  • trunk/src/includes/admin/converters/vBulletin3.php

    r6766 r7006  
    641641     */
    642642    public function callback_savepass( $field, $row ) {
    643         $pass_array = array( 'hash'  => $field, 'salt'  => $row['salt'] );
     643        $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
    644644        return $pass_array;
    645645    }
     
    737737        $vbulletin_markup = preg_replace( '/\[QUOTE\]/', '<blockquote>', $vbulletin_markup );
    738738        // Replace '[QUOTE=User Name($1);PostID($2)]' with '<em>@$1 $2 wrote:</em><blockquote>"
    739         $vbulletin_markup = preg_replace( '/\[QUOTE=(.*?);(.*?)\]/' , '<em>@$1 $2 wrote:</em><blockquote>', $vbulletin_markup );
     739        $vbulletin_markup = preg_replace( '/\[QUOTE=(.*?);(.*?)\]/', '<em>@$1 $2 wrote:</em><blockquote>', $vbulletin_markup );
    740740        // Replace '[/QUOTE]' with '</blockquote>'
    741741        $vbulletin_markup = preg_replace( '/\[\/QUOTE\]/', '</blockquote>', $vbulletin_markup );
  • trunk/src/includes/admin/forums.php

    r6989 r7006  
    540540            'bbp_forum_mods'        => esc_html__( 'Moderators', 'bbpress' ),
    541541            'author'                => esc_html__( 'Creator',    'bbpress' ),
    542             'bbp_forum_created'     => esc_html__( 'Created' ,   'bbpress' ),
     542            'bbp_forum_created'     => esc_html__( 'Created',    'bbpress' ),
    543543            'bbp_forum_freshness'   => esc_html__( 'Last Post',  'bbpress' )
    544544        );
     
    694694        // Messages array
    695695        $messages[ $this->post_type ] = array(
    696             0 =>  '', // Left empty on purpose
     696            0 => '', // Left empty on purpose
    697697
    698698            // Updated
    699             1 =>  sprintf(
     699            1 => sprintf(
    700700                '%1$s <a href="%2$s">%3$s</a>',
    701701                esc_html__( 'Forum updated.', 'bbpress' ),
  • trunk/src/includes/admin/metaboxes.php

    r6924 r7006  
    316316    <p>
    317317        <strong class="label"><?php esc_html_e( 'Type:', 'bbpress' ); ?></strong>
    318         <label class="screen-reader-text" for="bbp_forum_type_select"><?php esc_html_e( 'Type:', 'bbpress' ) ?></label>
     318        <label class="screen-reader-text" for="bbp_forum_type_select"><?php esc_html_e( 'Type:', 'bbpress' ); ?></label>
    319319        <?php bbp_form_forum_type_dropdown( array( 'forum_id' => $post->ID ) ); ?>
    320320    </p>
     
    328328    <p>
    329329        <strong class="label"><?php esc_html_e( 'Status:', 'bbpress' ); ?></strong>
    330         <label class="screen-reader-text" for="bbp_forum_status_select"><?php esc_html_e( 'Status:', 'bbpress' ) ?></label>
     330        <label class="screen-reader-text" for="bbp_forum_status_select"><?php esc_html_e( 'Status:', 'bbpress' ); ?></label>
    331331        <?php bbp_form_forum_status_dropdown( array( 'forum_id' => $post->ID ) ); ?>
    332332    </p>
     
    340340    <p>
    341341        <strong class="label"><?php esc_html_e( 'Visibility:', 'bbpress' ); ?></strong>
    342         <label class="screen-reader-text" for="bbp_forum_visibility_select"><?php esc_html_e( 'Visibility:', 'bbpress' ) ?></label>
     342        <label class="screen-reader-text" for="bbp_forum_visibility_select"><?php esc_html_e( 'Visibility:', 'bbpress' ); ?></label>
    343343        <?php bbp_form_forum_visibility_dropdown( array( 'forum_id' => $post->ID ) ); ?>
    344344    </p>
  • trunk/src/includes/admin/replies.php

    r6850 r7006  
    270270
    271271        $sendback = remove_query_arg( array( 'spam', 'unspam' ), $sendback );
    272         $updated = $locked = 0;
     272        $updated  = $locked = 0;
    273273
    274274        if ( 'spam' === $doaction ) {
     
    814814            // Show the 'spam' link on published and pending replies and 'not spam' on spammed replies
    815815            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 ) ) {
    816                 $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 );
     816                $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 );
    817817                if ( ! bbp_is_reply_spam( $reply->ID ) ) {
    818                     $actions['spam'] = '<a href="' . esc_url( $spam_uri ) . '" title="' . esc_attr__( 'Mark this reply as spam',    'bbpress' ) . '">' . esc_html__( 'Spam',     'bbpress' ) . '</a>';
     818                    $actions['spam']   = '<a href="' . esc_url( $spam_uri ) . '" title="' . esc_attr__( 'Mark this reply as spam',    'bbpress' ) . '">' . esc_html__( 'Spam',     'bbpress' ) . '</a>';
    819819                } else {
    820820                    $actions['unspam'] = '<a href="' . esc_url( $spam_uri ) . '" title="' . esc_attr__( 'Mark the reply as not spam', 'bbpress' ) . '">' . esc_html__( 'Not Spam', 'bbpress' ) . '</a>';
     
    829829            if ( bbp_get_trash_status_id() === $reply->post_status ) {
    830830                $post_type_object   = get_post_type_object( bbp_get_reply_post_type() );
    831                 $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>";
     831                $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>';
    832832            } elseif ( ! empty( $trash_days ) ) {
    833                 $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>";
     833                $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>';
    834834            }
    835835
    836836            if ( ( bbp_get_trash_status_id() === $reply->post_status ) || empty( $trash_days ) ) {
    837                 $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>";
     837                $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>';
    838838            }
    839839        }
     
    964964        // Messages array
    965965        $messages[ $this->post_type ] = array(
    966             0 =>  '', // Left empty on purpose
     966            0 => '', // Left empty on purpose
    967967
    968968            // Updated
    969             1 =>  sprintf(
     969            1 => sprintf(
    970970                '%1$s <a href="%2$s">%3$s</a>',
    971971                esc_html__( 'Reply updated.', 'bbpress' ),
  • trunk/src/includes/admin/settings.php

    r6967 r7006  
    969969    if ( ! empty( $theme_options ) ) : ?>
    970970
    971         <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>
     971        <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>
    972972        <label for="_bbp_theme_package_id"><?php esc_html_e( 'will serve all bbPress templates', 'bbpress' ); ?></label>
    973973
     
    14651465        // Button & text
    14661466        $button = '<a href="' . esc_url( $new_url ) . '">' . esc_html__( 'create a new one', 'bbpress' ) . '</a>';
    1467         $text   = esc_html__( 'Use %s to contain your group forums, or %s', 'bbpress' );
     1467        $text   = esc_html__( 'Use %s to contain your group forums, or %s', 'bbpress' ); //phpcs:ignore
    14681468    } else {
    14691469        $text = esc_html__( 'Use %s to contain your group forums', 'bbpress' );
     
    15181518
    15191519    <div class="wrap">
    1520         <h1 class="wp-heading-inline"><?php esc_html_e( 'Forums Settings', 'bbpress' ) ?></h1>
     1520        <h1 class="wp-heading-inline"><?php esc_html_e( 'Forums Settings', 'bbpress' ); ?></h1>
    15211521        <hr class="wp-header-end">
    15221522
     
    15681568    } ?>
    15691569
    1570     <select name="_bbp_converter_platform" id="_bbp_converter_platform"><?php echo $options ?></select>
     1570    <select name="_bbp_converter_platform" id="_bbp_converter_platform"><?php echo $options; ?></select>
    15711571    <p class="description"><?php esc_html_e( 'The previous forum software', 'bbpress' ); ?></p>
    15721572
     
    17931793    // Starting or continuing?
    17941794    $progress_text = ! empty( $step )
    1795         ? sprintf( esc_html__( 'Previously stopped at step %d of %d', 'bbpress' ), $step, $max )
     1795        ? sprintf( esc_html__( 'Previously stopped at step %1$d of %2$d', 'bbpress' ), $step, $max )
    17961796        : esc_html__( 'Ready to go.', 'bbpress' ); ?>
    17971797
     
    19581958 * @param bool $slug
    19591959 */
    1960 function bbp_form_option( $option, $default = '' , $slug = false ) {
     1960function bbp_form_option( $option, $default = '', $slug = false ) {
    19611961    echo bbp_get_form_option( $option, $default, $slug );
    19621962}
  • trunk/src/includes/admin/tools.php

    r6976 r7006  
    2828
    2929    <div class="card">
    30         <h3 class="title"><?php esc_html_e( 'Forums', 'bbpress' ) ?></h3>
     30        <h3 class="title"><?php esc_html_e( 'Forums', 'bbpress' ); ?></h3>
    3131        <p><?php esc_html_e( 'bbPress provides the following tools to help you manage your forums:', 'bbpress' ); ?></p>
    3232
  • trunk/src/includes/admin/tools/common.php

    r6934 r7006  
    220220
    221221    // Get tools
    222     $tools  = bbp_get_admin_repair_tools( bbp_get_admin_repair_tool_page_id() );
     222    $tools = bbp_get_admin_repair_tools( bbp_get_admin_repair_tool_page_id() );
    223223
    224224    // Loop through tools
     
    312312
    313313    // Get tools
    314     $tools  = bbp_get_admin_repair_tools( bbp_get_admin_repair_tool_page_id() );
     314    $tools = bbp_get_admin_repair_tools( bbp_get_admin_repair_tool_page_id() );
    315315
    316316    // Loop through tools
     
    525525
    526526    // Overhead
    527     $overhead  = ! empty( $_GET['overhead'] )
     527    $overhead = ! empty( $_GET['overhead'] )
    528528        ? sanitize_key( $_GET['overhead'] )
    529529        : '';
  • trunk/src/includes/admin/tools/repair.php

    r6934 r7006  
    426426
    427427    if ( is_wp_error( $bbp_db->query( $sql_delete ) ) ) {
    428         return array( 1, sprintf( $statement, $result ) );
     428        return array( 1, sprintf( $statement, $result ) );
    429429    }
    430430
     
    468468
    469469    if ( is_wp_error( $bbp_db->query( $sql_delete ) ) ) {
    470         return array( 1, sprintf( $statement, $result ) );
     470        return array( 1, sprintf( $statement, $result ) );
    471471    }
    472472
     
    992992    }
    993993
    994     // Loop through forums
    995     foreach ( $forums as $forum_id ) {
     994    // Loop through forums
     995    foreach ( $forums as $forum_id ) {
    996996        if ( ! bbp_is_forum_category( $forum_id ) ) {
    997997            bbp_update_forum( array( 'forum_id' => $forum_id ) );
     
    11071107
    11081108        // If we don't have a postmeta _bbp_status value
    1109         if( empty( $topic_status ) ) {
     1109        if ( empty( $topic_status ) ) {
    11101110            update_post_meta( $closed_topic, '_bbp_status', 'publish' );
    11111111            ++$changed; // Keep a count to display at the end
  • trunk/src/includes/admin/tools/reset.php

    r6896 r7006  
    3030                <tbody>
    3131                    <tr valign="top">
    32                         <th scope="row"><?php esc_html_e( 'The following data will be removed:', 'bbpress' ) ?></th>
     32                        <th scope="row"><?php esc_html_e( 'The following data will be removed:', 'bbpress' ); ?></th>
    3333                        <td>
    3434                            <?php esc_html_e( 'All Forums',           'bbpress' ); ?><br />
  • trunk/src/includes/admin/tools/upgrade.php

    r6990 r7006  
    386386
    387387    // Complete results
    388     $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 ) );
     388    $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 ) );
    389389    return array( 0, sprintf( $statement, $result ) );
    390390}
  • trunk/src/includes/admin/topics.php

    r6850 r7006  
    275275
    276276        $sendback = remove_query_arg( array( 'spam', 'unspam' ), $sendback );
    277         $updated = $locked = 0;
     277        $updated  = $locked = 0;
    278278
    279279        if ( 'spam' === $doaction ) {
     
    619619
    620620                $is_sticky = bbp_is_topic_sticky( $topic_id );
    621                 $is_super  = ( false === $is_sticky ) && ! empty( $_GET['super'] ) && ( "1" === $_GET['super'] )
     621                $is_super  = ( false === $is_sticky ) && ! empty( $_GET['super'] ) && ( '1' === $_GET['super'] )
    622622                    ? true
    623623                    : false;
     
    693693        // Bail if no topic_id or notice
    694694        $topic_id = bbp_get_topic_id( $_GET['topic_id'] );
    695         if (  empty( $topic_id ) ) {
     695        if ( empty( $topic_id ) ) {
    696696            return;
    697697        }
     
    10331033            if ( bbp_get_trash_status_id() === $topic->post_status ) {
    10341034                $post_type_object   = get_post_type_object( bbp_get_topic_post_type() );
    1035                 $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>";
     1035                $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>';
    10361036            } elseif ( ! empty( $trash_days ) ) {
    1037                 $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>";
     1037                $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>';
    10381038            }
    10391039
    10401040            if ( ( bbp_get_trash_status_id() === $topic->post_status ) || empty( $trash_days ) ) {
    1041                 $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>";
     1041                $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>';
    10421042            }
    10431043        }
     
    11681168        // Messages array
    11691169        $messages[ $this->post_type ] = array(
    1170             0 =>  '', // Left empty on purpose
     1170            0 => '', // Left empty on purpose
    11711171
    11721172            // Updated
    1173             1 =>  sprintf(
     1173            1 => sprintf(
    11741174                '%1$s <a href="%2$s">%3$s</a>',
    11751175                esc_html__( 'Topic updated.', 'bbpress' ),
  • trunk/src/includes/admin/users.php

    r6817 r7006  
    162162        ?>
    163163
    164         <label class="screen-reader-text" for="<?php echo $select_id; ?>"><?php esc_html_e( 'Change forum role to&hellip;', 'bbpress' ) ?></label>
     164        <label class="screen-reader-text" for="<?php echo $select_id; ?>"><?php esc_html_e( 'Change forum role to&hellip;', 'bbpress' ); ?></label>
    165165        <select name="<?php echo $select_id; ?>" id="<?php echo $select_id; ?>" style="display:inline-block; float:none;">
    166             <option value=''><?php esc_html_e( 'Change forum role to&hellip;', 'bbpress' ) ?></option>
     166            <option value=''><?php esc_html_e( 'Change forum role to&hellip;', 'bbpress' ); ?></option>
    167167            <?php foreach ( $dynamic_roles as $role => $details ) : ?>
    168168                <option value="<?php echo esc_attr( $role ); ?>"><?php echo bbp_translate_user_role( $details['name'] ); ?></option>
  • trunk/src/includes/common/engagements.php

    r7005 r7006  
    811811        // Try to delete caches, but only if everything else succeeded
    812812        if ( ! empty( $retval ) && ! empty( $object_ids ) ) {
    813             foreach( $object_ids as $object_id ) {
     813            foreach ( $object_ids as $object_id ) {
    814814                $this->cache_delete( $meta_key, $object_id );
    815815            }
  • trunk/src/includes/common/formatting.php

    r6924 r7006  
    9797 */
    9898function bbp_kses_data( $data = '' ) {
    99     return wp_kses( $data , bbp_kses_allowed_tags() );
     99    return wp_kses( $data, bbp_kses_allowed_tags() );
    100100}
    101101
     
    112112function bbp_code_trick( $content = '' ) {
    113113    $content = str_replace( array( "\r\n", "\r" ), "\n", $content );
    114     $content = preg_replace_callback( "|(`)(.*?)`|",      'bbp_encode_callback', $content );
     114    $content = preg_replace_callback('|(`)(.*?)`|',      'bbp_encode_callback', $content );
    115115    $content = preg_replace_callback( "!(^|\n)`(.*?)`!s", 'bbp_encode_callback', $content );
    116116
     
    131131    // Setup variables
    132132    $openers = array( '<p>', '<br />' );
    133     $content = preg_replace_callback( "!(<pre><code>|<code>)(.*?)(</code></pre>|</code>)!s", 'bbp_decode_callback', $content );
     133    $content = preg_replace_callback( '!(<pre><code>|<code>)(.*?)(</code></pre>|</code>)!s', 'bbp_decode_callback', $content );
    134134
    135135    // Do the do
     
    197197
    198198    // Trim inline code, not pre blocks (to prevent removing indentation)
    199     if ( "`" === $matches[1] ) {
     199    if ( '`' === $matches[1] ) {
    200200        $content = trim( $matches[2] );
    201201    } else {
     
    215215
    216216    // Wrap blocks in pre tags
    217     if ( "`" !== $matches[1] ) {
     217    if ('`' !== $matches[1] ) {
    218218        $content = "\n<pre>" . $content . "</pre>\n";
    219219    }
     
    235235    // Setup variables
    236236    $trans_table = array_flip( get_html_translation_table( HTML_ENTITIES ) );
    237     $amps        = array( '&#38;','&#038;', '&amp;' );
    238     $single      = array( '&#39;','&#039;'          );
     237    $amps        = array( '&#38;', '&#038;', '&amp;' );
     238    $single      = array( '&#39;', '&#039;'          );
    239239    $content     = $matches[2];
    240240    $content     = strtr( $content, $trans_table );
     
    314314    // Bail on links that match the current domain
    315315    if ( preg_match( '%href=["\'](' . preg_quote( set_url_scheme( $home_url, 'http'  ) ) . ')%i', $text ) ||
    316         preg_match( '%href=["\'](' . preg_quote( set_url_scheme( $home_url, 'https' ) ) . ')%i', $text )
     316        preg_match( '%href=["\'](' . preg_quote( set_url_scheme( $home_url, 'https' ) ) . ')%i', $text )
    317317    ) {
    318318        return "<a {$text}>";
     
    393393
    394394    // Cleanup of accidental links within links
    395     return preg_replace( '#(<a([ \r\n\t]+[^>]+?>|>))<a [^>]+?>([^>]+?)</a>([^<]*)</a>#i', "$1$3$4</a>", $r );
     395    return preg_replace( '#(<a([ \r\n\t]+[^>]+?>|>))<a [^>]+?>([^>]+?)</a>([^<]*)</a>#i', '$1$3$4</a>', $r );
    396396}
    397397
  • trunk/src/includes/common/functions.php

    r6974 r7006  
    177177    // Is the post by an anonymous user?
    178178    if ( ( bbp_get_topic_post_type() === $data['post_type'] && ! bbp_is_topic_anonymous( $postarr['ID'] ) ) ||
    179         ( bbp_get_reply_post_type() === $data['post_type'] && ! bbp_is_reply_anonymous( $postarr['ID'] ) ) ) {
     179        ( bbp_get_reply_post_type() === $data['post_type'] && ! bbp_is_reply_anonymous( $postarr['ID'] ) ) ) {
    180180        return $data;
    181181    }
     
    223223            $lockable = "+{$minutes} minutes";
    224224            if ( true === $utc ) {
    225                 $lockable .= " UTC";
     225                $lockable .= ' UTC';
    226226            }
    227227
     
    714714    // Prepare duplicate check query
    715715    $query  = "SELECT ID FROM {$bbp_db->posts} {$join}";
    716     $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'] );
     716    $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'] );
    717717    $query .= ! empty( $r['post_parent'] )
    718         ? $bbp_db->prepare( " AND post_parent = %d", $r['post_parent'] )
     718        ? $bbp_db->prepare( ' AND post_parent = %d', $r['post_parent'] )
    719719        : '';
    720720    $query .= $where;
    721     $query .= " LIMIT 1";
     721    $query .= ' LIMIT 1';
    722722    $dupe   = apply_filters( 'bbp_check_for_duplicate_query', $query, $r );
    723723
     
    11491149    // Custom headers
    11501150    $headers  = apply_filters( 'bbp_subscription_mail_headers', $headers  );
    1151     $to_email = apply_filters( 'bbp_subscription_to_email',     $no_reply );
     1151    $to_email = apply_filters( 'bbp_subscription_to_email',     $no_reply );
    11521152
    11531153    // Before
     
    24482448                        $the_query = array(
    24492449                            'posts_per_page' => bbp_get_replies_per_rss_page(),
    2450                             'meta_query'     => array( array( ) ),
     2450                            'meta_query'     => array( array() ),
    24512451                            'feed'           => true
    24522452                        );
  • trunk/src/includes/common/template.php

    r6930 r7006  
    20852085 * @return bool True if match, false if not
    20862086 */
    2087 function bbp_is_query_name( $name = '' )  {
     2087function bbp_is_query_name( $name = '' ) {
    20882088    return (bool) ( bbp_get_query_name() === $name );
    20892089}
     
    20962096 * @return string To return the query var value
    20972097 */
    2098 function bbp_get_query_name()  {
     2098function bbp_get_query_name() {
    20992099    return get_query_var( '_bbp_query_name' );
    21002100}
     
    21072107 * @param string $name What to set the query var to
    21082108 */
    2109 function bbp_set_query_name( $name = '' )  {
     2109function bbp_set_query_name( $name = '' ) {
    21102110    set_query_var( '_bbp_query_name', $name );
    21112111}
     
    24132413
    24142414        // Build the trail
    2415         $trail  = ! empty( $crumbs ) ? ( $r['before'] . $r['crumb_before'] . implode( $sep . $r['crumb_after'] . $r['crumb_before'] , $crumbs ) . $r['crumb_after'] . $r['after'] ) : '';
     2415        $trail  = ! empty( $crumbs ) ? ( $r['before'] . $r['crumb_before'] . implode( $sep . $r['crumb_after'] . $r['crumb_before'], $crumbs ) . $r['crumb_after'] . $r['after'] ) : '';
    24162416
    24172417        // Filter & return
  • trunk/src/includes/core/template-functions.php

    r6930 r7006  
    383383
    384384    // Filter & return
    385     return (array) apply_filters( 'bbp_get_template_stack', $stack ) ;
     385    return (array) apply_filters( 'bbp_get_template_stack', $stack );
    386386}
    387387
  • trunk/src/includes/core/template-loader.php

    r6573 r7006  
    3030
    3131    // Editing a user
    32     if     ( bbp_is_single_user_edit() && ( $new_template = bbp_get_single_user_edit_template() ) ) :
     32    if     ( bbp_is_single_user_edit() && ( $new_template = bbp_get_single_user_edit_template() ) ) :  //phpcs:ignore
    3333
    3434    // User favorites
  • trunk/src/includes/core/theme-compat.php

    r6884 r7006  
    5656     * @param array $properties
    5757     */
    58     public function __construct( Array $properties = array() ) {
     58    public function __construct( array $properties = array() ) {
    5959        $this->_data = $properties;
    6060    }
  • trunk/src/includes/extend/buddypress/groups.php

    r6967 r7006  
    323323    public function edit_screen( $group = false ) {
    324324        $forum_id  = 0;
    325         $group_id  = empty( $group->id ) ? bp_get_new_group_id() : $group->id ;
     325        $group_id  = empty( $group->id ) ? bp_get_new_group_id() : $group->id;
    326326        $forum_ids = bbp_get_group_forum_ids( $group_id );
    327327
     
    400400            bbp_add_error( 'bbp_edit_group_forum_screen_save', __( '<strong>ERROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );
    401401            return;
    402         }
     402        }
    403403
    404404        $edit_forum = ! empty( $_POST['bbp-edit-group-forum'] ) ? true : false;
     
    963963
    964964                    // Single Topic
    965                     else:
     965                    else :
    966966                        bbp_set_query_name( 'bbp_single_topic' );
    967967                        bbp_get_template_part( 'content', 'single-topic' );
  • trunk/src/includes/extend/buddypress/loader.php

    r6807 r7006  
    243243
    244244        // Favorite topics
    245         if ( bbp_is_favorites_active() ){
     245        if ( bbp_is_favorites_active() ) {
    246246            $sub_nav[] = array(
    247247                'name'            => esc_html__( 'Favorites', 'bbpress' ),
     
    380380                    'type'    => 'thumb'
    381381                ) );
    382                 $bp->bp_options_title = bp_get_displayed_user_fullname();
     382                $bp->bp_options_title  = bp_get_displayed_user_fullname();
    383383            }
    384384        }
  • trunk/src/includes/extend/buddypress/notifications.php

    r6981 r7006  
    9393        $filter = 'bbp_single_new_subscription_notification';
    9494        $text   = ! empty( $secondary_item_id )
    95             ? 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 ) )
    96             : sprintf( esc_html__( 'You have %d new reply to %s',             'bbpress' ), $action_item_count, $topic_title );
     95            ? 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 ) )
     96            : sprintf( esc_html__( 'You have %1$d new reply to %2$s',             'bbpress' ), $action_item_count, $topic_title );
    9797    }
    9898
     
    155155    // Notify the topic author if not the current reply author
    156156    if ( $author_id !== $topic_author_id ) {
    157         $args['secondary_item_id'] = $secondary_item_id ;
     157        $args['secondary_item_id'] = $secondary_item_id;
    158158
    159159        bp_notifications_add_notification( $args );
  • trunk/src/includes/forums/template.php

    r6941 r7006  
    11721172        // First link never has view=all
    11731173        $retval = bbp_get_view_all( 'edit_others_topics' )
    1174             ? "<a href='" . esc_url( bbp_remove_view_all( $link ) ) . "'>" . esc_html( $topics ) . "</a>"
     1174            ? "<a href='" . esc_url( bbp_remove_view_all( $link ) ) . "'>" . esc_html( $topics ) . '</a>'
    11751175            : esc_html( $topics );
    11761176
     
    11871187            // Hidden link
    11881188            $retval .= ! bbp_get_view_all( 'edit_others_topics' )
    1189                 ? " <a href='" . esc_url( bbp_add_view_all( $link, true ) ) . "'>" . esc_html( $extra ) . "</a>"
     1189                ? " <a href='" . esc_url( bbp_add_view_all( $link, true ) ) . "'>" . esc_html( $extra ) . '</a>'
    11901190                : " {$extra}";
    11911191        }
     
    15711571
    15721572        // Adjust the ancestor check based on the count
    1573         switch( $operator ) {
     1573        switch ( $operator ) {
    15741574            default:
    15751575            case 'AND':
     
    23912391        ob_start(); ?>
    23922392
    2393         <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'] ); ?>>
     2393        <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'] ); ?>>
    23942394
    23952395            <?php foreach ( bbp_get_forum_types( $r['forum_id'] ) as $key => $label ) : ?>
     
    24772477        ob_start(); ?>
    24782478
    2479         <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'] ); ?>>
     2479        <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'] ); ?>>
    24802480
    24812481            <?php foreach ( bbp_get_forum_statuses( $r['forum_id'] ) as $key => $label ) : ?>
     
    25632563        ob_start(); ?>
    25642564
    2565         <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'] ); ?>>
     2565        <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'] ); ?>>
    25662566
    25672567            <?php foreach ( bbp_get_forum_visibilities( $r['forum_id'] ) as $key => $label ) : ?>
  • trunk/src/includes/replies/functions.php

    r6923 r7006  
    717717
    718718        // Update counts, etc...
    719         do_action( 'bbp_edit_reply', $reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author , true, $reply_to );
     719        do_action( 'bbp_edit_reply', $reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author, true, $reply_to );
    720720
    721721        /** Revisions *********************************************************/
     
    731731
    732732        // Update revision log
    733         if ( ! empty( $_POST['bbp_log_reply_edit'] ) && ( "1" === $_POST['bbp_log_reply_edit'] ) ) {
     733        if ( ! empty( $_POST['bbp_log_reply_edit'] ) && ( '1' === $_POST['bbp_log_reply_edit'] ) ) {
    734734            $revision_id = wp_save_post_revision( $reply_id );
    735735            if ( ! empty( $revision_id ) ) {
     
    822822            set_transient( '_bbp_' . bbp_current_author_ip() . '_last_posted', time() );
    823823        }
    824 
    825824    } else {
    826825        if ( empty( $is_edit ) && ! current_user_can( 'throttle' ) ) {
     
    20802079    // The texts to search for
    20812080    $search     = array(
    2082         "FROM {$table_name} " ,
     2081        "FROM {$table_name} ",
    20832082        "WHERE 1=1  AND {$table_name}.post_parent = {$topic_id}",
    20842083        ") AND {$table_name}.post_parent = {$topic_id}"
     
    20872086    // The texts to replace them with
    20882087    $replace     = array(
    2089         $search[0] . "FORCE INDEX (PRIMARY, post_parent) " ,
     2088        $search[0] . 'FORCE INDEX (PRIMARY, post_parent) ',
    20902089        "WHERE 1=1 AND ({$table_name}.ID = {$topic_id} OR {$table_name}.post_parent = {$topic_id})",
    20912090        ") AND ({$table_name}.ID = {$topic_id} OR {$table_name}.post_parent = {$topic_id})"
     
    21472146        <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
    21482147        <link><?php self_link(); ?></link>
    2149         <description><?php //?></description>
     2148        <description><?php //?></description><?php // phpcs:ignore ?>
    21502149        <lastBuildDate><?php echo date( 'r' ); ?></lastBuildDate>
    21512150        <generator><?php echo esc_url_raw( 'https://bbpress.org/?v=' . convert_chars( bbp_get_version() ) ); ?></generator>
     
    21902189                    <link><?php bbp_reply_url(); ?></link>
    21912190                    <pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>
    2192                     <dc:creator><?php the_author() ?></dc:creator>
     2191                    <dc:creator><?php the_author(); ?></dc:creator>
    21932192
    21942193                    <description>
  • trunk/src/includes/replies/template.php

    r6967 r7006  
    15291529     * Return the reply to id of a reply
    15301530     *
    1531      * @since 2.4.0 bbPress (r4944)
     1531     * @since 2.4.0 bbPress (r4944)
    15321532     *
    15331533     * @param int $reply_id Optional. Reply id
     
    23872387            // Several replies in a topic with several pages
    23882388            } else {
    2389                 $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 );
     2389                $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
    23902390            }
    23912391
     
    23992399            // Several posts in a topic with several pages
    24002400            } else {
    2401                 $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 );
     2401                $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
    24022402            }
    24032403        }
     
    27122712        ob_start(); ?>
    27132713
    2714         <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'] ); ?>>
     2714        <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'] ); ?>>
    27152715
    27162716            <?php foreach ( bbp_get_reply_statuses( $r['reply_id'] ) as $key => $label ) : ?>
  • trunk/src/includes/search/template.php

    r6903 r7006  
    413413        // Several pages of results
    414414        } else {
    415             $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 );
     415            $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
    416416        }
    417417
  • trunk/src/includes/topics/functions.php

    r6923 r7006  
    647647
    648648        // Update counts, etc...
    649         do_action( 'bbp_edit_topic', $topic_id, $forum_id, $anonymous_data, $topic_author , true /* Is edit */ );
     649        do_action( 'bbp_edit_topic', $topic_id, $forum_id, $anonymous_data, $topic_author, true /* Is edit */ );
    650650
    651651        /** Revisions *********************************************************/
     
    661661
    662662        // Update revision log
    663         if ( ! empty( $_POST['bbp_log_topic_edit'] ) && ( "1" === $_POST['bbp_log_topic_edit'] ) ) {
     663        if ( ! empty( $_POST['bbp_log_topic_edit'] ) && ( '1' === $_POST['bbp_log_topic_edit'] ) ) {
    664664            $revision_id = wp_save_post_revision( $topic_id );
    665665            if ( ! empty( $revision_id ) ) {
     
    790790        }
    791791
     792    // If not anonymous, then
    792793    } else {
    793794        if ( empty( $is_edit ) && ! current_user_can( 'throttle' ) ) {
     
    868869
    869870        // Get the forum ID if none was passed
    870         if ( empty( $forum_id )  ) {
     871        if ( empty( $forum_id ) ) {
    871872            $forum_id = bbp_get_topic_forum_id( $topic_id );
    872873        }
     
    11951196
    11961197        // Shift the tags if told to
    1197         if ( ! empty( $_POST['bbp_topic_tags'] ) && ( "1" === $_POST['bbp_topic_tags'] ) ) {
     1198        if ( ! empty( $_POST['bbp_topic_tags'] ) && ( '1' === $_POST['bbp_topic_tags'] ) ) {
    11981199            wp_set_post_terms( $destination_topic->ID, $source_topic_tags, bbp_get_topic_tag_tax_id(), true );
    11991200        }
     
    14881489
    14891490    // Copy the subscribers
    1490     if ( ! empty( $_POST['bbp_topic_subscribers'] ) && "1" === $_POST['bbp_topic_subscribers'] && bbp_is_subscriptions_active() ) {
     1491    if ( ! empty( $_POST['bbp_topic_subscribers'] ) && '1' === $_POST['bbp_topic_subscribers'] && bbp_is_subscriptions_active() ) {
    14911492
    14921493        // Get the subscribers
     
    15051506
    15061507    // Copy the favoriters if told to
    1507     if ( ! empty( $_POST['bbp_topic_favoriters'] ) && ( "1" === $_POST['bbp_topic_favoriters'] ) ) {
     1508    if ( ! empty( $_POST['bbp_topic_favoriters'] ) && ( '1' === $_POST['bbp_topic_favoriters'] ) ) {
    15081509
    15091510        // Get the favoriters
     
    15221523
    15231524    // Copy the tags if told to
    1524     if ( ! empty( $_POST['bbp_topic_tags'] ) && ( "1" === $_POST['bbp_topic_tags'] ) ) {
     1525    if ( ! empty( $_POST['bbp_topic_tags'] ) && ( '1' === $_POST['bbp_topic_tags'] ) ) {
    15251526
    15261527        // Get the source topic tags
     
    21352136
    21362137            $is_sticky = bbp_is_topic_sticky( $r['id'] );
    2137             $is_super  = false === $is_sticky && ! empty( $_GET['super'] ) && ( "1" === $_GET['super'] ) ? true : false;
     2138            $is_super  = false === $is_sticky && ! empty( $_GET['super'] ) && ( '1' === $_GET['super'] ) ? true : false;
    21382139
    21392140            // Toggle
     
    37763777        <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
    37773778        <link><?php self_link(); ?></link>
    3778         <description><?php //?></description>
     3779        <description><?php //?></description><?php // phpcs:ignore ?>
    37793780        <lastBuildDate><?php echo date( 'r' ); ?></lastBuildDate>
    37803781        <generator><?php echo esc_url_raw( 'https://bbpress.org/?v=' . convert_chars( bbp_get_version() ) ); ?></generator>
     
    37923793                    <link><?php bbp_topic_permalink(); ?></link>
    37933794                    <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>
    3794                     <dc:creator><?php the_author() ?></dc:creator>
     3795                    <dc:creator><?php the_author(); ?></dc:creator>
    37953796
    37963797                    <?php if ( !post_password_required() ) : ?>
  • trunk/src/includes/topics/template.php

    r6967 r7006  
    638638            // Default to topic post type name label
    639639            } else {
    640                 $tto    = get_post_type_object( bbp_get_topic_post_type() );
    641                 $title  = $tto->labels->name;
     640                $tto   = get_post_type_object( bbp_get_topic_post_type() );
     641                $title = $tto->labels->name;
    642642            }
    643643        }
     
    14681468
    14691469            // Filter sections
    1470             $sections    = apply_filters( 'bbp_get_topic_author_links', $author_links, $r, $args );
     1470            $sections = apply_filters( 'bbp_get_topic_author_links', $author_links, $r, $args );
    14711471
    14721472            // Assemble sections into author link
     
    20182018        // First link never has view=all
    20192019        $retval = bbp_get_view_all( 'edit_others_replies' )
    2020             ? "<a href='" . esc_url( bbp_remove_view_all( $link ) ) . "'>" . esc_html( $replies ) . "</a>"
     2020            ? "<a href='" . esc_url( bbp_remove_view_all( $link ) ) . "'>" . esc_html( $replies ) . '</a>'
    20212021            : $replies;
    20222022
     
    20332033            // Hidden link
    20342034            $retval .= ! bbp_get_view_all( 'edit_others_replies' )
    2035                 ? " <a href='" . esc_url( bbp_add_view_all( $link, true ) ) . "'>" . esc_html( $extra ) . "</a>"
     2035                ? " <a href='" . esc_url( bbp_add_view_all( $link, true ) ) . "'>" . esc_html( $extra ) . '</a>'
    20362036                : " {$extra}";
    20372037        }
     
    29902990            // Several topics in a forum with several pages
    29912991            } else {
    2992                 $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 );
     2992                $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
    29932993            }
    29942994
     
    32423242        ob_start(); ?>
    32433243
    3244         <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'] ); ?>>
     3244        <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'] ); ?>>
    32453245
    32463246            <?php foreach ( bbp_get_topic_statuses( $r['topic_id'] ) as $key => $label ) : ?>
  • trunk/src/includes/users/capabilities.php

    r6734 r7006  
    486486
    487487    // Make array of post types to mark as spam
    488     $post_types  = array( bbp_get_topic_post_type(), bbp_get_reply_post_type() );
    489     $post_types  = "'" . implode( "', '", $post_types ) . "'";
     488    $post_types = array( bbp_get_topic_post_type(), bbp_get_reply_post_type() );
     489    $post_types = "'" . implode( "', '", $post_types ) . "'";
    490490
    491491    // Loop through blogs and remove their posts
  • trunk/src/templates/default/bbpress/form-forum.php

    r6806 r7006  
    8888
    8989                        <p class="form-allowed-tags">
    90                             <label><?php esc_html_e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:','bbpress' ); ?></label><br />
     90                            <label><?php esc_html_e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:', 'bbpress' ); ?></label><br />
    9191                            <code><?php bbp_allowed_tags(); ?></code>
    9292                        </p>
  • trunk/src/templates/default/bbpress/form-reply.php

    r6806 r7006  
    7777
    7878                        <p class="form-allowed-tags">
    79                             <label><?php esc_html_e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:','bbpress' ); ?></label><br />
     79                            <label><?php esc_html_e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:', 'bbpress' ); ?></label><br />
    8080                            <code><?php bbp_allowed_tags(); ?></code>
    8181                        </p>
  • trunk/src/templates/default/bbpress/form-search.php

    r6806 r7006  
    22
    33/**
    4  * Search 
     4 * Search
    55 *
    66 * @package bbPress
  • trunk/src/templates/default/bbpress/form-user-edit.php

    r6806 r7006  
    1515<form id="bbp-your-profile" method="post" enctype="multipart/form-data">
    1616
    17     <h2 class="entry-title"><?php esc_html_e( 'Name', 'bbpress' ) ?></h2>
     17    <h2 class="entry-title"><?php esc_html_e( 'Name', 'bbpress' ); ?></h2>
    1818
    1919    <?php do_action( 'bbp_user_edit_before' ); ?>
    2020
    2121    <fieldset class="bbp-form">
    22         <legend><?php esc_html_e( 'Name', 'bbpress' ) ?></legend>
     22        <legend><?php esc_html_e( 'Name', 'bbpress' ); ?></legend>
    2323
    2424        <?php do_action( 'bbp_user_edit_before_name' ); ?>
    2525
    2626        <div>
    27             <label for="first_name"><?php esc_html_e( 'First Name', 'bbpress' ) ?></label>
     27            <label for="first_name"><?php esc_html_e( 'First Name', 'bbpress' ); ?></label>
    2828            <input type="text" name="first_name" id="first_name" value="<?php bbp_displayed_user_field( 'first_name', 'edit' ); ?>" class="regular-text" />
    2929        </div>
    3030
    3131        <div>
    32             <label for="last_name"><?php esc_html_e( 'Last Name', 'bbpress' ) ?></label>
     32            <label for="last_name"><?php esc_html_e( 'Last Name', 'bbpress' ); ?></label>
    3333            <input type="text" name="last_name" id="last_name" value="<?php bbp_displayed_user_field( 'last_name', 'edit' ); ?>" class="regular-text" />
    3434        </div>
     
    4040
    4141        <div>
    42             <label for="display_name"><?php esc_html_e( 'Display Name', 'bbpress' ) ?></label>
     42            <label for="display_name"><?php esc_html_e( 'Display Name', 'bbpress' ); ?></label>
    4343
    4444            <?php bbp_edit_user_display_name(); ?>
     
    5050    </fieldset>
    5151
    52     <h2 class="entry-title"><?php esc_html_e( 'Contact Info', 'bbpress' ) ?></h2>
     52    <h2 class="entry-title"><?php esc_html_e( 'Contact Info', 'bbpress' ); ?></h2>
    5353
    5454    <fieldset class="bbp-form">
    55         <legend><?php esc_html_e( 'Contact Info', 'bbpress' ) ?></legend>
     55        <legend><?php esc_html_e( 'Contact Info', 'bbpress' ); ?></legend>
    5656
    5757        <?php do_action( 'bbp_user_edit_before_contact' ); ?>
    5858
    5959        <div>
    60             <label for="url"><?php esc_html_e( 'Website', 'bbpress' ) ?></label>
     60            <label for="url"><?php esc_html_e( 'Website', 'bbpress' ); ?></label>
    6161            <input type="text" name="url" id="url" value="<?php bbp_displayed_user_field( 'user_url', 'edit' ); ?>" maxlength="200" class="regular-text code" />
    6262        </div>
     
    9797    </fieldset>
    9898
    99     <h2 class="entry-title"><?php esc_html_e( 'Account', 'bbpress' ) ?></h2>
     99    <h2 class="entry-title"><?php esc_html_e( 'Account', 'bbpress' ); ?></h2>
    100100
    101101    <fieldset class="bbp-form">
    102         <legend><?php esc_html_e( 'Account', 'bbpress' ) ?></legend>
     102        <legend><?php esc_html_e( 'Account', 'bbpress' ); ?></legend>
    103103
    104104        <?php do_action( 'bbp_user_edit_before_account' ); ?>
     
    117117
    118118        <div>
    119             <label for="url"><?php esc_html_e( 'Language', 'bbpress' ) ?></label>
     119            <label for="url"><?php esc_html_e( 'Language', 'bbpress' ); ?></label>
    120120
    121121            <?php bbp_edit_user_language(); ?>
     
    129129    <?php if ( ! bbp_is_user_home_edit() && current_user_can( 'promote_user', bbp_get_displayed_user_id() ) ) : ?>
    130130
    131         <h2 class="entry-title"><?php esc_html_e( 'User Role', 'bbpress' ) ?></h2>
     131        <h2 class="entry-title"><?php esc_html_e( 'User Role', 'bbpress' ); ?></h2>
    132132
    133133        <fieldset class="bbp-form">
  • trunk/src/templates/default/bbpress/form-user-roles.php

    r6258 r7006  
    1414
    1515<div>
    16     <label for="role"><?php esc_html_e( 'Blog Role', 'bbpress' ) ?></label>
     16    <label for="role"><?php esc_html_e( 'Blog Role', 'bbpress' ); ?></label>
    1717
    1818    <?php bbp_edit_user_blog_role(); ?>
     
    2121
    2222<div>
    23     <label for="forum-role"><?php esc_html_e( 'Forum Role', 'bbpress' ) ?></label>
     23    <label for="forum-role"><?php esc_html_e( 'Forum Role', 'bbpress' ); ?></label>
    2424
    2525    <?php bbp_edit_user_forums_role(); ?>
  • trunk/src/templates/default/bbpress/pagination-search.php

    r6258 r7006  
    22
    33/**
    4  * Pagination for pages of search results 
     4 * Pagination for pages of search results
    55 *
    66 * @package bbPress
  • trunk/src/templates/default/bbpress/user-details.php

    r6574 r7006  
    2626    <div id="bbp-user-navigation">
    2727        <ul>
    28             <li class="<?php if ( bbp_is_single_user_profile() ) :?>current<?php endif; ?>">
     28            <li class="<?php if ( bbp_is_single_user_profile() ) : ?>current<?php endif; ?>">
    2929                <span class="vcard bbp-user-profile-link">
    3030                    <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>
     
    3232            </li>
    3333
    34             <li class="<?php if ( bbp_is_single_user_topics() ) :?>current<?php endif; ?>">
     34            <li class="<?php if ( bbp_is_single_user_topics() ) : ?>current<?php endif; ?>">
    3535                <span class='bbp-user-topics-created-link'>
    3636                    <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>
     
    3838            </li>
    3939
    40             <li class="<?php if ( bbp_is_single_user_replies() ) :?>current<?php endif; ?>">
     40            <li class="<?php if ( bbp_is_single_user_replies() ) : ?>current<?php endif; ?>">
    4141                <span class='bbp-user-replies-created-link'>
    4242                    <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>
     
    4545
    4646            <?php if ( bbp_is_engagements_active() ) : ?>
    47                 <li class="<?php if ( bbp_is_single_user_engagements() ) :?>current<?php endif; ?>">
     47                <li class="<?php if ( bbp_is_single_user_engagements() ) : ?>current<?php endif; ?>">
    4848                    <span class='bbp-user-engagements-created-link'>
    4949                        <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>
     
    5353
    5454            <?php if ( bbp_is_favorites_active() ) : ?>
    55                 <li class="<?php if ( bbp_is_favorites() ) :?>current<?php endif; ?>">
     55                <li class="<?php if ( bbp_is_favorites() ) : ?>current<?php endif; ?>">
    5656                    <span class="bbp-user-favorites-link">
    5757                        <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>
     
    6363
    6464                <?php if ( bbp_is_subscriptions_active() ) : ?>
    65                     <li class="<?php if ( bbp_is_subscriptions() ) :?>current<?php endif; ?>">
     65                    <li class="<?php if ( bbp_is_subscriptions() ) : ?>current<?php endif; ?>">
    6666                        <span class="bbp-user-subscriptions-link">
    6767                            <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>
     
    7070                <?php endif; ?>
    7171
    72                 <li class="<?php if ( bbp_is_single_user_edit() ) :?>current<?php endif; ?>">
     72                <li class="<?php if ( bbp_is_single_user_edit() ) : ?>current<?php endif; ?>">
    7373                    <span class="bbp-user-edit-link">
    7474                        <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>
  • trunk/src/templates/default/bbpress/user-profile.php

    r6592 r7006  
    1717    <div class="bbp-user-section">
    1818        <h3><?php esc_html_e( 'Profile', 'bbpress' ); ?></h3>
    19         <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>
     19        <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>
    2020
    2121        <?php if ( bbp_get_displayed_user_field( 'description' ) ) : ?>
     
    2727        <?php if ( bbp_get_displayed_user_field( 'user_url' ) ) : ?>
    2828
    29             <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>
     29            <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>
    3030
    3131        <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.