78% light-live-chat

Code Review | Light live chat

WordPress plugin Light live chat scored78%from 54 tests.

About plugin

  • Plugin page: light-live-chat
  • Plugin version: 1.0.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.5
  • WordPress version: 6.3.1
  • First release: Jun 17, 2020
  • Latest release: Aug 28, 2020
  • Number of updates: 18
  • Update frequency: every 4.1 days
  • Top authors: lightchat (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /699 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.30MB] [CPU: ▼0.37ms] Passed 4 tests

Server-side resources used by Light live chat
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.78 ▲0.3239.35 ▼1.19
Dashboard /wp-admin3.64 ▲0.3450.51 ▲2.62
Posts /wp-admin/edit.php3.69 ▲0.3345.99 ▼0.64
Add New Post /wp-admin/post-new.php6.16 ▲0.2783.47 ▼2.28
Media Library /wp-admin/upload.php3.50 ▲0.2736.88 ▲4.96
LightChat widget /wp-admin/options-general.php?page=light-live-chat5.0346.09

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Light live chat
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.42 ▼0.191.68 ▲0.0944.16 ▲1.79
Dashboard /wp-admin2,202 ▲215.56 ▼0.0793.81 ▼5.7342.01 ▲0.75
Posts /wp-admin/edit.php2,104 ▲42.02 ▲0.0233.34 ▼4.1033.28 ▼4.95
Add New Post /wp-admin/post-new.php1,529 ▼123.59 ▲0.51688.69 ▲25.6759.75 ▲12.57
Media Library /wp-admin/upload.php1,398 ▼54.17 ▼0.0593.17 ▼7.9042.58 ▼5.02
LightChat widget /wp-admin/options-general.php?page=light-live-chat8792.0024.4526.61

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

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

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 | 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
Please fix the following
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/light-live-chat/classes/Plugin.php
    • > /wp-content/plugins/light-live-chat/classes/Html.php
    • > /wp-content/plugins/light-live-chat/classes/ACTIONS.php
    • > /wp-content/plugins/light-live-chat/light-live-chat.php
    • > /wp-content/plugins/light-live-chat/classes/Settings.php
  • 144× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/light-live-chat/vendors/vendor/twig/twig/src/Test/IntegrationTestCase.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/light-live-chat/vendors/vendor/twig/twig/src/Test/NodeTestCase.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig\\Cache\\CacheInterface' not found in wp-content/plugins/light-live-chat/vendors/vendor/twig/twig/src/Cache/FilesystemCache.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\\Binary\\AbstractBinary' not found in wp-content/plugins/light-live-chat/vendors/vendor/twig/twig/src/Node/Expression/Binary/GreaterEqualBinary.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\\Binary\\AbstractBinary' not found in wp-content/plugins/light-live-chat/vendors/vendor/twig/twig/src/Node/Expression/Binary/BitwiseXorBinary.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\\AbstractExpression' not found in wp-content/plugins/light-live-chat/vendors/vendor/twig/twig/src/Node/Expression/NameExpression.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig\\TokenParser\\TokenParserInterface' not found in wp-content/plugins/light-live-chat/vendors/vendor/twig/twig/src/TokenParser/AbstractTokenParser.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\TokenParser\\IncludeTokenParser' not found in wp-content/plugins/light-live-chat/vendors/vendor/twig/twig/src/TokenParser/EmbedTokenParser.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\ode' not found in wp-content/plugins/light-live-chat/vendors/vendor/twig/twig/src/Node/MacroNode.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\TokenParser\\AbstractTokenParser' not found in wp-content/plugins/light-live-chat/vendors/vendor/twig/twig/src/TokenParser/WithTokenParser.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention: The official readme.txt might help

light-live-chat/light-live-chat.php Passed 13 tests

The entry point to "Light live chat" version 1.0.5 is a PHP file that has certain tags in its header comment area
119 characters long description:
Providing an easy way for a live chat widget integration. Multilingual. For LightChat.org customers (has a free tariff)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin20,739 lines of code in 517 files:
LanguageFilesBlank linesComment linesLines of code
PHP3784,0405,13916,904
reStructuredText1142,4952,4722,962
JSON700477
PO File1273379
Markdown425071
JavaScript1104662
Bourne Shell16143
Sass516143
YAML17043
Twig40028
CSS16127

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity5.12
▷ Minimum class complexity1.00
▷ Maximum class complexity153.00
Average method complexity2.71
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces28
Interfaces14
Traits0
Classes352
▷ Abstract classes143.98%
▷ Concrete classes33896.02%
▷ Final classes5415.98%
Methods900
▷ Static methods697.67%
▷ Public methods75383.67%
▷ Protected methods596.56%
▷ Private methods889.78%
Functions113
▷ Named functions9987.61%
▷ Anonymous functions1412.39%
Constants88
▷ Global constants33.41%
▷ Class constants8596.59%
▷ Public constants85100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin