84% snatchbot-webchat

Code Review | SnatchBot Webchat

WordPress plugin SnatchBot Webchat scored84%from 54 tests.

About plugin

  • Plugin page: snatchbot-webchat
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1.0-5.3
  • WordPress version: 6.3.1
  • First release: Dec 28, 2019
  • Latest release: May 20, 2020
  • Number of updates: 11
  • Update frequency: every 13.4 days
  • Top authors: snatchbot (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /1,478 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

Analyzing server-side resources used by SnatchBot Webchat
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.40 ▼0.0635.32 ▼11.92
Dashboard /wp-admin3.33 ▲0.0250.76 ▼9.37
Posts /wp-admin/edit.php3.44 ▲0.0846.15 ▼9.50
Add New Post /wp-admin/post-new.php5.91 ▲0.0291.50 ▼41.48
Media Library /wp-admin/upload.php3.25 ▲0.0239.88 ▲5.17

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 23 new files
Database: 1 new table, 6 new options
New tables
wp_snatchbot_webchat
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for SnatchBot Webchat
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲9014.48 ▲0.111.92 ▲0.2943.01 ▼3.10
Dashboard /wp-admin2,220 ▲325.83 ▼0.23102.84 ▼15.3486.22 ▲43.04
Posts /wp-admin/edit.php2,103 ▲141.98 ▼0.0534.29 ▼0.4032.29 ▼1.28
Add New Post /wp-admin/post-new.php1,524 ▲1017.48 ▲0.06695.58 ▼24.4149.64 ▼17.25
Media Library /wp-admin/upload.php1,393 ▲54.15 ▼0.0999.72 ▼15.8786.13 ▲34.77

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/snatchbot-webchat/admin/ajax-actions.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/snatchbot-webchat/includes/sbw-utility-functions.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_admin_page_title() in wp-content/plugins/snatchbot-webchat/admin/views/Ajax-view.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: tournament, tekken, tag

snatchbot-webchat/index.php 92% from 13 tests

The main PHP file in "SnatchBot Webchat" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("snatchbot-webchat.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
Good job! No executable or dangerous file extensions detected1,304 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP7137279823
CSS31327470
JavaScript20011

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity6.00
▷ Minimum class complexity1.00
▷ Maximum class complexity16.00
Average method complexity2.47
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
9 PNG files occupy 1.22MB with 0.63MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/favicons.png0.55KB0.52KB▼ 5.69%
assets/img/screenshot-5.png454.04KB146.12KB▼ 67.82%
assets/img/screenshot-1.png180.18KB59.46KB▼ 67.00%
assets/img/screenshot-4.png137.60KB45.64KB▼ 66.83%
assets/img/logo.png7.38KB3.76KB▼ 49.10%