89% quantity-field-on-shop-page-for-woocommerce

Code Review | Quantity Field on Shop Page for WooCommerce

WordPress plugin Quantity Field on Shop Page for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: quantity-field-on...
  • Plugin version: 1.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6.1-6.2.2
  • WordPress version: 6.3.1
  • First release: Jan 27, 2017
  • Latest release: Jul 5, 2023
  • Number of updates: 26
  • Update frequency: every 90.4 days
  • Top authors: Wooassist (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

4,000+ active /43,610 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

This is a short check of server-side resources used by Quantity Field on Shop Page for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.84 ▼6.12
Dashboard /wp-admin3.32 ▲0.0245.26 ▼1.52
Posts /wp-admin/edit.php3.37 ▲0.0147.20 ▲1.35
Add New Post /wp-admin/post-new.php5.90 ▲0.0182.94 ▼16.06
Media Library /wp-admin/upload.php3.24 ▲0.0135.70 ▲2.52

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Quantity Field on Shop Page for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.26 ▼1.104.58 ▲2.8042.05 ▲0.59
Dashboard /wp-admin2,206 ▲185.97 ▲0.86111.02 ▲4.4437.44 ▼4.53
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0139.44 ▲4.9236.14 ▲0.21
Add New Post /wp-admin/post-new.php1,533 ▼923.15 ▲4.99653.08 ▲5.5547.35 ▼8.42
Media Library /wp-admin/upload.php1,391 ▼04.23 ▲0.01100.00 ▲0.7440.70 ▼2.32

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

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
The smoke test was a success, however most plugin functionality was not tested

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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: field, woocommerce, shop, quantity

quantity-field-on-shop-page-for-woocommerce/wc-quantity-field-shop-page.php 85% from 13 tests

The main file in "Quantity Field on Shop Page for WooCommerce" v. 1.4.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("quantity-field-on-shop-page-for-woocommerce.php" instead of "wc-quantity-field-shop-page.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 172 characters long)

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 plugin86 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1275479
CSS1107

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.59
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity2.57
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods114.29%
▷ Public methods7100.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

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected