73% i-chat

Code Review | I Chat

WordPress plugin I Chat scored73%from 54 tests.

About plugin

  • Plugin page: i-chat
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5-4.4
  • WordPress version: 6.3.1
  • First release: Mar 27, 2017
  • Latest release: Apr 5, 2017
  • Number of updates: 6
  • Update frequency: every 7.2 days
  • Top authors: mazharahmedkhan010 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /558 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

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

This is a short check of server-side resources used by I Chat
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0842.28 ▼1.03
Dashboard /wp-admin3.37 ▲0.0749.08 ▲0.50
Posts /wp-admin/edit.php3.43 ▲0.0749.74 ▼6.73
Add New Post /wp-admin/post-new.php5.96 ▲0.0787.22 ▼8.83
Media Library /wp-admin/upload.php3.30 ▲0.0747.21 ▲8.32
I Chat /wp-admin/options-general.php?page=i-chat-plugin3.2632.33

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 13 new files
Database: 2 new tables, 6 new options
New tables
wp_chat_user
wp_chat_messages
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by I Chat
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲5114.39 ▲0.032.63 ▲0.6146.85 ▲1.74
Dashboard /wp-admin2,204 ▲275.61 ▲0.0384.04 ▼3.6441.25 ▼5.81
Posts /wp-admin/edit.php2,103 ▲31.99 ▲0.0233.21 ▼6.9836.29 ▼3.92
Add New Post /wp-admin/post-new.php1,533 ▲522.95 ▼0.11628.00 ▼4.1154.15 ▼12.96
Media Library /wp-admin/upload.php1,406 ▲64.17 ▼0.0198.81 ▲1.1944.73 ▼0.54
I Chat /wp-admin/options-general.php?page=i-chat-plugin7902.0423.9828.34

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
It is recommended to fix the following
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_chat_messages
    • wp_chat_user
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Please fix the following
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATH/wp-config.php' (include_path='.:/usr/share/php') in wp-content/plugins/i-chat/i-functions.php on line 2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/i-chat/i-functions.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/i-chat/includes/i-chat-settings.php:4
    • > PHP Warning
      require_once(ABSPATH/wp-config.php): failed to open stream: No such file or directory in wp-content/plugins/i-chat/i-functions.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATH/wp-config.php' (include_path='.:/usr/share/php') in wp-content/plugins/i-chat/i-functions.php on line 2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/i-chat/i-functions.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/i-chat/includes/i-chat-settings.php:4
    • > PHP Warning
      require_once(ABSPATH/wp-config.php): failed to open stream: No such file or directory in wp-content/plugins/i-chat/i-functions.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% 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 to be fixed:
  • Screenshots: Add descriptions for screenshots #1, #2, #3, #4 in i-chat/assets to your readme.txt
  • Tags: Please delete some tags, you are using 18 tag instead of maximum 10
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === i-chat === )
The official readme.txt is a good inspiration

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

The primary PHP file in "I Chat" version 1.0.0 is used by WordPress to initiate all plugin functionality
54 characters long description:
A cool chatting plugin, To chat with your web vistors.

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 plugin954 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP45735564
JavaScript22927251
CSS3273139

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/close.png2.19KB1.77KB▼ 19.16%
img/chat-send.png1.22KB0.50KB▼ 58.95%
img/chat-trigger.png15.20KB6.03KB▼ 60.35%