90% wc-add-to-cart-by-product

Code Review | Add to Cart by Product for WooCommerce

WordPress plugin Add to Cart by Product for WooCommerce scored90%from 54 tests.

About plugin

  • Plugin page: wc-add-to-cart-by...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.1
  • WordPress version: 6.3.1
  • First release: Mar 8, 2017
  • Latest release: May 30, 2022
  • Number of updates: 9
  • Update frequency: every 211.3 days
  • Top authors: psykro (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /3,061 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.28ms] Passed 4 tests

This is a short check of server-side resources used by Add to Cart by Product for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0034.75 ▼4.73
Dashboard /wp-admin3.31 ▲0.0146.35 ▼4.25
Posts /wp-admin/edit.php3.36 ▲0.0049.67 ▼0.21
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.41 ▼7.03
Media Library /wp-admin/upload.php3.24 ▲0.0035.56 ▼1.11

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Add to Cart by Product for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2914.40 ▼0.181.67 ▼0.1039.54 ▼1.72
Dashboard /wp-admin2,209 ▲184.84 ▼0.1999.75 ▼5.5342.51 ▼0.42
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0740.22 ▼1.5135.12 ▼2.22
Add New Post /wp-admin/post-new.php1,529 ▲1518.46 ▲0.92632.77 ▼65.9153.11 ▼4.64
Media Library /wp-admin/upload.php1,388 ▼04.22 ▼0.0394.93 ▼2.0339.26 ▼6.20

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

Smoke tests Passed 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 Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
2 plugin tags: add to cart, woocommerce

wc-add-to-cart-by-product/wc-add-to-cart-by-product.php Passed 13 tests

The main file in "Add to Cart by Product for WooCommerce" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
66 characters long description:
Provides a simpler add to cart shortcode for WooCommerce products.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin32 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3113232

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.70
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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin