74% wc-empty-cart

Code Review | Woocommerce Empty Cart

WordPress plugin Woocommerce Empty Cart scored74%from 54 tests.

About plugin

  • Plugin page: wc-empty-cart
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1.2-4.8.1
  • WordPress version: 6.3.1
  • First release: Jun 4, 2015
  • Latest release: Sep 5, 2017
  • Number of updates: 13
  • Update frequency: every 63.5 days
  • Top authors: iwcontribution (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,851 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼1.92MB] [CPU: ▼55.27ms] Passed 4 tests

Analyzing server-side resources used by Woocommerce Empty Cart
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.10 ▼1.395.35 ▼38.56
Dashboard /wp-admin2.12 ▼1.217.48 ▼46.23
Posts /wp-admin/edit.php2.13 ▼1.266.36 ▼42.88
Add New Post /wp-admin/post-new.php2.12 ▼3.797.25 ▼93.39
Media Library /wp-admin/upload.php2.13 ▼1.145.54 ▼28.31

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: no files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Woocommerce Empty Cart: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.13 ▼1.252.01 ▼5.9746.53 ▲0.61
Dashboard /wp-admin2,206 ▲185.89 ▲0.99109.66 ▼9.9741.45 ▼6.06
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0535.28 ▼14.4432.29 ▼9.65
Add New Post /wp-admin/post-new.php1,514 ▼1417.60 ▼0.53682.02 ▲9.2151.69 ▼2.79
Media Library /wp-admin/upload.php1,388 ▲34.25 ▲0.0892.27 ▼11.1840.55 ▼0.31

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/wc-empty-cart/woocommerce-empty-cart.php+21
    Use of undefined constant WC_QUICK_VIEW_URL - assumed 'WC_QUICK_VIEW_URL' (this will throw an Error in a future version of PHP)
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wc-empty-cart/admin/empty-cart-button.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-empty-cart/woocommerce-empty-cart.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
3 plugin tags: woocommerce, empty cart, woocommerce extension

wc-empty-cart/woocommerce-empty-cart.php 92% from 13 tests

The entry point to "Woocommerce Empty Cart" version 1.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wc-empty-cart.php" instead of "woocommerce-empty-cart.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin66 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2231666

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.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
PNG images were not found in this plugin