78% checkout-field-visibility-for-woocommerce

Code Review | Checkout Field Visibility for WooCommerce

WordPress plugin Checkout Field Visibility for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: checkout-field-vi...
  • Plugin version: 1.2.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.0.3
  • WordPress version: 6.3.1
  • First release: Apr 24, 2020
  • Latest release: Oct 23, 2022
  • Number of updates: 28
  • Update frequency: every 32.6 days
  • Top authors: zamartz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /1,675 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

Analyzing server-side resources used by Checkout Field Visibility for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.29 ▼8.12
Dashboard /wp-admin3.31 ▼0.0446.19 ▼19.40
Posts /wp-admin/edit.php3.36 ▲0.0048.32 ▼21.83
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.15 ▼19.22
Media Library /wp-admin/upload.php3.23 ▲0.0039.58 ▲2.66
Dashboard /wp-admin/admin.php?page=zamartz-admin3.0020.85
Status /wp-admin/admin.php?page=zamartz-status3.0031.24
Settings /wp-admin/admin.php?page=zamartz-settings3.0022.28

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Checkout Field Visibility for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲6814.34 ▼0.031.96 ▼0.2845.02 ▲2.01
Dashboard /wp-admin2,195 ▲155.62 ▼0.0884.43 ▼15.6841.10 ▼1.05
Posts /wp-admin/edit.php2,100 ▼01.98 ▼0.0233.55 ▼2.8234.73 ▼1.48
Add New Post /wp-admin/post-new.php1,526 ▼123.16 ▲0.14667.65 ▼28.4663.21 ▲5.04
Media Library /wp-admin/upload.php1,400 ▲64.18 ▼0.01144.74 ▲47.9956.28 ▲11.07
Dashboard /wp-admin/admin.php?page=zamartz-admin280.420.096.16
Status /wp-admin/admin.php?page=zamartz-status280.420.077.80
Settings /wp-admin/admin.php?page=zamartz-settings280.420.173.86

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 12× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Trait 'Zamartz_General' not found in wp-content/plugins/checkout-field-visibility-for-woocommerce/admin/class-zamartz-network-admin-addons.php on line 22
    • > PHP Fatal error
      Trait 'Zamartz_General' not found in wp-content/plugins/checkout-field-visibility-for-woocommerce/admin/zamartz/network/class-zamartz-network-settings.php on line 12
    • > PHP Fatal error
      Trait 'Zamartz_HTML_Template' not found in wp-content/plugins/checkout-field-visibility-for-woocommerce/admin/zamartz/helper/trait-zamartz-rss-methods.php on line 12
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/checkout-field-visibility-for-woocommerce/admin/partials/wp-checkout-vis-fields-woo-admin-html-form.php:22
    • > PHP Fatal error
      Trait 'Zamartz_General' not found in wp-content/plugins/checkout-field-visibility-for-woocommerce/admin/zamartz/class-zamartz-settings.php on line 12
    • > PHP Fatal error
      Trait 'Zamartz_HTML_Template' not found in wp-content/plugins/checkout-field-visibility-for-woocommerce/admin/zamartz/class-zamartz-status.php on line 12
    • > PHP Fatal error
      Trait 'Zamartz_General' not found in wp-content/plugins/checkout-field-visibility-for-woocommerce/admin/zamartz/network/class-zamartz-network-dashboard.php on line 12
    • > PHP Fatal error
      Trait 'Zamartz_General' not found in wp-content/plugins/checkout-field-visibility-for-woocommerce/admin/class-zamartz-admin-addons.php on line 22
    • > PHP Fatal error
      Trait 'Zamartz_General' not found in wp-content/plugins/checkout-field-visibility-for-woocommerce/admin/zamartz/class-zamartz-dashboard.php on line 12
    • > PHP Fatal error
      Trait 'Zamartz_General' not found in wp-content/plugins/checkout-field-visibility-for-woocommerce/admin/class-wp-checkout-vis-fields-woo-settings.php on line 22

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=zamartz-admin
    • > Network (severe)
    wp-admin/admin.php?page=zamartz-admin - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=zamartz-status
    • > Network (severe)
    wp-admin/admin.php?page=zamartz-status - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=zamartz-settings
    • > Network (severe)
    wp-admin/admin.php?page=zamartz-settings - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: woocommerce checkout fields, shipping, ecommerce, billing, checkout field customizer...

checkout-field-visibility-for-woocommerce/wp-checkout-vis-fields-woo.php 85% from 13 tests

"Checkout Field Visibility for WooCommerce" version 1.2.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("checkout-field-visibility-for-woocommerce.php" instead of "wp-checkout-vis-fields-woo.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin6,978 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
PHP358412,2495,227
CSS4230521,030
JavaScript47248720
SVG1001

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
The following items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 192)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity26.79
▷ Minimum class complexity1.00
▷ Maximum class complexity311.00
Average method complexity4.93
▷ Minimum method complexity1.00
▷ Maximum method complexity192.00
Code structure
Namespaces0
Interfaces0
Traits4
Classes25
▷ Abstract classes00.00%
▷ Concrete classes25100.00%
▷ Final classes00.00%
Methods189
▷ Static methods21.06%
▷ Public methods18095.24%
▷ Protected methods00.00%
▷ Private methods94.76%
Functions9
▷ Named functions666.67%
▷ Anonymous functions333.33%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/zamartz/assets/images/zamartz-icon-menu.png0.43KB0.50KB0.00%
admin/images/dashboard-default.png7.03KB3.46KB▼ 50.76%