84% woocommerce-extra-price-fields

Code Review | Woocommerce Extra Price Fields - Display extra price info on Woocommerce products

WordPress plugin Woocommerce Extra Price Fields - Display extra price info on Woocommerce products scored84%from 54 tests.

About plugin

  • Plugin page: woocommerce-extra...
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Apr 15, 2013
  • Latest release: Sep 21, 2023
  • Number of updates: 60
  • Update frequency: every 63.5 days
  • Top authors: aman086 (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

3,000+ active /28,908 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.28ms] Passed 4 tests

A check of server-side resources used by Woocommerce Extra Price Fields - Display extra price info on Woocommerce products
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0237.34 ▼7.07
Dashboard /wp-admin3.32 ▲0.0248.30 ▼3.88
Posts /wp-admin/edit.php3.37 ▲0.0249.41 ▼0.88
Add New Post /wp-admin/post-new.php5.90 ▲0.0293.23 ▼1.29
Media Library /wp-admin/upload.php3.24 ▲0.0235.56 ▼0.53

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Woocommerce Extra Price Fields - Display extra price info on Woocommerce products
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.32 ▼1.051.94 ▼0.0442.08 ▼1.60
Dashboard /wp-admin2,215 ▲155.80 ▼0.0599.12 ▼5.1941.51 ▲0.58
Posts /wp-admin/edit.php2,100 ▼02.05 ▼0.0735.35 ▼2.3237.28 ▲3.07
Add New Post /wp-admin/post-new.php1,555 ▲1018.25 ▼5.21596.13 ▼88.6552.49 ▼9.73
Media Library /wp-admin/upload.php1,397 ▼04.22 ▼0.01103.33 ▲2.1445.21 ▲0.04

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • 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 | 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
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-extra-price-fields/woocommerce-extra-price-fields.php:52

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 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
3 plugin tags: woocommerce price extension, woocommerce, ecommerce

woocommerce-extra-price-fields/woocommerce-extra-price-fields.php 92% from 13 tests

This is the main PHP file of "Woocommerce Extra Price Fields - Display extra price info on Woocommerce products" version 2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.0.5" instead of "3.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin59 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1312359

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.26
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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