68% simple-chat

Code Review | Simple Chat

WordPress plugin Simple Chat scored68%from 54 tests.

About plugin

  • Plugin page: simple-chat
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.5.3
  • WordPress version: 6.3.1
  • First release: Apr 26, 2013
  • Latest release: Jul 15, 2016
  • Number of updates: 13
  • Update frequency: every 90.5 days
  • Top authors: webarthur (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

10+ active /13,552 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼7.55ms] Passed 4 tests

Analyzing server-side resources used by Simple Chat
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0838.73 ▲0.44
Dashboard /wp-admin3.32 ▼0.0249.20 ▼14.48
Posts /wp-admin/edit.php3.37 ▲0.0243.04 ▼2.94
Add New Post /wp-admin/post-new.php5.93 ▲0.0481.71 ▼10.41
Media Library /wp-admin/upload.php3.25 ▲0.0234.92 ▼2.37
Simple Chat /wp-admin/options-general.php?page=simple-chat3.2633.22

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 22 new files
Database: 4 new tables, 7 new options
New tables
wp_schat_channel_users
wp_schat_users
wp_usermessages
wp_schat_channels
New WordPress options
simple_chat_version
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple Chat
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,061 ▲31513.66 ▼0.6921.11 ▲19.4948.97 ▲4.21
Dashboard /wp-admin2,208 ▲285.75 ▲0.1697.14 ▼0.4038.43 ▼4.71
Posts /wp-admin/edit.php2,110 ▲102.20 ▲0.2352.82 ▲18.9734.13 ▼2.87
Add New Post /wp-admin/post-new.php1,608 ▲8223.63 ▲0.36660.92 ▼20.9858.43 ▲5.03
Media Library /wp-admin/upload.php1,411 ▲174.31 ▲0.08112.21 ▲14.9543.68 ▼1.32
Simple Chat /wp-admin/options-general.php?page=simple-chat9132.1738.6224.86

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie tables detected upon uninstall: 4 tables
    • wp_usermessages
    • wp_schat_users
    • wp_schat_channel_users
    • wp_schat_channels
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • simple_chat_version

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant SIMPLE_CHAT_LIKE_URL - assumed 'SIMPLE_CHAT_LIKE_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/simple-chat/admin-template.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-chat/admin.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-chat/ajax.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/simple-chat/admin-template.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/simple-chat/simple-chat.php:14

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=simple-chat
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,farbtastic&ver=6.3.1 1:28609 "jQuery.Deferred exception: jq(...).live is not a function" "TypeError: jq(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/simple-chat/js/global.js?ver=6.3.1:325:30)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,farbtastic&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,farbtastic&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=simple-chat
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,farbtastic&ver=6.3.1 1:28609 "jQuery.Deferred exception: j(...).live is not a function" "TypeError: j(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/simple-chat/js/schat.js?nocache=1697967115&ver=6.3.1:548:46)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,farbtastic&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,farbtastic&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=simple-chat
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,farbtastic&ver=6.3.1 1:28721 Uncaught TypeError: jq(...).live is not a function
    • > GET request to /wp-admin/options-general.php?page=simple-chat
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,farbtastic&ver=6.3.1 1:28721 Uncaught TypeError: j(...).live is not a function

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
9 plugin tags: google talk, ajax, facebook chat, google plus, talk...

simple-chat/simple-chat.php Passed 13 tests

The entry point to "Simple Chat" version 1.0.6 is a PHP file that has certain tags in its header comment area
73 characters long description:
a chat based on facebook chat, works only for registred and logged users.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin3,109 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript34812961,832
CSS36346650
PHP819798627

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants13100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 compressed PNG files occupy 0.00MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
themes/images/busy.png0.30KB0.27KB▼ 11.00%
themes/images/off.png0.29KB0.27KB▼ 8.64%
themes/images/on.png0.32KB0.27KB▼ 15.64%
themes/images/afk.png0.31KB0.27KB▼ 12.42%