83% woocommerce-pdf-invoices-italian-add-on

Code Review | WooCommerce PDF Invoices Italian Add-on

WordPress plugin WooCommerce PDF Invoices Italian Add-on scored83%from 54 tests.

About plugin

  • Plugin page: woocommerce-pdf-i...
  • Plugin version: 0.7.4
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.4.1
  • WordPress version: 6.3.1
  • First release: Jan 3, 2015
  • Latest release: Nov 16, 2023
  • Number of updates: 172
  • Update frequency: every 18.8 days
  • Top authors: labdav (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

6,000+ active /116,002 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

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

A check of server-side resources used by WooCommerce PDF Invoices Italian Add-on
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.45 ▼7.17
Dashboard /wp-admin3.32 ▲0.0144.59 ▼3.27
Posts /wp-admin/edit.php3.43 ▲0.0748.04 ▼0.70
Add New Post /wp-admin/post-new.php5.90 ▲0.0193.07 ▼4.06
Media Library /wp-admin/upload.php3.24 ▲0.0135.49 ▲1.77

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 30 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce PDF Invoices Italian Add-on
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲3514.09 ▼0.641.72 ▼0.0739.77 ▼4.74
Dashboard /wp-admin2,205 ▲285.61 ▼0.0494.70 ▲0.6443.03 ▼3.14
Posts /wp-admin/edit.php2,110 ▲71.94 ▼0.0141.17 ▼1.0736.21 ▼2.62
Add New Post /wp-admin/post-new.php1,534 ▲823.04 ▼0.11671.01 ▲23.5155.45 ▼2.02
Media Library /wp-admin/upload.php1,407 ▲74.16 ▼0.03107.26 ▲4.7543.32 ▲1.47

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% 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)
Good news, no errors were detected

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
Please take a closer look at the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WooCommerce_Italian_add_on' not found in wp-content/plugins/woocommerce-pdf-invoices-italian-add-on/includes/class-wcpdf-integration.php:4
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_header_logo_id() on null in wp-content/plugins/woocommerce-pdf-invoices-italian-add-on/templates/pdf/Simple/receipt.php:6

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)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 15 tag instead of maximum 10
You can look at the official readme.txt

woocommerce-pdf-invoices-italian-add-on/woocommerce-pdf-italian-add-on.php 85% from 13 tests

"WooCommerce PDF Invoices Italian Add-on" version 0.7.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("woocommerce-pdf-invoices-italian-add-on.php" instead of "woocommerce-pdf-italian-add-on.php")

Code Analysis Passed 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
Everything looks great! No dangerous files found in this plugin3,910 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP184042023,302
PO File1180344472
JavaScript24289
CSS110146
SVG1001

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity38.17
▷ Minimum class complexity2.00
▷ Maximum class complexity123.00
Average method complexity4.40
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods131
▷ Static methods10.76%
▷ Public methods12796.95%
▷ Protected methods00.00%
▷ Private methods43.05%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
4 PNG files occupy 0.14MB with 0.07MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/logo2.png108.62KB1.77KB▼ 98.37%
images/receipt.png0.47KB0.34KB▼ 28.25%
images/agenziaEntrate_logo.png23.93KB8.59KB▼ 64.13%
images/invoice_width.png8.38KB7.74KB▼ 7.63%