83% minmax-quantity-for-woocommerce

Code Review | Min and Max Quantity for WooCommerce

WordPress plugin Min and Max Quantity for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: minmax-quantity-f...
  • Plugin version: 1.3.4
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Aug 15, 2016
  • Latest release: Nov 6, 2023
  • Number of updates: 89
  • Update frequency: every 29.7 days
  • Top authors: RazyRx (57.3%)dholovnia (43.82%)

Code review

54 tests

User reviews

193 reviews

Install metrics

20,000+ active /351,495 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.59MB] [CPU: ▲8.79ms] Passed 4 tests

An overview of server-side resources used by Min and Max Quantity for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.05 ▲1.5953.91 ▲11.28
Dashboard /wp-admin4.94 ▲1.6463.43 ▲17.38
Posts /wp-admin/edit.php4.99 ▲1.6453.31 ▲6.85
Add New Post /wp-admin/post-new.php7.46 ▲1.5793.54 ▼0.35
Media Library /wp-admin/upload.php4.80 ▲1.5751.56 ▲17.44

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 96 new files
Database: no new tables, 8 new options
New WordPress options
berocket_admin_notices_rate_stars
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
br_mm_quantity_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Min and Max Quantity for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲4513.91 ▼0.231.81 ▲0.0045.57 ▲0.51
Dashboard /wp-admin2,200 ▲255.56 ▼0.1387.21 ▼12.8873.93 ▲33.54
Posts /wp-admin/edit.php2,120 ▲171.96 ▲0.0235.60 ▼8.7733.89 ▼3.41
Add New Post /wp-admin/post-new.php1,437 ▼9817.51 ▼7.59679.76 ▲54.4155.83 ▼3.84
Media Library /wp-admin/upload.php1,411 ▲114.22 ▲0.0596.92 ▼0.2077.32 ▲33.73

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • berocket_admin_notices_rate_stars
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 25× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/minmax-quantity-for-woocommerce/berocket/libraries/tutorial.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/minmax-quantity-for-woocommerce/berocket/includes/updater.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_plugin_data() in wp-content/plugins/minmax-quantity-for-woocommerce/berocket/templates/settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/minmax-quantity-for-woocommerce/main.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'BeRocket_plugin_variations' not found in wp-content/plugins/minmax-quantity-for-woocommerce/includes/addons/attribute_limitation.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'BeRocket_MM_Quantity' not found in wp-content/plugins/minmax-quantity-for-woocommerce/includes/addons/set_input_limitation.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/minmax-quantity-for-woocommerce/berocket/libraries/tippy.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/minmax-quantity-for-woocommerce/berocket/libraries/popup.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/minmax-quantity-for-woocommerce/berocket/includes/settings_fields.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/minmax-quantity-for-woocommerce/berocket/includes/error_notices.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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
Please fix the following attributes:
  • Screenshots: Add images for these screenshots: #1 (General settings), #2 (Limitation for product), #3 (Limitation for product variation)
  • Tags: Too many tags (34 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

minmax-quantity-for-woocommerce/woocommerce-minmax-quantity.php 92% from 13 tests

The primary PHP file in "Min and Max Quantity for WooCommerce" version 1.3.4 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("minmax-quantity-for-woocommerce.php" instead of "woocommerce-minmax-quantity.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin23,654 lines of code in 66 files:
LanguageFilesBlank linesComment linesLines of code
PHP384791,05310,466
CSS162,516939,517
JavaScript81344163,191
PO File2194216430
XML20050

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity52.90
▷ Minimum class complexity1.00
▷ Maximum class complexity240.00
Average method complexity4.79
▷ Minimum method complexity1.00
▷ Maximum method complexity98.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes31
▷ Abstract classes00.00%
▷ Concrete classes31100.00%
▷ Final classes00.00%
Methods425
▷ Static methods15636.71%
▷ Public methods425100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions32
▷ Named functions32100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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
7 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
berocket/assets/css/mail.png2.59KB1.92KB▼ 26.02%
includes/ico.png1.90KB1.41KB▼ 25.89%
berocket/assets/images/submenu-icon-a.png0.54KB0.48KB▼ 10.20%
berocket/libraries/addons/default.png3.87KB2.63KB▼ 31.94%
berocket/libraries/templates/default.png3.87KB2.63KB▼ 31.94%