73% conversation-watson

Code Review | Chatbot with IBM Watson

WordPress plugin Chatbot with IBM Watson scored73%from 54 tests.

About plugin

  • Plugin page: conversation-watson
  • Plugin version: 0.8.36
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1
  • WordPress version: 6.3.1
  • First release: Jun 23, 2017
  • Latest release: Nov 1, 2022
  • Number of updates: 136
  • Update frequency: every 14.4 days
  • Top authors: cognitiveclass (66.18%)intela (28.68%)intelahelp (6.62%)

Code review

54 tests

User reviews

24 reviews

Install metrics

1,000+ active /82,082 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.35MB] [CPU: ▲6.88ms] Passed 4 tests

Server-side resources used by Chatbot with IBM Watson
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.72 ▲1.2658.51 ▲2.64
Dashboard /wp-admin4.73 ▲1.4266.14 ▲15.94
Posts /wp-admin/edit.php4.78 ▲1.4261.36 ▲10.40
Add New Post /wp-admin/post-new.php7.25 ▲1.3698.83 ▼0.68
Media Library /wp-admin/upload.php4.59 ▲1.3653.74 ▲15.17
Customize Plugin /wp-admin/admin.php?page=watson_asst_customize4.5959.56
Set Up Chatbot /wp-admin/admin.php?page=watson_asst_setup4.5553.47
Advanced Features /wp-admin/admin.php?page=watson_asst_advanced4.5767.87

Server storage [IO: ▲8.00MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 1,416 new files
Database: 14 new tables, 15 new options
New tables
wp_watsonconv_contexts
wp_watsonconv_input_entities
wp_watsonconv_task_runner_queue
wp_watsonconv_intents
wp_watsonconv_actions
wp_watsonconv_user_inputs
wp_watsonconv_watson_outputs
wp_watsonconv_debug_log
wp_watsonconv_entities
wp_watsonconv_input_intents
...
New WordPress options
widget_recent-comments
watsonconv_fallback_state
widget_recent-posts
theysaidso_admin_options
watsonconv_cron_was_reliable
watsonconv_last_cron_check
watsonconv_runner_launched
can_compress_scripts
watsonconv_runner_state
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

Checking browser requirements for Chatbot with IBM Watson
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲6114.24 ▼0.131.91 ▼0.1140.90 ▼3.94
Dashboard /wp-admin2,223 ▲465.53 ▼0.1688.26 ▼19.3241.11 ▼0.35
Posts /wp-admin/edit.php2,131 ▲312.02 ▲0.0533.17 ▼4.7733.31 ▼3.00
Add New Post /wp-admin/post-new.php1,551 ▲2323.31 ▲0.10652.46 ▲23.6558.15 ▲6.63
Media Library /wp-admin/upload.php1,434 ▲404.22 ▼0.01101.90 ▲0.9345.05 ▲1.68
Customize Plugin /wp-admin/admin.php?page=watson_asst_customize1,7873.6278.3332.98
Set Up Chatbot /wp-admin/admin.php?page=watson_asst_setup1,7949.04267.6665.18
Advanced Features /wp-admin/admin.php?page=watson_asst_advanced1,8352.8450.4029.87

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie tables were found after uninstall: 14 tables
    • wp_watsonconv_input_intents
    • wp_watsonconv_sessions
    • wp_watsonconv_actions
    • wp_watsonconv_task_runner_queue
    • wp_watsonconv_entities
    • wp_watsonconv_requests
    • wp_watsonconv_watson_outputs
    • wp_watsonconv_contexts
    • wp_watsonconv_output_intents
    • wp_watsonconv_intents
    • ...
  • The uninstall procedure has failed, leaving 15 options in the database
    • watsonconv_runner_state
    • db_upgraded
    • watsonconv_fallback_time
    • watsonconv_runner_launched
    • watsonconv_logger_initialized
    • watsonconv_runner
    • watsonconv_last_cron_check
    • watsonconv_cron_was_reliable
    • widget_theysaidso_widget
    • watsonconv_fallback_state
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 1336× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\Tests\\HolodeckTestCase' not found in wp-content/plugins/conversation-watson/vendor/twilio/sdk/Twilio/Tests/Integration/Api/V2010/Account/IncomingPhoneNumber/LocalTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\ListResource' not found in wp-content/plugins/conversation-watson/vendor/twilio/sdk/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberList.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\InstanceResource' not found in wp-content/plugins/conversation-watson/vendor/twilio/sdk/Twilio/Rest/Accounts/V1/CredentialInstance.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\ListResource' not found in wp-content/plugins/conversation-watson/vendor/twilio/sdk/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionList.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\Tests\\HolodeckTestCase' not found in wp-content/plugins/conversation-watson/vendor/twilio/sdk/Twilio/Tests/Integration/Sync/V1/Service/SyncList/SyncListItemTest.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\Page' not found in wp-content/plugins/conversation-watson/vendor/twilio/sdk/Twilio/Rest/Pricing/V1/Voice/CountryPage.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\Page' not found in wp-content/plugins/conversation-watson/vendor/twilio/sdk/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionPage.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\Tests\\HolodeckTestCase' not found in wp-content/plugins/conversation-watson/vendor/twilio/sdk/Twilio/Tests/Integration/Api/V2010/Account/Recording/AddOnResultTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\InstanceContext' not found in wp-content/plugins/conversation-watson/vendor/twilio/sdk/Twilio/Rest/Preview/DeployedDevices/FleetContext.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\InstanceResource' not found in wp-content/plugins/conversation-watson/vendor/twilio/sdk/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageInstance.php:37

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% 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
6 plugin tags: chat, faq, chat bot, artificial intelligence, support...

conversation-watson/watson.php 85% from 13 tests

The entry point to "Chatbot with IBM Watson" version 0.8.36 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("conversation-watson.php" instead of "watson.php")
  • 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 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin103,001 lines of code in 1,395 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,37422,81565,658100,067
Markdown854101,424
CSS21160678
JavaScript28263472
make2409212
JSON20076
Python17223531
YAML10016
Bourne Shell10010
XML1018
reStructuredText1677

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity3.70
▷ Minimum class complexity1.00
▷ Maximum class complexity93.00
Average method complexity1.45
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces222
Interfaces2
Traits0
Classes1,654
▷ Abstract classes17110.34%
▷ Concrete classes1,48389.66%
▷ Final classes00.00%
Methods9,862
▷ Static methods5755.83%
▷ Public methods9,02291.48%
▷ Protected methods8088.19%
▷ Private methods320.32%
Functions15
▷ Named functions213.33%
▷ Anonymous functions1386.67%
Constants23
▷ Global constants417.39%
▷ Class constants1982.61%
▷ Public constants19100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
12 PNG files occupy 0.93MB with 0.67MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/options_instructions/7_json_text_close.png76.38KB16.15KB▼ 78.86%
img/chatbot_logo.png21.57KB10.67KB▼ 50.52%
img/options_instructions/6_json_text_open.png76.36KB16.12KB▼ 78.89%
img/credentials_v2_2.png163.26KB43.11KB▼ 73.59%
img/options_instructions/9_json_options_filled.png103.22KB24.67KB▼ 76.10%