Skip to content

Commit

Permalink
Merge branch 'release'
Browse files Browse the repository at this point in the history
  • Loading branch information
mehedi-bb committed Feb 3, 2025
2 parents 5b6e211 + d0ce9c0 commit c6f4747
Show file tree
Hide file tree
Showing 64 changed files with 557 additions and 572 deletions.
2 changes: 1 addition & 1 deletion bp-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: The BuddyBoss Platform adds community features to WordPress. Member Profiles, Activity Feeds, Direct Messaging, Notifications, and more!
* Author: BuddyBoss
* Author URI: https://buddyboss.com/
* Version: 2.7.80
* Version: 2.7.90
* Text Domain: buddyboss
* Domain Path: /src/languages
* License: GPLv2 or later (license.txt)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@
},
"license": "GPL-2.0-or-later",
"version": "3.1.0",
"BBVersion": "2.7.80"
"BBVersion": "2.7.90"
}
2 changes: 1 addition & 1 deletion src/bp-activity/classes/class-bp-activity-component.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class BP_Activity_Component extends BP_Component {
public function __construct() {
parent::start(
'activity',
__( 'Activity Feeds', 'buddyboss' ),
'Activity Feeds',
buddypress()->plugin_dir,
array(
'adminbar_myaccount_order' => 25,
Expand Down
2 changes: 1 addition & 1 deletion src/bp-activity/classes/class-bp-activity-notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static function instance() {
*/
public function __construct() {
// Initialize.
$this->start();
add_action( 'bp_init', array( $this, 'start' ), 5 );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/bp-blogs/classes/class-bp-blogs-component.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class BP_Blogs_Component extends BP_Component {
public function __construct() {
parent::start(
'blogs',
__( 'Site Directory', 'buddyboss' ),
'Site Directory',
buddypress()->plugin_dir,
array(
'adminbar_myaccount_order' => 30,
Expand Down
37 changes: 0 additions & 37 deletions src/bp-core/admin/templates/upgrade-screen.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,43 +26,6 @@

<h1 class="bb-advance-heading"><?php esc_html_e( 'Unlock more social networking features for your websites', 'buddyboss' ); ?></h1>
<div class="bb-upgrade-wrap">
<div class="bb-advance-card bb-advance-card--hero">
<div class="card-inner-wrap">
<div class="card-figure-wrapper">
<div class="card-figure">
<img alt="" class="upgrade-figure" src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/images/upgrade/bb-upgrade-card-rapyd.png' ); ?>" />
</div>
</div>
<div class="card-data">
<h2><?php esc_html_e( 'Rapyd Cloud', 'buddyboss' ); ?></h2>
<div class="card-subtitle"><?php esc_html_e( 'The highest performance managed WordPress hosting on the planet', 'buddyboss' ); ?></div>
<div class="advance-card-note">
<p class="wp-upgrade-description">
<?php esc_html_e( 'Many hosting providers claim to have the best performance. But when you add dynamic features and high concurrency, website performance suffers. Rapyd keeps your feature-rich websites fast and responsive, even during periods of very high traffic.', 'buddyboss' ); ?>
</p>
</div>
<div class="advance-card-action">
<a href="
<?php
echo esc_url(
bp_get_admin_url(
add_query_arg(
array(
'page' => 'bb-upgrade',
'tab' => 'bb-performance-tester',
),
'admin.php'
)
)
);
?>
" class="advance-action-button"><?php esc_html_e( 'Test Performance', 'buddyboss' ); ?></a>
<a href="https://rapyd.cloud/?fpr=buddyboss93" class="advance-action-link" target="_blank"><?php esc_html_e( 'View Pricing', 'buddyboss' ); ?><i class="bb-icon-l bb-icon-arrow-up"></i></a>
</div>
</div>
</div>
</div>

<div class="bb-advance-card bb-advance-card--pro">
<div class="card-inner-wrap">
<div class="card-figure">
Expand Down
10 changes: 0 additions & 10 deletions src/bp-core/bb-core-native-presence.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,6 @@
// Include BB_Presence class.
require_once __DIR__ . '/classes/class-bb-presence.php';

// File from the build version.
$buddyboss_lang = WP_PLUGIN_DIR . '/buddyboss-platform/languages/';
if ( ! is_dir( $buddyboss_lang ) ) {
// File from the development version.
$buddyboss_lang = WP_PLUGIN_DIR . '/buddyboss-platform/src/languages/';
}
if ( ! empty( $buddyboss_lang ) && function_exists( 'load_plugin_textdomain' ) ) {
load_plugin_textdomain( 'buddyboss', false, $buddyboss_lang );
}

BB_Presence::instance()->bb_presence_mu_loader();

$loggedin_user_id = ! empty( get_current_user_id() ) ? get_current_user_id() : BB_Presence::instance()->bb_get_loggedin_user_id();
Expand Down
2 changes: 1 addition & 1 deletion src/bp-core/bp-core-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
add_action( 'template_redirect', 'bp_restrict_single_attachment', 999 );

// Load Post Notifications.
add_action( 'bp_core_components_included', 'bb_load_post_notifications' );
add_action( 'bp_loaded', 'bb_load_post_notifications' );
add_action( 'comment_post', 'bb_post_new_comment_reply_notification', 20, 3 );
add_action( 'wp_insert_comment', 'bb_post_new_comment_reply_notification_helper', 20, 2 );
add_action( 'transition_comment_status', 'bb_post_comment_on_status_change', 20, 3 );
Expand Down
8 changes: 7 additions & 1 deletion src/bp-core/bp-core-filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -1774,7 +1774,13 @@ function bp_core_cron_schedules( $schedules = array() ) {

return $schedules;
}
add_filter( 'cron_schedules', 'bp_core_cron_schedules', 99, 1 ); // phpcs:ignore WordPress.WP.CronInterval.CronSchedulesInterval

add_action(
'bp_init',
function () {
add_filter( 'cron_schedules', 'bp_core_cron_schedules', 99, 1 ); // phpcs:ignore WordPress.WP.CronInterval.CronSchedulesInterval
}
);

/**
* Filter to update the Avatar URL for the rest api.
Expand Down
75 changes: 2 additions & 73 deletions src/bp-core/bp-core-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2342,77 +2342,6 @@ function bp_is_get_request() {

/** Miscellaneous hooks *******************************************************/

/**
* Load the buddyboss translation file for current language.
*
* @since BuddyPress 1.0.2
*
* @see load_textdomain() for a description of return values.
*
* @return bool True on success, false on failure.
*/
function bp_core_load_buddypress_textdomain() {
global $wp_version;
$domain = 'buddyboss';

if ( version_compare( $wp_version, '6.7', '<=' ) ) {
/**
* Filters the locale to be loaded for the language files.
*
* @since BuddyPress 1.0.2
*
* @param string $value Current locale for the install.
*/
$mofile_custom = sprintf( '%s-%s.mo', $domain, apply_filters( 'buddypress_locale', get_locale() ) );

$plugin_dir = BP_PLUGIN_DIR;
if ( defined( 'BP_SOURCE_SUBDIRECTORY' ) && ! empty( constant( 'BP_SOURCE_SUBDIRECTORY' ) ) ) {
$plugin_dir = $plugin_dir . 'src';
}

/**
* Filters the locations to load language files from.
*
* @since BuddyPress 2.2.0
*
* @param array $value Array of directories to check for language files in.
*/
$locations = apply_filters(
'buddypress_locale_locations',
array(
trailingslashit( WP_LANG_DIR . '/' . $domain ),
trailingslashit( WP_LANG_DIR ),
trailingslashit( $plugin_dir . '/languages' ),
)
);

unload_textdomain( $domain );

// Try custom locations in WP_LANG_DIR.
foreach ( $locations as $location ) {
if ( load_textdomain( 'buddyboss', $location . $mofile_custom ) ) {
return true;
}
}
} else {
/**
* In most cases, WordPress already loaded BuddyBoss textdomain
* thanks to the `_load_textdomain_just_in_time()` function.
*/
if ( is_textdomain_loaded( $domain ) ) {
return true;
}
}

$plugin_folder = plugin_basename( BP_PLUGIN_DIR );
$buddyboss_lang_path = $plugin_folder . '/languages';
if ( defined( 'BP_SOURCE_SUBDIRECTORY' ) && ! empty( constant( 'BP_SOURCE_SUBDIRECTORY' ) ) ) {
$buddyboss_lang_path = $plugin_folder . '/src/languages';
}
return load_plugin_textdomain( $domain, false, $buddyboss_lang_path );
}
add_action( 'bp_core_loaded', 'bp_core_load_buddypress_textdomain' );

/**
* A JavaScript-free implementation of the search functions in BuddyPress.
*
Expand Down Expand Up @@ -2754,7 +2683,7 @@ function bp_core_get_components( $type = 'all' ) {
);

if ( class_exists( 'BB_Platform_Pro' ) && function_exists( 'is_plugin_active' ) && is_plugin_active( 'buddyboss-platform-pro/buddyboss-platform-pro.php' ) ) {
$plugin_data = get_plugin_data( trailingslashit( WP_PLUGIN_DIR ) . 'buddyboss-platform-pro/buddyboss-platform-pro.php' );
$plugin_data = get_plugin_data( trailingslashit( WP_PLUGIN_DIR ) . 'buddyboss-platform-pro/buddyboss-platform-pro.php', false, false );
$plugin_version = ! empty( $plugin_data['Version'] ) ? $plugin_data['Version'] : 0;
if ( $plugin_version && version_compare( $plugin_version, '1.0.9', '>' ) ) {
$optional_components['messages']['settings'] = bp_get_admin_url(
Expand Down Expand Up @@ -9903,7 +9832,7 @@ function bb_remove_deleted_user_last_activities() {
$table_exists = $wpdb->get_var( "SHOW TABLES LIKE '{$bp_prefix}bp_activity'" );

if ( $table_exists ) {
$sql = "DELETE a FROM {$bp_prefix}bp_activity a LEFT JOIN {$wpdb->users} u ON a.user_id = u.ID WHERE u.ID IS NULL AND a.component = 'members' AND a.type = 'last_activity'";
$sql = "DELETE a FROM {$bp_prefix}bp_activity a LEFT JOIN {$wpdb->users} u ON a.user_id = u.ID WHERE ( u.ID IS NULL OR u.user_status != 0 ) AND a.component = 'members' AND a.type = 'last_activity'";
$wpdb->query( $sql ); // phpcs:ignore

// Also remove duplicates last_activity per user if any.
Expand Down
10 changes: 5 additions & 5 deletions src/bp-core/bp-core-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ function bp_get_default_options() {
/* XProfile **********************************************************/

// Default profile groups name.
'bp-xprofile-base-group-name' => __( 'Details', 'buddyboss' ),
'bp-xprofile-base-group-name' => 'Details',

// Default fullname field name.
'bp-xprofile-firstname-field-name' => __( 'First Name', 'buddyboss' ),
'bp-xprofile-firstname-field-name' => 'First Name',

// Default fullname field name.
'bp-xprofile-lastname-field-name' => __( 'Last Name', 'buddyboss' ),
'bp-xprofile-lastname-field-name' => 'Last Name',

// Default fullname field name.
'bp-xprofile-nickname-field-name' => __( 'Nickname', 'buddyboss' ),
'bp-xprofile-nickname-field-name' => 'Nickname',

// Default fullname field name. (for backward compat).
'bp-xprofile-fullname-field-name' => __( 'Name', 'buddyboss' ),
'bp-xprofile-fullname-field-name' => 'Name',

'bp-display-name-format' => 'first_name',

Expand Down
4 changes: 4 additions & 0 deletions src/bp-core/bp-core-update.php
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,10 @@ function bp_version_updater() {
if ( function_exists( 'bb_migrate_xprofile_visibility' ) ) {
bb_migrate_xprofile_visibility( true );
}

if ( function_exists( 'bb_remove_deleted_user_last_activities' ) ) {
bb_remove_deleted_user_last_activities();
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/bp-core/classes/class-bb-post-notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static function instance() {
*/
public function __construct() {
// Initialize.
$this->start();
add_action( 'bp_init', array( $this, 'start' ), 5 );
}

/**
Expand Down
35 changes: 35 additions & 0 deletions src/bp-core/classes/class-bb-presence.php
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,8 @@ public function bb_presence_mu_loader() {
add_filter( 'bb_rest_cache_pre_current_user_id', array( $this, 'bb_cookie_support' ), 1 );
add_filter( 'bb_rest_cache_pre_current_user_id', array( $this, 'bb_jwt_auth_support' ), 2 );

$this->bb_load_translations();

if ( ! isset( $_GET['bypass'] ) ) { // phpcs:ignore
$this->bb_prepare_presence_mu();
}
Expand Down Expand Up @@ -1041,6 +1043,39 @@ public function bb_endpoint_render( $user_id, $ids ) {
echo wp_json_encode( apply_filters( 'rest_post_dispatch_cache', $presence_data, $current_endpoint ) );
exit;
}

/**
* Function to load translations at mu level.
*
* @since BuddyBoss 2.7.90
*/
public function bb_load_translations() {
$domain = 'buddyboss';
if ( function_exists( 'is_textdomain_loaded' ) && ! is_textdomain_loaded( $domain ) ) {
$mofile_custom = sprintf( '%s-%s.mo', $domain, get_locale() );
$buddyboss_lang = WP_PLUGIN_DIR . '/buddyboss-platform/languages/';
if ( ! is_dir( $buddyboss_lang ) ) {
// File from the development version.
$buddyboss_lang = WP_PLUGIN_DIR . '/buddyboss-platform/src/languages/';
}
if ( ! empty( $buddyboss_lang ) && function_exists( 'load_textdomain' ) ) {

$locations = array(
trailingslashit( WP_LANG_DIR . '/' . $domain ),
trailingslashit( WP_LANG_DIR ),
trailingslashit( WP_LANG_DIR . '/plugins' ),
trailingslashit( $buddyboss_lang ),
);

// Try to load the translations from locations.
foreach ( $locations as $location ) {
if ( load_textdomain( $domain, $location . $mofile_custom ) ) {
return true;
}
}
}
}
}
}

BB_Presence::instance();
Expand Down
21 changes: 19 additions & 2 deletions src/bp-core/classes/class-bp-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class BP_Core extends BP_Component {
public function __construct() {
parent::start(
'core',
__( 'BuddyBoss Core', 'buddyboss' ),
'BuddyBoss Core',
buddypress()->plugin_dir
);

Expand Down Expand Up @@ -70,7 +70,24 @@ private function load_components() {
*
* @param array $value Array of included and optional components.
*/
$bp->optional_components = apply_filters( 'bp_optional_components', array_keys( bp_core_get_components( 'optional' ) ) );
$bp->optional_components = apply_filters( 'bp_optional_components',
array(
'settings',
'notifications',
'groups',
'forums',
'activity',
'media',
'document',
'video',
'messages',
'friends',
'invites',
'moderation',
'search',
'blogs',
)
);

/**
* Filters the required components.
Expand Down
2 changes: 1 addition & 1 deletion src/bp-core/gdpr/class-bp-core-gdpr.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class BP_Core_Gdpr {

public function __construct() {
$this->load_on_bp_dependency();
add_action( 'bp_loaded', array( $this, 'load_on_bp_dependency' ), 0 );
}

/**
Expand Down
13 changes: 8 additions & 5 deletions src/bp-core/profile-search/bps-xprofile.php
Original file line number Diff line number Diff line change
Expand Up @@ -583,26 +583,29 @@ function bp_ps_learndash_get_users_for_course( $course_id = 0, $query_args = arr
$query_args['role__not_in'] = array( 'administrator' );
}

$course_access_list = get_course_meta_setting( $course_id, 'course_access_list' );
$course_user_ids = array_merge( $course_user_ids, $course_access_list );
if ( function_exists( 'learndash_use_legacy_course_access_list' ) && true === learndash_use_legacy_course_access_list() ) {
$course_access_list = function_exists( 'learndash_get_course_meta_setting' ) ? learndash_get_course_meta_setting( $course_id, 'course_access_list' ) : get_course_meta_setting( $course_id, 'course_access_list' );
$course_user_ids = array_merge( $course_user_ids, $course_access_list );
}

$course_access_users = get_course_users_access_from_meta( $course_id );
$course_access_users = function_exists( 'learndash_get_course_users_access_from_meta' ) ? learndash_get_course_users_access_from_meta( $course_id ) : get_course_users_access_from_meta( $course_id );
$course_user_ids = array_merge( $course_user_ids, $course_access_users );

if ( function_exists( 'learndash_get_course_groups_users_access' ) ) {
$course_groups_users = learndash_get_course_groups_users_access( $course_id );
} else {
$course_groups_users = get_course_groups_users_access( $course_id );
}

$course_user_ids = array_merge( $course_user_ids, $course_groups_users );

if ( ! empty( $course_user_ids ) ) {
$course_user_ids = array_unique( $course_user_ids );
}

$course_expired_access_users = get_course_expired_access_from_meta( $course_id );
$course_expired_access_users = function_exists( 'learndash_get_course_expired_access_from_meta' ) ? learndash_get_course_expired_access_from_meta( $course_id ) : get_course_expired_access_from_meta( $course_id );
if ( ! empty( $course_expired_access_users ) ) {
$course_user_ids = array_diff( $course_access_list, $course_expired_access_users );
$course_user_ids = array_diff( $course_user_ids, $course_expired_access_users );
}

if ( ! empty( $course_user_ids ) ) {
Expand Down
Loading

0 comments on commit c6f4747

Please sign in to comment.