84% add-whatsapp-button

Code Review | Add Chat App Button

WordPress plugin Add Chat App Button scored84%from 54 tests.

About plugin

  • Plugin page: add-whatsapp-button
  • Plugin version: 2.1.2
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4.1
  • WordPress version: 6.3.1
  • First release: Oct 29, 2018
  • Latest release: Nov 18, 2023
  • Number of updates: 88
  • Update frequency: every 21.0 days
  • Top authors: udidol (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

3,000+ active /46,835 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.17MB] [CPU: ▼0.29ms] Passed 4 tests

Server-side resources used by Add Chat App Button
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0836.28 ▼1.44
Dashboard /wp-admin3.50 ▲0.2047.52 ▼0.17
Posts /wp-admin/edit.php3.62 ▲0.2650.11 ▲1.40
Add New Post /wp-admin/post-new.php6.11 ▲0.2289.20 ▼0.94
Media Library /wp-admin/upload.php3.43 ▲0.2035.47 ▲2.00
Add WhatsApp Button /wp-admin/options-general.php?page=awb-options3.3830.69

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Add Chat App Button
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,921 ▲15913.58 ▼0.6611.57 ▲9.8237.84 ▼2.31
Dashboard /wp-admin2,212 ▲355.61 ▼0.0590.86 ▼6.6539.73 ▼5.20
Posts /wp-admin/edit.php2,114 ▲142.04 ▲0.0341.64 ▼0.7736.27 ▼4.05
Add New Post /wp-admin/post-new.php1,542 ▲1623.39 ▲0.41600.07 ▲3.0461.17 ▲3.99
Media Library /wp-admin/upload.php1,417 ▲174.26 ▲0.0897.20 ▼4.4539.25 ▼6.36
Add WhatsApp Button /wp-admin/options-general.php?page=awb-options1,8282.3456.3334.85

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 71 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=awb-options
    • > Notice in wp-content/plugins/add-whatsapp-button/admin/settings.php+406
    Trying to access array offset on value of type bool

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Screenshots: Screenshot #5 (An example of a fixed button anchored in the bottom of the page) image required
The official readme.txt is a good inspiration

add-whatsapp-button/add-whatsapp-button.php Passed 13 tests

The main PHP script in "Add Chat App Button" version 2.1.2 is automatically included on every request by WordPress
73 characters long description:
Adds a Floating button to your website which opens a WhatsApp chat window

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,587 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP81923161,027
CSS37466321
PO File15465183
JavaScript581728
SVG601728

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity17.43
▷ Minimum class complexity3.00
▷ Maximum class complexity42.00
Average method complexity4.68
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods32
▷ Static methods928.12%
▷ Public methods2887.50%
▷ Protected methods00.00%
▷ Private methods412.50%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.24MB with 0.12MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/portrait_black.png109.84KB28.67KB▼ 73.90%
img/wa-icon-original.png4.26KB4.43KB0.00%
img/landscape_black.png128.09KB29.58KB▼ 76.91%