78% woocommerce-pdf-invoices-packing-slips

Code Review | PDF Invoices & Packing Slips for WooCommerce

WordPress plugin PDF Invoices & Packing Slips for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: woocommerce-pdf-i...
  • Plugin version: 3.7.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.4
  • WordPress version: 6.3.1
  • First release: Jan 17, 2014
  • Latest release: Nov 27, 2023
  • Number of updates: 368
  • Update frequency: every 9.8 days
  • Top authors: pomegranate (89.13%)wpovernight (11.14%)

Code review

54 tests

User reviews

1637 reviews

Install metrics

300,000+ active /13,953,690 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.40MB] [CPU: ▼6.06ms] Passed 4 tests

Analyzing server-side resources used by PDF Invoices & Packing Slips for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.91 ▲0.4538.76 ▼3.03
Dashboard /wp-admin3.75 ▲0.4147.88 ▼16.81
Posts /wp-admin/edit.php3.80 ▲0.4553.08 ▲8.53
Add New Post /wp-admin/post-new.php6.27 ▲0.3896.43 ▼8.85
Media Library /wp-admin/upload.php3.61 ▲0.3839.29 ▲4.44

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 583 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

A check of browser resources used by PDF Invoices & Packing Slips for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲4914.69 ▲0.351.67 ▲0.0437.38 ▼5.39
Dashboard /wp-admin2,204 ▲295.60 ▼0.1093.01 ▼18.4440.49 ▼2.50
Posts /wp-admin/edit.php2,106 ▲31.95 ▼0.0640.24 ▼2.7636.19 ▼0.19
Add New Post /wp-admin/post-new.php1,532 ▲623.08 ▲0.31603.56 ▼23.8657.26 ▲2.71
Media Library /wp-admin/upload.php1,406 ▲64.23 ▲0.0296.50 ▼3.7141.90 ▲1.61

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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 perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/masterminds/html5/bin/entities.php
  • 142× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\Shape' not found in wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/phenx/php-svg-lib/src/Svg/Tag/Text.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\BinaryStream' not found in wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/phenx/php-font-lib/src/FontLib/Table/Type/nameRecord.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Table\\Table' not found in wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/phenx/php-font-lib/src/FontLib/Table/Type/os2.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/dompdf/dompdf/src/FrameDecorator/ListBullet.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\Renderer\\AbstractRenderer' not found in wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/dompdf/dompdf/src/Renderer.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\AbstractTag' not found in wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/phenx/php-svg-lib/src/Svg/Tag/StyleTag.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameReflower\\AbstractFrameReflower' not found in wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/dompdf/dompdf/src/FrameReflower/NullFrameReflower.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/dompdf/dompdf/src/FrameDecorator/TableRow.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\Value\\CSSFunction' not found in wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/sabberworm/php-css-parser/src/Value/CalcFunction.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\TrueType\\File' not found in wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/phenx/php-font-lib/src/FontLib/OpenType/File.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test


Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: pdf, packing slips, invoices, ubl, woocommerce

woocommerce-pdf-invoices-packing-slips/woocommerce-pdf-invoices-packingslips.php 85% from 13 tests

The main file in "PDF Invoices & Packing Slips for WooCommerce" v. 3.7.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("woocommerce-pdf-invoices-packing-slips.php" instead of "woocommerce-pdf-invoices-packingslips.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.4" instead of "3.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin102,467 lines of code in 407 files:
LanguageFilesBlank linesComment linesLines of code
PO File196,9169,79518,552

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity31.68
▷ Minimum class complexity1.00
▷ Maximum class complexity811.00
Average method complexity4.07
▷ Minimum method complexity1.00
▷ Maximum method complexity98.00
Code structure
▷ Abstract classes217.84%
▷ Concrete classes24792.16%
▷ Final classes20.81%
▷ Static methods2257.83%
▷ Public methods2,37382.60%
▷ Protected methods41414.41%
▷ Private methods862.99%
▷ Named functions14475.79%
▷ Anonymous functions4624.21%
▷ Global constants197.95%
▷ Class constants22092.05%
▷ Public constants21497.27%

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.02MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/dropbox_logo.png4.27KB2.21KB▼ 48.19%
vendor/dompdf/dompdf/lib/res/broken_image.png0.60KB0.47KB▼ 22.33%
assets/images/cloud-print.png2.63KB2.55KB▼ 2.93%
assets/images/wpo-helper.png17.86KB5.25KB▼ 70.62%