87% pdf-invoices-and-packing-slips-for-woocommerce

Code Review | PDF Invoices and Packing Slips For WooCommerce

WordPress plugin PDF Invoices and Packing Slips For WooCommerce scored 87% from 54 tests.

About plugin

  • Plugin page: pdf-invoices-and-...
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-5.9.1
  • WordPress version: 5.8.1
  • First release: Sep 30, 2020
  • Latest release: Mar 11, 2022
  • Number of updates: 28
  • Update frequency: every 18.9 days
  • Top authors: acowebscd (67.86%)acowebs (35.71%)

Code review

54 tests

User reviews

5 reviews

Install metrics

800+ active / 9,869 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.50MB] [CPU: ▼140.85ms] Passed 4 tests

This is a short check of server-side resources used by PDF Invoices and Packing Slips For WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.19 ▲0.3531.00 ▲7.36
Dashboard /wp-admin3.64 ▲0.5748.70 ▲5.29
Posts /wp-admin/edit.php3.69 ▲0.5744.91 ▲9.97
Add New Post /wp-admin/post-new.php6.03 ▲0.5886.34 ▼580.76
Media Library /wp-admin/upload.php3.52 ▲0.5130.74 ▲4.73

Server storage [IO: ▲64.94MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Please try to fix the following items
  • Total filesystem usage should be limited to 25MB (currently using 64.94MB)
Filesystem: 707 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for PDF Invoices and Packing Slips For WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,670 ▲6915.62 ▼0.174.80 ▼1.8375.69 ▼1.39
Dashboard /wp-admin2,935 ▲396.00 ▼0.21129.94 ▼5.17173.68 ▼6.45
Posts /wp-admin/edit.php2,739 ▲23.22 ▼0.1476.54 ▲12.63143.78 ▲0.76
Add New Post /wp-admin/post-new.php3,589 ▼11718.04 ▼0.88501.27 ▲80.98237.27 ▲70.05
Media Library /wp-admin/upload.php1,754 ▲25.53 ▲0.05138.52 ▼0.80194.64 ▲13.35

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
Uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Please fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/pdf-invoices-and-packing-slips-for-woocommerce/includes/views/admin-root.php
  • 210× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/pdf-invoices-and-packing-slips-for-woocommerce/includes/vendor/mpdf/mpdf/src/Tag/Code.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Barcode\\AbstractBarcode' not found in wp-content/plugins/pdf-invoices-and-packing-slips-for-woocommerce/includes/vendor/mpdf/mpdf/src/Barcode/Imb.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/pdf-invoices-and-packing-slips-for-woocommerce/includes/vendor/mpdf/mpdf/src/Tag/Tr.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/pdf-invoices-and-packing-slips-for-woocommerce/includes/vendor/mpdf/mpdf/src/Tag/H1.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/pdf-invoices-and-packing-slips-for-woocommerce/includes/vendor/mpdf/mpdf/src/Tag/Q.php:5
    • > PHP Fatal error
      Trait 'Mpdf\\Strict' not found in wp-content/plugins/pdf-invoices-and-packing-slips-for-woocommerce/includes/vendor/mpdf/mpdf/src/Writer/BaseWriter.php on line 10
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\MpdfException' not found in wp-content/plugins/pdf-invoices-and-packing-slips-for-woocommerce/includes/vendor/mpdf/mpdf/src/Exception/InvalidArgumentException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/pdf-invoices-and-packing-slips-for-woocommerce/includes/vendor/mpdf/mpdf/src/Tag/BarCode.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'DeepCopy\\TypeFilter\\TypeFilter' not found in wp-content/plugins/pdf-invoices-and-packing-slips-for-woocommerce/includes/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ReplaceFilter.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\PdfParserException' not found in wp-content/plugins/pdf-invoices-and-packing-slips-for-woocommerce/includes/vendor/setasign/fpdi/src/PdfParser/CrossReference/CrossReferenceException.php:19

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 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Donate link: Please fix this invalid url: ""
The official readme.txt might help

pdf-invoices-and-packing-slips-for-woocommerce/start.php 92% from 13 tests

The entry point to "PDF Invoices and Packing Slips For WooCommerce" version 1.2.1 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("pdf-invoices-and-packing-slips-for-woocommerce.php" instead of "start.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin83,410 lines of code in 487 files:
LanguageFilesBlank linesComment linesLines of code
PHP40710,91612,79779,669
JSON73201,129
Markdown837301,127
SVG5300484
CSS49219449
PO File1201201425
YAML319271
XML211054
JavaScript2022

PHP code 0% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 7,009)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 460)
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity58.27
▷ Minimum class complexity1.00
▷ Maximum class complexity7,009.00
Average method complexity13.95
▷ Minimum method complexity1.00
▷ Maximum method complexity460.00
Code structure
Namespaces51
Interfaces10
Traits6
Classes300
▷ Abstract classes93.00%
▷ Concrete classes29197.00%
▷ Final classes124.12%
Methods1,406
▷ Static methods1279.03%
▷ Public methods1,22386.98%
▷ Protected methods543.84%
▷ Private methods1299.17%
Functions48
▷ Named functions2347.92%
▷ Anonymous functions2552.08%
Constants441
▷ Global constants194.31%
▷ Class constants42295.69%
▷ Public constants422100.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
7 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/vendor/myclabs/deep-copy/doc/deep-clone.png13.68KB6.54KB▼ 52.22%
includes/vendor/myclabs/deep-copy/doc/clone.png12.09KB5.48KB▼ 54.70%
includes/vendor/myclabs/deep-copy/doc/deep-copy.png10.64KB5.23KB▼ 50.84%
assets/images/doc-settings-active-arrow.png1.14KB0.29KB▼ 74.66%
assets/images/invoice-temp1.png3.93KB4.10KB0.00%