Architecture and Core Classes
BuddyPress Status follows the standard WordPress plugin architecture: a small bootstrap file registers activation, loads the core class, and hooks into bp_include to start execution after BuddyPress is loaded.
Bootstrap and Entry Point
Section titled “Bootstrap and Entry Point”The plugin’s entry point is buddypress-status.php. It defines these constants:
| Constant | Value |
|---|---|
BPSTS_PLUGIN_VERSION |
Current version string (3.3.0) |
BPSTS_PLUGIN_FILE |
Absolute path to the main plugin file |
BPSTS_PLUGIN_BASENAME |
plugin_basename() of the main file |
BPSTS_PLUGIN_URL |
URL to the plugin directory |
BPSTS_PLUGIN_PATH |
Filesystem path to the plugin directory |
BPSTS_STATUS_MAX_LENGTH |
Character limit for status text (140) |
Execution starts on bp_include, not plugins_loaded, which guarantees BuddyPress is available before any BuddyPress function is called.
add_action( 'bp_include', 'buddypress_status_begin_execution' );Directory Structure
Section titled “Directory Structure”buddypress-status/├── admin/│ ├── class-buddypress-status-admin.php # Legacy class: register_setting x3 + sanitizers only│ └── index.php├── assets/│ ├── css/ # Admin card-panel styles (admin.css, admin-settings.css)│ ├── js/ # Admin JS (admin.js)│ └── vendor/fontawesome/ # Bundled Font Awesome 6.5.1 (css + webfonts)├── includes/│ ├── class-buddypress-status.php # Core orchestrator│ ├── class-buddypress-status-loader.php # Hook queue│ ├── class-buddypress-status-i18n.php # Translations│ ├── buddypress-status-general-functions.php # Helper functions and most filters│ ├── buddypress-status-emoji-data.php # Emoji dataset│ └── admin/│ ├── class-bpsts-admin.php # Admin card-panel controller│ └── views/ # Tab view partials (shell, hub, overview,│ # settings-general, settings-global-status,│ # settings-feeling-activities, faq, license)├── public/│ ├── class-buddypress-status-public.php # Frontend logic and AJAX handlers│ ├── css/│ ├── js/│ ├── icons/│ └── inc/│ └── bpsts-add-status.php # Status form template├── edd-license/ # EDD license client + updater├── languages/└── buddypress-status.php # BootstrapCore Classes
Section titled “Core Classes”Buddypress_Status
Section titled “Buddypress_Status”File: includes/class-buddypress-status.php
The orchestrator. Its constructor:
- Applies the
buddypress_status_theme_supportfilter to decide which theme-specific code paths to activate (defaultarray( 'reign-theme', 'buddyx-pro' )). - Sets the plugin name (
buddypress-status) and version. - Calls
load_dependencies(),set_locale(),define_admin_hooks(), anddefine_public_hooks().
Public methods: run() (fires the loader), get_plugin_name(), get_version(), get_loader().
Buddypress_Status_Loader
Section titled “Buddypress_Status_Loader”File: includes/class-buddypress-status-loader.php
Collects add_action and add_filter calls during setup, then registers them all when run() is called. This decouples hook registration from execution.
BPSTS_Admin
Section titled “BPSTS_Admin”File: includes/admin/class-bpsts-admin.php
Owns the wp-admin interface (the 3.3.0 card-panel migration):
- Registers the shared WB Plugins top-level menu and the BP Status submenu on
admin_menu(menu slugbuddypress_status). - Renders the six-tab settings page (Overview, General, Global Status, Feeling Activities, Support, License) from the partials in
includes/admin/views/. - Enqueues admin CSS/JS and the bundled Font Awesome on its own screens only.
Buddypress_Status_Admin (legacy)
Section titled “Buddypress_Status_Admin (legacy)”File: admin/class-buddypress-status-admin.php
Retained only to register the three settings groups (register_setting x3) and their sanitizers (sanitize_general_settings, sanitize_global_statuses, sanitize_feeling_activities) on admin_init. It no longer renders menus or pages.
Buddypress_Status_Public
Section titled “Buddypress_Status_Public”File: public/class-buddypress-status-public.php
All frontend behaviour lives here:
- Enqueues CSS and JS on BuddyPress pages (activity, members, groups, and user profiles).
- Registers the profile status sub-navigation item.
- Renders the current status in the profile header via
bp_before_member_header_meta(orbp_before_member_in_header_metafor BuddyBoss Theme). - Renders a truncated status in the members directory via
bp_directory_members_item_meta,bp_member_item_meta,bp_nouveau_members_loop_item, andbp_member_members_list_item. - Handles the five AJAX actions (add, update, delete, set-current, update-icon).
- Registers a custom
activity_statusactivity type and appends mood/feeling data to activity meta.
Theme Compatibility
Section titled “Theme Compatibility”The buddypress_status_theme_support filter accepts an array of theme slugs; themes in that array receive extra compatibility code. Out of the box the array contains 'reign-theme' and 'buddyx-pro'. BuddyBoss Theme is handled by a separate check that swaps the profile-header hook. Youzify, when active, adds the status form via Youzify’s own header hook.
Asset Loading
Section titled “Asset Loading”Assets are enqueued only on BuddyPress pages. Font Awesome 6.5.1 is bundled with the plugin and served from assets/vendor/fontawesome/, not from an external CDN. To avoid conflicts, the public class deregisters common Font Awesome style handles registered by other plugins or themes (font-awesome, fontawesome, font-awesome-4/5/6, fontawesome-all, font-awesome-pro, and similar) before loading its own copy.
Internationalization
Section titled “Internationalization”Text domain: buddypress-status. All user-facing strings pass through standard WordPress i18n functions, and translation loading is handled by Buddypress_Status_i18n.
Build Tools
Section titled “Build Tools”The plugin uses Grunt (gruntfile.js) for CSS minification, RTL CSS generation, JS minification, and .pot generation. Minified and RTL variants are generated artifacts; do not edit them directly.
npm install # Install Grunt and pluginsnpm run build # Run the full build
