83% bp-messages-tool

Code Review | BP Messages Tool

WordPress plugin BP Messages Tool scored83%from 54 tests.

About plugin

  • Plugin page: bp-messages-tool
  • Plugin version: 2.2
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Oct 20, 2015
  • Latest release: Dec 23, 2022
  • Number of updates: 51
  • Update frequency: every 51.4 days
  • Top authors: shanebp (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

300+ active /8,340 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.60ms] Passed 4 tests

An overview of server-side resources used by BP Messages Tool
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0034.38 ▼6.07
Dashboard /wp-admin3.31 ▲0.0148.92 ▼3.61
Posts /wp-admin/edit.php3.36 ▲0.0046.66 ▲0.62
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.98 ▼6.79
Media Library /wp-admin/upload.php3.23 ▲0.0035.50 ▼1.91

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by BP Messages Tool
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲3914.31 ▼0.161.78 ▼0.0441.77 ▼2.54
Dashboard /wp-admin2,200 ▲235.48 ▼0.1786.14 ▼7.1243.43 ▲3.62
Posts /wp-admin/edit.php2,111 ▲111.97 ▼0.0138.62 ▼3.1935.80 ▼1.32
Add New Post /wp-admin/post-new.php1,537 ▲222.83 ▲4.70681.19 ▲58.0966.86 ▲5.06
Media Library /wp-admin/upload.php1,414 ▲144.27 ▲0.06107.56 ▲7.8349.36 ▲6.78

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined variable: bpmt_user_data in wp-content/plugins/bp-messages-tool/templates/bpmt-messages-loop.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/bp-messages-tool/templates/bpmt-messages-last-ten.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bp_has_message_threads() in wp-content/plugins/bp-messages-tool/templates/bpmt-messages-loop.php:26
    • > PHP Notice
      Trying to get property 'box' of non-object in wp-content/plugins/bp-messages-tool/templates/bpmt-messages-loop.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bpmt_view_delete_back_link() in wp-content/plugins/bp-messages-tool/templates/bpmt-messages-thread.php:10
    • > PHP Notice
      Undefined variable: bpmt_user_data in wp-content/plugins/bp-messages-tool/templates/bpmt-messages-loop.php on line 20
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/bp-messages-tool/templates/bpmt-messages-loop.php on line 12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% 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
These attributes need to be fixed:
  • Requires at least: Invalid plugin version format
Please take inspiration from this readme.txt

bp-messages-tool/loader.php 85% from 13 tests

The main PHP script in "BP Messages Tool" version 2.2 is automatically included on every request by WordPress
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("bp-messages-tool.php" instead of "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 plugin462 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP627950462

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin