84% woocommerce-clear-cart-on-browser-close

Code Review | Woocommerce Clear on Browser Close

WordPress plugin Woocommerce Clear on Browser Close scored84%from 54 tests.

About plugin

  • Plugin page: woocommerce-clear...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.8
  • WordPress version: 6.3.1
  • First release: Jan 5, 2014
  • Latest release: Jan 6, 2014
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: maksbd19 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

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

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.06ms] Passed 4 tests

This is a short check of server-side resources used by Woocommerce Clear on Browser Close
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.43 ▼2.71
Dashboard /wp-admin3.32 ▲0.0246.79 ▼5.71
Posts /wp-admin/edit.php3.37 ▲0.0247.28 ▼4.08
Add New Post /wp-admin/post-new.php5.90 ▲0.0283.51 ▼11.72
Media Library /wp-admin/upload.php3.25 ▲0.0236.41 ▲1.04
WC Clear Cart on Browser Close /wp-admin/options-general.php?page=wc-clear-cart-on-browser-close3.2132.24

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Woocommerce Clear on Browser Close
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.51 ▼0.221.66 ▼0.1040.92 ▼6.06
Dashboard /wp-admin2,202 ▲255.64 ▲0.1188.30 ▼3.4940.16 ▼3.30
Posts /wp-admin/edit.php2,104 ▲41.97 ▲0.0039.50 ▲2.4236.46 ▲2.11
Add New Post /wp-admin/post-new.php1,532 ▲623.35 ▲0.28643.47 ▼63.1056.17 ▲4.21
Media Library /wp-admin/upload.php1,404 ▲44.23 ▲0.0394.85 ▼14.8041.02 ▼7.38
WC Clear Cart on Browser Close /wp-admin/options-general.php?page=wc-clear-cart-on-browser-close8072.0223.0526.40

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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 were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

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 | 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
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-clear-cart-on-browser-close/index.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 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: Screenshot #1 (screenshot-1.png is the screen shot of the plugin settings page from a working example.) image missing
You can look at the official readme.txt

woocommerce-clear-cart-on-browser-close/index.php 92% from 13 tests

The main PHP script in "Woocommerce Clear on Browser Close" version 1.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("woocommerce-clear-cart-on-browser-close.php" instead of "index.php")

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
Good job! No executable or dangerous file extensions detected70 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1302070

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.56
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%
Functions5
▷ Named functions5100.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
1 PNG file occupies 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png76.03KB30.63KB▼ 59.71%