61% imbachat-widget

Code Review | ImbaChat

WordPress plugin ImbaChat scored61%from 54 tests.

About plugin

  • Plugin page: imbachat-widget
  • Plugin version: 3.1.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.2
  • WordPress version: 6.3.1
  • First release: Apr 22, 2020
  • Latest release: Dec 2, 2023
  • Number of updates: 228
  • Update frequency: every 5.8 days
  • Top authors: imbasynergy (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

40+ active /9,664 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

An overview of server-side resources used by ImbaChat
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.95 ▲0.491,046.17 ▲1,004.09
Dashboard /wp-admin3.82 ▲0.5231.34 ▼22.12
Posts /wp-admin/edit.php3.82 ▲0.4630.91 ▼16.66
Add New Post /wp-admin/post-new.php3.82 ▼2.0731.49 ▼69.32
Media Library /wp-admin/upload.php3.82 ▲0.5929.61 ▼5.56
Get Started /wp-admin/admin.php?page=imbachat-setup-help3.8232.89
Integration Settings /wp-admin/admin.php?page=imbachat-hooks-settings3.8231.53
Users Settings /wp-admin/admin.php?page=imbachat-users-settings3.8229.64
ImbaChat Settings /wp-admin/admin.php?page=imbachat-settings3.8231.59

Server storage [IO: ▲4.36MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 467 new files
Database: no new tables, 9 new options
New WordPress options
widget_my_custom_widget
IMCH_LANG
widget_recent-comments
imbachat_db_version
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for ImbaChat
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,176 ▲41413.46 ▲0.2510.33 ▲6.3042.42 ▼2.38
Dashboard /wp-admin2,344 ▲1675.74 ▲0.16130.55 ▲32.6446.41 ▲3.20
Posts /wp-admin/edit.php2,255 ▲1552.19 ▲0.2439.26 ▲0.5744.28 ▲5.43
Add New Post /wp-admin/post-new.php1,800 ▲27423.92 ▲0.91585.77 ▼81.8047.02 ▼24.68
Media Library /wp-admin/upload.php1,549 ▲1554.27 ▼0.03100.45 ▲3.2244.09 ▼0.34
Get Started /wp-admin/admin.php?page=imbachat-setup-help1,3163.3563.4936.77
Integration Settings /wp-admin/admin.php?page=imbachat-hooks-settings9952.1630.0032.00
Users Settings /wp-admin/admin.php?page=imbachat-users-settings1,0692.1628.8432.62
ImbaChat Settings /wp-admin/admin.php?page=imbachat-settings1,1351.9536.0653.69

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/imbachat-widget/includes/class/class-im-cmd-options.php+182
    Undefined offset: 0
  • The uninstall procedure has failed, leaving 9 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • imbachat_db_version
    • widget_my_custom_widget
    • can_compress_scripts
    • IMCH_LANG
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=imbachat-settings
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/imbachat-widget/includes/class/class-im-cmd-options.php+182
    Undefined offset: 0
  • 20 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=imbachat-settings
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/imbachat-widget/includes/class/class-im-cmd-options.php+182
    Trying to get property 'id' of non-object
  • 20 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=imbachat-settings
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/imbachat-widget/includes/class/class-im-cmd-options.php+182
    Trying to get property 'description' of non-object
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=imbachat-settings
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/imbachat-widget/includes/class/class-im-cmd-options.php+182
    Undefined offset: 1
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=imbachat-settings
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/imbachat-widget/includes/class/class-im-cmd-options.php+182
    Undefined offset: 2
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=imbachat-settings
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/imbachat-widget/includes/class/class-im-cmd-options.php+182
    Undefined offset: 3

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
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/imbachat-widget/view/ic_functions.php
    • > /wp-content/plugins/imbachat-widget/view/html-im-chat.php
  • 58× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/imbachat-widget/widgets/ic_widgets.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup' not found in wp-content/plugins/imbachat-widget/CMB2/includes/CMB2_Options_Hookup.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/imbachat-widget/includes/admin/views/cmb2/html-imbachat-settings.php:46
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/imbachat-widget/CMB2/includes/types/CMB2_Type_File_Base.php:13
    • > PHP Warning
      Use of undefined constant IMBACHAT__PLUGIN_DIR - assumed 'IMBACHAT__PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/imbachat-widget/admin/admin.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cmb2_dir() in wp-content/plugins/imbachat-widget/CMB2/includes/rest-api/CMB2_REST_Controller.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/imbachat-widget/view/admin_menu/get_started.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/imbachat-widget/view/admin_menu/links.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/imbachat-widget/CMB2/includes/types/CMB2_Type_Textarea_Code.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Radio' not found in wp-content/plugins/imbachat-widget/CMB2/includes/types/CMB2_Type_Multicheck.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% 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:
  • Donate link: Invalid URI found ("paypal.me/TrapenokVictor")
  • Tags: There are too many tags (22 tag instead of maximum 10)
  • Screenshots: These screenshots need descriptions #10, #6, #7, #8, #9 in imbachat-widget/assets to your readme.txt
Please take inspiration from this readme.txt

imbachat-widget/ImbaChatWidget.php 85% from 13 tests

This is the main PHP file of "ImbaChat" version 3.1.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("imbachat-widget.php" instead of "ImbaChatWidget.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 150 characters long)

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
Success! There were no dangerous files found in this plugin61,667 lines of code in 294 files:
LanguageFilesBlank linesComment linesLines of code
PO File12615,88421,25936,048
PHP1052,7867,33511,841
CSS182811,2115,091
JSON4004,318
JavaScript144126931,853
Sass17306291,411
Markdown532201,001
Bourne Shell1332784
SVG40020

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity17.68
▷ Minimum class complexity1.00
▷ Maximum class complexity188.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes92
▷ Abstract classes99.78%
▷ Concrete classes8390.22%
▷ Final classes00.00%
Methods688
▷ Static methods17625.58%
▷ Public methods58184.45%
▷ Protected methods9313.52%
▷ Private methods142.03%
Functions92
▷ Named functions8188.04%
▷ Anonymous functions1111.96%
Constants20
▷ Global constants1155.00%
▷ Class constants945.00%
▷ Public constants9100.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
22 PNG files occupy 0.51MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
CMB2/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
CMB2/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
CMB2/images/ico-delete.png0.70KB0.72KB0.00%
CMB2/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
admin/assets/images/EAS.PNG47.10KB12.33KB▼ 73.81%