63% bp-better-messages

Code Review | Better Messages – Live Chat for WordPress, BuddyPress, PeepSo, Ultimate Member, BuddyBoss

WordPress plugin Better Messages – Live Chat for WordPress, BuddyPress, PeepSo, Ultimate Member, BuddyBoss scored63%from 54 tests.

About plugin

  • Plugin page: bp-better-messages
  • Plugin version: 2.4.1
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Jan 3, 2017
  • Latest release: Dec 1, 2023
  • Number of updates: 960
  • Update frequency: every 2.6 days
  • Top authors: wordplus (100%)

Code review

54 tests

User reviews

114 reviews

Install metrics

10,000+ active /996,112 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲6.53MB] [CPU: ▲49.90ms] 75% from 4 tests

This is a short check of server-side resources used by Better Messages – Live Chat for WordPress, BuddyPress, PeepSo, Ultimate Member, BuddyBoss
Please have a look at the following items
  • Extra RAM: Extra memory usage should kept under 5MB (currently 6.53MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /10.00 ▲6.54103.56 ▲64.90
Dashboard /wp-admin9.82 ▲6.4895.65 ▲34.26
Posts /wp-admin/edit.php9.94 ▲6.5893.18 ▲47.33
Add New Post /wp-admin/post-new.php12.58 ▲6.69150.32 ▲58.04
Media Library /wp-admin/upload.php9.75 ▲6.5292.49 ▲59.95
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius9.9981.11

Server storage [IO: ▲11.57MB] [DB: ▲0.08MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 354 new files
Database: 10 new tables, 9 new options
New tables
wp_bm_threads
wp_bm_message_messages
wp_bm_message_meta
wp_bm_guests
wp_bm_thread_meta
wp_bm_moderation
wp_bm_user_roles_index
wp_bm_message_recipients
wp_bm_mentions
wp_bm_user_index
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options
fs_debug_mode
can_compress_scripts
fs_active_plugins
widget_recent-posts
fs_accounts

Browser metrics Passed 4 tests

Better Messages – Live Chat for WordPress, BuddyPress, PeepSo, Ultimate Member, BuddyBoss: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,993 ▲25720.45 ▲6.11604.09 ▲602.3928.43 ▼15.62
Dashboard /wp-admin2,233 ▲535.53 ▼0.1087.50 ▼11.6239.62 ▼5.14
Posts /wp-admin/edit.php2,145 ▲422.08 ▲0.1339.73 ▼2.7634.98 ▼2.75
Add New Post /wp-admin/post-new.php1,554 ▲2822.52 ▼0.82676.64 ▲2.0251.47 ▼12.62
Media Library /wp-admin/upload.php1,447 ▲474.20 ▲0.03100.63 ▲6.3646.14 ▲5.37
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,1031.6527.3630.18

Uninstaller [IO: ▲0.00MB] [DB: ▲0.08MB] 25% from 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/bp-better-messages/vendor/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • Zombie tables detected upon uninstall: 10 tables
    • wp_bm_threads
    • wp_bm_user_index
    • wp_bm_user_roles_index
    • wp_bm_message_messages
    • wp_bm_message_recipients
    • wp_bm_moderation
    • wp_bm_message_meta
    • wp_bm_guests
    • wp_bm_mentions
    • wp_bm_thread_meta
  • Zombie WordPress options detected upon uninstall: 9 options
    • fs_debug_mode
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • fs_accounts
    • fs_active_plugins
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 13× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/bp-better-messages/vendor/random-name-generator/random-name-generator.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bp-better-messages/addons/uncanny/uncanny-automator-better-messages.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/bp-better-messages/vendor/randomizer/randomizer-start.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/bp-better-messages/vendor/php-jwt/php-jwt.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bp-better-messages/addons/automatorwp/automatorwp.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'BetterMessages\\RandomNameGenerator\\AbstractGenerator' not found in wp-content/plugins/bp-better-messages/vendor/random-name-generator/All.php:9
    • > PHP Fatal error
      Trait 'Uncanny_Automator\\Recipe\\Integrations' not found in wp-content/plugins/bp-better-messages/addons/uncanny/better-messages/add-better-messages-integration.php on line 8
    • > PHP Fatal error
      Trait 'Uncanny_Automator\\Recipe\\Actions' not found in wp-content/plugins/bp-better-messages/addons/uncanny/better-messages/actions/automator-send-message-action.php on line 8
    • > PHP Fatal error
      Uncaught Error: Interface 'BetterMessages\\RandomNameGenerator\\Generator' not found in wp-content/plugins/bp-better-messages/vendor/random-name-generator/AbstractGenerator.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/bp-better-messages/vendor/buddypress/functions.php:67

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add descriptions for these screenshots #2, #3, #4, #5, #6 in bp-better-messages/assets to your readme.txt
Please take inspiration from this readme.txt

bp-better-messages/bp-better-messages.php 92% from 13 tests

Analyzing the main PHP file in "Better Messages – Live Chat for WordPress, BuddyPress, PeepSo, Ultimate Member, BuddyBoss" version 2.4.1
Please take the time to fix the following:
  • Domain Path: The domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("/languages*/")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin90,531 lines of code in 278 files:
LanguageFilesBlank linesComment linesLines of code
PHP21814,36520,28159,213
CSS302,55217220,166
Sass121,6861279,906
JavaScript12107941,172
SVG20055
XML13016
JSON3003

PHP code 0% from 2 tests

Analyzing cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,096)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 165)
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity55.75
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.33
▷ Minimum method complexity1.00
▷ Maximum method complexity165.00
Code structure
Namespaces5
Interfaces3
Traits0
Classes134
▷ Abstract classes42.99%
▷ Concrete classes13097.01%
▷ Final classes00.00%
Methods2,286
▷ Static methods29212.77%
▷ Public methods1,85481.10%
▷ Protected methods291.27%
▷ Private methods40317.63%
Functions232
▷ Named functions18378.88%
▷ Anonymous functions4921.12%
Constants157
▷ Global constants10264.97%
▷ Class constants5535.03%
▷ Public constants4785.45%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
addons/automatorwp/assets/icon.png10.45KB5.47KB▼ 47.64%
vendor/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
assets/images/icon.png10.45KB5.47KB▼ 47.64%
vendor/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
addons/uncanny/better-messages/img/icon.png10.45KB5.47KB▼ 47.64%