68% simple-chat

Code Review | Simple Chat

WordPress plugin Simple Chat scored 68% 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: 5.8.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

40+ active / 13,285 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼141.68ms] Passed 4 tests

This is a short check of server-side resources used by Simple Chat
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.92 ▲0.0829.60 ▲7.16
Dashboard /wp-admin3.13 ▲0.0733.57 ▼3.41
Posts /wp-admin/edit.php3.22 ▲0.1134.81 ▲4.83
Add New Post /wp-admin/post-new.php5.49 ▲0.0572.41 ▼568.06
Media Library /wp-admin/upload.php3.07 ▲0.0723.64 ▼0.08
Simple Chat /wp-admin/options-general.php?page=simple-chat3.0523.55

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 22 new files
Database: 4 new tables, 1 new option
New tables
wp_schat_channels
wp_schat_channel_users
wp_usermessages
wp_schat_users
New WordPress options
simple_chat_version

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 /4,068 ▲46716.58 ▲0.6525.49 ▲18.9791.14 ▲20.35
Dashboard /wp-admin2,938 ▲456.54 ▲0.35129.29 ▼3.79165.36 ▼6.86
Posts /wp-admin/edit.php2,751 ▲453.32 ▲0.0879.15 ▲15.85142.93 ▲13.91
Add New Post /wp-admin/post-new.php2,325 ▼1,41815.55 ▼3.14414.44 ▼24.44157.12 ▼45.71
Media Library /wp-admin/upload.php1,757 ▲85.93 ▲0.42160.45 ▲21.08184.67 ▲5.22
Simple Chat /wp-admin/options-general.php?page=simple-chat1,1973.1176.19121.02

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The uninstall procedure failed, leaving 4 tables in the database
    • wp_usermessages
    • wp_schat_channel_users
    • wp_schat_channels
    • wp_schat_users
  • Zombie WordPress options were found after uninstall: 1 option
    • simple_chat_version

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > 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 __() in wp-content/plugins/simple-chat/admin-template.php:9
    • > 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 get_option() in wp-content/plugins/simple-chat/simple-chat.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-chat/admin.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues 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=5.8.1 1:31592 "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=5.8.1:325:30)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,farbtastic&ver=5.8.1:2:30038)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,farbtastic&ver=5.8.1:2:30340)" 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=5.8.1 1:31592 "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=1646978866&ver=5.8.1:548:46)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,farbtastic&ver=5.8.1:2:30038)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,farbtastic&ver=5.8.1:2:30340)" 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=5.8.1 1:31702 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=5.8.1 1:31702 Uncaught TypeError: j(...).live is not a function

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
9 plugin tags: facebook, chat, facebook chat, talk, ajax...

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

This is the main PHP file of "Simple Chat" version 1.0.6, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
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 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected3,109 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript34812961,832
CSS36346650
PHP819798627

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 compressed PNG files occupy 0.00MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
themes/images/afk.png0.31KB0.27KB▼ 12.42%
themes/images/off.png0.29KB0.27KB▼ 8.64%
themes/images/on.png0.32KB0.27KB▼ 15.64%
themes/images/busy.png0.30KB0.27KB▼ 11.00%