84% product-price-by-formula-for-woocommerce

Code Review | Product Price by Formula for WooCommerce

WordPress plugin Product Price by Formula for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: product-price-by-...
  • Plugin version: 2.4.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.3.1
  • WordPress version: 6.3.1
  • First release: Sep 13, 2017
  • Latest release: Oct 4, 2023
  • Number of updates: 45
  • Update frequency: every 49.2 days
  • Top authors: algoritmika (60%)prowcplugins (42.22%)

Code review

54 tests

User reviews

13 reviews

Install metrics

200+ active /10,624 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
Installer ran successfully

Server metrics [RAM: ▲0.40MB] [CPU: ▲0.45ms] Passed 4 tests

Analyzing server-side resources used by Product Price by Formula for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.78 ▲0.3244.33 ▼2.30
Dashboard /wp-admin3.76 ▲0.4653.32 ▲3.76
Posts /wp-admin/edit.php3.81 ▲0.4654.76 ▲5.15
Add New Post /wp-admin/post-new.php6.30 ▲0.4299.82 ▼4.80
Media Library /wp-admin/upload.php3.62 ▲0.4041.56 ▲10.54

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 21 new files
Database: no new tables, 10 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
prowc_ppbf_plugin_notice_remindlater
prowc_ppbf_version
prowc_ppbf_plugin_reviewtrack
widget_theysaidso_widget
prowc_ppbf_activation_time
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Product Price by Formula for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲7313.28 ▼1.101.71 ▼0.2943.19 ▼3.18
Dashboard /wp-admin2,222 ▲315.91 ▲1.02101.71 ▼2.5839.51 ▼5.45
Posts /wp-admin/edit.php2,110 ▲182.14 ▲0.1444.65 ▲2.0638.90 ▲4.28
Add New Post /wp-admin/post-new.php1,533 ▼117.69 ▼5.33622.85 ▲15.2255.06 ▲2.37
Media Library /wp-admin/upload.php1,410 ▲254.50 ▲0.2398.11 ▼3.5545.02 ▼0.29

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 10 options in the database
    • prowc_ppbf_plugin_reviewtrack
    • prowc_ppbf_plugin_notice_remindlater
    • prowc_ppbf_version
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • prowc_ppbf_activation_time

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'ProWC_PPBF_TerminalExpression' not found in wp-content/plugins/product-price-by-formula-for-woocommerce/includes/lib/PHPMathParser/Expressions.php:3

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, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: woo commerce, woocommerce, product, formula, price

product-price-by-formula-for-woocommerce/product-price-by-formula-for-woocommerce.php Passed 13 tests

"Product Price by Formula for WooCommerce" version 2.4.8's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
64 characters long description:
Set formula for automatic WooCommerce product price calculation.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin1,966 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP142617841,823
CSS141109
JavaScript26234

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity15.35
▷ Minimum class complexity1.00
▷ Maximum class complexity72.00
Average method complexity3.17
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes20
▷ Abstract classes210.00%
▷ Concrete classes1890.00%
▷ Final classes15.56%
Methods133
▷ Static methods21.50%
▷ Public methods12896.24%
▷ Protected methods53.76%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/img/admin-rating-ppbf.png0.82KB0.56KB▼ 31.62%
includes/img/prowc_logo.png38.75KB12.41KB▼ 67.98%