84% hide-cart-when-empty

Code Review | WooCommerce Hide Cart When Empty

WordPress plugin WooCommerce Hide Cart When Empty scored84%from 54 tests.

About plugin

  • Plugin page: hide-cart-when-empty
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 27, 2022
  • Latest release: Aug 10, 2023
  • Number of updates: 7
  • Update frequency: every 62.9 days
  • Top authors: wpfixit (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /652 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

A check of server-side resources used by WooCommerce Hide Cart When Empty
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.62 ▼2.78
Dashboard /wp-admin3.32 ▼0.0250.74 ▼21.67
Posts /wp-admin/edit.php3.37 ▲0.0250.98 ▲0.43
Add New Post /wp-admin/post-new.php5.90 ▲0.0283.53 ▼25.45
Media Library /wp-admin/upload.php3.24 ▲0.0239.89 ▼0.11

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

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

Browser metrics Passed 4 tests

WooCommerce Hide Cart When Empty: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲3614.12 ▼0.141.80 ▼0.1145.36 ▲1.49
Dashboard /wp-admin2,200 ▲205.63 ▲0.0591.66 ▼3.2541.52 ▼1.03
Posts /wp-admin/edit.php2,105 ▲22.03 ▲0.0339.93 ▲4.0437.94 ▲2.35
Add New Post /wp-admin/post-new.php1,539 ▲1122.84 ▼0.23654.81 ▼38.1754.20 ▼3.11
Media Library /wp-admin/upload.php1,411 ▲114.24 ▲0.03101.58 ▼10.2843.67 ▼2.52

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/hide-cart-when-empty/hide-cart-when-empty.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% 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
No tags were detected

hide-cart-when-empty/hide-cart-when-empty.php 85% from 13 tests

The main file in "WooCommerce Hide Cart When Empty" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 158 characters long)
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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 plugin103 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1171990
CSS10013

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.09
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods5100.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions583.33%
▷ Anonymous functions116.67%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin