62% quantities-and-units-for-woocommerce

Code Review | Quantities and Units for WooCommerce

WordPress plugin Quantities and Units for WooCommerce scored 62% from 54 tests.

About plugin

  • Plugin page: quantities-and-un...
  • Plugin version: 1.0.13
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.3
  • WordPress version: 6.3.1
  • First release: Oct 30, 2015
  • Latest release: Nov 29, 2016
  • Number of updates: 29
  • Update frequency: every 13.7 days
  • Top authors: greatwitenorth (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

2,000+ active / 21,336 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▼1.17MB] [CPU: ▼38.94ms] Passed 4 tests

This is a short check of server-side resources used by Quantities and Units for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.80 ▼0.6615.13 ▼28.15
Dashboard /wp-admin2.83 ▼0.4719.83 ▼29.23
Posts /wp-admin/edit.php2.84 ▼0.5216.78 ▼29.87
Add New Post /wp-admin/post-new.php2.84 ▼3.0516.72 ▼68.49
Media Library /wp-admin/upload.php2.84 ▼0.3918.51 ▼15.65
Add New /wp-admin/post-new.php?post_type=quantity-rule2.8415.98
All Rules /wp-admin/edit.php?post_type=quantity-rule2.8416.28

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Quantities and Units for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,500 ▼25713.15 ▼1.220.50 ▼1.5518.10 ▼31.26
Dashboard /wp-admin2,244 ▲564.87 ▼0.0299.40 ▼13.2040.11 ▼1.84
Posts /wp-admin/edit.php2,124 ▲352.05 ▲0.0641.08 ▲5.1432.61 ▼3.62
Add New Post /wp-admin/post-new.php1,544 ▲2423.28 ▲0.15591.99 ▼123.1557.37 ▼5.42
Media Library /wp-admin/upload.php1,423 ▲384.21 ▲0.0799.66 ▼3.5343.52 ▼4.54
Add New /wp-admin/post-new.php?post_type=quantity-rule1,8052.6347.9070.31
All Rules /wp-admin/edit.php?post_type=quantity-rule1,2181.9633.1231.88
Advanced Rules /wp-admin/class-wcqu-advanced-rules.php260.440.1013.98

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin cannot be uninstalled
    • > Warning in wp-admin/includes/plugin.php+294
    opendir(wp-content/plugins/woocommerce): failed to open dir: No such file or directory
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 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/quantities-and-units-for-woocommerce/includes/class-wcqu-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/quantities-and-units-for-woocommerce/includes/class-wcqu-post-type.php+340
    Trying to get property 'name' of non-object

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/quantities-and-units-for-woocommerce/includes/wcqu-functions.php:421

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
    • > GET request to /wp-admin/post-new.php?post_type=quantity-rule
    • > Network (severe)
    wp-content/plugins/quantities-and-units-for-woocommerce/assets/img/rapid-order-logo.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/class-wcqu-advanced-rules.php
    • > Network (severe)
    wp-admin/class-wcqu-advanced-rules.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Screenshots: Add an image for screenshot #1 (Required configuration for Out of Stock quantities to be displayed.)
You can look at the official readme.txt

quantities-and-units-for-woocommerce/quantites-and-units.php 92% from 13 tests

The main PHP script in "Quantities and Units for WooCommerce" version 1.0.13 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("quantities-and-units-for-woocommerce.php" instead of "quantites-and-units.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected1,999 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP105625391,792
CSS22613122
JavaScript2302985

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.68
Average class complexity39.22
▷ Minimum class complexity7.00
▷ Maximum class complexity93.00
Average method complexity5.99
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods69
▷ Static methods11.45%
▷ Public methods69100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions888.89%
▷ Anonymous functions111.11%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 0.47MB with 0.33MB 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-2.png115.13KB35.68KB▼ 69.00%
screenshot-3.png35.57KB9.83KB▼ 72.35%
screenshot-5.png78.40KB24.44KB▼ 68.83%
screenshot-4.png50.66KB11.43KB▼ 77.43%