88% advanced-product-fields-for-woocommerce

Code Review | Advanced Product Fields (Product Addons) for WooCommerce

WordPress plugin Advanced Product Fields (Product Addons) for WooCommerce scored 88% from 54 tests.

About plugin

  • Plugin page: advanced-product-...
  • Plugin version: 1.4.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.0-5.9.2
  • WordPress version: 5.9.2
  • First release: Aug 7, 2019
  • Latest release: Mar 14, 2022
  • Number of updates: 57
  • Update frequency: every 16.7 days
  • Top authors: maartenbelmans (100%)

Code review

54 tests

User reviews

171 reviews

Install metrics

20,000+ active / 228,594 total downloads

Benchmarks

Plugin footprint Passed 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.15MB] [CPU: ▼295.31ms] Passed 4 tests

This is a short check of server-side resources used by Advanced Product Fields (Product Addons) for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1254.09 ▼6.39
Dashboard /wp-admin3.61 ▲0.1933.69 ▼0.45
Posts /wp-admin/edit.php3.83 ▲0.1941.71 ▲3.47
Add New Post /wp-admin/post-new.php7.07 ▲0.09109.76 ▼1,172.32
Media Library /wp-admin/upload.php3.49 ▲0.1925.07 ▼2.09
Product Fields /wp-admin/admin.php?page=wapf-field-groups3.7232.10

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 78 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Advanced Product Fields (Product Addons) for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲4115.29 ▼0.385.86 ▼0.002.21 ▼0.03
Dashboard /wp-admin2,889 ▲286.17 ▼0.02118.06 ▼23.04171.24 ▲4.80
Posts /wp-admin/edit.php2,688 ▼03.35 ▲0.1265.62 ▲0.75146.95 ▼2.00
Add New Post /wp-admin/post-new.php1,661 ▼015.84 ▼0.58405.44 ▼27.60213.07 ▲23.39
Media Library /wp-admin/upload.php1,698 ▲65.55 ▲0.10155.83 ▼3.66218.26 ▼7.42
Product Fields /wp-admin/admin.php?page=wapf-field-groups1,4875.1889.0799.68

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 8× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/advanced-product-fields-for-woocommerce/views/frontend/fields/text.php
    • > /wp-content/plugins/advanced-product-fields-for-woocommerce/views/frontend/fields/textarea.php
    • > /wp-content/plugins/advanced-product-fields-for-woocommerce/views/admin/field.php
    • > /wp-content/plugins/advanced-product-fields-for-woocommerce/views/frontend/fields/url.php
    • > /wp-content/plugins/advanced-product-fields-for-woocommerce/views/frontend/field-group.php
    • > /wp-content/plugins/advanced-product-fields-for-woocommerce/views/frontend/fields/email.php
    • > /wp-content/plugins/advanced-product-fields-for-woocommerce/views/frontend/fields/select.php
    • > /wp-content/plugins/advanced-product-fields-for-woocommerce/views/frontend/fields/number.php
  • 93× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/advanced-product-fields-for-woocommerce/views/admin/settings/options.php:5
    • > PHP Notice
      Undefined variable: model in wp-content/plugins/advanced-product-fields-for-woocommerce/views/frontend/fields/true-false.php on line 9
    • > PHP Notice
      Undefined variable: model in wp-content/plugins/advanced-product-fields-for-woocommerce/views/frontend/fields/select.php on line 9
    • > PHP Notice
      Undefined variable: model in wp-content/plugins/advanced-product-fields-for-woocommerce/views/admin/settings/conditionals.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/advanced-product-fields-for-woocommerce/views/admin/settings/true-false.php:8
    • > PHP Notice
      Undefined variable: product_id in wp-content/plugins/advanced-product-fields-for-woocommerce/views/frontend/product-totals.php on line 6
    • > PHP Notice
      Undefined variable: model in wp-content/plugins/advanced-product-fields-for-woocommerce/views/frontend/fields/email.php on line 1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/advanced-product-fields-for-woocommerce/views/frontend/fields/true-false.php on line 9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/advanced-product-fields-for-woocommerce/views/frontend/fields/url.php on line 6
    • > PHP Notice
      Undefined variable: model in wp-content/plugins/advanced-product-fields-for-woocommerce/views/admin/settings/types.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: product fields, woocommerce product addons, woocommerce, woocommerce product options, product addons

advanced-product-fields-for-woocommerce/advanced-product-fields-for-woocommerce.php 92% from 13 tests

This is the main PHP file of "Advanced Product Fields (Product Addons) for WooCommerce" version 1.4.6, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.5" instead of "3.4.0")

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
There were no executable files found in this plugin3,701 lines of code in 57 files:
LanguageFilesBlank linesComment linesLines of code
PHP531,071943,679
JavaScript20020
CSS2002

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity20.29
▷ Minimum class complexity1.00
▷ Maximum class complexity69.00
Average method complexity2.99
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes21
▷ Abstract classes00.00%
▷ Concrete classes21100.00%
▷ Final classes00.00%
Methods158
▷ Static methods6843.04%
▷ Public methods14289.87%
▷ Protected methods00.00%
▷ Private methods1610.13%
Functions32
▷ Named functions412.50%
▷ Anonymous functions2887.50%
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
No PNG files were detected