78% better-chat-support

Code Review | Better Chat Support for Messenger

WordPress plugin Better Chat Support for Messenger scored78%from 54 tests.

About plugin

  • Plugin page: better-chat-support
  • Plugin version: 1.1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Jan 19, 2023
  • Latest release: Nov 16, 2023
  • Number of updates: 11
  • Update frequency: every 27.4 days
  • Top authors: themeatelier (72.73%)fhinvention (36.36%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /283 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲1.21MB] [CPU: ▼1.59ms] Passed 4 tests

Analyzing server-side resources used by Better Chat Support for Messenger
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.99 ▲1.5350.68 ▲11.57
Dashboard /wp-admin4.79 ▲1.4956.00 ▲11.26
Posts /wp-admin/edit.php4.85 ▲1.4959.67 ▲11.17
Add New Post /wp-admin/post-new.php6.31 ▲0.4262.68 ▼40.35
Media Library /wp-admin/upload.php4.65 ▲1.4351.64 ▲19.21

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 163 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
mcs-opt
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Better Chat Support for Messenger: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,060 ▲29815.68 ▲1.3025.05 ▲23.4291.67 ▲45.38
Dashboard /wp-admin2,244 ▲645.58 ▼0.0496.30 ▲1.2746.76 ▲5.82
Posts /wp-admin/edit.php2,159 ▲562.15 ▲0.2135.53 ▼8.3931.00 ▼7.83
Add New Post /wp-admin/post-new.php1,708 ▲18222.28 ▼0.88667.62 ▲58.9738.65 ▼35.94
Media Library /wp-admin/upload.php1,458 ▲644.27 ▲0.0698.04 ▲0.7847.24 ▲2.72
MCS settings /wp-admin/admin.php?page=mcs#tab=mcs-settings4,2244.1299.08102.90
Backup /wp-admin/admin.php?page=mcs#tab=backup4,0733.6759.0579.62
Buttons shortcodes /wp-admin/admin.php?page=mcs#tab=buttons-shortcodes4,0783.6357.9680.26

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
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • widget_recent-posts
    • mcs-opt
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

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 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 items
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/better-chat-support/inc/functions.php
    • > /wp-content/plugins/better-chat-support/inc/class-enqueue.php
    • > /wp-content/plugins/better-chat-support/messenger-chat-support.php
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/better-chat-support/view/shortcodes/custom-shortcode.php:11
    • > PHP Warning
      Use of undefined constant MCS_ALERT_MSG - assumed 'MCS_ALERT_MSG' (this will throw an Error in a future version of PHP) in wp-content/plugins/better-chat-support/inc/functions.php on line 11
    • > PHP Warning
      Use of undefined constant MCS_ALERT_MSG - assumed 'MCS_ALERT_MSG' (this will throw an Error in a future version of PHP) in wp-content/plugins/better-chat-support/inc/class-enqueue.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/better-chat-support/view/chat-bubbles/chat-bubbles.php:3

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Frontend chat bubble with form), #2 (Frontend chat bubble without form), #3 (Frontend buttons), #4 (Admin panel)
You can take inspiration from this readme.txt

better-chat-support/messenger-chat-support.php 85% from 13 tests

The main PHP file in "Better Chat Support for Messenger" ver. 1.1.5 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • 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
  • Main file name: The principal plugin file should be the same as the plugin slug ("better-chat-support.php" instead of "messenger-chat-support.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected21,722 lines of code in 108 files:
LanguageFilesBlank linesComment linesLines of code
PHP712,0931,4309,142
PO File203,1983,5916,500
JavaScript5861392,873
Sass11941,397
CSS680191,335
Markdown1580281
JSON220192
SVG2002

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity20.54
▷ Minimum class complexity1.00
▷ Maximum class complexity151.00
Average method complexity5.69
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes59
▷ Abstract classes23.39%
▷ Concrete classes5796.61%
▷ Final classes11.75%
Methods246
▷ Static methods3012.20%
▷ Public methods22491.06%
▷ Protected methods72.85%
▷ Private methods156.10%
Functions32
▷ Named functions3196.88%
▷ Anonymous functions13.12%
Constants8
▷ Global constants562.50%
▷ Class constants337.50%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
12 PNG files occupy 0.07MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/image/bubble-6.png4.04KB2.20KB▼ 45.43%
admin/assets/images/checkerboard.png2.29KB2.54KB0.00%
assets/image/bubble-1.png1.46KB1.25KB▼ 14.89%
assets/image/bubble-5.png7.33KB3.35KB▼ 54.28%
assets/image/bubble-3.png6.14KB2.80KB▼ 54.46%