83% min-max-quantity-for-woocommerce

Code Review | CI WooCommerce Minimum Maximum Quantity & Step Control

WordPress plugin CI WooCommerce Minimum Maximum Quantity & Step Control scored83%from 54 tests.

About plugin

  • Plugin page: min-max-quantity-...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2
  • WordPress version: 6.3.1
  • First release: Oct 18, 2019
  • Latest release: Nov 19, 2019
  • Number of updates: 8
  • Update frequency: every 4.0 days
  • Top authors: im_niloy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,060 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▼6.88ms] Passed 4 tests

An overview of server-side resources used by CI WooCommerce Minimum Maximum Quantity & Step Control
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1538.34 ▼1.88
Dashboard /wp-admin3.55 ▲0.2155.25 ▼7.91
Posts /wp-admin/edit.php3.60 ▲0.2559.13 ▲7.99
Add New Post /wp-admin/post-new.php6.05 ▲0.1686.61 ▼20.68
Media Library /wp-admin/upload.php3.39 ▲0.1639.63 ▲2.95
Min & Max Settings /wp-admin/admin.php?page=wcmmqty_options3.3838.40

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

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

Browser metrics Passed 4 tests

A check of browser resources used by CI WooCommerce Minimum Maximum Quantity & Step Control
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,997 ▲23614.89 ▲0.521.92 ▲0.0642.77 ▼2.62
Dashboard /wp-admin2,381 ▲1786.64 ▲1.76122.51 ▲12.9638.52 ▼4.44
Posts /wp-admin/edit.php2,283 ▲1833.52 ▲1.5356.30 ▲20.3434.97 ▼1.80
Add New Post /wp-admin/post-new.php1,541 ▼421.80 ▼1.62654.99 ▲21.0638.33 ▼32.36
Media Library /wp-admin/upload.php1,420 ▲264.37 ▲0.1692.96 ▼5.5548.19 ▲0.90
Min & Max Settings /wp-admin/admin.php?page=wcmmqty_options1,1773.4349.8272.12

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • wcmmqty_settings
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/min-max-quantity-for-woocommerce/inc/wc-mmqty-public.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/min-max-quantity-for-woocommerce/inc/wc-mmqty-admin.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 86% 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:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

min-max-quantity-for-woocommerce/wc-mmqty.php 77% from 13 tests

The entry point to "CI WooCommerce Minimum Maximum Quantity & Step Control" version 1.0.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Domain Path: The domain path folder was not found ("/languages")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("min-max-quantity-for-woocommerce.php" instead of "wc-mmqty.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin750 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP5332265750

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity23.33
▷ Minimum class complexity1.00
▷ Maximum class complexity68.00
Average method complexity2.24
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods38
▷ Static methods00.00%
▷ Public methods38100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions1090.91%
▷ Anonymous functions19.09%
Constants3
▷ Global constants3100.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