62% fluentchat-basic

Code Review | FluentChat - Live Chat for WordPress

WordPress plugin FluentChat - Live Chat for WordPress scored62%from 54 tests.

About plugin

  • Plugin page: fluentchat-basic
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.9
  • WordPress version: 6.3.1
  • First release: Oct 2, 2017
  • Latest release: Nov 22, 2019
  • Number of updates: 20
  • Update frequency: every 39.1 days
  • Top authors: nish@ncrafts.net (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,993 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
Install script ran successfully

Server metrics [RAM: ▲0.44MB] [CPU: ▼1.40ms] Passed 4 tests

Analyzing server-side resources used by FluentChat - Live Chat for WordPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.95 ▲0.4953.50 ▲11.96
Dashboard /wp-admin3.74 ▲0.3953.69 ▼10.52
Posts /wp-admin/edit.php3.85 ▲0.5050.36 ▲5.86
Add New Post /wp-admin/post-new.php6.32 ▲0.4389.16 ▼6.62
Media Library /wp-admin/upload.php3.66 ▲0.4340.59 ▲5.69
Active Chats /wp-admin/admin.php?page=fluentchatbasic-dashboard3.6441.55
Operator Profile /wp-admin/admin.php?page=fluentchatbasic-profile3.6539.02
Settings /wp-admin/admin.php?page=fluentchatbasic-settings3.6640.74
Archived Chats /wp-admin/admin.php?page=fluentchatbasic-archives3.6437.58

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 187 new files
Database: 5 new tables, 6 new options
New tables
wp_fluentchat_messages
wp_fluentchat_customers
wp_fluentchat_feedback
wp_fluentchat_operators
wp_fluentchat_chats
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for FluentChat - Live Chat for WordPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,114 ▲36815.29 ▲0.9138.18 ▲36.4646.14 ▲1.47
Dashboard /wp-admin2,240 ▲525.84 ▼0.0195.44 ▼18.5039.22 ▼7.28
Posts /wp-admin/edit.php2,123 ▲342.01 ▲0.0137.27 ▲0.7430.85 ▼3.67
Add New Post /wp-admin/post-new.php1,555 ▲2718.39 ▼0.11599.58 ▼39.7533.10 ▼37.48
Media Library /wp-admin/upload.php1,425 ▲374.19 ▼0.0395.18 ▼6.9643.78 ▲1.03
Active Chats /wp-admin/admin.php?page=fluentchatbasic-dashboard8643.6575.1133.08
Operator Profile /wp-admin/admin.php?page=fluentchatbasic-profile3,7064.2688.6920.22
Settings /wp-admin/admin.php?page=fluentchatbasic-settings2,6795.39139.6043.03
Archived Chats /wp-admin/admin.php?page=fluentchatbasic-archives8903.5987.4435.02

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
These items require your attention
  • Zombie tables were found after uninstall: 5 tables
    • wp_fluentchat_customers
    • wp_fluentchat_chats
    • wp_fluentchat_operators
    • wp_fluentchat_messages
    • wp_fluentchat_feedback
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=fluentchatbasic-dashboard
    • > Notice in wp-content/plugins/fluentchat-basic/functions.php+1538
    Undefined variable: activeChats

SRP 50% from 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
Please take a closer look at the following
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Interface 'Sinergi\\BrowserDetector\\DetectorInterface' not found in wp-content/plugins/fluentchat-basic/vendor/sinergi/browser-detector/src/DeviceDetector.php:5
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/fluentchat-basic/functions.php on line 24
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/fluentchat-basic/functions.php on line 20
    • > PHP Fatal error
      Uncaught Error: Interface 'Sinergi\\BrowserDetector\\DetectorInterface' not found in wp-content/plugins/fluentchat-basic/vendor/sinergi/browser-detector/src/OsDetector.php:5
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/fluentchat-basic/functions.php on line 23
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/fluentchat-basic/functions.php on line 22
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/fluentchat-basic/functions.php on line 21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/fluentchat-basic/functions.php:59
    • > PHP Fatal error
      Uncaught Error: Interface 'Sinergi\\BrowserDetector\\DetectorInterface' not found in wp-content/plugins/fluentchat-basic/vendor/sinergi/browser-detector/src/LanguageDetector.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Sinergi\\BrowserDetector\\DetectorInterface' not found in wp-content/plugins/fluentchat-basic/vendor/sinergi/browser-detector/src/BrowserDetector.php:5

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
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=fluentchatbasic-archives
    • > Console-api (severe) in wp-content/plugins/fluentchat-basic/dist/chat-archives.min.js?ver=1+0:41170
    Warning: Something is calling a React component directly. Use a factory or JSX instead. See: https://fb.me/react-legacyfactory
    • > GET request to /wp-admin/admin.php?page=fluentchatbasic-profile
    • > Console-api (severe) in unknown
    /wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0 9:53544 Invariant Violation: parentComponent must be a valid React Componentat e.exports (/wp-content/plugins/fluentchat-basic/dist/chat-profile.min.js?ver=1:1:189793)at unstable_renderSubtreeIntoContainer (/wp-content/plugins/fluentchat-basic/dist/chat-profile.min.js?ver=1:1:372463)at r.renderPortal (/wp-content/plugins/fluentchat-basic/dist/chat-profile.min.js?ver=1:1:80419)at n.value (/wp-content/plugins/fluentchat-basic/dist/chat-profile.min.js?ver=1:1:80730)at Jr (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:80714)at Zr (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:80489)at Gr (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:80023)at /wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:91526at xl (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:92039)at fl (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:85808)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=fluentchatbasic-archives
    • > Javascript (severe) in unknown
    /wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0 9:32518 Uncaught Error: parentComponent must be a valid React Component
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=fluentchatbasic-settings
    • > Console-api (severe) in wp-content/plugins/fluentchat-basic/dist/chat-settings.min.js?ver=1+0:380414
    Warning: bind(): You are binding a component method to the component. React does this for you automatically in a high-performance way, so you can safely remove this call. See ColorPicker
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=fluentchatbasic-settings
    • > Console-api (severe) in unknown
    /wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0 9:53544 Invariant Violation: parentComponent must be a valid React Componentat e.exports (/wp-content/plugins/fluentchat-basic/dist/chat-settings.min.js?ver=1:1:180154)at unstable_renderSubtreeIntoContainer (/wp-content/plugins/fluentchat-basic/dist/chat-settings.min.js?ver=1:1:362824)at r.renderPortal (/wp-content/plugins/fluentchat-basic/dist/chat-settings.min.js?ver=1:1:44168)at n.value (/wp-content/plugins/fluentchat-basic/dist/chat-settings.min.js?ver=1:1:44479)at Jr (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:80714)at Zr (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:80489)at Gr (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:80023)at /wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:91526at xl (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:92039)at fl (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:85808)
    • > GET request to /wp-admin/admin.php?page=fluentchatbasic-archives
    • > Console-api (severe) in unknown
    /wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0 9:53544 Invariant Violation: parentComponent must be a valid React Componentat e.exports (/wp-content/plugins/fluentchat-basic/dist/chat-archives.min.js?ver=1:1:159441)at unstable_renderSubtreeIntoContainer (/wp-content/plugins/fluentchat-basic/dist/chat-archives.min.js?ver=1:1:342111)at r.renderPortal (/wp-content/plugins/fluentchat-basic/dist/chat-archives.min.js?ver=1:1:50067)at n.value (/wp-content/plugins/fluentchat-basic/dist/chat-archives.min.js?ver=1:1:50378)at Jr (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:80714)at Zr (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:80489)at Gr (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:80023)at /wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:91526at xl (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:92039)at fl (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:85808)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
9 plugin tags: live chat, customer support, wordpress chat, wordpress live chat, live help...

fluentchat-basic/functions.php 85% from 13 tests

The principal PHP file in "FluentChat - Live Chat for WordPress" v. 1.0.2 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("fluentchat-basic.php" instead of "functions.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected30,885 lines of code in 156 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1253,0425,03023,095
PHP205019183,296
SVG1032,370
PO File59559652,035
JSON20086
CSS3003

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity23.47
▷ Minimum class complexity1.00
▷ Maximum class complexity128.00
Average method complexity3.33
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces2
Interfaces1
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods165
▷ Static methods6640.00%
▷ Public methods14386.67%
▷ Protected methods00.00%
▷ Private methods2213.33%
Functions34
▷ Named functions3397.06%
▷ Anonymous functions12.94%
Constants65
▷ Global constants00.00%
▷ Class constants65100.00%
▷ Public constants65100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
14 PNG files occupy 0.23MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/operator_female.png15.21KB5.93KB▼ 61.02%
assets/marketing/logo-pro.png1.78KB1.45KB▼ 18.79%
assets/anon.png5.51KB3.37KB▼ 38.78%
assets/anon2.png7.78KB3.56KB▼ 54.22%
assets/marketing/rating.png19.32KB18.81KB▼ 2.64%