93% cart-drawer-for-wc

Code Review | Cart Drawer for WC

WordPress plugin Cart Drawer for WC scored 93% from 54 tests.

About plugin

  • Plugin page: cart-drawer-for-wc
  • Plugin version: 1.5.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-5.8
  • WordPress version: 5.9.2
  • First release: Feb 1, 2022
  • Latest release: Feb 1, 2022
  • Number of updates: 2
  • Update frequency: every 7.0 days
  • Top authors: wpevince (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 44 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by Cart Drawer for WC
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0164.28 ▲4.66
Dashboard /wp-admin3.41 ▲0.0037.97 ▼0.57
Posts /wp-admin/edit.php3.64 ▲0.0042.59 ▼0.70
Add New Post /wp-admin/post-new.php6.88 ▼0.0997.42 ▼1,264.53
Media Library /wp-admin/upload.php3.29 ▲0.0025.18 ▼4.08

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Cart Drawer for WC
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲2116.01 ▲0.315.82 ▼0.432.47 ▲0.37
Dashboard /wp-admin2,895 ▲346.17 ▼0.04116.67 ▼22.16155.31 ▼13.96
Posts /wp-admin/edit.php2,690 ▼13.23 ▲0.0168.69 ▲6.87198.26 ▲48.72
Add New Post /wp-admin/post-new.php1,661 ▼5016.04 ▼4.55432.59 ▼29.54158.61 ▼45.17
Media Library /wp-admin/upload.php1,698 ▼05.51 ▼0.09178.62 ▲34.46184.52 ▼65.31

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/cart-drawer-for-wc/includes/shortcodes.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/cart-drawer-for-wc/cart-drawer-woocommerce.php:40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cart-drawer-for-wc/includes/ajax-functions.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cart-drawer-for-wc/includes/cart-drawer.php:42

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 on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: A description for screenshot #1 is required in cart-drawer-for-wc/assets to your readme.txt
  • Donate link: Invalid url: ""
You can look at the official readme.txt

cart-drawer-for-wc/cart-drawer-woocommerce.php 85% from 13 tests

The main file in "Cart Drawer for WC" v. 1.5.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("cart-drawer-for-wc.php" instead of "cart-drawer-woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin1,012 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
CSS1179542
PHP47337325
JavaScript13412145

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity2.00
▷ Minimum method complexity2.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods1
▷ Static methods1100.00%
▷ Public methods1100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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