77% click-to-chat-whatso

Code Review | Click to Chat

WordPress plugin Click to Chat scored 77% from 54 tests.

About plugin

  • Plugin page: click-to-chat-whatso
  • Plugin version: 2.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.8
  • WordPress version: 5.8.1
  • First release: Jul 28, 2021
  • Latest release: Oct 19, 2021
  • Number of updates: 57
  • Update frequency: every 1.5 days
  • Top authors: whatso (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

70+ active / 536 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.45MB] [CPU: ▼137.71ms] Passed 4 tests

This is a short check of server-side resources used by Click to Chat
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.26 ▲0.5438.36 ▲17.75
Dashboard /wp-admin3.55 ▲0.4948.61 ▲4.66
Posts /wp-admin/edit.php3.59 ▲0.4948.79 ▲5.62
Add New Post /wp-admin/post-new.php5.85 ▲0.4194.40 ▼559.74
Media Library /wp-admin/upload.php3.43 ▲0.4333.64 ▼1.39
Quick Setup /wp-admin/admin.php?page=whatso_floating_quick_setup3.5432.40
Accounts /wp-admin/edit.php?post_type=whatso_accounts3.4939.08
WhatsApp Notification Setup /wp-admin/admin.php?page=whatso_notifications_setup3.5028.17
Shortcode Settings /wp-admin/admin.php?page=whatso_settings3.4637.14
WooCommerce Settings /wp-admin/admin.php?page=whatso_woocommerce_button3.4746.98
Display Settings /wp-admin/admin.php?page=whatso_floating_widget3.4639.47

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 56 new files
Database: no new tables, 1 new option
New WordPress options
whatso_settings

Browser metrics Passed 4 tests

Click to Chat: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,878 ▲28216.33 ▲0.7614.54 ▲5.5948.44 ▼1.73
Dashboard /wp-admin3,005 ▲745.97 ▲0.04134.38 ▼10.59124.09 ▲6.49
Posts /wp-admin/edit.php2,797 ▲582.72 ▲0.0264.09 ▼2.5881.14 ▼1.57
Add New Post /wp-admin/post-new.php1,643 ▼22921.93 ▲2.39274.92 ▼112.78107.03 ▼0.23
Media Library /wp-admin/upload.php1,794 ▼135.02 ▼0.02127.85 ▼19.35131.84 ▲8.68
Quick Setup /wp-admin/admin.php?page=whatso_floating_quick_setup1,4042.1051.46135.87
Accounts /wp-admin/edit.php?post_type=whatso_accounts1,4962.6356.7661.86
WhatsApp Notification Setup /wp-admin/admin.php?page=whatso_notifications_setup1,4442.0952.08103.79
Shortcode Settings /wp-admin/admin.php?page=whatso_settings1,8033.9079.5265.44
WooCommerce Settings /wp-admin/admin.php?page=whatso_woocommerce_button1,5113.4568.6095.35
Display Settings /wp-admin/admin.php?page=whatso_floating_widget1,3953.3767.4984.49

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 1 option
    • whatso_settings

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/click-to-chat-whatso/includes/WHATSO_Quick.php
    • > /wp-content/plugins/click-to-chat-whatso/view/notifications_setup.php
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/click-to-chat-whatso/view/floating_widget_header.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WHATSO_Utils' not found in wp-content/plugins/click-to-chat-whatso/controller/floating_quick_setup.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/click-to-chat-whatso/view/woocommerce_button.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/click-to-chat-whatso/view/floating_widget_header.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/click-to-chat-whatso/view/notifications_setup.php:280
    • > PHP Fatal error
      Uncaught Error: Class 'WHATSO_Utils' not found in wp-content/plugins/click-to-chat-whatso/view/floating_quick_setup.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WHATSO_Utils' not found in wp-content/plugins/click-to-chat-whatso/controller/woocommerce_button.php:35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/click-to-chat-whatso/view/floating_widget_header.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WHATSO_Utils' not found in wp-content/plugins/click-to-chat-whatso/view/floating_widget_display_settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/click-to-chat-whatso/view/floating_widget_header.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Tags: Too many tags (15 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Screenshot #1 (Click to Chat - Whatso - WhatsApp chat widget) image missing
Please take inspiration from this readme.txt

click-to-chat-whatso/whatso.php 85% from 13 tests

The principal PHP file in "Click to Chat" v. 2.0.0 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("click-to-chat-whatso.php" instead of "whatso.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected6,058 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
PHP318252523,671
CSS491261,178
JavaScript3256145800
PO File1172194409

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity28.08
▷ Minimum class complexity4.00
▷ Maximum class complexity140.00
Average method complexity5.85
▷ Minimum method complexity1.00
▷ Maximum method complexity52.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods68
▷ Static methods1014.71%
▷ Public methods6697.06%
▷ Protected methods00.00%
▷ Private methods22.94%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
7 PNG files occupy 0.09MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/logo-white-small.png0.90KB1.24KB0.00%
assets/images/whatso-new-logo.png0.64KB0.62KB▼ 4.10%
assets/images/jquery.minicolors.png67.02KB34.31KB▼ 48.80%
assets/images/blank-avatar.png5.38KB5.45KB0.00%
assets/images/avtar.png11.19KB4.14KB▼ 63.03%