84% woocommerce-empty-cart-button

Code Review | Woocommerce Empty Cart Button

WordPress plugin Woocommerce Empty Cart Button scored 84% from 54 tests.

About plugin

  • Plugin page: woocommerce-empty...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.2-3.8.0
  • WordPress version: 6.3.1
  • First release: Sep 17, 2013
  • Latest release: Dec 23, 2013
  • Number of updates: 6
  • Update frequency: every 16.3 days
  • Top authors: raviraj (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active / 6,361 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

A check of server-side resources used by Woocommerce Empty Cart Button
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0145.58 ▲4.54
Dashboard /wp-admin3.31 ▲0.0163.69 ▲13.83
Posts /wp-admin/edit.php3.36 ▲0.0152.78 ▲4.54
Add New Post /wp-admin/post-new.php5.89 ▲0.01105.44 ▼21.37
Media Library /wp-admin/upload.php3.24 ▲0.0135.32 ▲3.29

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Woocommerce Empty Cart Button
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4314.41 ▲0.142.45 ▲0.0446.21 ▼14.85
Dashboard /wp-admin2,203 ▲155.83 ▲0.95137.16 ▲17.2257.34 ▲18.93
Posts /wp-admin/edit.php2,092 ▲32.01 ▼0.0543.78 ▲6.6040.05 ▲1.16
Add New Post /wp-admin/post-new.php1,541 ▲821.29 ▼1.90714.00 ▼47.5281.33 ▲23.43
Media Library /wp-admin/upload.php1,388 ▲64.25 ▲0.05131.59 ▲10.0664.71 ▲14.37

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-empty-cart-button/woocommerce-empty-cart-button.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (Empty Cart Button in Action) image missing
You can look at the official readme.txt

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

The main PHP file in "Woocommerce Empty Cart Button" ver. 1.1 adds more information about the plugin and also serves as the entry point for this plugin
33 characters long description:
Empty cart button for woocommerce

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin46 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1101423
PO File12323

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.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
2 PNG files occupy 0.06MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png32.61KB13.50KB▼ 58.59%
empty-cart.png32.61KB13.50KB▼ 58.59%