77% click-to-chat-for-whatsapp

Code Review | Click to Chat - HoliThemes

WordPress plugin Click to Chat - HoliThemes scored77%from 54 tests.

About plugin

  • Plugin page: click-to-chat-for...
  • Plugin version: 3.30.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3.2
  • WordPress version: 6.3.1
  • First release: Oct 23, 2017
  • Latest release: Oct 16, 2023
  • Number of updates: 1
  • Update frequency: every 365.0 days

Code review

54 tests

User reviews

124 reviews

Install metrics

500,000+ active /9,720,477 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.65MB] [CPU: ▼0.19ms] Passed 4 tests

Analyzing server-side resources used by Click to Chat - HoliThemes
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.78 ▲0.3248.28 ▲6.49
Dashboard /wp-admin4.11 ▲0.8150.28 ▲1.06
Posts /wp-admin/edit.php4.16 ▲0.8156.95 ▲14.74
Add New Post /wp-admin/post-new.php6.63 ▲0.7586.78 ▼15.41
Media Library /wp-admin/upload.php3.97 ▲0.7444.91 ▲7.10
Greetings /wp-admin/admin.php?page=click-to-chat-greetings4.2271.21
Click to Chat /wp-admin/admin.php?page=click-to-chat4.0739.57
Customize /wp-admin/admin.php?page=click-to-chat-customize-styles3.9641.87
Other Settings /wp-admin/admin.php?page=click-to-chat-other-settings3.9639.13

Server storage [IO: ▲1.91MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 192 new files
Database: no new tables, 25 new options
New WordPress options
ht_ctc_s7_1
ht_ctc_s7
ht_ctc_share
widget_recent-comments
ht_ctc_s3_1
ht_ctc_greetings_options
theysaidso_admin_options
widget_recent-posts
ht_ctc_one_time
ht_ctc_s3
...

Browser metrics Passed 4 tests

Checking browser requirements for Click to Chat - HoliThemes
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,118 ▲35713.58 ▼0.7721.58 ▲19.8539.45 ▼9.09
Dashboard /wp-admin2,272 ▲955.59 ▼0.0482.89 ▼16.7242.58 ▼1.38
Posts /wp-admin/edit.php2,175 ▲752.02 ▲0.0340.08 ▼0.2740.25 ▲5.61
Add New Post /wp-admin/post-new.php6,357 ▲4,83125.95 ▲3.22903.60 ▲209.5860.25 ▲4.99
Media Library /wp-admin/upload.php1,478 ▲784.22 ▲0.01100.22 ▼14.3245.75 ▼1.86
Greetings /wp-admin/admin.php?page=click-to-chat-greetings3,0119.43281.7342.14
Click to Chat /wp-admin/admin.php?page=click-to-chat5,2094.2275.5052.27
Customize /wp-admin/admin.php?page=click-to-chat-customize-styles1,3933.0756.8430.43
Other Settings /wp-admin/admin.php?page=click-to-chat-other-settings2,5912.9572.0140.92

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 25 options
    • ht_ctc_woo_options
    • ht_ctc_s5
    • ht_ctc_s3_1
    • widget_theysaidso_widget
    • ht_ctc_s1
    • ht_ctc_s8
    • ht_ctc_share
    • ht_ctc_s7_1
    • ht_ctc_group
    • ht_ctc_chat_options
    • ...

Smoke tests 50% from 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 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 take a closer look at the following
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/click-to-chat-for-whatsapp/new/admin/components/editor.php
    • > /wp-content/plugins/click-to-chat-for-whatsapp/new/admin/components/editor_lite.php
    • > /wp-content/plugins/click-to-chat-for-whatsapp/click-to-chat.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/click-to-chat-for-whatsapp/new/inc/commons/position-to-place.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
  • Screenshots: These screenshots lack descriptions #10, #11, #12, #13, #14, #15, #16, #17, #18, #2, #3, #4, #5, #6, #7, #8, #9 in click-to-chat-for-whatsapp/assets to your readme.txt
You can take inspiration from this readme.txt

click-to-chat-for-whatsapp/click-to-chat.php 92% from 13 tests

The primary PHP file in "Click to Chat - HoliThemes" version 3.30.1 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("click-to-chat-for-whatsapp.php" instead of "click-to-chat.php")

Code Analysis 97% from 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 detected17,935 lines of code in 180 files:
LanguageFilesBlank linesComment linesLines of code
PHP1414,1222,91912,694
JavaScript227067963,861
CSS1386281,330
SVG40050

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 103)
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity28.82
▷ Minimum class complexity1.00
▷ Maximum class complexity174.00
Average method complexity5.52
▷ Minimum method complexity1.00
▷ Maximum method complexity103.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes49
▷ Abstract classes00.00%
▷ Concrete classes49100.00%
▷ Final classes00.00%
Methods301
▷ Static methods165.32%
▷ Public methods29397.34%
▷ Protected methods00.00%
▷ Private methods82.66%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.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.08MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
new/admin/admin_assets/intl/img/flags@2x.png170.28KB68.04KB▼ 60.04%
new/inc/assets/img/wa_bg.png21.42KB23.86KB0.00%
new/inc/assets/img/whatsapp-logo-32x32.png1.12KB1.13KB0.00%
new/admin/admin_assets/intl/img/flags.png69.20KB23.42KB▼ 66.16%