84% custom-price-for-woocommerce

Code Review | Custom Price for WooCommerce

WordPress plugin Custom Price for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: custom-price-for-...
  • Plugin version: 1.0.10
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.4
  • WordPress version: 6.3.1
  • First release: Apr 4, 2022
  • Latest release: Nov 7, 2023
  • Number of updates: 23
  • Update frequency: every 25.8 days
  • Top authors: wpdesk (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active /11,801 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼7.71ms] Passed 4 tests

Analyzing server-side resources used by Custom Price for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1040.99 ▼2.11
Dashboard /wp-admin3.39 ▲0.0546.07 ▼14.98
Posts /wp-admin/edit.php3.44 ▲0.0946.44 ▲1.25
Add New Post /wp-admin/post-new.php5.91 ▲0.0381.47 ▼14.98
Media Library /wp-admin/upload.php3.25 ▲0.0338.70 ▲5.12

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 351 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
plugin_activation_custom-price-for-woocommerce/custom-price-for-woocommerce.php
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Custom Price for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3114.22 ▼0.101.66 ▼0.1243.21 ▼0.94
Dashboard /wp-admin2,201 ▲245.60 ▼0.0394.65 ▼9.7140.62 ▼2.92
Posts /wp-admin/edit.php2,106 ▲61.97 ▼0.0038.92 ▼3.7735.45 ▲0.99
Add New Post /wp-admin/post-new.php1,529 ▲323.01 ▼0.25646.92 ▼13.1149.68 ▼5.92
Media Library /wp-admin/upload.php1,403 ▲64.18 ▼0.08101.58 ▼0.9943.04 ▼1.42

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • plugin_activation_custom-price-for-woocommerce/custom-price-for-woocommerce.php
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 163× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CPWFreeVendor\\Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/custom-price-for-woocommerce/vendor_prefixed/monolog/monolog/src/Monolog/Handler/GelfHandler.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'CPWFreeVendor\\Monolog\\Handler\\Handler' not found in wp-content/plugins/custom-price-for-woocommerce/vendor_prefixed/monolog/monolog/src/Monolog/Handler/NullHandler.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'CPWFreeVendor\\Monolog\\Handler\\AbstractHandler' not found in wp-content/plugins/custom-price-for-woocommerce/vendor_prefixed/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Psr\\Log\\AbstractLogger' not found in wp-content/plugins/custom-price-for-woocommerce/vendor/psr/log/Psr/Log/NullLogger.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'CPWFreeVendor\\WPDesk\\PluginBuilder\\Plugin\\Hookable' not found in wp-content/plugins/custom-price-for-woocommerce/vendor_prefixed/wpdesk/custom-price-for-woocommerce-core/src/Order.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'CPWFreeVendor\\Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/custom-price-for-woocommerce/vendor_prefixed/monolog/monolog/src/Monolog/Handler/TestHandler.php:72
    • > PHP Fatal error
      Uncaught Error: Class 'CPWFreeVendor\\Monolog\\Formatter\ormalizerFormatter' not found in wp-content/plugins/custom-price-for-woocommerce/vendor_prefixed/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'CPWFreeVendor\\Monolog\\Handler\\Handler' not found in wp-content/plugins/custom-price-for-woocommerce/vendor_prefixed/monolog/monolog/src/Monolog/Handler/FilterHandler.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'CPWFreeVendor\\Monolog\\Formatter\ormalizerFormatter' not found in wp-content/plugins/custom-price-for-woocommerce/vendor_prefixed/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'CPWFreeVendor\\Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/custom-price-for-woocommerce/vendor_prefixed/monolog/monolog/src/Monolog/Handler/StreamHandler.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: name your price, name your price woocommerce, price on request, custom price, call for price

custom-price-for-woocommerce/custom-price-for-woocommerce.php 92% from 13 tests

The principal PHP file in "Custom Price for WooCommerce" v. 1.0.10 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Requires at least: Required version must match the one declared in readme.txt ("5.0" instead of "5.8")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected18,971 lines of code in 341 files:
LanguageFilesBlank linesComment linesLines of code
PHP30784611,10416,060
CSS7205101,017
JavaScript7296241932
JSON1700916
Markdown25025
XML10021

PHP code Passed 2 tests

A short 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.38
Average class complexity7.92
▷ Minimum class complexity1.00
▷ Maximum class complexity110.00
Average method complexity2.51
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces46
Interfaces38
Traits12
Classes234
▷ Abstract classes125.13%
▷ Concrete classes22294.87%
▷ Final classes73.15%
Methods1,369
▷ Static methods14710.74%
▷ Public methods1,01374.00%
▷ Protected methods19414.17%
▷ Private methods16211.83%
Functions50
▷ Named functions1428.00%
▷ Anonymous functions3672.00%
Constants138
▷ Global constants10.72%
▷ Class constants13799.28%
▷ Public constants11080.29%

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
6 PNG files occupy 0.10MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/logo.png2.36KB2.43KB0.00%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/octolize.com.png88.91KB39.07KB▼ 56.06%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/flexibleshipping.com.png5.63KB3.68KB▼ 34.58%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/wpdesk.net.png2.36KB2.43KB0.00%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/wpdesk.pl.png2.36KB2.43KB0.00%