93% woo-fiscalita-italiana

Code Review | Italian VAT Kit for WooCommerce

WordPress plugin Italian VAT Kit for WooCommerce scored 93% from 54 tests.

About plugin

  • Plugin page: woo-fiscalita-ita...
  • Plugin version: 1.3.25
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9.2
  • WordPress version: 5.9.2
  • First release: Jun 29, 2016
  • Latest release: Mar 16, 2022
  • Number of updates: 111
  • Update frequency: every 18.8 days
  • Top authors: Mte90 (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

300+ active / 10,812 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

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

A check of server-side resources used by Italian VAT Kit for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0264.10 ▲3.89
Dashboard /wp-admin3.42 ▲0.0136.34 ▼0.13
Posts /wp-admin/edit.php3.65 ▲0.0149.89 ▲5.38
Add New Post /wp-admin/post-new.php6.89 ▼0.0899.73 ▼1,164.70
Media Library /wp-admin/upload.php3.30 ▲0.0132.91 ▲6.39

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 727 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Italian VAT Kit for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲916.22 ▲0.515.97 ▼0.522.35 ▼1.75
Dashboard /wp-admin2,895 ▲346.11 ▼0.07116.86 ▼27.00161.73 ▲1.83
Posts /wp-admin/edit.php2,694 ▲63.23 ▼0.0165.46 ▲3.01139.68 ▼0.84
Add New Post /wp-admin/post-new.php1,717 ▲6020.82 ▼1.30442.69 ▼10.67166.94 ▲0.88
Media Library /wp-admin/upload.php1,701 ▲35.49 ▼0.00142.35 ▼2.10180.74 ▼4.01

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 53× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/woo-fiscalita-italiana/admin/includes/CMB2/includes/types/CMB2_Type_Text.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/woo-fiscalita-italiana/admin/includes/CMB2/includes/CMB2_hookup.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_wfi_settings() in wp-content/plugins/woo-fiscalita-italiana/public/includes/WFI_Order_User_Info.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/woo-fiscalita-italiana/admin/includes/CMB2/includes/types/CMB2_Type_File_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-fiscalita-italiana/public/includes/WFI_ActDeact.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cmb2_dir() in wp-content/plugins/woo-fiscalita-italiana/admin/includes/CMB2/includes/rest-api/CMB2_REST_Controller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/woo-fiscalita-italiana/admin/includes/CMB2/includes/CMB2_Field.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/woo-fiscalita-italiana/admin/includes/CMB2/includes/types/CMB2_Type_Oembed.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Radio' not found in wp-content/plugins/woo-fiscalita-italiana/admin/includes/CMB2/includes/types/CMB2_Type_Multicheck.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/woo-fiscalita-italiana/admin/includes/CMB2/includes/types/CMB2_Type_Textarea.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: pec, fattura, codice fiscale, partita iva, italian

woo-fiscalita-italiana/woo-fiscalita-italiana.php 85% from 13 tests

"Italian VAT Kit for WooCommerce" version 1.3.25's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Requires at least: Required version does not match the one declared in readme.txt ("5.9" instead of "5.0")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected111,448 lines of code in 508 files:
LanguageFilesBlank linesComment linesLines of code
PHP26212,94130,90953,219
PO File13120,29325,60245,299
Sass589421825,365
CSS341,1681,1494,714
JavaScript164117131,867
Markdown32760796
XML2239161
JSON20027

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please tend to the following items
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity41.73
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity3.92
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes169
▷ Abstract classes127.10%
▷ Concrete classes15792.90%
▷ Final classes10.64%
Methods2,414
▷ Static methods37015.33%
▷ Public methods1,78874.07%
▷ Protected methods1235.10%
▷ Private methods50320.84%
Functions209
▷ Named functions209100.00%
▷ Anonymous functions00.00%
Constants178
▷ Global constants13073.03%
▷ Class constants4826.97%
▷ Public constants48100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
18 PNG files occupy 0.06MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/includes/CMB2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
includes/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
admin/includes/CMB2/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
admin/includes/CMB2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
admin/includes/CMB2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%