93% woo-custom-checkout-fields

Code Review | Woocommerce Custom Checkout Fields Editor With Drag & Drop

WordPress plugin Woocommerce Custom Checkout Fields Editor With Drag & Drop scored 93% from 54 tests.

About plugin

  • Plugin page: woo-custom-checko...
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.9
  • WordPress version: 5.9.2
  • First release: Jun 8, 2017
  • Latest release: Feb 14, 2022
  • Number of updates: 11
  • Update frequency: every 155.6 days
  • Top authors: umairsaleem (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

400+ active / 3,565 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

An overview of server-side resources used by Woocommerce Custom Checkout Fields Editor With Drag & Drop
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▼0.0250.93 ▼0.55
Dashboard /wp-admin3.46 ▲0.0534.40 ▲0.76
Posts /wp-admin/edit.php3.69 ▲0.0537.69 ▲0.24
Add New Post /wp-admin/post-new.php6.92 ▼0.0593.08 ▼1,220.71
Media Library /wp-admin/upload.php3.34 ▲0.0428.40 ▲3.36

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 29 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Woocommerce Custom Checkout Fields Editor With Drag & Drop
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,191 ▼56316.12 ▲0.510.36 ▼6.3532.96 ▲30.35
Dashboard /wp-admin2,888 ▲276.16 ▼0.02127.29 ▼7.07166.92 ▲0.23
Posts /wp-admin/edit.php2,694 ▲63.24 ▼0.0163.02 ▼3.27133.78 ▼8.76
Add New Post /wp-admin/post-new.php1,711 ▼621.17 ▼0.69413.91 ▼13.32156.49 ▼7.06
Media Library /wp-admin/upload.php1,695 ▼35.53 ▲0.04148.29 ▼9.24292.38 ▲95.45

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
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woo-custom-checkout-fields/include/update_checkout_fields_class.php:13
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/woo-custom-checkout-fields/include/admin/forms/wcfew_admin_extra_fields_form.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Countries' not found in wp-content/plugins/woo-custom-checkout-fields/include/admin/forms/wcfew_admin_shipping_fields_form.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/woo-custom-checkout-fields/include/admin/forms/wcfew_show_new_form.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woo-custom-checkout-fields/include/manage_extrafield_class.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Countries' not found in wp-content/plugins/woo-custom-checkout-fields/include/admin/forms/wcfew_admin_billing_fields_form.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Countries' not found in wp-content/plugins/woo-custom-checkout-fields/include/admin/forms/wcfew_admin_additional_fields_form.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-custom-checkout-fields/include/admin/wcfew_admin_settings.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woo-custom-checkout-fields/include/add_order_meta_fields_class.php:12

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed: Please take inspiration from this readme.txt

woo-custom-checkout-fields/es-woo-custom-checkout-fields.php 85% from 13 tests

The principal PHP file in "Woocommerce Custom Checkout Fields Editor With Drag & Drop" v. 0.1 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("woo-custom-checkout-fields.php" instead of "es-woo-custom-checkout-fields.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.7.3" instead of "3.3")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin10,479 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
CSS565597,511
PHP11729491,417
JavaScript5152141,322
SVG100229

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity75.00
▷ Minimum class complexity18.00
▷ Maximum class complexity149.00
Average method complexity9.22
▷ Minimum method complexity1.00
▷ Maximum method complexity80.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods36
▷ Static methods00.00%
▷ Public methods36100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
assets/css/chosen-sprite.png0.63KB0.88KB0.00%