89% min-and-max-quantity-for-woocommerce

Code Review | Minimum and Maximum Quantity for WooCommerce

WordPress plugin Minimum and Maximum Quantity for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: min-and-max-quant...
  • Plugin version: 1.1.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2.2
  • WordPress version: 6.3.1
  • First release: May 19, 2020
  • Latest release: Jul 24, 2023
  • Number of updates: 34
  • Update frequency: every 34.3 days
  • Top authors: dots (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

3,000+ active /26,649 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.01MB] [CPU: ▼11.22ms] Passed 4 tests

Server-side resources used by Minimum and Maximum Quantity for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0038.43 ▼9.67
Dashboard /wp-admin3.31 ▼0.0443.94 ▼16.73
Posts /wp-admin/edit.php3.36 ▲0.0045.55 ▼5.63
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.99 ▼12.85
Media Library /wp-admin/upload.php3.23 ▲0.0036.93 ▲3.50

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 246 new files
Database: no new tables, 10 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
fs_active_plugins
widget_recent-posts
fs_accounts
widget_recent-comments
can_compress_scripts
mmqw_version
fs_debug_mode

Browser metrics Passed 4 tests

Checking browser requirements for Minimum and Maximum Quantity for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.19 ▼0.181.77 ▼0.9143.50 ▲0.27
Dashboard /wp-admin2,195 ▲175.62 ▼0.0489.84 ▼26.0937.86 ▼4.50
Posts /wp-admin/edit.php2,100 ▼01.98 ▲0.0334.50 ▼8.2334.94 ▲0.25
Add New Post /wp-admin/post-new.php1,526 ▼1123.08 ▲4.67666.46 ▲49.2659.65 ▼7.13
Media Library /wp-admin/upload.php1,400 ▼04.34 ▲0.13110.87 ▲11.8549.91 ▲5.29

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • fs_debug_mode
    • mmqw_version
    • widget_recent-posts
    • fs_accounts
    • widget_recent-comments
    • fs_active_plugins
    • db_upgraded

Smoke tests Passed 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 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 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed: Please take inspiration from this readme.txt

min-and-max-quantity-for-woocommerce/min-and-max-quantity-for-woocommerce.php 92% from 13 tests

The entry point to "Minimum and Maximum Quantity for WooCommerce" version 1.1.1 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 157 characters long)

Code Analysis 97% from 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
There were no executable files found in this plugin39,878 lines of code in 168 files:
LanguageFilesBlank linesComment linesLines of code
PHP1358,52418,47336,970
PO File46289531,566
JavaScript6109167833
CSS192628499
SVG3008
Markdown1002

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity87.52
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.75
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes58
▷ Abstract classes23.45%
▷ Concrete classes5696.55%
▷ Final classes00.00%
Methods1,369
▷ Static methods21415.63%
▷ Public methods96370.34%
▷ Protected methods201.46%
▷ Private methods38628.20%
Functions105
▷ Named functions105100.00%
▷ Anonymous functions00.00%
Constants154
▷ Global constants10467.53%
▷ Class constants5032.47%
▷ Public constants50100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
23 PNG files occupy 0.58MB with 0.26MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/thedotstore-images/popular-plugins/hide-shipping-method-for-woocommerce.png7.13KB2.75KB▼ 61.38%
admin/images/thedotstore-images/popular-plugins/Advance-Product-Sample-Plugin.png11.96KB4.80KB▼ 59.83%
admin/css/images/ui-icons_777777_256x240.png6.83KB4.17KB▼ 38.92%
admin/images/menu-icon.png2.02KB0.66KB▼ 67.52%
admin/images/thedotstore-images/popular-plugins/WooCommerce-Blocker-Prevent-Fake-Orders.png6.83KB6.87KB0.00%