<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][13881] trunk/src/bp-core/admin/bp-core-admin-components.php: WPCS: miscellaneous fixes for the `src/bp-core/admin/bp-core-admin-components.php` template.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://buddypress.trac.wordpress.org/changeset/13881">13881</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://buddypress.trac.wordpress.org/changeset/13881","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>espellcaste</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2024-06-01 16:36:50 +0000 (Sat, 01 Jun 2024)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>WPCS: miscellaneous fixes for the `src/bp-core/admin/bp-core-admin-components.php` template.

See <a href="http://buddypress.trac.wordpress.org/ticket/7228">#7228</a> and <a href="http://buddypress.trac.wordpress.org/ticket/9164">#9164</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcbpcoreadminbpcoreadmincomponentsphp">trunk/src/bp-core/admin/bp-core-admin-components.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcbpcoreadminbpcoreadmincomponentsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/admin/bp-core-admin-components.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/admin/bp-core-admin-components.php      2024-06-01 16:34:10 UTC (rev 13880)
+++ trunk/src/bp-core/admin/bp-core-admin-components.php        2024-06-01 16:36:50 UTC (rev 13881)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,7 +14,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * Renders the Component Setup admin panel.
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * @since 1.6.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> function bp_core_admin_components_settings() {
</span><span class="cx" style="display: block; padding: 0 10px">        bp_core_admin_tabbed_screen_header( __( 'BuddyPress Settings', 'buddypress' ), __( 'Components', 'buddypress' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,7 +26,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        <?php bp_core_admin_components_options(); ?>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        <p class="submit clear">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                <input class="button-primary" type="submit" name="bp-admin-component-submit" id="bp-admin-component-submit" value="<?php esc_attr_e( 'Save Settings', 'buddypress' ) ?>"/>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         <input class="button-primary" type="submit" name="bp-admin-component-submit" id="bp-admin-component-submit" value="<?php esc_attr_e( 'Save Settings', 'buddypress' ); ?>"/>
</ins><span class="cx" style="display: block; padding: 0 10px">                         </p>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        <?php wp_nonce_field( 'bp-admin-component-setup' ); ?>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -35,7 +34,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                </form>
</span><span class="cx" style="display: block; padding: 0 10px">        </div>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -57,27 +56,27 @@
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @param mixed $value Active components.
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $active_components      = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        // The default components (if none are previously selected).
</span><span class="cx" style="display: block; padding: 0 10px">        $default_components = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                'xprofile' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         'xprofile'      => array(
</ins><span class="cx" style="display: block; padding: 0 10px">                         'title'       => __( 'Extended Profiles', 'buddypress' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'description' => __( 'Customize your community with fully editable profile fields that allow your users to describe themselves.', 'buddypress' )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'description' => __( 'Customize your community with fully editable profile fields that allow your users to describe themselves.', 'buddypress' ),
</ins><span class="cx" style="display: block; padding: 0 10px">                 ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                'settings' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         'settings'      => array(
</ins><span class="cx" style="display: block; padding: 0 10px">                         'title'       => __( 'Account Settings', 'buddypress' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'description' => __( 'Allow your users to modify their account and notification settings directly from within their profiles.', 'buddypress' )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'description' => __( 'Allow your users to modify their account and notification settings directly from within their profiles.', 'buddypress' ),
</ins><span class="cx" style="display: block; padding: 0 10px">                 ),
</span><span class="cx" style="display: block; padding: 0 10px">                'notifications' => array(
</span><span class="cx" style="display: block; padding: 0 10px">                        'title'       => __( 'Notifications', 'buddypress' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'description' => __( 'Notify members of relevant activity with a toolbar bubble and/or via email, and allow them to customize their notification settings.', 'buddypress' )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'description' => __( 'Notify members of relevant activity with a toolbar bubble and/or via email, and allow them to customize their notification settings.', 'buddypress' ),
</ins><span class="cx" style="display: block; padding: 0 10px">                 ),
</span><span class="cx" style="display: block; padding: 0 10px">        );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        $optional_components = bp_core_admin_get_components( 'optional' );
</span><span class="cx" style="display: block; padding: 0 10px">        $required_components = bp_core_admin_get_components( 'required' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $retired_components  = bp_core_admin_get_components( 'retired'  );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $retired_components  = bp_core_admin_get_components( 'retired' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        // Merge optional and required together.
</span><span class="cx" style="display: block; padding: 0 10px">        $all_components = $optional_components + $required_components;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -86,7 +85,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        // deactivated components into activated ones.
</span><span class="cx" style="display: block; padding: 0 10px">        if ( empty( $active_components ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                $deactivated_components = bp_get_option( 'bp-deactivated-components' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( !empty( $deactivated_components ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( ! empty( $deactivated_components ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        // Trim off namespace and filename.
</span><span class="cx" style="display: block; padding: 0 10px">                        $trimmed = array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -96,8 +95,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        // Loop through the optional components to create an active component array.
</span><span class="cx" style="display: block; padding: 0 10px">                        foreach ( array_keys( (array) $optional_components ) as $ocomponent ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if ( !in_array( $ocomponent, $trimmed ) ) {
-                                       $active_components[$ocomponent] = 1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         if ( ! in_array( $ocomponent, $trimmed, true ) ) {
+                                       $active_components[ $ocomponent ] = 1;
</ins><span class="cx" style="display: block; padding: 0 10px">                                 }
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -110,7 +109,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        // Core component is always active.
</span><span class="cx" style="display: block; padding: 0 10px">        $active_components['core'] = $all_components['core'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $inactive_components       = array_diff( array_keys( $all_components ) , array_keys( $active_components ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $inactive_components       = array_diff( array_keys( $all_components ), array_keys( $active_components ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /** Display **************************************************************
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -117,27 +116,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        // Get the total count of all plugins.
</span><span class="cx" style="display: block; padding: 0 10px">        $all_count = count( $all_components );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $page      = bp_core_do_network_admin()  ? 'settings.php' : 'options-general.php';
-       $action    = !empty( $_GET['action'] ) ? $_GET['action'] : 'all';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $page      = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php';
+       $action    = ! empty( $_GET['action'] ) ? $_GET['action'] : 'all';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        switch( $action ) {
-               case 'all' :
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ switch ( $action ) {
+               case 'all':
</ins><span class="cx" style="display: block; padding: 0 10px">                         $current_components = $all_components;
</span><span class="cx" style="display: block; padding: 0 10px">                        break;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                case 'active' :
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         case 'active':
</ins><span class="cx" style="display: block; padding: 0 10px">                         foreach ( array_keys( $active_components ) as $component ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $current_components[$component] = $all_components[$component];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         $current_components[ $component ] = $all_components[ $component ];
</ins><span class="cx" style="display: block; padding: 0 10px">                         }
</span><span class="cx" style="display: block; padding: 0 10px">                        break;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                case 'inactive' :
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         case 'inactive':
</ins><span class="cx" style="display: block; padding: 0 10px">                         foreach ( $inactive_components as $component ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $current_components[$component] = $all_components[$component];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         $current_components[ $component ] = $all_components[ $component ];
</ins><span class="cx" style="display: block; padding: 0 10px">                         }
</span><span class="cx" style="display: block; padding: 0 10px">                        break;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                case 'mustuse' :
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         case 'mustuse':
</ins><span class="cx" style="display: block; padding: 0 10px">                         $current_components = $required_components;
</span><span class="cx" style="display: block; padding: 0 10px">                        break;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                case 'retired' :
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         case 'retired':
</ins><span class="cx" style="display: block; padding: 0 10px">                         $current_components = $retired_components;
</span><span class="cx" style="display: block; padding: 0 10px">                        break;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -179,7 +178,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'action' => 'retired',
</span><span class="cx" style="display: block; padding: 0 10px">                        'view'   => sprintf(
</span><span class="cx" style="display: block; padding: 0 10px">                                /* translators: %s: the number of retired components */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                _n( 'Retired <span class="count">(%s)</span>',  'Retired <span class="count">(%s)</span>',  count( $retired_components ),  'buddypress' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         _n( 'Retired <span class="count">(%s)</span>', 'Retired <span class="count">(%s)</span>', count( $retired_components ), 'buddypress' ),
</ins><span class="cx" style="display: block; padding: 0 10px">                                 number_format_i18n( count( $retired_components ) )
</span><span class="cx" style="display: block; padding: 0 10px">                        ),
</span><span class="cx" style="display: block; padding: 0 10px">                ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -196,11 +195,27 @@
</span><span class="cx" style="display: block; padding: 0 10px">        <ul class="subsubsub">
</span><span class="cx" style="display: block; padding: 0 10px">                <?php foreach ( $component_views as $component_view ) : ?>
</span><span class="cx" style="display: block; padding: 0 10px">                        <li>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                <a href="<?php echo esc_url( add_query_arg( array( 'page' => 'bp-components', 'action' => $component_view['action'] ), bp_get_admin_url( $page ) ) ); ?>" <?php if ( $action === $component_view['action'] ) : ?>class="current"<?php endif; ?>>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         <a href="
+                               <?php
+                               echo esc_url(
+                                       add_query_arg(
+                                               array(
+                                                       'page'   => 'bp-components',
+                                                       'action' => $component_view['action'],
+                                               ),
+                                               bp_get_admin_url( $page )
+                                       )
+                               );
+                               ?>
+                                                       "
+                       <?php
+                       if ( $action === $component_view['action'] ) :
+                               ?>
+                                       class="current"<?php endif; ?>>
</ins><span class="cx" style="display: block; padding: 0 10px">                                         <?php echo wp_kses( $component_view['view'], array( 'span' => array( 'class' => true ) ) ); ?>
</span><span class="cx" style="display: block; padding: 0 10px">                                </a><?php echo 'retired' !== $component_view['action'] ? ' |' : ''; ?>
</span><span class="cx" style="display: block; padding: 0 10px">                        </li>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                <?php endforeach ;?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         <?php endforeach; ?>
</ins><span class="cx" style="display: block; padding: 0 10px">         </ul>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        <h3 class="screen-reader-text">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -233,8 +248,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                <?php foreach ( $current_components as $name => $labels ) : ?>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                        <?php
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        if ( ! in_array( $name, array( 'core', 'members' ) ) ) {
-                                               $class = isset( $active_components[esc_attr( $name )] ) ? 'active' : 'inactive';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 if ( ! in_array( $name, array( 'core', 'members' ), true ) ) {
+                                               $class = isset( $active_components[ esc_attr( $name ) ] ) ? 'active' : 'inactive';
</ins><span class="cx" style="display: block; padding: 0 10px">                                         } else {
</span><span class="cx" style="display: block; padding: 0 10px">                                                $class = 'active';
</span><span class="cx" style="display: block; padding: 0 10px">                                        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -243,10 +258,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        <tr id="<?php echo esc_attr( $name ); ?>" class="<?php echo esc_attr( $name ) . ' ' . esc_attr( $class ); ?>">
</span><span class="cx" style="display: block; padding: 0 10px">                                                <th scope="row" class="check-column">
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                        <?php if ( ! in_array( $name, array( 'core', 'members' ) ) ) : ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                                 <?php if ( ! in_array( $name, array( 'core', 'members' ), true ) ) : ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                                <input type="checkbox" id="<?php echo esc_attr( "bp_components[$name]" ); ?>" name="<?php echo esc_attr( "bp_components[$name]" ); ?>" value="1"<?php checked( isset( $active_components[esc_attr( $name )] ) ); ?> />
-                                                               <label for="<?php echo esc_attr( "bp_components[$name]" ); ?>" class="screen-reader-text">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                                         <input
+                                                                       type="checkbox"
+                                                                       id="<?php echo esc_attr( "bp_components[ $name ]" ); ?>"
+                                                                       name="<?php echo esc_attr( "bp_components[ $name ]" ); ?>"
+                                                                       value="1"<?php checked( isset( $active_components[ esc_attr( $name ) ] ) ); ?>
+                                                               />
+                                                               <label for="<?php echo esc_attr( "bp_components[ $name ]" ); ?>" class="screen-reader-text">
</ins><span class="cx" style="display: block; padding: 0 10px">                                                                         <?php
</span><span class="cx" style="display: block; padding: 0 10px">                                                                                /* translators: accessibility text */
</span><span class="cx" style="display: block; padding: 0 10px">                                                                                printf( esc_html__( 'Select %s', 'buddypress' ), esc_html( $labels['title'] ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -257,7 +277,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                                </th>
</span><span class="cx" style="display: block; padding: 0 10px">                                                <td class="plugin-title column-primary">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                        <label for="<?php echo esc_attr( "bp_components[$name]" ); ?>">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                                 <label for="<?php echo esc_attr( "bp_components[ $name ]" ); ?>">
</ins><span class="cx" style="display: block; padding: 0 10px">                                                                 <span aria-hidden="true"></span>
</span><span class="cx" style="display: block; padding: 0 10px">                                                                <strong><?php echo esc_html( $labels['title'] ); ?></strong>
</span><span class="cx" style="display: block; padding: 0 10px">                                                        </label>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -346,10 +366,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $bp = buddypress();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Save settings and upgrade schema.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
-               require_once( $bp->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         require_once ABSPATH . 'wp-admin/includes/upgrade.php';
+               require_once $bp->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $submitted = stripslashes_deep( $_POST['bp_components'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $submitted             = stripslashes_deep( $_POST['bp_components'] );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $bp->active_components = bp_core_admin_get_active_components_from_submitted_settings( $submitted );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                bp_core_install( $bp->active_components );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -408,7 +428,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function bp_core_admin_get_active_components_from_submitted_settings( $submitted ) {
</span><span class="cx" style="display: block; padding: 0 10px">        $current_action = 'all';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'active', 'inactive', 'retired' ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'active', 'inactive', 'retired' ), true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                 $current_action = $_GET['action'];
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -415,7 +435,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        $current_components = buddypress()->active_components;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        switch ( $current_action ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                case 'retired' :
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         case 'retired':
</ins><span class="cx" style="display: block; padding: 0 10px">                         $retired_components = bp_core_admin_get_components( 'retired' );
</span><span class="cx" style="display: block; padding: 0 10px">                        foreach ( array_keys( $retired_components ) as $retired_component ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                if ( ! isset( $submitted[ $retired_component ] ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -423,14 +443,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                }
</span><span class="cx" style="display: block; padding: 0 10px">                        } // Fall through.
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
-               case 'inactive' :
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         case 'inactive':
</ins><span class="cx" style="display: block; padding: 0 10px">                         $components = array_merge( $submitted, $current_components );
</span><span class="cx" style="display: block; padding: 0 10px">                        break;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                case 'all' :
-               case 'active' :
-               default :
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         case 'all':
+               case 'active':
+               default:
</ins><span class="cx" style="display: block; padding: 0 10px">                         $components = $submitted;
</span><span class="cx" style="display: block; padding: 0 10px">                        break;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -446,7 +465,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * @since 1.7.0
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $type Optional; component type to fetch. Default value is 'all', or 'optional', 'retired', 'required'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $type Optional; Component type to fetch. Defaults to 'all'.
+ *                     Possible values include 'all', 'optional', 'retired', and 'required'.
</ins><span class="cx" style="display: block; padding: 0 10px">  * @return array Requested components' data.
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> function bp_core_admin_get_components( $type = 'all' ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -460,7 +480,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @param array  $components Array of component information.
</span><span class="cx" style="display: block; padding: 0 10px">         * @param string $type       Type of component list requested.
</span><span class="cx" style="display: block; padding: 0 10px">         *                           Possible values include 'all', 'optional',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         *                           'retired', 'required'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  *                           'retired', and 'required'.
</ins><span class="cx" style="display: block; padding: 0 10px">          */
</span><span class="cx" style="display: block; padding: 0 10px">        return apply_filters( 'bp_core_admin_get_components', $components, $type );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre>
</div>
</div>

</body>
</html>