10% pdf-invoicespacking-slip-and-shipping-label-free-for-woocommerce

Code Review | PDF Invoices,Packing slip and Shipping Label Free for Woocommerce

WordPress plugin PDF Invoices,Packing slip and Shipping Label Free for Woocommerce scored 10% from 54 tests.

About plugin

  • Plugin page: pdf-invoicespacki...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.6
  • WordPress version: 6.3.1
  • First release: Mar 19, 2020
  • Latest release: Dec 28, 2020
  • Number of updates: 8
  • Update frequency: every 35.6 days
  • Top authors: phoeniixx (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 601 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/pdf-invoicespacking-slip-and-shipping-label-free-for-woocommerce/admin/class-pdf-invoices-packing-slip-shipping-label-for-woocommerce-admin.php+104
    Undefined variable: order_id

Server metrics [RAM: ▼1.90MB] [CPU: ▼49.94ms] Passed 4 tests

This is a short check of server-side resources used by PDF Invoices,Packing slip and Shipping Label Free for Woocommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.374.53 ▼36.15
Dashboard /wp-admin2.11 ▼1.195.46 ▼39.00
Posts /wp-admin/edit.php2.11 ▼1.256.70 ▼40.11
Add New Post /wp-admin/post-new.php2.11 ▼3.786.24 ▼84.48
Media Library /wp-admin/upload.php2.11 ▼1.126.53 ▼28.84

Server storage [IO: ▲17.89MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 599 new files
Database: no new tables, 105 new options
New WordPress options
woocommerce_invoice_enable_product_pck_sku
woocommerce_invoice_enable_pck_order_date
woocommerce_invoice_enable_invoice_notes
woocommerce_settings_invoice_pdf_invoice_suffix
woocommerce_invoice_enable_reg_num
woocommerce_invoice_enable_refunded_order
woocommerce_invoice_enable_product_line_total
woocommerce_invoice_enable_myaccount
woocommerce_invoice_enable_order_date
woocommerce_invoice_enable_email_address
...

Browser metrics Passed 4 tests

A check of browser resources used by PDF Invoices,Packing slip and Shipping Label Free for Woocommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲8813.65 ▼0.711.76 ▼0.2347.72 ▼2.58
Dashboard /wp-admin2,226 ▲385.42 ▲0.54113.90 ▲2.2842.14 ▼0.33
Posts /wp-admin/edit.php2,117 ▲312.45 ▲0.4143.45 ▲3.2633.47 ▼0.92
Add New Post /wp-admin/post-new.php1,543 ▲2918.48 ▲0.98597.51 ▼75.7034.13 ▼17.29
Media Library /wp-admin/upload.php1,414 ▲234.65 ▲0.3696.63 ▼4.2742.75 ▼1.02

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/pdf-invoicespacking-slip-and-shipping-label-free-for-woocommerce/admin/class-pdf-invoices-packing-slip-shipping-label-for-woocommerce-admin.php+104
    Undefined variable: order_id
  • Zombie WordPress options were found after uninstall: 105 options
    • woocommerce_invoice_enable_order_number
    • woocommerce_packing_notes
    • woocommerce_invoice_enable_product_image
    • widget_recent-comments
    • woocommerce_settings_invoice_pdf_invoice_suffix
    • woocommerce_invoice_enable_completed_order
    • woocommerce_proforma_enable_invoice_plugin
    • woocommerce_invoice_enable_reg_num
    • woocommerce_invoice_enable_product_pck_description
    • woocommerce_invoice_enable_product_pck_variation
    • ...

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 | 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
  • 208× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\FpdfTpl' not found in wp-content/plugins/pdf-invoicespacking-slip-and-shipping-label-free-for-woocommerce/admin/libs/mpdf/vendor/setasign/fpdi/src/Fpdi.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/pdf-invoicespacking-slip-and-shipping-label-free-for-woocommerce/admin/libs/mpdf/vendor/mpdf/mpdf/src/Tag/Sup.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Psr\\Log\\AbstractLogger' not found in wp-content/plugins/pdf-invoicespacking-slip-and-shipping-label-free-for-woocommerce/admin/libs/mpdf/vendor/psr/log/Psr/Log/Test/TestLogger.php:57
    • > PHP Fatal error
      Uncaught Error: Interface 'setasign\\Fpdi\\PdfParser\\Filter\\FilterInterface' not found in wp-content/plugins/pdf-invoicespacking-slip-and-shipping-label-free-for-woocommerce/admin/libs/mpdf/vendor/setasign/fpdi/src/PdfParser/Filter/AsciiHex.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'tFPDF' not found in wp-content/plugins/pdf-invoicespacking-slip-and-shipping-label-free-for-woocommerce/admin/libs/mpdf/vendor/setasign/fpdi/src/Tfpdf/FpdfTpl.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\SetHtmlPageFooter' not found in wp-content/plugins/pdf-invoicespacking-slip-and-shipping-label-free-for-woocommerce/admin/libs/mpdf/vendor/mpdf/mpdf/src/Tag/SetHtmlPageHeader.php:5
    • > PHP Fatal error
      Uncaught UnexpectedValueException: creating archive "wp-content/plugins/pdf-invoicespacking-slip-and-shipping-label-free-for-woocommerce/admin/libs/mpdf/vendor/paragonie/random_compat/dist/random_compat.phar" disabled by the php.ini setting phar.readonly in /var/www/wordpress/wp-content/plugins/pdf-invoicespacking-slip-and-shipping-label-free-for-woocommerce/admin/libs/mpdf/vendor/paragonie/random_compat/other/build_phar.php:12
    • > PHP Fatal error
      Trait 'Mpdf\\Strict' not found in wp-content/plugins/pdf-invoicespacking-slip-and-shipping-label-free-for-woocommerce/admin/libs/mpdf/vendor/mpdf/mpdf/src/Tag/Tag.php on line 18
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/pdf-invoicespacking-slip-and-shipping-label-free-for-woocommerce/admin/libs/mpdf/vendor/mpdf/mpdf/src/Tag/TextArea.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/pdf-invoicespacking-slip-and-shipping-label-free-for-woocommerce/admin/libs/mpdf/vendor/mpdf/mpdf/src/Tag/FieldSet.php:5

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)
There were no browser issues found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention: The official readme.txt is a good inspiration

pdf-invoicespacking-slip-and-shipping-label-free-for-woocommerce/pdf-invoices-packing-slip-shipping-label-for-woocommerce.php 77% from 13 tests

The entry point to "PDF Invoices,Packing slip and Shipping Label Free for Woocommerce" version 1.0.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("pdf-invoicespacking-slip-and-shipping-label-free-for-woocommerce.php" instead of "pdf-invoices-packing-slip-shipping-label-for-woocommerce.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Description: Please keep the plugin description shorter than 140 characters (currently 186 characters long)

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin78,824 lines of code in 433 files:
LanguageFilesBlank linesComment linesLines of code
PHP38710,64211,81776,551
Markdown738201,146
JSON28320519
CSS36518406
JavaScript273184
XML311073
YAML210242
Bourne Shell1203

PHP code 0% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 7,005)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 460)
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity59.72
▷ Minimum class complexity1.00
▷ Maximum class complexity7,005.00
Average method complexity13.97
▷ Minimum method complexity1.00
▷ Maximum method complexity460.00
Code structure
Namespaces43
Interfaces10
Traits6
Classes282
▷ Abstract classes93.19%
▷ Concrete classes27396.81%
▷ Final classes124.40%
Methods1,358
▷ Static methods1339.79%
▷ Public methods1,17386.38%
▷ Protected methods533.90%
▷ Private methods1329.72%
Functions32
▷ Named functions928.12%
▷ Anonymous functions2371.88%
Constants432
▷ Global constants102.31%
▷ Class constants42297.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
5 PNG files occupy 0.06MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/libs/mpdf/vendor/myclabs/deep-copy/doc/graph.png6.29KB3.03KB▼ 51.86%
admin/icon/pdfim.png19.22KB0.31KB▼ 98.41%
admin/libs/mpdf/vendor/myclabs/deep-copy/doc/clone.png12.09KB5.48KB▼ 54.70%
admin/libs/mpdf/vendor/myclabs/deep-copy/doc/deep-clone.png13.68KB6.54KB▼ 52.22%
admin/libs/mpdf/vendor/myclabs/deep-copy/doc/deep-copy.png10.64KB5.23KB▼ 50.84%