83% woocommerce-max-quantity

Code Review | Max Quantity For WC Shops

WordPress plugin Max Quantity For WC Shops scored 83% from 54 tests.

About plugin

  • Plugin page: woocommerce-max-q...
  • Plugin version: 1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.0-6.2
  • WordPress version: 6.3.1
  • First release: Aug 21, 2013
  • Latest release: Apr 21, 2023
  • Number of updates: 63
  • Update frequency: every 56.0 days
  • Top authors: isabel104 (100%)

Code review

54 tests

User reviews

33 reviews

Install metrics

5,000+ active / 83,968 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▲2.19ms] Passed 4 tests

An overview of server-side resources used by Max Quantity For WC Shops
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0441.32 ▲1.45
Dashboard /wp-admin3.34 ▲0.0445.26 ▼2.97
Posts /wp-admin/edit.php3.39 ▲0.0446.25 ▲2.54
Add New Post /wp-admin/post-new.php5.92 ▲0.0498.01 ▲7.72
Media Library /wp-admin/upload.php3.26 ▲0.0344.63 ▲10.98

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Max Quantity For WC Shops: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.25 ▼1.131.58 ▼1.0443.47 ▲3.42
Dashboard /wp-admin2,206 ▲185.85 ▲0.97104.91 ▼22.6440.59 ▼18.20
Posts /wp-admin/edit.php2,089 ▲32.04 ▲0.0635.31 ▼2.3832.84 ▲2.30
Add New Post /wp-admin/post-new.php1,536 ▲2223.27 ▲5.75709.27 ▲24.1550.99 ▼4.49
Media Library /wp-admin/upload.php1,391 ▲34.13 ▼0.03115.17 ▲15.5443.76 ▼3.23

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/woocommerce-max-quantity/max-quantity-for-wc-shops.php:33

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
6 plugin tags: cart maximum, order limit, max, woocommerce, cart max...

woocommerce-max-quantity/max-quantity-for-wc-shops.php 62% from 13 tests

"Max Quantity For WC Shops" version 1.6's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.8" instead of "2.0.0")
  • Domain Path: Please prefix the domain path with a forward slash character ("/languages")
  • 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 should use only dashes and lowercase characters ("languages")
  • Main file name: Name the main plugin file the same as the plugin slug ("woocommerce-max-quantity.php" instead of "max-quantity-for-wc-shops.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
Everything looks great! No dangerous files found in this plugin189 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP155108189

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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 were not PNG files found in your plugin