78% clicktowhat-whatsapp-widget

Code Review | ClickToChat Widget

WordPress plugin ClickToChat Widget scored78%from 54 tests.

About plugin

  • Plugin page: clicktowhat-whats...
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 23, 2019
  • Latest release: Nov 5, 2019
  • Number of updates: 20
  • Update frequency: every 8.6 days
  • Top authors: clicktowhat (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,320 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

A check of server-side resources used by ClickToChat Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0247.37 ▲3.97
Dashboard /wp-admin3.33 ▲0.0354.11 ▼0.05
Posts /wp-admin/edit.php3.38 ▲0.0258.53 ▼0.08
Add New Post /wp-admin/post-new.php5.92 ▲0.0296.09 ▼12.37
Media Library /wp-admin/upload.php3.26 ▲0.0238.59 ▼7.54
ClickToChat Widget /wp-admin/options-general.php?page=widget_settings3.2230.20

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for ClickToChat Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲5114.24 ▼0.111.97 ▲0.0942.42 ▼3.63
Dashboard /wp-admin2,213 ▲365.63 ▼0.0492.44 ▼12.0441.74 ▼4.43
Posts /wp-admin/edit.php2,122 ▲221.98 ▲0.0043.92 ▲5.5241.51 ▲5.75
Add New Post /wp-admin/post-new.php1,546 ▲1822.63 ▼0.70663.10 ▼32.5953.03 ▲2.58
Media Library /wp-admin/upload.php1,421 ▲214.18 ▲0.00103.64 ▼7.3244.41 ▼5.53
ClickToChat Widget /wp-admin/options-general.php?page=widget_settings8552.0426.2428.50

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

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
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/clicktowhat-whatsapp-widget/templates/settings-page.php
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined variable: token in wp-content/plugins/clicktowhat-whatsapp-widget/templates/settings-page.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/clicktowhat-whatsapp-widget/clickToChat.php:160
    • > PHP Notice
      Undefined variable: validposttypes in wp-content/plugins/clicktowhat-whatsapp-widget/templates/settings-page.php on line 33
    • > PHP Notice
      Undefined variable: validposttypes in wp-content/plugins/clicktowhat-whatsapp-widget/templates/settings-page.php on line 25
    • > PHP Notice
      Undefined variable: validposttypes in wp-content/plugins/clicktowhat-whatsapp-widget/templates/settings-page.php on line 29

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 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Contributors: The plugin contributors field is not present
You can take inspiration from this readme.txt

clicktowhat-whatsapp-widget/clickToChat.php 92% from 13 tests

This is the main PHP file of "ClickToChat Widget" version 1.1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("clicktowhat-whatsapp-widget.php" instead of "clickToChat.php")

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
Success! There were no dangerous files found in this plugin114 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP22275111
JSON1003

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity4.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%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin