84% checkout-validation-for-woocommerce

Code Review | Custom Validation for WooCommerce

WordPress plugin Custom Validation for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: checkout-validati...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 10, 2021
  • Latest release: Apr 29, 2023
  • Number of updates: 7
  • Update frequency: every 103.4 days
  • Top authors: shawnphenry (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /408 total downloads

Benchmarks

Plugin footprint 83% from 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: ▼0.29ms] Passed 4 tests

An overview of server-side resources used by Custom Validation for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0036.82 ▼3.52
Dashboard /wp-admin3.31 ▲0.0151.83 ▲3.72
Posts /wp-admin/edit.php3.36 ▲0.0144.47 ▲0.61
Add New Post /wp-admin/post-new.php5.89 ▲0.0193.01 ▼1.51
Media Library /wp-admin/upload.php3.23 ▲0.0133.72 ▲3.25
Checkout Validation /wp-admin/admin.php?page=cvfwoo3.2030.51

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 8 new options
New WordPress options
cvfwoo_filters
widget_theysaidso_widget
can_compress_scripts
cvfwoo_notice
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Custom Validation for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.28 ▼0.071.92 ▲0.2843.88 ▲1.29
Dashboard /wp-admin2,195 ▲175.55 ▼0.3588.30 ▼9.5238.14 ▼1.13
Posts /wp-admin/edit.php2,103 ▼01.97 ▼0.0635.88 ▲1.2332.93 ▼1.32
Add New Post /wp-admin/post-new.php1,534 ▲818.69 ▼4.66601.88 ▼97.9466.63 ▲4.89
Media Library /wp-admin/upload.php1,400 ▼34.15 ▼0.0295.10 ▼5.6543.16 ▼2.11
Checkout Validation /wp-admin/admin.php?page=cvfwoo8471.9922.4628.27

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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
Almost there! Just fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/checkout-validation-for-woocommerce/checkout_validate.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/checkout-validation-for-woocommerce/checkout_validate.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: spam, woocommerce, validation, checkout

checkout-validation-for-woocommerce/index.php 92% from 13 tests

This is the main PHP file of "Custom Validation for WooCommerce" version 1.0.1, 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:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("checkout-validation-for-woocommerce.php" instead of "index.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
There were no executable files found in this plugin144 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP33925144

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
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%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin