58% virtual-bot

Code Review | Virtual Bot

WordPress plugin Virtual Bot scored58%from 54 tests.

About plugin

  • Plugin page: virtual-bot
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 3, 2022
  • Latest release: Jun 1, 2023
  • Number of updates: 13
  • Update frequency: every 14.2 days
  • Top authors: ofeknakar01 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /789 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼1.12MB] [CPU: ▼43.61ms] Passed 4 tests

Analyzing server-side resources used by Virtual Bot
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.86 ▼0.6014.94 ▼25.00
Dashboard /wp-admin2.90 ▼0.4119.26 ▼33.51
Posts /wp-admin/edit.php2.90 ▼0.4616.80 ▼27.69
Add New Post /wp-admin/post-new.php2.90 ▼2.9917.76 ▼88.24
Media Library /wp-admin/upload.php2.90 ▼0.3316.38 ▼17.74
VirtualBot /wp-admin/admin.php?page=chatbot2.9018.41
edit /wp-admin/admin.php?page=chatbot-edit-bot2.9022.18
conversation /wp-admin/admin.php?page=chatbot-bot-conversation2.9016.25
Add new /wp-admin/admin.php?page=chatbot-add-new2.9016.61

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 57 new files
Database: 2 new tables, 6 new options
New tables
wp_virtual_bot
wp_virtual_bot_conversations
New WordPress options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Virtual Bot
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,847 ▲10113.37 ▼1.031.65 ▼0.3144.25 ▼0.60
Dashboard /wp-admin2,256 ▲715.08 ▼0.73118.37 ▲19.2939.96 ▼0.77
Posts /wp-admin/edit.php2,136 ▲472.19 ▲0.1448.59 ▲5.6528.76 ▼7.02
Add New Post /wp-admin/post-new.php1,570 ▲2818.56 ▲0.43622.98 ▼0.7337.53 ▼14.40
Media Library /wp-admin/upload.php1,435 ▲444.38 ▲0.09104.16 ▲8.1337.79 ▼6.05
VirtualBot /wp-admin/admin.php?page=chatbot1,3989.32318.4694.37
edit /wp-admin/admin.php?page=chatbot-edit-bot1,2903.2043.8694.28
conversation /wp-admin/admin.php?page=chatbot-bot-conversation9062.2839.1029.56
Add new /wp-admin/admin.php?page=chatbot-add-new1,2953.2142.08111.18

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_virtual_bot
    • wp_virtual_bot_conversations
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 29 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=chatbot-add-new
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=chatbot-add-new
    • > Notice in wp-content/plugins/virtual-bot/virtual-bot.php+87
    Undefined variable: wp
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=chatbot-add-new
    • > Notice in wp-content/plugins/virtual-bot/virtual-bot.php+87
    Trying to get property 'query_vars' of non-object
    • > GET request to /wp-admin/admin.php?page=chatbot-bot-conversation
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/virtual-bot/virtual-bot.php+364
    A non-numeric value encountered

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=chatbot-bot-conversation
    • > Network (severe)
    wp-admin/admin-ajax.php - Failed to load resource: the server responded with a status of 400 (Bad Request)
    • > GET request to /wp-admin/admin.php?page=chatbot-edit-bot
    • > Javascript (severe) in unknown
    /wp-content/plugins/virtual-bot/js/editorEdit.js?ver=6.3.1 80:67 Uncaught TypeError: Cannot read properties of undefined (reading 'name')

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
7 plugin tags: assistant, bot, chat-bot, virtual-bot, chatbot...

virtual-bot/virtual-bot.php 92% from 13 tests

The main PHP file in "Virtual Bot" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

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
No dangerous file extensions were detected7,104 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript81,9232174,894
CSS28121,378
PHP635938832

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.14
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions571.43%
▷ Anonymous functions228.57%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
40 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/editor/avatars/avatar4.png4.32KB2.21KB▼ 48.85%
inc/dashboard/imgs/deleteB.png0.50KB0.41KB▼ 16.93%
inc/editor/avatars/avatar7.png4.15KB2.11KB▼ 49.12%
inc/dashboard/imgs/rate-1.png0.72KB0.56KB▼ 22.13%
inc/editor/imgs/right.png0.61KB0.50KB▼ 16.91%