79% add-fields-to-checkout-page-woocommerce

Code Review | Custom WooCommerce Checkout Fields Editor

WordPress plugin Custom WooCommerce Checkout Fields Editor scored79%from 54 tests.

About plugin

  • Plugin page: add-fields-to-che...
  • Plugin version: 1.2.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Mar 27, 2017
  • Latest release: Sep 4, 2023
  • Number of updates: 261
  • Update frequency: every 9.0 days
  • Top authors: themelocation (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

4,000+ active /61,495 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲4.74MB] [CPU: ▲18.10ms] Passed 4 tests

This is a short check of server-side resources used by Custom WooCommerce Checkout Fields Editor
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /8.62 ▲5.1659.26 ▲17.76
Dashboard /wp-admin8.64 ▲5.3469.80 ▲19.67
Posts /wp-admin/edit.php8.64 ▲5.2974.88 ▲30.58
Add New Post /wp-admin/post-new.php9.06 ▲3.18101.29 ▲4.39
Media Library /wp-admin/upload.php8.64 ▲5.4262.44 ▲31.06
Freemius Debug [v.2.4.5] /wp-admin/admin.php?page=freemius8.6451.91

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 202 new files
Database: no new tables, 10 new options
New WordPress options
theysaidso_admin_options
fs_gdpr
fs_active_plugins
fs_debug_mode
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
fs_accounts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Custom WooCommerce Checkout Fields Editor
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲7513.31 ▼0.994.59 ▲2.8632.45 ▼16.86
Dashboard /wp-admin2,230 ▲424.90 ▲0.02112.96 ▲12.2144.76 ▲5.47
Posts /wp-admin/edit.php2,110 ▲182.00 ▼0.0141.18 ▼13.4139.56 ▲2.68
Add New Post /wp-admin/post-new.php1,522 ▼623.17 ▲5.03667.80 ▲69.3953.37 ▲0.19
Media Library /wp-admin/upload.php1,409 ▲214.23 ▼0.1099.46 ▲2.2544.31 ▲2.49
Freemius Debug [v.2.4.5] /wp-admin/admin.php?page=freemius1,0561.6925.9928.44

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/add-fields-to-checkout-page-woocommerce/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 10 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • fs_debug_mode
    • widget_theysaidso_widget
    • fs_active_plugins
    • db_upgraded
    • fs_gdpr
    • widget_recent-posts
    • fs_accounts
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (Dashboard page for settings), #2 (Dashboard page for add new custom field), #3 (Thats how on front end your fields will look.)
The official readme.txt is a good inspiration

add-fields-to-checkout-page-woocommerce/checkout-form-editor.php 77% from 13 tests

This is the main PHP file of "Custom WooCommerce Checkout Fields Editor" version 1.2.9, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.5" instead of "3.0.0")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("add-fields-to-checkout-page-woocommerce.php" instead of "checkout-form-editor.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected37,076 lines of code in 138 files:
LanguageFilesBlank linesComment linesLines of code
PHP1107,68916,56332,709
CSS16136532,166
JavaScript74211131,607
PO File3132210353
Markdown1680214
JSON10027

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 2,911)
Cyclomatic complexity
Average complexity per logical line of code0.64
Average class complexity92.49
▷ Minimum class complexity1.00
▷ Maximum class complexity2,911.00
Average method complexity4.77
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes47
▷ Abstract classes24.26%
▷ Concrete classes4595.74%
▷ Final classes00.00%
Methods1,172
▷ Static methods17414.85%
▷ Public methods83170.90%
▷ Protected methods151.28%
▷ Private methods32627.82%
Functions126
▷ Named functions126100.00%
▷ Anonymous functions00.00%
Constants125
▷ Global constants10080.00%
▷ Class constants2520.00%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
16 PNG files occupy 0.33MB with 0.18MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/ui-bg_highlight-soft_75_cccccc_1x100.png0.31KB0.18KB▼ 42.95%
assets/css/ui-bg_glass_75_e6e6e6_1x400.png0.29KB0.15KB▼ 49.83%
assets/css/ui-bg_flat_75_ffffff_40x100.png0.24KB0.08KB▼ 64.78%
screenshot-2.png111.70KB44.38KB▼ 60.27%
screenshot-1.png98.37KB38.67KB▼ 60.69%