68% woocommerce-incremental-product-quantities

Code Review | WooCommerce Advanced Product Quantities

WordPress plugin WooCommerce Advanced Product Quantities scored68%from 54 tests.

About plugin

  • Plugin page: woocommerce-incre...
  • Plugin version: 2.1.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.1
  • WordPress version: 6.3.1
  • First release: Nov 22, 2013
  • Latest release: Jan 23, 2015
  • Number of updates: 37
  • Update frequency: every 11.5 days
  • Top authors: jtwiest (78.38%)WPBackOffice (24.32%)

Code review

54 tests

User reviews

25 reviews

Install metrics

3,000+ active /48,886 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼0.96MB] [CPU: ▼38.03ms] Passed 4 tests

Server-side resources used by WooCommerce Advanced Product Quantities
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.01 ▼0.4415.95 ▼27.51
Dashboard /wp-admin3.05 ▼0.2521.51 ▼25.72
Posts /wp-admin/edit.php3.05 ▼0.3019.97 ▼30.61
Add New Post /wp-admin/post-new.php3.05 ▼2.8319.73 ▼68.29
Media Library /wp-admin/upload.php3.05 ▼0.1719.33 ▼18.18
Add New /wp-admin/post-new.php?post_type=quantity-rule3.0518.14
All Rules /wp-admin/edit.php?post_type=quantity-rule3.0518.89

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

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

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Advanced Product Quantities
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,512 ▼22313.21 ▼1.190.89 ▼1.2015.68 ▼29.03
Dashboard /wp-admin2,250 ▲625.88 ▲1.01100.21 ▼15.7440.81 ▼1.33
Posts /wp-admin/edit.php2,135 ▲462.02 ▲0.0240.21 ▲3.7735.61 ▲3.02
Add New Post /wp-admin/post-new.php1,560 ▲4023.42 ▲0.44639.61 ▼14.6763.48 ▲4.30
Media Library /wp-admin/upload.php1,432 ▲504.26 ▲0.1098.32 ▲4.2243.17 ▲2.89
Advanced Rules /wp-admin/class-ipq-advanced-rules.php260.440.1113.23
Add New /wp-admin/post-new.php?post_type=quantity-rule1,8542.7255.5071.60
All Rules /wp-admin/edit.php?post_type=quantity-rule1,2322.0133.7035.52

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Warning in wp-admin/includes/plugin.php+294
    opendir(wp-content/plugins/woocommerce): failed to open dir: No such file or directory
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=quantity-rule
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-admin/includes/plugin.php+294
    opendir(wp-content/plugins/woocommerce): failed to open dir: No such file or directory
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=quantity-rule
    • > Notice in wp-content/plugins/woocommerce-incremental-product-quantities/includes/class-ipq-post-type.php+339
    Trying to get property 'term_id' of non-object
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=quantity-rule
    • > Notice in wp-content/plugins/woocommerce-incremental-product-quantities/includes/class-ipq-post-type.php+340
    Trying to get property 'name' of non-object

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 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/class-ipq-advanced-rules.php
    • > Network (severe)
    wp-admin/class-ipq-advanced-rules.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (Required configuration for Out of Stock quantities to be displayed.) image required
You can look at the official readme.txt

woocommerce-incremental-product-quantities/incremental-product-quantities.php 85% from 13 tests

The entry point to "WooCommerce Advanced Product Quantities" version 2.1.9 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woocommerce-incremental-product-quantities.php" instead of "incremental-product-quantities.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 273 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected1,921 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP85154621,617
CSS12613121
Markdown1450119
JavaScript2272964

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.70
Average class complexity45.86
▷ Minimum class complexity27.00
▷ Maximum class complexity89.00
Average method complexity6.71
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods55
▷ Static methods11.82%
▷ Public methods55100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
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
7 PNG files occupy 0.47MB with 0.32MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/wpbo-logo.png24.75KB8.99KB▼ 63.66%
screenshot-1.png127.62KB43.10KB▼ 66.22%
screenshot-5.png78.40KB24.44KB▼ 68.83%
screenshot-3.png35.57KB9.83KB▼ 72.35%
screenshot-2.png115.13KB35.68KB▼ 69.00%