84% show-state-field-for-woocommerce

Code Review | Show State Field for WooCommerce

WordPress plugin Show State Field for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: show-state-field-...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.2
  • WordPress version: 6.3.1
  • First release: Feb 5, 2022
  • Latest release: Mar 18, 2023
  • Number of updates: 8
  • Update frequency: every 50.9 days
  • Top authors: coder426 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /919 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

An overview of server-side resources used by Show State Field for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.79 ▼4.30
Dashboard /wp-admin3.31 ▲0.0154.29 ▲0.03
Posts /wp-admin/edit.php3.37 ▲0.0149.89 ▼4.00
Add New Post /wp-admin/post-new.php5.89 ▲0.0190.09 ▼16.40
Media Library /wp-admin/upload.php3.24 ▲0.0135.26 ▼0.84

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 31 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Show State Field for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.17 ▼0.421.81 ▲0.0244.26 ▼1.93
Dashboard /wp-admin2,192 ▲155.54 ▲0.0382.12 ▼9.0640.11 ▼3.67
Posts /wp-admin/edit.php2,100 ▲31.99 ▼0.0235.15 ▼3.2735.92 ▼1.56
Add New Post /wp-admin/post-new.php1,535 ▲718.10 ▼5.10605.83 ▼71.9384.24 ▲24.15
Media Library /wp-admin/upload.php1,400 ▼34.21 ▲0.0695.76 ▼3.0642.38 ▼5.47

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/show-state-field-for-woocommerce/woo-checkout-hidden-state-field.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
2 plugin tags: show state field, hidden state field for woocommerce

show-state-field-for-woocommerce/woo-checkout-hidden-state-field.php 85% from 13 tests

"Show State Field for WooCommerce" version 1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
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
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("show-state-field-for-woocommerce.php" instead of "woo-checkout-hidden-state-field.php")

Code Analysis Passed 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 detected9,817 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
SVG3009,552
PHP22934237
JavaScript451621
CSS30187

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.71
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin