98% additional-measurements-units-for-woocommerce

Code Review | additional measurements units for WooCommerce

WordPress plugin additional measurements units for WooCommerce scored 98% from 54 tests.

About plugin

  • Plugin page: additional-measur...
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.0-5.8
  • WordPress version: 5.9.2
  • First release: Aug 24, 2021
  • Latest release: Aug 24, 2021
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: kardi420 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 199 total downloads


Plugin footprint Passed 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: ▼295.79ms] Passed 4 tests

A check of server-side resources used by additional measurements units for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0255.11 ▲3.72
Dashboard /wp-admin3.42 ▲0.0132.20 ▼4.06
Posts /wp-admin/edit.php3.65 ▲0.0136.83 ▼3.12
Add New Post /wp-admin/post-new.php6.89 ▼0.0893.69 ▼1,174.08
Media Library /wp-admin/upload.php3.30 ▲0.0122.76 ▼1.91

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for additional measurements units for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,764 ▲1015.88 ▲0.176.04 ▲0.212.03 ▼0.48
Dashboard /wp-admin2,892 ▲346.16 ▼0.02120.57 ▼15.97155.86 ▼6.57
Posts /wp-admin/edit.php2,691 ▲63.24 ▼0.0163.14 ▼2.66142.84 ▼11.25
Add New Post /wp-admin/post-new.php1,661 ▼5817.01 ▼5.16408.30 ▼23.73156.52 ▼5.50
Media Library /wp-admin/upload.php1,698 ▲35.49 ▼0.01136.02 ▲1.23187.24 ▲2.43

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
This plugin's uninstaller ran successfully

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found


Plugin configuration 79% from 29 tests

readme.txt 88% from 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
Attributes that require attention:
  • Screenshots: Screenshot #1 (measurements units screenshot.png . Note that the screenshot is stored in the /assets directory.) image required
  • Screenshots: Please a description for screenshot #0 in additional-measurements-units-for-woocommerce/assets to your readme.txt
The official readme.txt is a good inspiration

additional-measurements-units-for-woocommerce/index.php 69% from 13 tests

This is the main PHP file of "additional measurements units for WooCommerce" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("4.8" instead of "4.2.0")
  • Domain Path: The domain path folder does not exist ("/languages/")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("additional-measurements-units-for-woocommerce.php" instead of "index.php")

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 detected32 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
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
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions2100.00%
▷ Anonymous functions00.00%
▷ 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
1 PNG file occupies 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/measurements.png56.95KB27.57KB▼ 51.58%