77% livechat-elementor

Code Review | WordPress Live Chat Plugin for Elementor - LiveChat

WordPress plugin WordPress Live Chat Plugin for Elementor - LiveChat scored77%from 54 tests.

About plugin

  • Plugin page: livechat-elementor
  • Plugin version: 1.0.12
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.4
  • WordPress version: 6.3.1
  • First release: Nov 22, 2021
  • Latest release: Oct 31, 2023
  • Number of updates: 15
  • Update frequency: every 47.9 days
  • Top authors: livechat (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,491 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.15MB] [CPU: ▼0.07ms] Passed 4 tests

Server-side resources used by WordPress Live Chat Plugin for Elementor - LiveChat
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1043.63 ▲2.16
Dashboard /wp-admin3.47 ▲0.1654.19 ▲1.05
Posts /wp-admin/edit.php3.52 ▲0.1651.82 ▲5.71
Add New Post /wp-admin/post-new.php6.05 ▲0.1686.90 ▼9.21
Media Library /wp-admin/upload.php3.39 ▲0.1640.46 ▲6.86
Settings /wp-admin/admin.php?page=livechat_settings3.3044.77
Resources /wp-admin/admin.php?page=livechat_resources3.2934.64

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 154 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
livechat_platform
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
livechat_public_key

Browser metrics Passed 4 tests

A check of browser resources used by WordPress Live Chat Plugin for Elementor - LiveChat
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,969 ▲20829.98 ▲15.632.54 ▲0.8637.98 ▼7.86
Dashboard /wp-admin2,347 ▲1665.49 ▼0.18139.02 ▲33.15100.31 ▲61.95
Posts /wp-admin/edit.php2,275 ▲1753.20 ▲1.2455.30 ▲21.7551.10 ▲17.44
Add New Post /wp-admin/post-new.php6,486 ▲4,96039.16 ▲15.821,335.78 ▲624.4339.57 ▼31.20
Media Library /wp-admin/upload.php1,575 ▲1785.62 ▲1.37120.13 ▲20.7899.26 ▲56.61
Settings /wp-admin/admin.php?page=livechat_settings85119.97334.4049.11
Resources /wp-admin/admin.php?page=livechat_resources1,42117.03824.6864.43

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 50% 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 | 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
  • 60× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'LiveChat\\Services\\Options\\Deprecated\\DeprecatedOption' not found in wp-content/plugins/livechat-elementor/plugin_files/Services/Options/Deprecated/DeprecatedLicenseNumber.class.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function LiveChat\\Services\\Options\\get_option() in wp-content/plugins/livechat-elementor/plugin_files/Services/Options/ReadableOption.class.php:49
    • > PHP Fatal error
      Uncaught Error: Class 'LiveChat\\Services\\Templates\\Template' not found in wp-content/plugins/livechat-elementor/plugin_files/Services/Templates/ConfirmIdentityNoticeTemplate.class.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'LiveChat\\Services\\Options\\Deprecated\\DeprecatedOption' not found in wp-content/plugins/livechat-elementor/plugin_files/Services/Options/Deprecated/DeprecatedReviewNoticeTimestamp.class.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/livechat-elementor/plugin_files/Services/Elementor/Widgets/LiveChatContactButtonWidget.class.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'LiveChat\\Services\\Options\\Deprecated\\DeprecatedOption' not found in wp-content/plugins/livechat-elementor/plugin_files/Services/Options/Deprecated/Widget/DeprecatedWidgetWordPressDisableGuestsOption.class.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'LiveChat\\Services\\Options\\ReadableOption' not found in wp-content/plugins/livechat-elementor/plugin_files/Services/Options/ReviewNoticeDismissed.class.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'LiveChat\\Services\\Options\\ReadableOption' not found in wp-content/plugins/livechat-elementor/plugin_files/Services/Options/ReviewNoticeTimestamp.class.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'LiveChat\\Services\\Templates\\Template' not found in wp-content/plugins/livechat-elementor/plugin_files/Services/Templates/ConnectNoticeTemplate.class.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'LiveChat\\Services\\Options\\OptionsSet' not found in wp-content/plugins/livechat-elementor/plugin_files/Services/Options/Elementor/ElementorWidgetsOptions.class.php:18

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=livechat_resources
    • > Console-api (warning) in unknown
    https://static.hotjar.com/c/hotjar-354332.js?sv=5 2:6897 "Hotjar not launching due to suspicious userAgent:" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/118.0.5993.117 Safari/537.36"
    • > GET request to /wp-admin/admin.php?page=livechat_resources
    • > Network (severe)
    https://accounts.livechat.com/v2/sessions/tagged - Failed to load resource: the server responded with a status of 404 ()

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: wordpress live chat, elementor, wordpress chat, chat plugin, live chat

livechat-elementor/elementor-livechat.php 77% from 13 tests

Analyzing the main PHP file in "WordPress Live Chat Plugin for Elementor - LiveChat" version 1.0.12
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 141 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("livechat-elementor.php" instead of "elementor-livechat.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
Success! There were no dangerous files found in this plugin5,786 lines of code in 139 files:
LanguageFilesBlank linesComment linesLines of code
PHP1141,0303,9834,407
Twig12350442
CSS5716347
Markdown1540235
JavaScript150163
JSON300143
SVG20248
HTML1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity4.31
▷ Minimum class complexity1.00
▷ Maximum class complexity73.00
Average method complexity1.97
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces24
Interfaces0
Traits0
Classes106
▷ Abstract classes10.94%
▷ Concrete classes10599.06%
▷ Final classes10.95%
Methods361
▷ Static methods9125.21%
▷ Public methods30785.04%
▷ Protected methods71.94%
▷ Private methods4713.02%
Functions18
▷ Named functions738.89%
▷ Anonymous functions1161.11%
Constants20
▷ Global constants1680.00%
▷ Class constants420.00%
▷ Public constants4100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.70MB with 0.45MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
plugin_files/images/lc-plus-wp@2x.png34.59KB13.34KB▼ 61.43%
plugin_files/images/lc-app.png666.92KB200.06KB▼ 70.00%
plugin_files/images/lc-plus-wp.png16.95KB6.85KB▼ 59.60%