84% price-per-unit-for-wc-product

Code Review | Price as per Unit for WooCommerce

WordPress plugin Price as per Unit for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: price-per-unit-fo...
  • Plugin version: 1.0.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Apr 7, 2021
  • Latest release: Apr 25, 2023
  • Number of updates: 9
  • Update frequency: every 83.2 days
  • Top authors: sunarc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /819 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.46ms] Passed 4 tests

This is a short check of server-side resources used by Price as per Unit for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0034.47 ▼5.19
Dashboard /wp-admin3.31 ▲0.0043.72 ▼4.99
Posts /wp-admin/edit.php3.36 ▲0.0045.33 ▼0.85
Add New Post /wp-admin/post-new.php5.89 ▲0.0093.94 ▼2.79
Media Library /wp-admin/upload.php3.23 ▲0.0032.95 ▲1.30

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Price as per Unit for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.22 ▼1.084.42 ▲2.8043.41 ▼11.19
Dashboard /wp-admin2,206 ▲154.86 ▼1.04106.61 ▼2.7642.76 ▼1.17
Posts /wp-admin/edit.php2,092 ▲31.99 ▼0.0538.47 ▼5.6633.92 ▼1.25
Add New Post /wp-admin/post-new.php1,514 ▼2017.98 ▼5.22598.38 ▼72.8461.41 ▲3.66
Media Library /wp-admin/upload.php1,391 ▲64.16 ▼0.0695.15 ▼8.2241.78 ▼1.66

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/price-per-unit-for-wc-product/INC/front.php:140
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/price-per-unit-for-wc-product/INC/admin-settings.php:10

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Donate link: Please fix this invalid URI: ""
The official readme.txt might help

price-per-unit-for-wc-product/price-per-unit-for-wc-product.php 92% from 13 tests

"Price as per Unit for WooCommerce" version 1.0.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 175 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
Everything looks great! No dangerous files found in this plugin305 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP36931305

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.46
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
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin