10% bp-instant-chat

Code Review | BuddyPress Instant Chat

WordPress plugin BuddyPress Instant Chat scored10%from 54 tests.

About plugin

  • Plugin page: bp-instant-chat
  • Plugin version: 1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.6
  • WordPress version: 6.3.1
  • First release: Jun 18, 2016
  • Latest release: Jul 31, 2016
  • Number of updates: 30
  • Update frequency: every 1.4 days
  • Top authors: richardphelps (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active /14,287 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/bp-instant-chat/bp-instant-chat.php+65
    Undefined index: action

Server metrics [RAM: ▼1.90MB] [CPU: ▼56.41ms] Passed 4 tests

Server-side resources used by BuddyPress Instant Chat
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.36 ▼1.375.37 ▼42.64
Dashboard /wp-admin2.38 ▼1.1812.29 ▼42.38
Posts /wp-admin/edit.php2.38 ▼1.307.41 ▼53.05
Add New Post /wp-admin/post-new.php2.38 ▼3.777.80 ▼87.57
Media Library /wp-admin/upload.php2.38 ▼1.116.38 ▼39.95

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
bpic_error_notices
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by BuddyPress Instant Chat
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲5614.73 ▼0.011.77 ▼0.1942.94 ▼2.57
Dashboard /wp-admin2,220 ▲465.66 ▲0.0888.49 ▼16.3943.04 ▼1.34
Posts /wp-admin/edit.php2,122 ▲192.04 ▲0.0535.90 ▼1.5936.96 ▲3.74
Add New Post /wp-admin/post-new.php1,551 ▲1017.46 ▼5.70674.11 ▲40.2253.66 ▼2.44
Media Library /wp-admin/upload.php1,431 ▲314.28 ▲0.0697.88 ▼3.1047.55 ▼0.87

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/bp-instant-chat/bp-instant-chat.php+65
    Undefined index: action
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • bpic_error_notices
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function have_posts() in wp-content/plugins/bp-instant-chat/templates/chat.php:2
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/bp-instant-chat/bp-instant-chat.php on line 37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bp-instant-chat/bp-instant-chat.php:45
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/bp-instant-chat/bp-instant-chat.php on line 38

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (The plugin settings page.) image not found
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
The official readme.txt is a good inspiration

bp-instant-chat/bp-instant-chat.php 92% from 13 tests

The primary PHP file in "BuddyPress Instant Chat" version 1.6 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin1,028 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP3141238890
CSS2310138

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity99.00
▷ Minimum class complexity99.00
▷ Maximum class complexity99.00
Average method complexity3.88
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods34
▷ Static methods00.00%
▷ Public methods34100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected