90% unit-price-for-woocommerce

Code Review | Unit Price for WooCommerce

WordPress plugin Unit Price for WooCommerce scored90%from 54 tests.

About plugin

  • Plugin page: unit-price-for-wo...
  • Plugin version: 1.1.8
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.4
  • WordPress version: 6.3.1
  • First release: Nov 26, 2020
  • Latest release: Oct 22, 2023
  • Number of updates: 45
  • Update frequency: every 23.6 days
  • Top authors: condless (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

1,000+ active /11,416 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.28MB] [CPU: ▼2.22ms] Passed 4 tests

A check of server-side resources used by Unit Price for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2840.39 ▲3.33
Dashboard /wp-admin3.59 ▲0.2843.84 ▼0.66
Posts /wp-admin/edit.php3.70 ▲0.3446.47 ▲1.61
Add New Post /wp-admin/post-new.php6.17 ▲0.2878.88 ▼11.13
Media Library /wp-admin/upload.php3.51 ▲0.2836.08 ▲1.31

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Unit Price for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.28 ▼0.081.84 ▲0.2738.99 ▼2.84
Dashboard /wp-admin2,195 ▲215.63 ▲0.0485.18 ▲1.0739.23 ▼3.71
Posts /wp-admin/edit.php2,100 ▼02.03 ▲0.0539.23 ▲3.4835.59 ▼0.21
Add New Post /wp-admin/post-new.php1,526 ▼1023.50 ▲5.19675.36 ▲63.9757.78 ▼17.13
Media Library /wp-admin/upload.php1,394 ▼94.19 ▲0.0594.57 ▼12.7042.76 ▼4.98

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 97% 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
These attributes need your attention: The official readme.txt is a good inspiration

unit-price-for-woocommerce/unit-price-for-woocommerce.php Passed 13 tests

The main PHP file in "Unit Price for WooCommerce" ver. 1.1.8 adds more information about the plugin and also serves as the entry point for this plugin
89 characters long description:
WooCommerce plugin for configuring products which are sold by units but priced by weight.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected1,309 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP1743621,143
PO File25872166

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.65
Average class complexity250.00
▷ Minimum class complexity250.00
▷ Maximum class complexity250.00
Average method complexity4.70
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods68
▷ Static methods00.00%
▷ Public methods68100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.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
No PNG files were detected