90% wc-max-quantity

Code Review | Max Quantity for Woocommerce

WordPress plugin Max Quantity for Woocommerce scored90%from 54 tests.

About plugin

  • Plugin page: wc-max-quantity
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Jul 27, 2023
  • Latest release: Jul 27, 2023
  • Number of updates: 2
  • Update frequency: every 4.0 days
  • Top authors: jakariaistauk (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /223 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

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

A check of server-side resources used by Max Quantity for Woocommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.97 ▼4.11
Dashboard /wp-admin3.33 ▼0.0245.31 ▼20.91
Posts /wp-admin/edit.php3.38 ▲0.0252.86 ▲7.25
Add New Post /wp-admin/post-new.php5.91 ▲0.0286.34 ▼5.40
Media Library /wp-admin/upload.php3.25 ▲0.0233.60 ▼6.98

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Max Quantity for Woocommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲7914.72 ▲0.251.85 ▲0.1641.54 ▼2.31
Dashboard /wp-admin2,198 ▲245.63 ▼0.0383.55 ▼5.4742.12 ▼1.28
Posts /wp-admin/edit.php2,103 ▲32.00 ▲0.0337.94 ▲1.7335.87 ▲0.16
Add New Post /wp-admin/post-new.php1,526 ▼023.86 ▲0.67700.14 ▼12.1351.03 ▼6.16
Media Library /wp-admin/upload.php1,400 ▼04.20 ▲0.0997.60 ▼23.1944.05 ▼4.15

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
Congratulations! This plugin passed the SRP test

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 Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: item limit, cart limit, cart quantity limit, quantity limit, woocommerce

wc-max-quantity/wc-max-quantity.php Passed 13 tests

Analyzing the main PHP file in "Max Quantity for Woocommerce" version 1.0.0
107 characters long description:
This plugin helps you to prevent any product form add to cart when its already added or the number exceeded

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected68 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1171668

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity2.60
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin