72% woo-piva-codice-fiscale-e-fattura-pdf-per-italia

Code Review | WooCommerce P.IVA e Codice Fiscale per Italia

WordPress plugin WooCommerce P.IVA e Codice Fiscale per Italia scored 72% from 54 tests.

About plugin

  • Plugin page: woo-piva-codice-f...
  • Plugin version: 2.1.11
  • PHP version: 7.4.16
  • WordPress compatibility: 4-5.6
  • WordPress version: 6.3.1
  • First release: May 5, 2016
  • Latest release: Feb 1, 2021
  • Number of updates: 105
  • Update frequency: every 16.5 days
  • Top authors: dot4all (100%)

Code review

54 tests

User reviews

22 reviews

Install metrics

3,000+ active / 57,539 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.35MB] [CPU: ▼4.90ms] Passed 4 tests

A check of server-side resources used by WooCommerce P.IVA e Codice Fiscale per Italia
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.3340.61 ▼12.37
Dashboard /wp-admin3.71 ▲0.4048.55 ▼4.94
Posts /wp-admin/edit.php3.76 ▲0.4056.29 ▲7.49
Add New Post /wp-admin/post-new.php6.22 ▲0.3393.23 ▼6.14
Media Library /wp-admin/upload.php3.57 ▲0.3336.67 ▲3.87
Sessions /wp-admin/tools.php?page=pantheon-sessions3.5537.53

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 25 new files
Database: 1 new table, 7 new options
New tables
wp_wcpicfi_sessions
New WordPress options
theysaidso_admin_options
can_compress_scripts
wcpicfi_session_version
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce P.IVA e Codice Fiscale per Italia
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲6614.47 ▼0.271.72 ▲0.0438.63 ▼6.19
Dashboard /wp-admin2,215 ▲335.84 ▼0.05104.83 ▲1.8940.92 ▼4.98
Posts /wp-admin/edit.php2,103 ▲112.17 ▲0.1140.78 ▲5.2835.99 ▲2.62
Add New Post /wp-admin/post-new.php1,546 ▲3223.44 ▲5.89651.06 ▼67.8254.76 ▼2.74
Media Library /wp-admin/upload.php1,397 ▲124.21 ▼0.05101.96 ▲1.5545.42 ▲2.16
Sessions /wp-admin/tools.php?page=pantheon-sessions8842.0425.3125.36

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie tables were found after uninstall: 1 table
    • wp_wcpicfi_sessions
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • wcpicfi_session_version
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, 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
Please fix the following items
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/woo-piva-codice-fiscale-e-fattura-pdf-per-italia/templates/pdf/Simple/html-document-wrapper.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/woo-piva-codice-fiscale-e-fattura-pdf-per-italia/templates/pdf/Simple/invoice.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/woo-piva-codice-fiscale-e-fattura-pdf-per-italia/includes/inc/class-list-table.php:13
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_header_logo_id() on null in wp-content/plugins/woo-piva-codice-fiscale-e-fattura-pdf-per-italia/templates/pdf/Simple/receipt.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-piva-codice-fiscale-e-fattura-pdf-per-italia/includes/class-session.php:260
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/woo-piva-codice-fiscale-e-fattura-pdf-per-italia/includes/inc/class-cli-command.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 79% from 29 tests

readme.txt 81% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Requires php: Version not formatted correctly
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === woo-piva-codice-fiscale-e-fattura-pdf-per-italia === )
  • Tags: You are using too many tags: 13 tag instead of maximum 10
The official readme.txt is a good inspiration

woo-piva-codice-fiscale-e-fattura-pdf-per-italia/dot4all-wc-cf-piva.php 77% from 13 tests

Analyzing the main PHP file in "WooCommerce P.IVA e Codice Fiscale per Italia" version 2.1.11
You should first fix the following items:
  • Requires at least: Required version number should use periods and dots only (ex. "7.0" instead of "4")
  • 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 ("woo-piva-codice-fiscale-e-fattura-pdf-per-italia.php" instead of "dot4all-wc-cf-piva.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected2,531 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP144297322,130
CSS34612236
PO File190257165

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity27.80
▷ Minimum class complexity5.00
▷ Maximum class complexity76.00
Average method complexity3.39
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods112
▷ Static methods1210.71%
▷ Public methods10089.29%
▷ Protected methods00.00%
▷ Private methods1210.71%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.07MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/copertina-woocommerce-piva-codice-fiscale-per-italia-pro-dot4all.png67.14KB30.00KB▼ 55.31%
images/receipt.png0.47KB0.34KB▼ 28.25%
images/professionist_invoice.png0.44KB0.34KB▼ 21.97%
images/private_invoice.png0.48KB0.35KB▼ 27.73%