84% maximum-products-per-user-for-woocommerce

Code Review | Maximum Products per User for WooCommerce

WordPress plugin Maximum Products per User for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: maximum-products-...
  • Plugin version: 4.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: Apr 19, 2019
  • Latest release: Nov 8, 2023
  • Number of updates: 117
  • Update frequency: every 14.2 days
  • Top authors: algoritmika (54.7%)wpcodefactory (46.15%)

Code review

54 tests

User reviews

38 reviews

Install metrics

1,000+ active /62,593 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
Install script ran successfully

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

A check of server-side resources used by Maximum Products per User for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0138.99 ▼1.32
Dashboard /wp-admin3.32 ▼0.0347.37 ▼16.32
Posts /wp-admin/edit.php3.37 ▲0.0147.13 ▲4.28
Add New Post /wp-admin/post-new.php5.90 ▲0.0183.82 ▼0.88
Media Library /wp-admin/upload.php3.24 ▲0.0133.26 ▲1.60

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

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

Browser metrics Passed 4 tests

Maximum Products per User for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5314.04 ▼0.672.08 ▲0.4144.96 ▲6.33
Dashboard /wp-admin2,195 ▲215.55 ▼0.0282.32 ▼6.7838.47 ▼0.93
Posts /wp-admin/edit.php2,100 ▼01.97 ▼0.0635.53 ▲1.0632.12 ▼2.21
Add New Post /wp-admin/post-new.php1,529 ▼123.27 ▲0.17608.29 ▲16.1449.82 ▼14.79
Media Library /wp-admin/upload.php1,394 ▼94.32 ▲0.0894.98 ▼5.3840.99 ▼1.36

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 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 everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'Expression' not found in wp-content/plugins/maximum-products-per-user-for-woocommerce/vendor/optimistex/math-expression/MathExpression.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: woo commerce, product quantity, woocommerce

maximum-products-per-user-for-woocommerce/maximum-products-per-user-for-woocommerce.php Passed 13 tests

Analyzing the main PHP file in "Maximum Products per User for WooCommerce" version 4.0.4
94 characters long description:
Limit number of items your WooCommerce customers can buy (lifetime or in selected date range).

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
Good job! No executable or dangerous file extensions detected6,726 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
PHP447512,9386,553
JSON400165
XML1008

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity32.17
▷ Minimum class complexity1.00
▷ Maximum class complexity338.00
Average method complexity4.59
▷ Minimum method complexity1.00
▷ Maximum method complexity71.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes35
▷ Abstract classes00.00%
▷ Concrete classes35100.00%
▷ Final classes00.00%
Methods292
▷ Static methods196.51%
▷ Public methods27192.81%
▷ Protected methods165.48%
▷ Private methods51.71%
Functions22
▷ Named functions836.36%
▷ Anonymous functions1463.64%
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