51% wschat-live-chat

Code Review | WSChat - WordPress Live Chat

WordPress plugin WSChat - WordPress Live Chat scored51%from 54 tests.

About plugin

  • Plugin page: wschat-live-chat
  • Plugin version: 3.1.0
  • PHP compatiblity: 7.1.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Jul 12, 2021
  • Latest release: Oct 4, 2023
  • Number of updates: 31
  • Update frequency: every 26.3 days
  • Top authors: elextensions (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /2,400 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲2.96MB] [CPU: ▲135.99ms] Passed 4 tests

A check of server-side resources used by WSChat - WordPress Live Chat
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /6.28 ▲2.8266.09 ▲27.43
Dashboard /wp-admin6.34 ▲3.03231.96 ▲183.52
Posts /wp-admin/edit.php6.39 ▲3.03223.50 ▲173.72
Add New Post /wp-admin/post-new.php8.85 ▲2.96265.60 ▲165.29
Media Library /wp-admin/upload.php6.29 ▲3.05213.00 ▲177.52
Live Chat /wp-admin/admin.php?page=wschat_chat6.26238.30
Help & Support /wp-admin/admin.php?page=wschat_helpandsupport6.26192.92
Go Premium! /wp-admin/admin.php?page=wschat_gopremium6.26213.35
Chat History /wp-admin/admin.php?page=wschat_history8.82214.18
Tags /wp-admin/admin.php?page=wschat_tags6.67199.18
Settings /wp-admin/admin.php?page=wschat_settings6.27205.49
Live Visitors [Premium] /wp-admin/admin.php?page=wschat_live_visitors9.38232.07
Agents /wp-admin/admin.php?page=wschat_agents6.26221.26

Server storage [IO: ▲36.38MB] [DB: ▲0.01MB] 67% from 3 tests

Input-output and database impact of this plugin
Please try to fix the following items
  • Total filesystem usage must be limited to 25MB (currently using 36.38MB)
Filesystem: 5,387 new files
Database: 6 new tables, 7 new options
New tables
wp_wschat_conversations
wp_wschat_users
wp_wschat_tags
wp_wschat_participants
wp_wschat_messages
wp_wschat_message_notifications
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
wschat-live-chat/wschat.php_activation_date
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for WSChat - WordPress Live Chat
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /12,894 ▲10,15919.76 ▲5.36175.87 ▲174.0649.31 ▲2.75
Dashboard /wp-admin2,502 ▲3145.98 ▲1.07139.05 ▲22.3372.48 ▲29.13
Posts /wp-admin/edit.php2,396 ▲3073.03 ▲1.0144.40 ▼0.2762.92 ▲24.03
Add New Post /wp-admin/post-new.php1,682 ▲16818.62 ▲1.02635.18 ▲21.0340.96 ▼14.87
Media Library /wp-admin/upload.php1,690 ▲3055.24 ▲0.97106.89 ▼1.6356.53 ▲9.67
Live Chat /wp-admin/admin.php?page=wschat_chat11,2635.44170.2579.16
Help & Support /wp-admin/admin.php?page=wschat_helpandsupport1,2922.7332.0750.17
Go Premium! /wp-admin/admin.php?page=wschat_gopremium1,1862.6530.5346.65
Chat History /wp-admin/admin.php?page=wschat_history1,3744.3667.5448.98
Tags /wp-admin/admin.php?page=wschat_tags1,2673.0445.3747.62
Settings /wp-admin/admin.php?page=wschat_settings1,7913.9754.9675.19
Live Visitors [Premium] /wp-admin/admin.php?page=wschat_live_visitors1,0882.8137.3341.52
Agents /wp-admin/admin.php?page=wschat_agents1,5422.7240.1044.24

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 tables in the database
    • wp_wschat_tags
    • wp_wschat_conversations
    • wp_wschat_participants
    • wp_wschat_message_notifications
    • wp_wschat_messages
    • wp_wschat_users
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • wschat-live-chat/wschat.php_activation_date
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

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
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wschat-live-chat/tests/bootstrap.php
    • > /wp-content/plugins/wschat-live-chat/resources/review_and_troubleshoot_notify/resources/logo.php
  • 3284× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\ListResource' not found in wp-content/plugins/wschat-live-chat/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/FunctionList.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Illuminate\\Contracts\otifications\\Dispatcher' not found in wp-content/plugins/wschat-live-chat/vendor/illuminate/support/Testing/Fakes/NotificationFake.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'ParagonIE_Sodium_Core_HChaCha20' not found in wp-content/plugins/wschat-live-chat/vendor/paragonie/sodium_compat/namespaced/Core/HChaCha20.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\InstanceResource' not found in wp-content/plugins/wschat-live-chat/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserInstance.php:37
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\Options' not found in wp-content/plugins/wschat-live-chat/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitOptions.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\InstanceResource' not found in wp-content/plugins/wschat-live-chat/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/BindingInstance.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\Page' not found in wp-content/plugins/wschat-live-chat/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantPage.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\Options' not found in wp-content/plugins/wschat-live-chat/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelOptions.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'SebastianBergmann\\Comparator\\Comparator' not found in wp-content/plugins/wschat-live-chat/vendor/google/gax/src/Testing/ProtobufMessageComparator.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\Page' not found in wp-content/plugins/wschat-live-chat/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/NumberPage.php:16

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=wschat_tags
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of null (reading 'addEventListener')" "TypeError: Cannot read properties of null (reading 'addEventListener')\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/wschat-live-chat/resources/dist/admin-tags.min.js?ver=2.0.0:273:77486)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=wschat_tags
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: Cannot read properties of null (reading 'addEventListener')
    • > GET request to /wp-admin/admin.php?page=wschat_settings
    • > Rendering (severe) in unknown
    /wp-admin/admin.php?page=wschat_settings 449 Error: attribute height: Unexpected end of attribute. Expected length, "".
    • > GET request to /wp-admin/admin.php?page=wschat_settings
    • > Rendering (severe) in unknown
    /wp-admin/admin.php?page=wschat_settings 457 Error: attribute height: Unexpected end of attribute. Expected length, "".
    • > GET request to /wp-admin/admin.php?page=wschat_live_visitors
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of undefined (reading 'classList')" "TypeError: Cannot read properties of undefined (reading 'classList')\n at ge._isAnimated (/wp-content/plugins/wschat-live-chat/resources/dist/live-visitors.js?ver=2.0.0:7:33633)\n at ge._initializeBackDrop (/wp-content/plugins/wschat-live-chat/resources/dist/live-visitors.js?ver=2.0.0:7:31848)\n at new ge (/wp-content/plugins/wschat-live-chat/resources/dist/live-visitors.js?ver=2.0.0:7:30404)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/wschat-live-chat/resources/dist/live-visitors.js?ver=2.0.0:7:76421)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=wschat_live_visitors
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: Cannot read properties of undefined (reading 'classList')

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Donate link: Please fix this invalid URI: ""
Please take inspiration from this readme.txt

wschat-live-chat/wschat.php 77% from 13 tests

"WSChat - WordPress Live Chat" version 3.1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("4.3" instead of "3.0.0")
  • Domain Path: The domain path is invalid: folder "/lang" does not exist
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wschat-live-chat.php" instead of "wschat.php")

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
It is important to fix the following items
  • Do not include executable or dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/wschat-live-chat/vendor/nesbot/carbon/bin/carbon.bat
      • wp-content/plugins/wschat-live-chat/vendor/bin/carbon.bat
311,443 lines of code in 5,094 files:
LanguageFilesBlank linesComment linesLines of code
PHP4,84262,734260,848258,446
JSON650032,687
JavaScript721,3982,1167,636
Markdown622,63417,141
XSD392482,803
Sass111971151,643
SVG800280
YAML7248214
Bourne Shell42811146
XML696121
Python23371101
reStructuredText1747874
Protocol Buffers2143864
HTML12038
Dockerfile29434
DOS Batch2009
CSS3055
INI1001

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please tend to the following items
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 160)
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity4.13
▷ Minimum class complexity1.00
▷ Maximum class complexity436.00
Average method complexity1.51
▷ Minimum method complexity1.00
▷ Maximum method complexity160.00
Code structure
Namespaces441
Interfaces187
Traits57
Classes4,230
▷ Abstract classes3758.87%
▷ Concrete classes3,85591.13%
▷ Final classes721.87%
Methods26,948
▷ Static methods2,86110.62%
▷ Public methods24,35990.39%
▷ Protected methods1,9417.20%
▷ Private methods6482.40%
Functions973
▷ Named functions28028.78%
▷ Anonymous functions69371.22%
Constants1,284
▷ Global constants201.56%
▷ Class constants1,26498.44%
▷ Public constants1,24298.26%

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
20 PNG files occupy 1.74MB with 1.22MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/img/youtube.png78.70KB19.21KB▼ 75.58%
resources/img/Advanced Bulk Edit.png69.40KB15.94KB▼ 77.03%
resources/img/google_feed.png80.41KB19.81KB▼ 75.37%
resources/img/WSDesk - Helpdesk _.png161.93KB43.90KB▼ 72.89%
resources/img/dialogflow.png28.95KB14.39KB▼ 50.31%