84% validar-for-woocommerce

Code Review | Address validation for WooCommerce by Validar

WordPress plugin Address validation for WooCommerce by Validar scored84%from 54 tests.

About plugin

  • Plugin page: validar-for-wooco...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.0-6.0
  • WordPress version: 6.3.1
  • First release: Dec 8, 2021
  • Latest release: Aug 9, 2022
  • Number of updates: 5
  • Update frequency: every 48.8 days
  • Top authors: validario (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /578 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
Installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼4.50ms] Passed 4 tests

An overview of server-side resources used by Address validation for WooCommerce by Validar
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1042.12 ▼3.17
Dashboard /wp-admin3.40 ▲0.1053.27 ▲3.22
Posts /wp-admin/edit.php3.51 ▲0.1650.13 ▼2.43
Add New Post /wp-admin/post-new.php5.98 ▲0.1089.06 ▼15.63
Media Library /wp-admin/upload.php3.32 ▲0.1039.95 ▲5.67

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Address validation for WooCommerce by Validar: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,798 ▲3714.23 ▼0.112.00 ▲0.3943.47 ▲0.89
Dashboard /wp-admin2,201 ▲245.58 ▼0.0288.90 ▲0.1243.03 ▲0.74
Posts /wp-admin/edit.php2,110 ▲102.01 ▼0.0134.38 ▼8.0437.23 ▼0.35
Add New Post /wp-admin/post-new.php1,546 ▲2018.41 ▼4.81625.35 ▼16.1260.68 ▲1.27
Media Library /wp-admin/upload.php1,412 ▲94.24 ▲0.0599.34 ▼7.6143.53 ▼0.15

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'ValidarBasePlatform' not found in wp-content/plugins/validar-for-woocommerce/platforms/class-woocommerce.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/validar-for-woocommerce/validar.php:450

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: shipping address, address validation, shipping, woocommerce

validar-for-woocommerce/validar.php 85% from 13 tests

The main file in "Address validation for WooCommerce by Validar" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("validar-for-woocommerce.php" instead of "validar.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin674 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP413899573
PO File1151759
CSS12024
JavaScript12418

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity13.25
▷ Minimum class complexity2.00
▷ Maximum class complexity20.00
Average method complexity1.91
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods54
▷ Static methods2037.04%
▷ Public methods5194.44%
▷ Protected methods11.85%
▷ Private methods23.70%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/validar.png5.07KB0.63KB▼ 87.63%