84% woocommerce-custom-price

Code Review | WooCommerce Custom Price

WordPress plugin WooCommerce Custom Price scored84%from 54 tests.

About plugin

  • Plugin page: woocommerce-custo...
  • Plugin version: 0.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.9
  • WordPress version: 6.3.1
  • First release: Jun 24, 2013
  • Latest release: Sep 16, 2014
  • Number of updates: 11
  • Update frequency: every 40.7 days
  • Top authors: azhkuro (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

500+ active /11,021 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

Server-side resources used by WooCommerce Custom Price
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0042.61 ▲1.10
Dashboard /wp-admin3.31 ▲0.0047.96 ▼6.88
Posts /wp-admin/edit.php3.36 ▲0.0045.88 ▼4.75
Add New Post /wp-admin/post-new.php5.89 ▲0.0098.61 ▼10.71
Media Library /wp-admin/upload.php3.23 ▲0.0036.67 ▲0.02

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Custom Price
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.21 ▼1.191.71 ▼0.2342.89 ▼1.81
Dashboard /wp-admin2,206 ▲184.86 ▼0.96108.44 ▼1.5842.41 ▼1.35
Posts /wp-admin/edit.php2,089 ▼02.02 ▲0.0139.34 ▲2.9134.35 ▼2.88
Add New Post /wp-admin/post-new.php1,514 ▼1917.58 ▼5.83677.40 ▲4.6960.04 ▲15.98
Media Library /wp-admin/upload.php1,391 ▲34.22 ▲0.09108.40 ▼8.5449.14 ▼1.70

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

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
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/woocommerce-custom-price/wc-custom-price.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: custom, woocommerce, products, price

woocommerce-custom-price/wc-custom-price.php 85% from 13 tests

The primary PHP file in "WooCommerce Custom Price" version 0.2.2 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woocommerce-custom-price.php" instead of "wc-custom-price.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Success! There were no dangerous files found in this plugin82 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1283782

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.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
PNG images were not found in this plugin