67% number-chat

Code Review | Number Chat

WordPress plugin Number Chat scored 67% from 54 tests.

About plugin

  • Plugin page: number-chat
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9
  • WordPress version: 5.9.2
  • First release: Feb 10, 2022
  • Latest release: Feb 16, 2022
  • Number of updates: 9
  • Update frequency: every 0.8 days
  • Top authors: wpcohort (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 82 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
This plugin's installer ran successfully

Server metrics [RAM: ▲5.55MB] [CPU: ▼255.40ms] 75% from 4 tests

This is a short check of server-side resources used by Number Chat
The following require your attention
  • Extra RAM: The extra memory usage must be under 5MB (currently 5.55MB on /wp-admin/options-general.php?page=redux-framework)
PageMemory (MB)CPU Time (ms)
Home /9.14 ▲5.6294.69 ▲45.68
Dashboard /wp-admin8.94 ▲5.5371.74 ▲37.13
Posts /wp-admin/edit.php9.17 ▲5.5374.02 ▲36.70
Add New Post /wp-admin/post-new.php12.49 ▲5.52128.28 ▼1,136.63
Media Library /wp-admin/upload.php8.89 ▲5.6064.85 ▲41.22
Freemius Debug [v.2.4.2] /wp-admin/admin.php?page=freemius9.0760.11
Redux /wp-admin/options-general.php?page=redux-framework8.8559.91

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 1,489 new files
Database: no new tables, 6 new options
New WordPress options
fs_gdpr
fs_debug_mode
numberchat
fs_accounts
fs_active_plugins
numberchat-transients

Browser metrics Passed 4 tests

A check of browser resources used by Number Chat
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,103 ▲34916.21 ▲0.4410.31 ▲4.206.09 ▲3.50
Dashboard /wp-admin2,974 ▲1206.14 ▲0.02114.90 ▼18.29167.69 ▲7.40
Posts /wp-admin/edit.php2,779 ▲883.25 ▲0.0264.94 ▲2.06156.46 ▲14.32
Add New Post /wp-admin/post-new.php1,691 ▲3017.76 ▲1.01402.37 ▼12.23151.63 ▼1.80
Media Library /wp-admin/upload.php1,790 ▲955.54 ▲0.05146.06 ▼0.96200.25 ▲16.83
Freemius Debug [v.2.4.2] /wp-admin/admin.php?page=freemius1,4902.7553.77112.56
Redux /wp-admin/options-general.php?page=redux-framework1,3894.2898.22283.72

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/number-chat/freemius/includes/class-freemius.php+8552
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 6 options in the database
    • numberchat
    • fs_gdpr
    • fs_accounts
    • numberchat-transients
    • fs_debug_mode
    • fs_active_plugins

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
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Please fix the following
  • 14× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/number-chat/redux-framework-master/extendify-sdk/app/Controllers/TemplateController.php
    • > /wp-content/plugins/number-chat/redux-framework-master/extendify-sdk/app/Controllers/UserController.php
    • > /wp-content/plugins/number-chat/redux-framework-master/extendify-sdk/app/Controllers/PingController.php
    • > /wp-content/plugins/number-chat/admin/partials/whatsapp-chat-admin-display.php
    • > /wp-content/plugins/number-chat/redux-framework-master/extendify-sdk/routes/api.php
    • > /wp-content/plugins/number-chat/freemius/templates/ajax-loader.php
    • > /wp-content/plugins/number-chat/redux-framework-master/extendify-sdk/app/Controllers/SiteSettingsController.php
    • > /wp-content/plugins/number-chat/public/partials/whatsapp-chat-public-display.php
    • > /wp-content/plugins/number-chat/redux-framework-master/extendify-sdk/app/Controllers/PluginController.php
    • > /wp-content/plugins/number-chat/redux-framework-master/extendify-sdk/app/Controllers/MetaController.php
  • 20× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/number-chat/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/number-chat/freemius/templates/account/partials/addon.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/number-chat/redux-framework-master/redux-core/templates/panel/header-stickybar.tpl.php:15
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/number-chat/includes/chat.php on line 32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/number-chat/redux-framework-master/extendify-sdk/editorplus/EditorPlus.php:220
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/number-chat/freemius/templates/account/partials/addon.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_head() in wp-content/plugins/number-chat/redux-framework-master/extendify-sdk/editorplus/editorplus-template.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/number-chat/redux-framework-master/extendify-sdk/app/ApiRouter.php:14
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/number-chat/includes/chat.php on line 27
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/number-chat/redux-framework-master/redux-core/templates/panel/content.tpl.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
Attributes that require attention:
  • Screenshots: These screenshots need descriptions #1, #2, #3 in number-chat/assets to your readme.txt
You can look at the official readme.txt

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

The main PHP script in "Number Chat" version 1.0 is automatically included on every request by WordPress
44 characters long description:
Add Whatsapp floating icon with Number Chat.

Code Analysis 95% from 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 plugin206,834 lines of code in 1,037 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript31515,89713,38367,199
PHP37714,82530,27363,159
JSON150039,376
Sass1223,61214619,745
CSS1525,1764409,848
SVG4982246,857
Markdown41520561
HTML17060
XML26029

PHP code 0% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
It is recommended to fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 2,908)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 110)
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity41.81
▷ Minimum class complexity1.00
▷ Maximum class complexity2,908.00
Average method complexity5.02
▷ Minimum method complexity1.00
▷ Maximum method complexity110.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes230
▷ Abstract classes62.61%
▷ Concrete classes22497.39%
▷ Final classes20.89%
Methods2,373
▷ Static methods51921.87%
▷ Public methods1,75774.04%
▷ Protected methods1586.66%
▷ Private methods45819.30%
Functions137
▷ Named functions11785.40%
▷ Anonymous functions2014.60%
Constants231
▷ Global constants10746.32%
▷ Class constants12453.68%
▷ Public constants124100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
76 PNG files occupy 1.31MB with 0.39MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
redux-framework-master/redux-core/assets/img/jquery-ui-bootstrap/ui-icons_777777_256x240.png6.85KB4.18KB▼ 38.94%
redux-framework-master/redux-core/assets/img/1c.png0.13KB0.13KB0.00%
redux-framework-master/redux-core/assets/img/jquery-ui-bootstrap/ui-icons_888888_256x240.png4.10KB4.11KB0.00%
redux-framework-master/redux-templates/assets/img/welcome-guide-1.png329.94KB86.05KB▼ 73.92%
redux-framework-master/redux-templates/assets/img/popup-congrats.png59.27KB37.29KB▼ 37.08%