54% bbp-messages

Code Review | bbPress Messages

WordPress plugin bbPress Messages scored54%from 54 tests.

About plugin

  • Plugin page: bbp-messages
  • Plugin version: 2.0.9.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.8.3
  • WordPress version: 6.3.1
  • First release: Mar 6, 2016
  • Latest release: Nov 15, 2017
  • Number of updates: 51
  • Update frequency: every 12.1 days
  • Top authors: elhardoum (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

300+ active /22,097 total downloads

Benchmarks

Plugin footprint 30% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by bbPress Messages
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.18 ▼2.67
Dashboard /wp-admin3.31 ▲0.0044.29 ▼4.69
Posts /wp-admin/edit.php3.36 ▲0.0049.12 ▲0.44
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.77 ▼0.13
Media Library /wp-admin/upload.php3.23 ▲0.0036.21 ▲4.10

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 55 new files
Database: 2 new tables, 6 new options
New tables
wp_bbp_messages_2p0
wp_bbp_messages_2p0_meta
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by bbPress Messages
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9014.48 ▼0.191.89 ▲0.1342.71 ▼2.36
Dashboard /wp-admin2,206 ▲155.88 ▼0.00105.77 ▼7.5243.21 ▲2.30
Posts /wp-admin/edit.php2,089 ▼32.00 ▼0.0139.25 ▼1.9436.70 ▲0.15
Add New Post /wp-admin/post-new.php1,542 ▲2818.59 ▲1.19601.06 ▼94.4852.89 ▼5.01
Media Library /wp-admin/upload.php1,391 ▲34.27 ▲0.0995.45 ▼5.6341.21 ▼4.70

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/bbp-messages/uninstall.php+19
    Undefined index: action
  • This plugin has failed uninstalling correctly, leaving 55 files (0.30MB) in the plugin directory
    • (new file) Inc/Core/Init.php
    • (new file) Inc/Core/Messages.php
    • (new file) Inc/Core/Redirect.php
    • (new file) CheckReady.php
    • (new file) Inc/Admin/Screen.php
    • (new file) Inc/Admin/index.html
    • (new file) BbpMessages.php
    • (new file) Inc/Admin/Settings.php
    • (new file) Inc/Admin/Admin.php
    • (new file) Inc/Admin/Importers/bbPMessages.php
    • ...
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_bbp_messages_2p0_meta
    • wp_bbp_messages_2p0
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

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 no errors were found, this is by no means 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 take a closer look at the following
  • 45× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bbp-messages/Inc/Core/integrate.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bbpm_messages_url() in wp-content/plugins/bbp-messages/templates/widgets/search.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bbpm_messages_url() in wp-content/plugins/bbp-messages/templates/widgets/new-message.php:9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/bbp-messages/templates/widgets/my-chats.php on line 1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/bbp-messages/templates/widgets/my-messages.php on line 1
    • > PHP Notice
      Undefined variable: title in wp-content/plugins/bbp-messages/templates/widgets/new-message.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/bbp-messages/templates/messages/single-settings.php:4
    • > PHP Notice
      Undefined variable: title in wp-content/plugins/bbp-messages/templates/widgets/my-messages.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/bbp-messages/Inc/Core/Widgets/MyMessages.php:3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/bbp-messages/templates/widgets/new-message.php on line 1

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
The official readme.txt is a good inspiration

bbp-messages/index.php 92% from 13 tests

The main PHP script in "bbPress Messages" version 2.0.9.1 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("bbp-messages.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin6,685 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
PHP361,6745446,283
CSS2248282
JavaScript13054
Markdown115040
HTML112026

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity54.74
▷ Minimum class complexity5.00
▷ Maximum class complexity444.00
Average method complexity4.95
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes00.00%
Methods251
▷ Static methods166.37%
▷ Public methods251100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions61
▷ Named functions5386.89%
▷ Anonymous functions813.11%
Constants3
▷ Global constants3100.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
PNG images were not found in this plugin