Skip to content

Database Schema

BuddyPress Status stores all data in two standard WordPress mechanisms: the wp_options table (for site-wide configuration) and wp_usermeta (for per-user status data). No custom database tables are created.

The main settings array. Written by the admin General tab and set to defaults on plugin activation.

array(
'prof_pg_dis_icon' => 'yes', // Show status form on profile pages ('yes'|'no')
'directory_dis_status' => 'yes', // Show status in members directory ('yes'|'no')
'feeling_activity' => 'yes', // Enable feeling/activity feature ('yes'|'no')
'user_role' => array( // Roles allowed to post statuses
'editor',
'author',
'contributor',
'subscriber',
// All non-administrator roles by default
),
)

Administrators are always allowed to post; the user_role array controls all other roles.

An indexed array of status suggestion strings shown to members as quick-select options. Managed from the Global Status admin tab.

array(
'Working from home 🏠',
'Feeling grateful 🙏',
'On a coffee break ☕',
// ...
)

When empty, the plugin falls back to a built-in set of 20 default suggestions. See buddypress_status_get_default_global_statuses().

An associative array of custom activity categories. Each key is a slug; each value is an array with title, question, and optionally icon and disabled.

array(
'celebrating' => array(
'title' => 'Celebrating',
'question' => 'What are you celebrating?',
'icon' => 'fa-star', // Font Awesome class
// 'disabled' => true // Omit or false to show; true to hide
),
// ...
)

When empty, the plugin falls back to the built-in list returned by buddypress_status_mood_categories(). See the Hooks and Filters reference for the bpsts_feeling_activities filter.

All fields are stored in wp_usermeta keyed by user ID.

An associative array of all statuses the user has saved. Keys are generated as status-{timestamp} (e.g., status-1717780800). Values are the sanitized status text strings.

array(
'status-1717780800' => 'Working from home today',
'status-1717694400' => 'Catching up on emails',
// ...
)

The array is capped at 10 entries. When a user saves an 11th status, the oldest entry (array_shift) is removed to make room.

Stores the key (e.g., status-1717780800) of whichever saved status the user has set as active. When this value matches a key in bpsts_saved_status, that status row is marked with the bpsts-active-status CSS class on the profile page.

When a status is deleted and it was the current status, this meta is cleared.

Stores the emoji the user has selected as their profile icon. The value is an associative array:

array(
'type' => 'emoji', // Always 'emoji' in current version
'unicode' => 'slightly-smiling-face', // Emoji slug key
'name' => 'Happy', // Display name
'category' => 'smileys_emotion', // One of the nine emoji categories
)

Allowed category values (validated server-side):

  • smileys_emotion
  • people_body
  • animals_nature
  • food_drink
  • activities
  • travel_places
  • objects
  • symbols
  • flags

Rate limits are enforced via WordPress transients, not a custom table. The transient key pattern is:

bpsts_rate_{action}_{user_id}

Two limits apply:

Action Transient suffix Limit Window
Adding a status add_status 10 saves 60 seconds
Deleting a status status_actions 20 actions 60 seconds

The helper buddypress_status_is_rate_limited( $user_id, $action, $limit, $window ) checks and increments the transient count. buddypress_status_get_rate_limit_remaining( $user_id, $action ) returns the number of seconds until the window resets.

The plugin writes to the WordPress object cache for two entries, both in the buddypress_status cache group:

Cache key Invalidated when
bpsts_member_status_{user_id} Status is added or set as current
bpsts_user_icon_{user_id} Icon is updated

If your site uses a persistent object cache (Redis, Memcached), these entries are invalidated correctly via wp_cache_delete() on every write.

// Get general settings (with empty-array default)
$settings = get_option( 'bpsts_gnrl_settings' );
// Get a user's saved statuses
$saved = get_user_meta( $user_id, 'bpsts_saved_status', true );
// Get active status key
$current_key = get_user_meta( $user_id, 'bpsts_current_status', true );
// Resolve to text:
$current_text = isset( $saved[ $current_key ] ) ? $saved[ $current_key ] : '';
// Get icon
$icon = get_user_meta( $user_id, 'bpsts_user_icon', true );

The plugin also ships two utility functions:

// Returns the full saved-status array for a user
buddypress_status_get_global_statuses(); // site-wide suggestions
// Returns the feeling activities array (custom or default)
buddypress_status_get_feeling_activities();