84% racar-clear-cart-for-woocommerce

Code Review | RaCar Clear Cart for WooCommerce

WordPress plugin RaCar Clear Cart for WooCommerce scored 84% from 54 tests.

About plugin

  • Plugin page: racar-clear-cart-...
  • Plugin version: 2.1.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.8-6.3.1
  • WordPress version: 6.3.1
  • First release: Mar 14, 2019
  • Latest release: Sep 23, 2023
  • Number of updates: 46
  • Update frequency: every 36.1 days
  • Top authors: rafacarvalhido (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

300+ active / 2,184 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
Install script ran successfully

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

This is a short check of server-side resources used by RaCar Clear Cart for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.82 ▼4.26
Dashboard /wp-admin3.31 ▲0.0148.65 ▼1.18
Posts /wp-admin/edit.php3.36 ▲0.0148.76 ▲0.39
Add New Post /wp-admin/post-new.php5.89 ▲0.0187.36 ▼11.70
Media Library /wp-admin/upload.php3.24 ▲0.0132.68 ▼3.97

Server storage [IO: ▲0.08MB] [DB: ▲0.33MB] Passed 3 tests

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

Browser metrics Passed 4 tests

An overview of browser requirements for RaCar Clear Cart for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲7714.74 ▲0.461.78 ▼0.0145.60 ▼4.11
Dashboard /wp-admin2,218 ▲305.85 ▼0.03108.23 ▲4.0242.20 ▼2.12
Posts /wp-admin/edit.php2,101 ▲121.99 ▼0.0539.83 ▲5.1236.41 ▼3.75
Add New Post /wp-admin/post-new.php1,545 ▲3123.60 ▲6.03665.92 ▼4.8464.59 ▲4.18
Media Library /wp-admin/upload.php1,394 ▲34.20 ▼0.1299.85 ▲0.4844.34 ▲1.94

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

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
Everything seems fine, however 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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/racar-clear-cart-for-woocommerce/includes/views/class-racar-clear-cart-button.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 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
5 plugin tags: clear cart, woocommerce, empty cart, woo commerce, cart

racar-clear-cart-for-woocommerce/racar-clear-cart-for-woocommerce.php Passed 13 tests

Analyzing the main PHP file in "RaCar Clear Cart for WooCommerce" version 2.1.2
102 characters long description:
This plugin adds a convenient button to empty the shopping cart. Clear the entire cart with one click.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin869 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP8156202657
PO File27294192
CSS21815
JavaScript1215

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity17.00
▷ Minimum class complexity5.00
▷ Maximum class complexity36.00
Average method complexity2.88
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods34
▷ Static methods823.53%
▷ Public methods3397.06%
▷ Protected methods00.00%
▷ Private methods12.94%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin