10% kn-public-chat

Code Review | KN Public Chat

WordPress plugin KN Public Chat scored10%from 54 tests.

About plugin

  • Plugin page: kn-public-chat
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.3.1
  • WordPress version: 6.3.1
  • First release: Jan 21, 2012
  • Latest release: Jan 24, 2012
  • Number of updates: 12
  • Update frequency: every 0.3 days
  • Top authors: KakiNetwork (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /6,795 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
You still need to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/kn-public-chat/functions.php+80
    Function create_function() is deprecated

Server metrics [RAM: ▼1.94MB] [CPU: ▼54.62ms] Passed 4 tests

An overview of server-side resources used by KN Public Chat
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.04 ▼1.424.54 ▼37.57
Dashboard /wp-admin2.06 ▼1.246.22 ▼49.60
Posts /wp-admin/edit.php2.06 ▼1.295.63 ▼41.99
Add New Post /wp-admin/post-new.php2.06 ▼3.825.94 ▼89.33
Media Library /wp-admin/upload.php2.06 ▼1.175.22 ▼31.59

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 16 new files
Database: no new tables, 14 new options
New WordPress options
kn_malay_chat_privatekey
kn_malay_chat_cboxid
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
kn_malay_chat_cboxheight
kn_malay_chat_version
kn_malay_chat_cboxwidth
widget_recent-posts
db_upgraded
...

Browser metrics Passed 4 tests

A check of browser resources used by KN Public Chat
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4314.20 ▼0.171.68 ▼0.0740.99 ▼7.03
Dashboard /wp-admin2,213 ▲335.56 ▼0.1083.44 ▼12.3267.71 ▲19.59
Posts /wp-admin/edit.php2,115 ▲151.99 ▼0.0434.85 ▼4.3734.73 ▼0.41
Add New Post /wp-admin/post-new.php1,556 ▲3023.18 ▼0.53690.67 ▼20.4359.29 ▲6.19
Media Library /wp-admin/upload.php1,412 ▲94.21 ▲0.0599.61 ▼7.5570.89 ▲24.00

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/kn-public-chat/functions.php+80
    Function create_function() is deprecated
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • widget_kn_malay_chat_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
The following issues need your attention
  • 32× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: cboxheight in wp-content/plugins/kn-public-chat/manage.php on line 8
    • > PHP Notice
      Undefined variable: versi in wp-content/plugins/kn-public-chat/setting.php on line 5
    • > PHP Notice
      Undefined variable: premium in wp-content/plugins/kn-public-chat/manage.php on line 85
    • > PHP Notice
      Undefined variable: cboxheight in wp-content/plugins/kn-public-chat/manage.php on line 49
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/kn-public-chat/var.php:4
    • > PHP Notice
      Undefined variable: kn_plugin in wp-content/plugins/kn-public-chat/setting.php on line 5
    • > PHP Notice
      Undefined variable: kn_plugin in wp-content/plugins/kn-public-chat/manage.php on line 45
    • > PHP Notice
      Undefined variable: premium in wp-content/plugins/kn-public-chat/manage.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/kn-public-chat/functions.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_user_logged_in() in wp-content/plugins/kn-public-chat/chat.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (Admin Page), #2 (Widget In Action)
You can take inspiration from this readme.txt

kn-public-chat/index.php 85% from 13 tests

Analyzing the main PHP file in "KN Public Chat" version 1.0.2
Please make the necessary changes and fix the following:
  • Description: The description should be shorter than 140 characters (currently 245 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("kn-public-chat.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin1,489 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript10121,129
PHP61115360

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity2.00
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.40
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
6 PNG files occupy 0.20MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png50.41KB16.09KB▼ 68.07%
images/icons/tools.png0.41KB0.44KB0.00%
images/icons/info.png0.29KB0.28KB▼ 3.38%
images/icon.png0.72KB0.66KB▼ 8.89%
screenshot-2.png148.78KB42.67KB▼ 71.32%