78% vies-validator

Code Review | VIES Validator

WordPress plugin VIES Validator scored78%from 54 tests.

About plugin

  • Plugin page: vies-validator
  • Plugin version: 1.0.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.6
  • WordPress version: 6.3.1
  • First release: Jul 3, 2018
  • Latest release: Jul 4, 2018
  • Number of updates: 13
  • Update frequency: every 0.1 days
  • Top authors: marekma (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,203 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
Install script ran successfully

Server metrics [RAM: ▲0.16MB] [CPU: ▼3.32ms] Passed 4 tests

This is a short check of server-side resources used by VIES Validator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1339.73 ▼5.51
Dashboard /wp-admin3.51 ▲0.2054.66 ▲0.15
Posts /wp-admin/edit.php3.56 ▲0.2055.75 ▲3.57
Add New Post /wp-admin/post-new.php6.04 ▲0.16104.93 ▼10.39
Media Library /wp-admin/upload.php3.37 ▲0.1439.89 ▲2.47
Vies Validator /wp-admin/options-general.php?page=vies-validator3.3339.87

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 50 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for VIES Validator
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,880 ▲11913.43 ▼0.928.47 ▲6.7639.46 ▼1.75
Dashboard /wp-admin2,206 ▲265.64 ▼0.0592.51 ▼2.5142.01 ▼3.22
Posts /wp-admin/edit.php2,108 ▲82.03 ▲0.0839.83 ▼0.7536.04 ▼0.71
Add New Post /wp-admin/post-new.php1,533 ▲723.39 ▲0.31607.70 ▼32.6963.33 ▼0.23
Media Library /wp-admin/upload.php1,402 ▲54.17 ▼0.0496.41 ▼10.4645.36 ▼1.68
Vies Validator /wp-admin/options-general.php?page=vies-validator8441.9922.9428.89

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

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)
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/vies-validator/public/partials/vies-validator-public-display.php
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/vies-validator/vendor/ph-7/eu-vat-validator/tests/Vat/ValidatorTest.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/vies-validator/vendor/ph-7/eu-vat-validator/tests/Vat/Provider/EuropaTest.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/vies-validator/admin/partials/vies-validator-admin-display.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'SoapClient' not found in wp-content/plugins/vies-validator/vendor/ph-7/eu-vat-validator/src/Vat/Provider/Europa.php:29
    • > PHP Fatal error
      Uncaught Error: Interface 'PH7\\Eu\\Vat\\Provider\\Providable' not found in wp-content/plugins/vies-validator/vendor/ph-7/eu-vat-validator/src/Vat/Provider/Europa.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'PH7\\Eu\\Vat\\Validatable' not found in wp-content/plugins/vies-validator/vendor/ph-7/eu-vat-validator/src/Vat/Validator.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: Screenshot #1 (The Vies Validator settings page.) image not found
Please take inspiration from this readme.txt

vies-validator/vies-validator.php Passed 13 tests

The primary PHP file in "VIES Validator" version 1.0.4 is used by WordPress to initiate all plugin functionality
140 characters long description:
Allow to add a VAT Number (Partita IVA) field to Woocommerce checkout and validate it using the VIES API service from Agenzia delle Entrate.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected1,217 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
PHP29304901983
JSON30092
Markdown141054
PO File1172153
XML13016
CSS23813
JavaScript24546

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity5.24
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity1.76
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces6
Interfaces2
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods100
▷ Static methods55.00%
▷ Public methods8787.00%
▷ Protected methods55.00%
▷ Private methods88.00%
Functions6
▷ Named functions466.67%
▷ Anonymous functions233.33%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin