90% woo-empty-cart-button

Code Review | Empty Cart Button for WooCommerce

WordPress plugin Empty Cart Button for WooCommerce scored90%from 54 tests.

About plugin

  • Plugin page: woo-empty-cart-bu...
  • Plugin version: 1.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.2.0
  • WordPress version: 6.3.1
  • First release: Sep 2, 2016
  • Latest release: Jul 14, 2023
  • Number of updates: 34
  • Update frequency: every 73.7 days
  • Top authors: wpcodelibrary (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

3,000+ active /20,400 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 gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.61ms] Passed 4 tests

An overview of server-side resources used by Empty Cart Button for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.01 ▼3.81
Dashboard /wp-admin3.31 ▲0.0143.33 ▼3.44
Posts /wp-admin/edit.php3.37 ▲0.0145.02 ▼1.53
Add New Post /wp-admin/post-new.php5.90 ▲0.0191.70 ▼9.65
Media Library /wp-admin/upload.php3.24 ▲0.0133.71 ▲3.03

Server storage [IO: ▲0.03MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Empty Cart Button for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.27 ▼1.114.68 ▲2.9641.35 ▼7.11
Dashboard /wp-admin2,209 ▲214.89 ▼0.00112.44 ▲5.1341.32 ▲0.67
Posts /wp-admin/edit.php2,089 ▼01.97 ▼0.0439.96 ▼0.5633.94 ▼1.85
Add New Post /wp-admin/post-new.php1,514 ▼317.53 ▼0.07585.03 ▼17.9142.97 ▼1.21
Media Library /wp-admin/upload.php1,382 ▼64.16 ▼0.0197.36 ▲0.8241.95 ▲1.23

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

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 shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Donate link: Please fix this invalid url: ""
The official readme.txt is a good inspiration

woo-empty-cart-button/woo-empty-cart-button.php Passed 13 tests

The main PHP script in "Empty Cart Button for WooCommerce" version 1.4.0 is automatically included on every request by WordPress
59 characters long description:
This plugin is use for empty whole cart using single click.

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 plugin99 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3294699

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.40
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity2.44
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods555.56%
▷ Public methods888.89%
▷ Protected methods00.00%
▷ Private methods111.11%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.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
PNG images were not found in this plugin