Skip to:
Content

BuddyPress.org

Ticket #8448: 8448.3-advices.patch

File 8448.3-advices.patch, 20.8 KB (added by imath, 4 years ago)
  • src/bp-core/admin/bp-core-admin-optouts.php

    diff --git src/bp-core/admin/bp-core-admin-optouts.php src/bp-core/admin/bp-core-admin-optouts.php
    index a80b188e4..5df6047d0 100644
    function bp_core_optouts_admin_load() { 
    5555                // The per_page screen option.
    5656                add_screen_option( 'per_page', array( 'label' => _x( 'Nonmember opt-outs', 'Nonmember opt-outs per page (screen options)', 'buddypress' ) ) );
    5757
    58                 get_current_screen()->add_help_tab( array(
    59                         'id'      => 'bp-optouts-overview',
    60                         'title'   => __( 'Overview', 'buddypress' ),
    61                         'content' =>
    62                         '<p>' . __( 'This is the administration screen for nonmember opt-outs on your site.', 'buddypress' ) . '</p>' .
    63                         '<p>' . __( 'From the screen options, you can customize the displayed columns and the pagination of this screen.', 'buddypress' ) . '</p>' .
    64                         '<p>' . __( 'You can reorder the list of opt-outs by clicking on the Email Address, User Who Contacted, Email Type or Date Modified column headers.', 'buddypress' ) . '</p>' .
    65                         '<p>' . __( 'Using the search form, you can search for an opt-out to a specific email address.', 'buddypress' ) . '</p>'
    66                 ) );
    67 
    68                 get_current_screen()->add_help_tab( array(
    69                         'id'      => 'bp-optouts-actions',
    70                         'title'   => __( 'Actions', 'buddypress' ),
    71                         'content' =>
    72                         '<p>' . __( 'Hovering over a row in the opt-outs list will display action links that allow you to manage the opt-out. You can perform the following actions:', 'buddypress' ) . '</p>' .
    73                         '<ul><li>' . __( '"Delete" allows you to delete the record of an opt-out. You will be asked to confirm this deletion.', 'buddypress' ) . '</li></ul>' .
    74                         '<p>' . __( 'Bulk actions allow you to perform these actions for the selected rows.', 'buddypress' ) . '</p>'
    75                 ) );
     58                // Current screen.
     59                $current_screen = get_current_screen();
     60
     61                $current_screen->add_help_tab(
     62                        array(
     63                                'id'      => 'bp-optouts-overview',
     64                                'title'   => __( 'Overview', 'buddypress' ),
     65                                'content' =>
     66                                        '<p>' . __( 'This is the administration screen for nonmember opt-outs on your site.', 'buddypress' ) . '</p>' .
     67                                        '<p>' . __( 'From the screen options, you can customize the displayed columns and the pagination of this screen.', 'buddypress' ) . '</p>' .
     68                                        '<p>' . __( 'You can reorder the list of opt-outs by clicking on the Email Address, User Who Contacted, Email Type or Date Modified column headers.', 'buddypress' ) . '</p>' .
     69                                        '<p>' . __( 'Using the search form, you can search for an opt-out to a specific email address.', 'buddypress' ) . '</p>',
     70                        )
     71                );
     72
     73                $current_screen->add_help_tab(
     74                        array(
     75                                'id'      => 'bp-optouts-actions',
     76                                'title'   => __( 'Actions', 'buddypress' ),
     77                                'content' =>
     78                                        '<p>' . __( 'Hovering over a row in the opt-outs list will display action links that allow you to manage the opt-out. You can perform the following actions:', 'buddypress' ) . '</p>' .
     79                                        '<ul><li>' . __( '"Delete" allows you to delete the record of an opt-out. You will be asked to confirm this deletion.', 'buddypress' ) . '</li></ul>' .
     80                                        '<p>' . __( 'Bulk actions allow you to perform these actions for the selected rows.', 'buddypress' ) . '</p>',
     81                        )
     82                );
    7683
    7784                // Help panel - sidebar links.
    78                 get_current_screen()->set_help_sidebar(
     85                $current_screen->set_help_sidebar(
    7986                        '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
    8087                        '<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
    8188                );
    8289
    8390                // Add accessible hidden headings and text for the Pending Users screen.
    84                 get_current_screen()->set_screen_reader_content( array(
    85                         /* translators: accessibility text */
    86                         'heading_views'      => __( 'Filter opt-outs list', 'buddypress' ),
    87                         /* translators: accessibility text */
    88                         'heading_pagination' => __( 'Opt-out list navigation', 'buddypress' ),
    89                         /* translators: accessibility text */
    90                         'heading_list'       => __( 'Opt-outs list', 'buddypress' ),
    91                 ) );
     91                $current_screen->set_screen_reader_content(
     92                        array(
     93                                /* translators: accessibility text */
     94                                'heading_views'      => __( 'Filter opt-outs list', 'buddypress' ),
     95                                /* translators: accessibility text */
     96                                'heading_pagination' => __( 'Opt-out list navigation', 'buddypress' ),
     97                                /* translators: accessibility text */
     98                                'heading_list'       => __( 'Opt-outs list', 'buddypress' ),
     99                        )
     100                );
    92101
    93102        } else {
    94103                if ( empty( $_REQUEST['optout_ids' ] ) ) {
    function bp_core_optouts_admin() { 
    233242
    234243                <?php endif; ?>
    235244
    236                         <p><?php echo $notice['message']; ?></p>
     245                        <p><?php echo esc_html( $notice['message'] ); ?></p>
    237246                </div>
    238247
    239248        <?php endif;
    function bp_core_optouts_admin_index() { 
    299308                        'action2',
    300309                        '_wpnonce',
    301310                        'optout_ids'
    302                 ), $_SERVER['REQUEST_URI']
     311                ),
     312                $_SERVER['REQUEST_URI']
    303313        );
    304314
    305315        ?>
    function bp_core_optouts_admin_index() { 
    309319
    310320                <?php
    311321                if ( $usersearch ) {
    312                         printf( '<span class="subtitle">' . __( 'Opt-outs with an email address matching &#8220;%s&#8221;', 'buddypress' ) . '</span>', esc_html( $usersearch ) );
     322                        $num_results = (int) $bp_optouts_list_table->total_items;
     323                        printf( '<span class="subtitle">' . esc_html( _n( 'Opt-out with an email address matching &#8220;%s&#8221;', 'Opt-outs with an email address matching &#8220;%s&#8221;', $num_results, 'buddypress' ) ) . '</span>', esc_html( $usersearch ) );
    313324                }
    314325                ?>
    315                 <p class="description"><?php _e( 'This table shows opt-out requests from people who are not members of this site, but have been contacted via communication from this site, and wish to receive no further communications.', 'buddypress' ); ?></p>
     326                <p class="description"><?php esc_html_e( 'This table shows opt-out requests from people who are not members of this site, but have been contacted via communication from this site, and wish to receive no further communications.', 'buddypress' ); ?></p>
    316327
    317328                <hr class="wp-header-end">
    318329
    function bp_core_optouts_admin_index() { 
    321332
    322333                <form id="bp-optouts-search-form" action="<?php echo esc_url( $search_form_url ) ;?>">
    323334                        <input type="hidden" name="page" value="<?php echo esc_attr( $plugin_page ); ?>" />
    324                         <?php $bp_optouts_list_table->search_box( __( 'Search for a specific email address', 'buddypress' ), 'bp-optouts' ); ?>
     335                        <?php $bp_optouts_list_table->search_box( esc_html__( 'Search for a specific email address', 'buddypress' ), 'bp-optouts' ); ?>
    325336                </form>
    326337
    327338                <form id="bp-optouts-form" action="<?php echo esc_url( $form_url );?>" method="post">
  • src/bp-core/bp-core-functions.php

    diff --git src/bp-core/bp-core-functions.php src/bp-core/bp-core-functions.php
    index 88e4b651b..e56c7453f 100644
    function bp_get_widget_max_count_limit( $widget_class = '' ) { 
    42474247 *                                 prompted the user to opt-out.
    42484248 *     @type string $date_modified Optional. Specify a time, else now will be used.
    42494249 * }
    4250  * @return false | int False on failure, ID of new (or existing) opt-out if successful.
     4250 * @return false|int False on failure, ID of new (or existing) opt-out if successful.
    42514251 */
    42524252function bp_add_optout( $args = array() ) {
    42534253        $optout = new BP_Optout();
    4254         $r = bp_parse_args( $args, array(
    4255                 'email_address'     => '',
    4256                 'user_id'           => 0,
    4257                 'email_type'        => '',
    4258                 'date_modified'     => bp_core_current_time(),
    4259         ), 'add_optout' );
     4254        $r      = bp_parse_args(
     4255                $args, array(
     4256                        'email_address' => '',
     4257                        'user_id'       => 0,
     4258                        'email_type'    => '',
     4259                        'date_modified' => bp_core_current_time(),
     4260                ),
     4261                'add_optout'
     4262        );
    42604263
    42614264        // Opt-outs must have an email address.
    42624265        if ( empty( $r['email_address'] ) ) {
    function bp_add_optout( $args = array() ) { 
    42644267        }
    42654268
    42664269        // Avoid creating duplicate opt-outs.
    4267         $optout_id = $optout->optout_exists( array(
    4268                 'email_address' => $r['email_address'],
    4269                 'user_id'       => $r['user_id'],
    4270                 'email_type'    => $r['email_type'],
    4271         ) );
     4270        $optout_id = $optout->optout_exists(
     4271                array(
     4272                        'email_address' => $r['email_address'],
     4273                        'user_id'       => $r['user_id'],
     4274                        'email_type'    => $r['email_type'],
     4275                )
     4276        );
    42724277
    42734278        if ( ! $optout_id ) {
    42744279                // Set up the new opt-out.
    function bp_add_optout( $args = array() ) { 
    42894294 * @since 8.0.0
    42904295 *
    42914296 * @see BP_Optout::get() for a description of parameters and return values.
     4297 *
     4298 * @param array $args See {@link BP_Optout::get()}.
     4299 * @return array See {@link BP_Optout::get()}.
    42924300 */
    42934301function bp_get_optouts( $args = array() ) {
    42944302        $optout_class = new BP_Optout();
    function bp_get_optouts( $args = array() ) { 
    43014309 * @since 8.0.0
    43024310 *
    43034311 * @param int $id ID of the optout to delete.
     4312 * @return bool True on success, false on failure.
    43044313 */
    43054314function bp_delete_optout_by_id( $id = 0 ) {
    43064315        $optout_class = new BP_Optout();
  • src/bp-core/classes/class-bp-optout.php

    diff --git src/bp-core/classes/class-bp-optout.php src/bp-core/classes/class-bp-optout.php
    index 6d7725c34..b9a4822a6 100644
    class BP_Optout { 
    282282
    283283                // id.
    284284                if ( false !== $args['id'] ) {
    285                         $id_in = implode( ',', wp_parse_id_list( $args['id'] ) );
     285                        $id_in                  = implode( ',', wp_parse_id_list( $args['id'] ) );
    286286                        $where_conditions['id'] = "id IN ({$id_in})";
    287287                }
    288288
    class BP_Optout { 
    323323                                $et_clean[] = $wpdb->prepare( '%s', sanitize_key( $et ) );
    324324                        }
    325325
    326                         $et_in = implode( ',', $et_clean );
     326                        $et_in                          = implode( ',', $et_clean );
    327327                        $where_conditions['email_type'] = "email_type IN ({$et_in})";
    328328                }
    329329
    class BP_Optout { 
    463463                // id.
    464464                if ( ! empty( $args['id'] ) ) {
    465465                        $where_clauses['data']['id'] = absint( $args['id'] );
    466                         $where_clauses['format'][] = '%d';
     466                        $where_clauses['format'][]   = '%d';
    467467                }
    468468
    469469                // email_address.
    470470                if ( ! empty( $args['email_address'] ) ) {
    471471                        $where_clauses['data']['email_address_hash'] = $args['email_address'];
    472                         $where_clauses['format'][] = '%s';
     472                        $where_clauses['format'][]                   = '%s';
    473473                }
    474474
    475475                // user_id.
    476476                if ( ! empty( $args['user_id'] ) ) {
    477477                        $where_clauses['data']['user_id'] = absint( $args['user_id'] );
    478                         $where_clauses['format'][] = '%d';
     478                        $where_clauses['format'][]        = '%d';
    479479                }
    480480
    481481                // email_type.
    482482                if ( ! empty( $args['email_type'] ) ) {
    483483                        $where_clauses['data']['email_type'] = $args['email_type'];
    484                         $where_clauses['format'][] = '%s';
     484                        $where_clauses['format'][]           = '%s';
    485485                }
    486486
    487487                return $where_clauses;
    class BP_Optout { 
    530530                $optouts_table_name = BP_Optout::get_table_name();
    531531
    532532                // Parse the arguments.
    533                 $r  = bp_parse_args( $args, array(
    534                         'id'                => false,
    535                         'email_address'     => false,
    536                         'user_id'           => false,
    537                         'email_type'        => false,
    538                         'search_terms'      => '',
    539                         'order_by'          => false,
    540                         'sort_order'        => false,
    541                         'page'              => false,
    542                         'per_page'          => false,
    543                         'fields'            => 'all',
    544                 ), 'bp_optout_get' );
     533                $r = bp_parse_args(
     534                        $args,
     535                        array(
     536                                'id'            => false,
     537                                'email_address' => false,
     538                                'user_id'       => false,
     539                                'email_type'    => false,
     540                                'search_terms'  => '',
     541                                'order_by'      => false,
     542                                'sort_order'    => false,
     543                                'page'          => false,
     544                                'per_page'      => false,
     545                                'fields'        => 'all',
     546                        ),
     547                        'bp_optout_get'
     548                );
    545549
    546550                $sql = array(
    547551                        'select'     => "SELECT",
    class BP_Optout { 
    561565                }
    562566
    563567                // WHERE.
    564                 $sql['where'] = self::get_where_sql( array(
    565                         'id'            => $r['id'],
    566                         'email_address' => $r['email_address'],
    567                         'user_id'       => $r['user_id'],
    568                         'email_type'    => $r['email_type'],
    569                         'search_terms'  => $r['search_terms'],
    570                 ) );
     568                $sql['where'] = self::get_where_sql(
     569                        array(
     570                                'id'            => $r['id'],
     571                                'email_address' => $r['email_address'],
     572                                'user_id'       => $r['user_id'],
     573                                'email_type'    => $r['email_type'],
     574                                'search_terms'  => $r['search_terms'],
     575                        )
     576                );
    571577
    572578                // ORDER BY.
    573                 $sql['orderby'] = self::get_order_by_sql( array(
    574                         'order_by'   => $r['order_by'],
    575                         'sort_order' => $r['sort_order']
    576                 ) );
     579                $sql['orderby'] = self::get_order_by_sql(
     580                        array(
     581                                'order_by'   => $r['order_by'],
     582                                'sort_order' => $r['sort_order']
     583                        )
     584                );
    577585
    578586                // LIMIT %d, %d.
    579                 $sql['pagination'] = self::get_paged_sql( array(
    580                         'page'     => $r['page'],
    581                         'per_page' => $r['per_page'],
    582                 ) );
     587                $sql['pagination'] = self::get_paged_sql(
     588                        array(
     589                                'page'     => $r['page'],
     590                                'per_page' => $r['per_page'],
     591                        )
     592                );
    583593
    584594                $paged_optouts_sql = "{$sql['select']} {$sql['fields']} {$sql['from']} {$sql['where']} {$sql['orderby']} {$sql['pagination']}";
    585595
    class BP_Optout { 
    643653                $optouts_table_name = BP_Optout::get_table_name();
    644654
    645655                // Parse the arguments.
    646                 $r  = bp_parse_args( $args, array(
    647                         'id'                => false,
    648                         'email_address'     => false,
    649                         'user_id'           => false,
    650                         'email_type'        => false,
    651                         'search_terms'      => '',
    652                         'order_by'          => false,
    653                         'sort_order'        => false,
    654                         'page'              => false,
    655                         'per_page'          => false,
    656                         'fields'            => 'all',
    657                 ), 'bp_optout_get_total_count' );
     656                $r  = bp_parse_args(
     657                        $args,
     658                        array(
     659                                'id'            => false,
     660                                'email_address' => false,
     661                                'user_id'       => false,
     662                                'email_type'    => false,
     663                                'search_terms'  => '',
     664                                'order_by'      => false,
     665                                'sort_order'    => false,
     666                                'page'          => false,
     667                                'per_page'      => false,
     668                                'fields'        => 'all',
     669                        ),
     670                        'bp_optout_get_total_count'
     671                );
    658672
    659673                // Build the query
    660674                $select_sql = "SELECT COUNT(*)";
    class BP_Optout { 
    700714                $retval = self::_update( $update['data'], $where['data'], $update['format'], $where['format'] );
    701715
    702716                // Clear matching items from the cache.
    703                 $cache_args = $where_args;
     717                $cache_args           = $where_args;
    704718                $cache_args['fields'] = 'ids';
    705                 $maybe_cached_ids = self::get( $cache_args );
     719                $maybe_cached_ids     = self::get( $cache_args );
    706720                foreach ( $maybe_cached_ids as $invite_id ) {
    707721                        wp_cache_delete( $invite_id, 'bp_optouts' );
    708722                }
    class BP_Optout { 
    747761                do_action( 'bp_optout_before_delete', $args );
    748762
    749763                // Clear matching items from the cache.
    750                 $cache_args = $args;
     764                $cache_args           = $args;
    751765                $cache_args['fields'] = 'ids';
    752                 $maybe_cached_ids = self::get( $cache_args );
     766                $maybe_cached_ids     = self::get( $cache_args );
    753767                foreach ( $maybe_cached_ids as $invite_id ) {
    754768                        wp_cache_delete( $invite_id, 'bp_optouts' );
    755769                }
    class BP_Optout { 
    783797                $exists = false;
    784798
    785799                $args['fields'] = 'ids';
    786                 $optouts = BP_Optout::get( $args );
     800                $optouts        = BP_Optout::get( $args );
    787801                if ( $optouts ) {
    788802                        $exists = current( $optouts );
    789803                }
     804
    790805                return $exists;
    791806        }
    792807
    class BP_Optout { 
    806821                        'id' => $id,
    807822                ) );
    808823        }
    809 
    810824}
  • src/bp-core/classes/class-bp-optouts-list-table.php

    diff --git src/bp-core/classes/class-bp-optouts-list-table.php src/bp-core/classes/class-bp-optouts-list-table.php
    index 7615583d8..5201c9172 100644
    class BP_Optouts_List_Table extends WP_Users_List_Table { 
    3333         */
    3434        public function __construct() {
    3535                // Define singular and plural labels, as well as whether we support AJAX.
    36                 parent::__construct( array(
    37                         'ajax'     => false,
    38                         'plural'   => 'optouts',
    39                         'singular' => 'optout',
    40                         'screen'   => get_current_screen()->id,
    41                 ) );
     36                parent::__construct(
     37                        array(
     38                                'ajax'     => false,
     39                                'plural'   => 'optouts',
     40                                'singular' => 'optout',
     41                                'screen'   => get_current_screen()->id,
     42                        )
     43                );
    4244        }
    4345
    4446        /**
    class BP_Optouts_List_Table extends WP_Users_List_Table { 
    5759                $paged    = $this->get_pagenum();
    5860
    5961                $args = array(
    60                         'search_terms'      => $search,
    61                         'order_by'          => 'date_modified',
    62                         'sort_order'        => 'DESC',
    63                         'page'              => $paged,
    64                         'per_page'          => $per_page,
     62                        'search_terms' => $search,
     63                        'order_by'     => 'date_modified',
     64                        'sort_order'   => 'DESC',
     65                        'page'         => $paged,
     66                        'per_page'     => $per_page,
    6567                );
    6668
    6769                if ( isset( $_REQUEST['orderby'] ) ) {
    class BP_Optouts_List_Table extends WP_Users_List_Table { 
    7678                $optouts_class     = new BP_Optout();
    7779                $this->total_items = $optouts_class->get_total_count( $args );
    7880
    79                 $this->set_pagination_args( array(
    80                         'total_items' => $this->total_items,
    81                         'per_page'    => $per_page,
    82                 ) );
     81                $this->set_pagination_args(
     82                        array(
     83                                'total_items' => $this->total_items,
     84                                'per_page'    => $per_page,
     85                        )
     86                );
    8387        }
    8488
    8589        /**
    class BP_Optouts_List_Table extends WP_Users_List_Table { 
    102106                );
    103107                ?>
    104108
    105                 <h2 class="screen-reader-text"><?php
    106                         /* translators: accessibility text */
    107                         _e( 'Filter opt-outs list', 'buddypress' );
    108                 ?></h2>
     109                <h2 class="screen-reader-text">
     110                        <?php
     111                                /* translators: accessibility text */
     112                                esc_html_e( 'Filter opt-outs list', 'buddypress' );
     113                        ?>
     114                </h2>
    109115                <ul class="subsubsub">
    110116                        <?php
    111117                        /**
    class BP_Optouts_List_Table extends WP_Users_List_Table { 
    150156                 *
    151157                 * @param array $value Array of columns to display.
    152158                 */
    153                 return apply_filters( 'bp_optouts_list_columns', array(
    154                         'cb'                       => '<input type="checkbox" />',
    155                         'email_address'            => __( 'Email Address Hash',    'buddypress' ),
    156                         'username'                 => __( 'Email Sender',        'buddypress' ),
    157                         'user_registered'          => __( 'Email Sender Registered',        'buddypress' ),
    158                         'email_type'               => __( 'Email Type', 'buddypress' ),
    159                         'email_type_description'   => __( 'Email Description', 'buddypress' ),
    160                         'optout_date_modified'     => __( 'Date Modified',   'buddypress' ),
    161                 ) );
     159                return apply_filters(
     160                        'bp_optouts_list_columns',
     161                        array(
     162                                'cb'                     => '<input type="checkbox" />',
     163                                'email_address'          => __( 'Email Address Hash', 'buddypress' ),
     164                                'username'               => __( 'Email Sender', 'buddypress' ),
     165                                'user_registered'        => __( 'Email Sender Registered', 'buddypress' ),
     166                                'email_type'             => __( 'Email Type', 'buddypress' ),
     167                                'email_type_description' => __( 'Email Description', 'buddypress' ),
     168                                'optout_date_modified'   => __( 'Date Modified', 'buddypress' ),
     169                        )
     170                );
    162171        }
    163172
    164173        /**
    class BP_Optouts_List_Table extends WP_Users_List_Table { 
    192201         */
    193202        public function get_sortable_columns() {
    194203                return array(
    195                         'email_address'            => 'email_address_hash',
    196                         'username'                 => 'user_id',
    197                         'email_type'               => 'email_type',
    198                         'optout_date_modified'     => 'date_modified',
     204                        'email_address'        => 'email_address_hash',
     205                        'username'             => 'user_id',
     206                        'email_type'           => 'email_type',
     207                        'optout_date_modified' => 'date_modified',
    199208                );
    200209        }
    201210
    class BP_Optouts_List_Table extends WP_Users_List_Table { 
    226235         * @return void
    227236         */
    228237        public function single_row( $optout = null, $style = '', $role = '', $numposts = 0 ) {
    229                 echo '<tr' . $style . ' id="optout-' . esc_attr( $optout->id ) . '">';
     238                echo '<tr' . $style . ' id="optout-' . intval( $optout->id ) . '">';
    230239                echo $this->single_row_columns( $optout );
    231240                echo '</tr>';
    232241        }
    class BP_Optouts_List_Table extends WP_Users_List_Table { 
    240249         */
    241250        public function column_cb( $optout = null ) {
    242251        ?>
    243                 <label class="screen-reader-text" for="optout_<?php echo intval( $optout->id ); ?>"><?php
    244                         /* translators: accessibility text */
    245                         printf( esc_html__( 'Select opt-out request: %s', 'buddypress' ), $optout->id );
    246                 ?></label>
     252                <label class="screen-reader-text" for="optout_<?php echo intval( $optout->id ); ?>">
     253                        <?php
     254                                /* translators: %d: accessibility text. */
     255                                printf( esc_html__( 'Select opt-out request: %d', 'buddypress' ), intval( $optout->id ) );
     256                        ?>
     257                </label>
    247258                <input type="checkbox" id="optout_<?php echo intval( $optout->id ) ?>" name="optout_ids[]" value="<?php echo esc_attr( $optout->id ) ?>" />
    248259                <?php
    249260        }
    class BP_Optouts_List_Table extends WP_Users_List_Table { 
    275286                        ),
    276287                        $form_url
    277288                );
    278                 $actions['delete'] = sprintf( '<a href="%1$s" class="delete">%2$s</a>', esc_url( $delete_link ), __( 'Delete', 'buddypress' ) );
     289                $actions['delete'] = sprintf( '<a href="%1$s" class="delete">%2$s</a>', esc_url( $delete_link ), esc_html__( 'Delete', 'buddypress' ) );
    279290
    280291                /**
    281292                 * Filters the row actions for each opt-out in list.
    class BP_Optouts_List_Table extends WP_Users_List_Table { 
    304315                        return;
    305316                }
    306317                $user_link = bp_core_get_user_domain( $optout->user_id );
    307                 echo $avatar . sprintf( '<strong><a href="%1$s" class="edit">%2$s</a></strong><br/>', esc_url( $user_link ), $inviter->user_login );
     318                echo $avatar . sprintf( '<strong><a href="%1$s" class="edit">%2$s</a></strong><br/>', esc_url( $user_link ), esc_html( $inviter->user_login ) );
    308319        }
    309320
    310321        /**