67% mchat

Code Review | MChat User Chat

WordPress plugin MChat User Chat scored67%from 54 tests.

About plugin

  • Plugin page: mchat
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.4.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9
  • WordPress version: 6.3.1
  • First release: Dec 30, 2021
  • Latest release: Feb 7, 2022
  • Number of updates: 12
  • Update frequency: every 3.3 days
  • Top authors: msolution (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /386 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.16MB] [CPU: ▼8.60ms] Passed 4 tests

A check of server-side resources used by MChat User Chat
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1742.17 ▲2.98
Dashboard /wp-admin3.47 ▲0.1649.65 ▼0.42
Posts /wp-admin/edit.php3.58 ▲0.2246.87 ▼3.71
Add New Post /wp-admin/post-new.php6.05 ▲0.1687.63 ▼30.74
Media Library /wp-admin/upload.php3.39 ▲0.1640.82 ▲0.49

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 28 new files
Database: 2 new tables, 7 new options
New tables
wp_wpmchat_chat
wp_wpmchat_chatmesg
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
wpmchat_ver
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for MChat User Chat
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,956 ▲22114.23 ▼0.3614.93 ▲12.8439.81 ▼13.43
Dashboard /wp-admin2,222 ▲404.84 ▼0.07114.20 ▼16.7740.03 ▼5.31
Posts /wp-admin/edit.php2,065 ▼242.01 ▼0.0139.73 ▲0.5033.52 ▼2.41
Add New Post /wp-admin/post-new.php1,546 ▲1323.10 ▼0.10671.66 ▼9.0884.50 ▲26.87
Media Library /wp-admin/upload.php1,401 ▲134.20 ▼0.04104.95 ▼16.9151.84 ▲8.24

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie tables were found after uninstall: 2 tables
    • wp_wpmchat_chatmesg
    • wp_wpmchat_chat
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • wpmchat_ver
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 15× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/mchat/includes/templates/front/index.php
    • > /wp-content/plugins/mchat/includes/templates/admin/wpmchat_main.php
    • > /wp-content/plugins/mchat/includes/templates/index.php
    • > /wp-content/plugins/mchat/assets/css/index.php
    • > /wp-content/plugins/mchat/includes/wp_mchat_front.php
    • > /wp-content/plugins/mchat/assets/img/index.php
    • > /wp-content/plugins/mchat/index.php
    • > /wp-content/plugins/mchat/assets/index.php
    • > /wp-content/plugins/mchat/includes/templates/front/wpmchat_inbox.php
    • > /wp-content/plugins/mchat/includes/index.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mchat/includes/wp_mchat_admin.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 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
These attributes need your attention:
  • Tags: There are too many tags (16 tag instead of maximum 10)
The official readme.txt is a good inspiration

mchat/wp_mchat.php 77% from 13 tests

The principal PHP file in "MChat User Chat" v. 1.0.1 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Domain Path: The domain path points to a folder that does not exist ("/lang")
  • Main file name: Name the main plugin file the same as the plugin slug ("mchat.php" instead of "wp_mchat.php")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

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
There were no executable files found in this plugin1,351 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP9184134950
JavaScript1253316
CSS220085

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity50.33
▷ Minimum class complexity5.00
▷ Maximum class complexity108.00
Average method complexity6.10
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods29
▷ Static methods26.90%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants12100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/close_pop.png1.91KB1.57KB▼ 17.98%