Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/01/2024 07:41:30 PM (10 months ago)
Author:
espellcaste
Message:

WPCS: Part II: miscellaneous fixes for some of the files of the core component.

Follow-up to 13883.

See #9164 and #7228

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/admin/bp-core-admin-schema.php

    r13497 r13886  
    2222 */
    2323function bp_core_install( $active_components = false ) {
    24 
    2524    bp_pre_schema_upgrade();
    2625
     
    4544
    4645    // Notifications.
    47     if ( !empty( $active_components['notifications'] ) ) {
     46    if ( ! empty( $active_components['notifications'] ) ) {
    4847        bp_core_install_notifications();
    4948    }
    5049
    5150    // Friend Connections.
    52     if ( !empty( $active_components['friends'] ) ) {
     51    if ( ! empty( $active_components['friends'] ) ) {
    5352        bp_core_install_friends();
    5453    }
    5554
    5655    // Extensible Groups.
    57     if ( !empty( $active_components['groups'] ) ) {
     56    if ( ! empty( $active_components['groups'] ) ) {
    5857        bp_core_install_groups();
    5958    }
    6059
    6160    // Private Messaging.
    62     if ( !empty( $active_components['messages'] ) ) {
     61    if ( ! empty( $active_components['messages'] ) ) {
    6362        bp_core_install_private_messaging();
    6463    }
    6564
    6665    // Extended Profiles.
    67     if ( !empty( $active_components['xprofile'] ) ) {
     66    if ( ! empty( $active_components['xprofile'] ) ) {
    6867        bp_core_install_extended_profiles();
    6968    }
    7069
    7170    // Blog tracking.
    72     if ( !empty( $active_components['blogs'] ) ) {
     71    if ( ! empty( $active_components['blogs'] ) ) {
    7372        bp_core_install_blog_tracking();
    7473    }
     
    7978 *
    8079 * @since 1.0.0
    81  *
    8280 */
    8381function bp_core_install_notifications() {
     
    120118 *
    121119 * @since 1.0.0
    122  *
    123120 */
    124121function bp_core_install_activity_streams() {
     
    170167 *
    171168 * @since 1.0.0
    172  *
    173169 */
    174170function bp_core_install_friends() {
     
    195191 *
    196192 * @since 1.0.0
    197  *
    198193 */
    199194function bp_core_install_groups() {
     
    254249 *
    255250 * @since 1.0.0
    256  *
    257251 */
    258252function bp_core_install_private_messaging() {
     
    312306 * @since 1.0.0
    313307 *
     308 * @global wpdb $wpdb WordPress database object.
    314309 */
    315310function bp_core_install_extended_profiles() {
     
    404399 *
    405400 * @since 1.0.0
    406  *
    407401 */
    408402function bp_core_install_blog_tracking() {
     
    444438
    445439    // Signups is not there and we need it so let's create it.
    446     require_once( buddypress()->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php' );
    447     require_once( ABSPATH                  . 'wp-admin/includes/upgrade.php'     );
     440    require_once buddypress()->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php';
     441    require_once ABSPATH . 'wp-admin/includes/upgrade.php';
    448442
    449443    // Never use bp_core_get_table_prefix() for any global users tables.
     
    459453    // Filter out all the queries except wp_signups.
    460454    foreach ( $create_queries as $key => $query ) {
    461         if ( preg_match( "|CREATE TABLE ([^ ]*)|", $query, $matches ) ) {
     455        if ( preg_match( '|CREATE TABLE ([^ ]*)|', $query, $matches ) ) {
    462456            if ( trim( $matches[1], '`' ) !== $wpdb->signups ) {
    463457                unset( $create_queries[ $key ] );
     
    540534        foreach ( $tt_ids as $tt_id ) {
    541535            $term = get_term_by( 'term_taxonomy_id', (int) $tt_id, bp_get_email_tax_type() );
    542             wp_update_term( (int) $term->term_id, bp_get_email_tax_type(), array(
    543                 'description' => $descriptions[ $id ],
    544             ) );
     536            wp_update_term(
     537                (int) $term->term_id,
     538                bp_get_email_tax_type(),
     539                array(
     540                    'description' => $descriptions[ $id ],
     541                )
     542            );
    545543        }
    546544    }
     
    569567    $charset_collate = $GLOBALS['wpdb']->get_charset_collate();
    570568    $bp_prefix       = bp_core_get_table_prefix();
    571     $sql[] = "CREATE TABLE {$bp_prefix}bp_invitations (
     569    $sql[]           = "CREATE TABLE {$bp_prefix}bp_invitations (
    572570        id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    573571        user_id bigint(20) NOT NULL,
     
    616614    $optouts_class   = new BP_Optout();
    617615    $table_name      = $optouts_class->get_table_name();
    618     $sql = "CREATE TABLE {$table_name} (
     616    $sql             = "CREATE TABLE {$table_name} (
    619617        id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    620618        email_address_hash varchar(255) NOT NULL,
Note: See TracChangeset for help on using the changeset viewer.