83% woocommerce-unit-of-measure

Code Review | WooCommerce Unit Of Measure

WordPress plugin WooCommerce Unit Of Measure scored83%from 54 tests.

About plugin

  • Plugin page: woocommerce-unit-...
  • Plugin version: 3.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0.0-5.9.0
  • WordPress version: 6.3.1
  • First release: Jun 13, 2015
  • Latest release: Feb 15, 2022
  • Number of updates: 30
  • Update frequency: every 81.3 days
  • Top authors: Brad Davis (100%)

Code review

54 tests

User reviews

23 reviews

Install metrics

6,000+ active /42,591 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.00MB] [CPU: ▼4.34ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce Unit Of Measure
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.07 ▼2.06
Dashboard /wp-admin3.31 ▲0.0046.49 ▲0.09
Posts /wp-admin/edit.php3.36 ▲0.0043.45 ▼5.57
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.88 ▼9.81
Media Library /wp-admin/upload.php3.23 ▲0.0034.11 ▲1.24

Server storage [IO: ▲0.12MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for WooCommerce Unit Of Measure
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.37 ▲0.021.65 ▼0.0143.81 ▲0.99
Dashboard /wp-admin2,195 ▲175.61 ▼0.3086.73 ▼13.1937.25 ▼0.70
Posts /wp-admin/edit.php2,097 ▼61.97 ▼0.0135.58 ▼5.0232.92 ▼3.14
Add New Post /wp-admin/post-new.php1,526 ▼422.95 ▼0.22657.84 ▼29.6558.77 ▼15.99
Media Library /wp-admin/upload.php1,400 ▼04.34 ▲0.1397.14 ▼6.3745.27 ▼0.95

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Unterminated comment starting line 2 in wp-content/plugins/woocommerce-unit-of-measure/admin/index.php on line 2
    • > PHP Warning
      Unterminated comment starting line 2 in wp-content/plugins/woocommerce-unit-of-measure/index.php on line 2
    • > PHP Warning
      Unterminated comment starting line 2 in wp-content/plugins/woocommerce-unit-of-measure/includes/index.php on line 2
    • > PHP Warning
      Unterminated comment starting line 2 in wp-content/plugins/woocommerce-unit-of-measure/public/index.php on line 2

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 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
Attributes that need to be fixed: Please take inspiration from this readme.txt

woocommerce-unit-of-measure/woocommerce-unit-of-measure.php 85% from 13 tests

The principal PHP file in "WooCommerce Unit Of Measure" v. 3.0.3 is loaded by WordPress automatically on each request
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Requires at least: Required version must match the one declared in readme.txt ("4.0" instead of "6.0.0")

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 detected131 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP733191110
PO File12221

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity2.00
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.31
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods1292.31%
▷ Protected methods00.00%
▷ Private methods17.69%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
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
2 PNG files occupy 0.11MB with 0.08MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png68.62KB20.64KB▼ 69.92%
assets/screenshot-1.png46.15KB13.53KB▼ 70.68%