78% woo-custom-fields-for-variation

Code Review | Woocommerce Custom Fields For Variation

WordPress plugin Woocommerce Custom Fields For Variation scored78%from 54 tests.

About plugin

  • Plugin page: woo-custom-fields...
  • Plugin version: 2.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0
  • WordPress version: 6.3.1
  • First release: Nov 3, 2017
  • Latest release: Aug 1, 2023
  • Number of updates: 59
  • Update frequency: every 35.5 days
  • Top authors: phoeniixx (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

800+ active /34,486 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
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.39ms] Passed 4 tests

Analyzing server-side resources used by Woocommerce Custom Fields For Variation
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0144.75 ▲5.94
Dashboard /wp-admin3.31 ▲0.0145.10 ▼1.32
Posts /wp-admin/edit.php3.36 ▲0.0145.90 ▼4.67
Add New Post /wp-admin/post-new.php5.89 ▲0.0180.14 ▼19.05
Media Library /wp-admin/upload.php3.23 ▲0.0133.49 ▼0.52

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 62 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Woocommerce Custom Fields For Variation
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7113.27 ▼1.321.77 ▲0.0344.08 ▲0.51
Dashboard /wp-admin2,212 ▲244.87 ▼0.00107.04 ▲6.9043.64 ▲3.23
Posts /wp-admin/edit.php2,094 ▲52.04 ▲0.0035.91 ▼5.3636.82 ▲0.15
Add New Post /wp-admin/post-new.php1,542 ▲923.15 ▲0.00565.84 ▼30.5544.45 ▼4.30
Media Library /wp-admin/upload.php1,394 ▲64.22 ▼0.0193.70 ▼3.1940.76 ▼4.14

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/woo-custom-fields-for-variation/public/partials/woo-custom-fields-for-variation-public-display.php
    • > /wp-content/plugins/woo-custom-fields-for-variation/admin/partials/woo-custom-fields-for-variation-admin-display.php
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_woocommerce_currency_symbol() in wp-content/plugins/woo-custom-fields-for-variation/public/front_section/header_script.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/woo-custom-fields-for-variation/admin/admin_section/phoen_general_setting.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_title() in wp-content/plugins/woo-custom-fields-for-variation/public/template/custom_textareas.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_title() in wp-content/plugins/woo-custom-fields-for-variation/public/template/custom_fields.php:7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/woo-custom-fields-for-variation/public/template/custom_textareas.php on line 3
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/woo-custom-fields-for-variation/public/template/custom_fields.php on line 3
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/woo-custom-fields-for-variation/public/template/custom_textareas.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/woo-custom-fields-for-variation/public/template/custom_fields.php on line 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 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Tags: There are too many tags (14 tag instead of maximum 10)
The official readme.txt might help

woo-custom-fields-for-variation/woo-custom-fields-for-variation.php Passed 13 tests

The principal PHP file in "Woocommerce Custom Fields For Variation" v. 2.2.0 is loaded by WordPress automatically on each request
109 characters long description:
This plugin is designed to give your Ecommerce website the space to add customized options for your products.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin23,628 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript124,3832,68619,853
CSS92551172,855
PHP18466568920

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity13.00
▷ Minimum class complexity1.00
▷ Maximum class complexity53.00
Average method complexity2.68
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods50
▷ Static methods24.00%
▷ Public methods3264.00%
▷ Protected methods00.00%
▷ Private methods1836.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
16 PNG files occupy 0.67MB with 0.38MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/custom input fields.png112.47KB33.58KB▼ 70.14%
admin/images/general-settings.png46.20KB14.56KB▼ 68.48%
admin/images/range type.png56.21KB18.29KB▼ 67.47%
admin/images/premium-btn.png5.72KB5.28KB▼ 7.69%
admin/images/option price type.png57.37KB17.35KB▼ 69.76%