77% botsplash-chat

Code Review | Botsplash Chat

WordPress plugin Botsplash Chat scored77%from 54 tests.

About plugin

  • Plugin page: botsplash-chat
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Sep 20, 2017
  • Latest release: Sep 20, 2017
  • Number of updates: 5
  • Update frequency: N/A
  • Top authors: botsplash (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /773 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼6.58ms] Passed 4 tests

This is a short check of server-side resources used by Botsplash Chat
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.88 ▼1.63
Dashboard /wp-admin3.33 ▲0.0343.34 ▼6.51
Posts /wp-admin/edit.php3.38 ▲0.0347.28 ▼2.85
Add New Post /wp-admin/post-new.php5.91 ▲0.0383.01 ▼15.32
Media Library /wp-admin/upload.php3.25 ▲0.0334.98 ▲2.59
Botsplash Chat /wp-admin/options-general.php?page=botsplash_wp_admin3.2329.05

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
botsplash_wp_options
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Botsplash Chat
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.81 ▲0.181.80 ▼0.1740.82 ▼3.56
Dashboard /wp-admin2,210 ▲185.88 ▲0.93101.70 ▼17.0739.58 ▼10.14
Posts /wp-admin/edit.php2,093 ▲42.02 ▼0.0340.28 ▲4.2034.36 ▲0.36
Add New Post /wp-admin/post-new.php1,517 ▼1617.62 ▼5.70662.77 ▼32.3153.40 ▼3.20
Media Library /wp-admin/upload.php1,383 ▼24.22 ▲0.0197.18 ▼1.9543.08 ▼1.23
Botsplash Chat /wp-admin/options-general.php?page=botsplash_wp_admin1,3449.45295.7353.70

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/botsplash-chat/botsplash_wp.php
    • > /wp-content/plugins/botsplash-chat/includes/botsplash_wp_code_block.php
    • > /wp-content/plugins/botsplash-chat/includes/botsplash_wp_appid_section.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined variable: appId in wp-content/plugins/botsplash-chat/includes/botsplash_wp_code_block.php on line 11
    • > PHP Notice
      Undefined variable: appId in wp-content/plugins/botsplash-chat/includes/botsplash_wp_appid_field.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/botsplash-chat/includes/botsplash_wp_render_options_page.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function submit_button() in wp-content/plugins/botsplash-chat/includes/botsplash_wp_appid_field.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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 to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (botsplash chat settings screen), #2 (create new botsplash.com account)
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === botsplash-chat === )
The official readme.txt might help

botsplash-chat/botsplash_wp.php 92% from 13 tests

The main PHP file in "Botsplash Chat" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("botsplash-chat.php" instead of "botsplash_wp.php")

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 plugin287 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP869233245
Markdown126042

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity2.75
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity1.47
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods15
▷ Static methods426.67%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.90MB with 0.59MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png252.68KB74.47KB▼ 70.53%
assets/screenshot-2.png665.56KB178.81KB▼ 73.13%
images/logo-150.png7.69KB3.77KB▼ 50.95%