78% pdf-invoicing-for-woocommerce

Code Review | PDF Invoicing for WooCommerce

WordPress plugin PDF Invoicing for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: pdf-invoicing-for...
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: Jan 31, 2020
  • Latest release: Sep 26, 2023
  • Number of updates: 31
  • Update frequency: every 43.1 days
  • Top authors: algoritmika (74.19%)wpcodefactory (29.03%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,020 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 successfully, without throwing any errors or notices

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

Server-side resources used by PDF Invoicing for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.29 ▼7.47
Dashboard /wp-admin3.32 ▲0.0145.16 ▼5.76
Posts /wp-admin/edit.php3.37 ▲0.0145.23 ▲0.53
Add New Post /wp-admin/post-new.php5.90 ▲0.0188.55 ▼3.85
Media Library /wp-admin/upload.php3.24 ▲0.0138.81 ▲2.56

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

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

Browser metrics Passed 4 tests

Checking browser requirements for PDF Invoicing for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.29 ▼1.141.80 ▼0.2042.05 ▼1.72
Dashboard /wp-admin2,206 ▲205.85 ▲0.88110.73 ▼9.4236.35 ▼11.00
Posts /wp-admin/edit.php2,092 ▲32.10 ▲0.1140.44 ▲4.0535.42 ▲2.91
Add New Post /wp-admin/post-new.php1,533 ▼023.55 ▲0.43589.01 ▼75.0550.16 ▼7.98
Media Library /wp-admin/upload.php1,391 ▼04.18 ▼0.0994.21 ▼13.3841.04 ▼7.71

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/pdf-invoicing-for-woocommerce/assets/lib/tcpdf/tools/tcpdf_addfont.php
  • 33× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'setasign\\Fpdi\\PdfParser\\Filter\\FilterInterface' not found in wp-content/plugins/pdf-invoicing-for-woocommerce/assets/lib/fpdi/src/PdfParser/Filter/AsciiHex.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\FpdiException' not found in wp-content/plugins/pdf-invoicing-for-woocommerce/assets/lib/fpdi/src/PdfReader/PdfReaderException.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/pdf-invoicing-for-woocommerce/assets/lib/fpdi/src/PdfParser/Type/PdfDictionary.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'tFPDF' not found in wp-content/plugins/pdf-invoicing-for-woocommerce/assets/lib/fpdi/src/Tfpdf/FpdfTpl.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\PdfParserException' not found in wp-content/plugins/pdf-invoicing-for-woocommerce/assets/lib/fpdi/src/PdfParser/CrossReference/CrossReferenceException.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\FpdfTpl' not found in wp-content/plugins/pdf-invoicing-for-woocommerce/assets/lib/fpdi/src/Fpdi.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/pdf-invoicing-for-woocommerce/assets/lib/fpdi/src/PdfParser/Type/PdfStream.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/pdf-invoicing-for-woocommerce/assets/lib/fpdi/src/PdfParser/Type/PdfArray.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Filter\\FilterException' not found in wp-content/plugins/pdf-invoicing-for-woocommerce/assets/lib/fpdi/src/PdfParser/Filter/LzwException.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Filter\\FilterException' not found in wp-content/plugins/pdf-invoicing-for-woocommerce/assets/lib/fpdi/src/PdfParser/Filter/Ascii85Exception.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
6 plugin tags: pdf, woocommerce, credit note, packing list, woo commerce...

pdf-invoicing-for-woocommerce/pdf-invoicing-for-woocommerce.php Passed 13 tests

The main file in "PDF Invoicing for WooCommerce" v. 2.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
32 characters long description:
Add PDF invoices to WooCommerce.

Code Analysis 95% from 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 detected52,635 lines of code in 109 files:
LanguageFilesBlank linesComment linesLines of code
PHP1042,63715,01452,366
Markdown3490171
JSON20098

PHP code 0% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 4,413)
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 502)
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity100.60
▷ Minimum class complexity1.00
▷ Maximum class complexity4,413.00
Average method complexity8.51
▷ Minimum method complexity1.00
▷ Maximum method complexity502.00
Code structure
Namespaces9
Interfaces2
Traits2
Classes69
▷ Abstract classes22.90%
▷ Concrete classes6797.10%
▷ Final classes11.49%
Methods972
▷ Static methods15015.43%
▷ Public methods65667.49%
▷ Protected methods31532.41%
▷ Private methods10.10%
Functions12
▷ Named functions758.33%
▷ Anonymous functions541.67%
Constants176
▷ Global constants13978.98%
▷ Class constants3721.02%
▷ Public constants37100.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
No PNG images were found in this plugin