62% buddypress

Code Review | BuddyPress

WordPress plugin BuddyPress scored62%from 54 tests.

About plugin

  • Plugin page: buddypress
  • Plugin version: 11.4.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.4
  • WordPress version: 6.3.1
  • First release: Apr 23, 2009
  • Latest release: Oct 30, 2023
  • Number of updates: 535
  • Update frequency: every 9.9 days
  • Top authors: boonebgorges (26.36%)johnjamesjacoby (24.49%)imath (19.63%)DJPaul (14.21%)apeatling (7.48%)

Code review

54 tests

User reviews

360 reviews

Install metrics

100,000+ active /12,131,322 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲8.11MB] [CPU: ▲65.86ms] 50% from 4 tests

This is a short check of server-side resources used by BuddyPress
It is recommended to improve the following
  • RAM: Total memory usage should be kept under 10MB (currently 11.88MB on /wp-admin/themes.php?page=bp-emails-customizer-redirect)
  • Extra RAM: The extra memory usage should kept under 5MB (currently 8.11MB on /wp-admin/themes.php?page=bp-emails-customizer-redirect)
PageMemory (MB)CPU Time (ms)
Home /10.50 ▲7.03107.49 ▲66.44
Dashboard /wp-admin11.75 ▲8.41108.94 ▲50.70
Posts /wp-admin/edit.php11.82 ▲8.46115.75 ▲65.28
Add New Post /wp-admin/post-new.php15.66 ▲9.77175.44 ▲81.01
Media Library /wp-admin/upload.php11.76 ▲8.53117.82 ▲82.75
Add New /wp-admin/post-new.php?post_type=bp-email11.89110.89
Profile Fields /wp-admin/users.php?page=bp-profile-setup12.63102.16
BuddyPress /wp-admin/tools.php?page=bp-tools11.7389.43
BuddyPress Options /wp-admin/options-general.php?page=bp-settings11.7484.67
All Emails /wp-admin/edit.php?post_type=bp-email11.93109.43
Manage Opt-outs /wp-admin/tools.php?page=bp-optouts11.8890.11
BuddyPress Credits /wp-admin/options-general.php?page=bp-credits11.7387.49
Manage Invitations /wp-admin/tools.php?page=bp-members-invitations12.0598.44
BuddyPress /wp-admin/options-general.php?page=bp-components11.7489.64
Emails /wp-admin/themes.php?page=bp-emails-customizer-redirect11.8888.03

Server storage [IO: ▲12.23MB] [DB: ▲0.03MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 1,340 new files
Database: 11 new tables, 36 new options
New tables
wp_bp_xprofile_meta
wp_bp_xprofile_fields
wp_bp_invitations
wp_bp_activity
wp_bp_xprofile_groups
wp_bp_notifications
wp_bp_activity_meta
wp_bp_notifications_meta
wp_bp_xprofile_data
wp_bp_optouts
...
New WordPress options
db_upgraded
hide-loggedout-adminbar
_bp_theme_package_id
bp-disable-account-deletion
_bp_enable_akismet
widget_bp_core_members_widget
bp-emails-unsubscribe-salt
bp-disable-avatar-uploads
widget_bp_messages_sitewide_notices_widget
bp-pages
...

Browser metrics Passed 4 tests

Checking browser requirements for BuddyPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,163 ▲40213.62 ▼0.5010.74 ▲9.1229.99 ▼12.09
Dashboard /wp-admin2,354 ▲1745.62 ▼0.0794.16 ▲5.3042.79 ▲3.26
Posts /wp-admin/edit.php2,262 ▲1592.02 ▲0.0341.63 ▲0.5739.06 ▲4.07
Add New Post /wp-admin/post-new.php1,832 ▲29525.16 ▲6.88675.76 ▲55.7642.70 ▼19.17
Media Library /wp-admin/upload.php1,559 ▲1594.24 ▲0.02103.17 ▲7.2045.47 ▲1.85
Add New /wp-admin/post-new.php?post_type=bp-email2,7487.94192.2878.33
Profile Fields /wp-admin/users.php?page=bp-profile-setup1,1532.2045.5927.60
BuddyPress /wp-admin/tools.php?page=bp-tools1,0311.8229.7335.81
BuddyPress Options /wp-admin/options-general.php?page=bp-settings1,1811.8223.3131.51
All Emails /wp-admin/edit.php?post_type=bp-email3,7912.2339.1038.71
Manage Opt-outs /wp-admin/tools.php?page=bp-optouts1,3011.7425.1133.61
BuddyPress Credits /wp-admin/options-general.php?page=bp-credits1,3771.7326.2053.12
Manage Invitations /wp-admin/tools.php?page=bp-members-invitations1,3751.6626.9535.92
BuddyPress /wp-admin/options-general.php?page=bp-components1,4331.6725.2735.51
Emails /wp-admin/themes.php?page=bp-emails-customizer-redirect9,29124.13564.98118.37

Uninstaller [IO: ▲0.00MB] [DB: ▲0.03MB] 50% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The plugin did not uninstall successfully, leaving 11 tables in the database
    • wp_bp_activity
    • wp_bp_notifications
    • wp_bp_xprofile_groups
    • wp_bp_invitations
    • wp_bp_activity_meta
    • wp_bp_xprofile_meta
    • wp_signups
    • wp_bp_notifications_meta
    • wp_bp_xprofile_fields
    • wp_bp_optouts
    • ...
  • This plugin does not fully uninstall, leaving 36 options in the database
    • widget_bp_messages_sitewide_notices_widget
    • _bp_initial_major_version
    • can_compress_scripts
    • bp-emails-unsubscribe-salt
    • _bp_db_version
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_bp_core_recently_active_widget
    • bp-disable-group-cover-image-uploads
    • bp-deactivated-components
    • ...

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 6× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/buddypress/bp-templates/bp-nouveau/buddypress/assets/widgets/friends.php
    • > /wp-content/plugins/buddypress/bp-templates/bp-nouveau/buddypress/assets/widgets/dynamic-groups.php
    • > /wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/assets/widgets/dynamic-members.php
    • > /wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/assets/widgets/friends.php
    • > /wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/assets/widgets/dynamic-groups.php
    • > /wp-content/plugins/buddypress/bp-templates/bp-nouveau/buddypress/assets/widgets/dynamic-members.php
  • 355× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/buddypress/bp-messages/actions/read.php:49
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bp_nouveau_get_component_slug() in wp-content/plugins/buddypress/bp-templates/bp-nouveau/buddypress/common/search-and-filters-bar.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bp_messages_form_action() in wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages/compose.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/buddypress/bp-settings/actions/notifications.php:58
    • > PHP Fatal error
      Uncaught Error: Class 'Walker' not found in wp-content/plugins/buddypress/bp-core/classes/class-bp-walker-category-checklist.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_embed_site_title() in wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/assets/embeds/footer.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bp_group_has_membership_requests() in wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/requests-loop.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/buddypress/bp-themes/bp-default/single.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bp_has_activities() in wp-content/plugins/buddypress/bp-templates/bp-nouveau/buddypress/activity/widget.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bp_nouveau_groups_create_hook() in wp-content/plugins/buddypress/bp-templates/bp-nouveau/buddypress/groups/create.php:9

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
    • > GET request to /wp-admin/themes.php?page=bp-emails-customizer-redirect
    • > Security (warning) in unknown
    /?post_type=bp-email&p=16&bp_customizer=email&customize_changeset_uuid=812ae264-db0f-40bd-9bfa-e33df3956950&customize_theme=twentytwentyone&customize_messenger_channel=preview-0 - An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.
    • > GET request to /wp-admin/themes.php?page=bp-emails-customizer-redirect
    • > Console-api (warning) in unknown
    /wp-includes/js/jquery/jquery.min.js?ver=3.7.0 1:28609 "jQuery.Deferred exception: _customizePartialRefreshExports is not defined" "ReferenceError: _customizePartialRefreshExports is not defined\n at Function.\u003Canonymous> (/wp-includes/js/customize-selective-refresh.min.js?ver=6.3.1:2:9028)\n at c (/wp-includes/js/jquery/jquery.min.js?ver=3.7.0:2:25266)\n at Object.fireWith (/wp-includes/js/jquery/jquery.min.js?ver=3.7.0:2:26015)\n at Function.trigger (/wp-includes/js/customize-base.min.js?ver=6.3.1:2:994)\n at HTMLDocument.\u003Canonymous> (/wp-includes/js/customize-preview.min.js?ver=6.3.1:2:10628)\n at e (/wp-includes/js/jquery/jquery.min.js?ver=3.7.0:2:26990)\n at t (/wp-includes/js/jquery/jquery.min.js?ver=3.7.0:2:27292)" undefined
    • > GET request to /wp-admin/themes.php?page=bp-emails-customizer-redirect
    • > Javascript (severe) in unknown
    /wp-includes/js/jquery/jquery.min.js?ver=3.7.0 1:28721 Uncaught ReferenceError: _customizePartialRefreshExports is not defined

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: profiles, friends, notifications, activity, groups...

buddypress/bp-loader.php 85% from 13 tests

The principal PHP file in "BuddyPress" v. 11.4.0 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Domain Path: The domain path folder does not exist ("/bp-languages/")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("buddypress.php" instead of "bp-loader.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin211,184 lines of code in 1,257 files:
LanguageFilesBlank linesComment linesLines of code
PHP71932,68490,214107,060
CSS1529,7076,33652,909
Sass638,9821,49627,372
JavaScript3194,1472,60623,669
YAML2250103
JSON10054
Bourne Shell16417

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity31.83
▷ Minimum class complexity1.00
▷ Maximum class complexity331.00
Average method complexity3.94
▷ Minimum method complexity1.00
▷ Maximum method complexity73.00
Code structure
Namespaces2
Interfaces2
Traits1
Classes184
▷ Abstract classes94.89%
▷ Concrete classes17595.11%
▷ Final classes00.00%
Methods1,963
▷ Static methods29615.08%
▷ Public methods1,68885.99%
▷ Protected methods23612.02%
▷ Private methods391.99%
Functions3,359
▷ Named functions3,31498.66%
▷ Anonymous functions451.34%
Constants48
▷ Global constants4083.33%
▷ Class constants816.67%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
11 compressed PNG files occupy 0.04MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
bp-themes/bp-default/_inc/images/closed.png0.21KB0.21KB▼ 1.36%
bp-themes/bp-default/_inc/images/white-grad.png0.08KB0.18KB0.00%
bp-themes/bp-default/_inc/images/rss.png0.62KB0.70KB0.00%
bp-core/images/mystery-group-50.png0.46KB0.64KB0.00%
bp-core/images/60pc_black.png0.07KB0.09KB0.00%