67% n-media-woocommerce-checkout-fields

Code Review | WooCommerce Checkout Field Manager

WordPress plugin WooCommerce Checkout Field Manager scored67%from 54 tests.

About plugin

  • Plugin page: n-media-woocommer...
  • Plugin version: 18.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 28, 2019
  • Latest release: Feb 12, 2023
  • Number of updates: 19
  • Update frequency: every 77.5 days
  • Top authors: nmedia (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /6,651 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.82MB] [CPU: ▼0.44ms] Passed 4 tests

A check of server-side resources used by WooCommerce Checkout Field Manager
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.31 ▲0.8147.42 ▲6.61
Dashboard /wp-admin4.19 ▲0.8561.62 ▼6.74
Posts /wp-admin/edit.php4.24 ▲0.8555.31 ▲1.79
Add New Post /wp-admin/post-new.php6.71 ▲0.79105.60 ▼3.35
Media Library /wp-admin/upload.php4.12 ▲0.8541.49 ▲6.56
Checkout Fields /wp-admin/admin.php?page=cfom4.0442.32

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 158 new files
Database: 1 new table, 8 new options
New tables
wp_cfom
New WordPress options
cfom_db_version
can_compress_scripts
widget_theysaidso_widget
cfom_default_sections_created
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Checkout Field Manager
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.30 ▲0.082.14 ▲0.4542.29 ▼4.94
Dashboard /wp-admin2,192 ▲125.48 ▼0.0585.35 ▼9.9239.19 ▼6.27
Posts /wp-admin/edit.php2,100 ▲32.01 ▼0.0036.74 ▼3.5733.31 ▼7.05
Add New Post /wp-admin/post-new.php1,526 ▼223.36 ▲0.32654.33 ▲28.5958.50 ▲1.95
Media Library /wp-admin/upload.php1,400 ▼04.08 ▼0.18103.43 ▲0.7744.28 ▼2.72
Checkout Fields /wp-admin/admin.php?page=cfom1,6361.9926.4235.83

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie tables detected upon uninstall: 1 table
    • wp_cfom
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • cfom_default_sections_created
    • cfom_db_version
    • widget_theysaidso_widget

Smoke tests 50% 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 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 take a closer look at the following
  • 15× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/n-media-woocommerce-checkout-fields/templates/admin/existing-meta.php
    • > /wp-content/plugins/n-media-woocommerce-checkout-fields/classes/cfom.order.php
    • > /wp-content/plugins/n-media-woocommerce-checkout-fields/classes/cfom.meta.php
    • > /wp-content/plugins/n-media-woocommerce-checkout-fields/inc/hooks.php
    • > /wp-content/plugins/n-media-woocommerce-checkout-fields/inc/functions.php
    • > /wp-content/plugins/n-media-woocommerce-checkout-fields/inc/arrays.php
    • > /wp-content/plugins/n-media-woocommerce-checkout-fields/templates/render-fields.php
    • > /wp-content/plugins/n-media-woocommerce-checkout-fields/classes/admin.class.php
    • > /wp-content/plugins/n-media-woocommerce-checkout-fields/templates/v10/file-modals.php
    • > /wp-content/plugins/n-media-woocommerce-checkout-fields/classes/cfom.class.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/n-media-woocommerce-checkout-fields/classes/deactivate.class.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 86% 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 need to be fixed: You can take inspiration from this readme.txt

n-media-woocommerce-checkout-fields/wc-checkout-fields.php 77% from 13 tests

The entry point to "WooCommerce Checkout Field Manager" version 18.0 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Requires at least: The required version number must match the one declared in readme.txt ("3.5" instead of "3.0.0")
  • Main file name: The principal plugin file should be the same as the plugin slug ("n-media-woocommerce-checkout-fields.php" instead of "wc-checkout-fields.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin38,680 lines of code in 111 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript341,49679913,876
CSS1815928513,026
PHP231,7328465,171
SVG1002,671
Sass1434341,768
LESS1434441,758
Markdown3280232
JSON300151
HTML10627

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity44.50
▷ Minimum class complexity9.00
▷ Maximum class complexity148.00
Average method complexity4.78
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods92
▷ Static methods55.43%
▷ Public methods8996.74%
▷ Protected methods00.00%
▷ Private methods33.26%
Functions83
▷ Named functions83100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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
33 PNG files occupy 0.15MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/jq-ui/smoothness/images/ui-icons_454545_256x240.png6.92KB4.18KB▼ 39.61%
js/images/sort_asc.png0.16KB0.25KB0.00%
js/images/sort_both.png0.20KB0.29KB0.00%
images/minus.png3.32KB0.62KB▼ 81.33%
images/delete_32.png4.37KB1.43KB▼ 67.31%