89% click-to-chat-widget

Code Review | Click To Chat Widget

WordPress plugin Click To Chat Widget scored 89% from 54 tests.

About plugin

  • Plugin page: click-to-chat-widget
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Feb 25, 2023
  • Latest release: Feb 26, 2023
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: homescript (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 134 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.14ms] Passed 4 tests

A check of server-side resources used by Click To Chat Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.24 ▼2.56
Dashboard /wp-admin3.33 ▲0.0244.97 ▼2.76
Posts /wp-admin/edit.php3.38 ▲0.0248.76 ▲3.03
Add New Post /wp-admin/post-new.php5.92 ▲0.0491.34 ▼3.72
Media Library /wp-admin/upload.php3.25 ▲0.0236.85 ▲0.49

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 30 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Click To Chat Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,906 ▲17114.91 ▲0.624.97 ▲3.1642.45 ▲1.86
Dashboard /wp-admin2,223 ▲386.35 ▲0.45112.78 ▲6.2744.24 ▲3.76
Posts /wp-admin/edit.php2,112 ▲233.09 ▲1.1139.71 ▼3.0435.37 ▲0.93
Add New Post /wp-admin/post-new.php1,544 ▲119.23 ▼3.58628.68 ▼65.4335.85 ▼18.79
Media Library /wp-admin/upload.php1,405 ▲205.57 ▲1.39103.33 ▼3.3442.81 ▼2.10

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

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

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: messaging, chat, whatsapp, click to chat

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

"Click To Chat Widget" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("click-to-chat-widget.php" instead of "hs-click-to-chat.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected4,377 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP132085581,592
JavaScript4173361,521
CSS330881,264

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity2.14
▷ Minimum class complexity1.00
▷ Maximum class complexity4.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods32
▷ Static methods26.25%
▷ Public methods2784.38%
▷ Protected methods00.00%
▷ Private methods515.62%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
4 PNG files occupy 0.26MB with 0.12MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/flags.png69.20KB23.42KB▼ 66.16%
public/img/green-icon-with-name.png2.22KB2.29KB0.00%
public/img/green-icon.png24.71KB9.48KB▼ 61.62%
admin/img/flags@2x.png170.28KB68.04KB▼ 60.04%