77% 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 scored77%from 54 tests.

About plugin

  • Plugin page: pdf-invoices-and-...
  • Plugin version: 1.3.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-6.3
  • WordPress version: 6.3.1
  • First release: Sep 30, 2020
  • Latest release: Oct 11, 2023
  • Number of updates: 43
  • Update frequency: every 25.7 days
  • Top authors: acowebscd (79.07%)acowebs (23.26%)

Code review

54 tests

User reviews

11 reviews

Install metrics

1,000+ active /24,041 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.12MB] [CPU: ▼5.51ms] Passed 4 tests

This is a short check of server-side resources used by PDF Invoices and Packing Slips For WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0445.11 ▲2.51
Dashboard /wp-admin3.36 ▲0.0651.98 ▼0.79
Posts /wp-admin/edit.php3.41 ▲0.0659.67 ▲7.71
Add New Post /wp-admin/post-new.php5.26 ▼0.6369.99 ▼24.32
Media Library /wp-admin/upload.php3.28 ▲0.0641.01 ▲0.55

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

How much does this plugin use your filesystem and database?
Please try to fix the following items
  • Total filesystem usage must be limited to 25MB (currently using 77.90MB)
Filesystem: 1,005 new files
Database: no new tables, 7 new options
New WordPress options
recovery_mode_email_last_sent
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for PDF Invoices and Packing Slips For WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,786 ▲2514.23 ▼0.181.86 ▲0.2445.66 ▲1.19
Dashboard /wp-admin2,194 ▲205.65 ▲0.0679.96 ▼20.6251.20 ▲7.98
Posts /wp-admin/edit.php2,108 ▲51.99 ▼0.0239.14 ▼5.3950.19 ▲13.74
Add New Post /wp-admin/post-new.php45 ▼1,4860.44 ▼22.570.13 ▼693.1812.70 ▼44.83
Media Library /wp-admin/upload.php1,405 ▲54.17 ▼0.0495.82 ▼9.2755.75 ▲7.02

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
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • recovery_mode_email_last_sent
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

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
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 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
  • 218× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > 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/ObjectWriter.php on line 9
    • > 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/I.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\FpdiException' not found in wp-content/plugins/pdf-invoices-and-packing-slips-for-woocommerce/includes/vendor/setasign/fpdi/src/PdfParser/PdfParserException.php:18
    • > 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/BookmarkWriter.php on line 8
    • > 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/Details.php:5
    • > 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/Dl.php:5
    • > 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/FieldSet.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'TCPDF' not found in wp-content/plugins/pdf-invoices-and-packing-slips-for-woocommerce/includes/vendor/setasign/fpdi/src/Tcpdf/Fpdi.php:33
    • > PHP Fatal error
      Uncaught Error: Interface 'DeepCopy\\Matcher\\Matcher' not found in wp-content/plugins/pdf-invoices-and-packing-slips-for-woocommerce/includes/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyMatcher.php:8
    • > 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/Select.php:7

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need your attention:
  • Donate link: Invalid url: ""
You can look at the official readme.txt

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

Analyzing the main PHP file in "PDF Invoices and Packing Slips For WooCommerce" version 1.3.6
Please take the time to fix the following:
  • 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 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected85,245 lines of code in 500 files:
LanguageFilesBlank linesComment linesLines of code
PHP40511,56612,56080,796
JSON81501,350
Markdown1039101,181
PO File1234234491
SVG5300484
CSS49219450
YAML7626196
XML5190123
JavaScript30286
HTML30085
Bourne Shell1203

PHP code 0% from 2 tests

Analyzing cyclomatic complexity and code structure
The following items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 7,016)
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 460)
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity59.43
▷ Minimum class complexity1.00
▷ Maximum class complexity7,016.00
Average method complexity13.72
▷ Minimum method complexity1.00
▷ Maximum method complexity460.00
Code structure
Namespaces46
Interfaces10
Traits6
Classes296
▷ Abstract classes93.04%
▷ Concrete classes28796.96%
▷ Final classes134.53%
Methods1,441
▷ Static methods1429.85%
▷ Public methods1,25186.81%
▷ Protected methods553.82%
▷ Private methods1359.37%
Functions37
▷ Named functions1232.43%
▷ Anonymous functions2567.57%
Constants442
▷ Global constants163.62%
▷ Class constants42696.38%
▷ Public constants426100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
8 PNG files occupy 0.60MB with 0.53MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/vendor/mpdf/qrcode/tests/reference/LOREM-IPSUM-2019-L-250.png183.72KB0.33KB▼ 99.82%
includes/vendor/mpdf/qrcode/tests/reference/LOREM-IPSUM-2019-L-100.png29.52KB0.25KB▼ 99.14%
includes/vendor/mpdf/qrcode/tests/reference/LOREM-IPSUM-2019-L-250-noborder.png183.72KB0.32KB▼ 99.82%
assets/images/woocommerce-placeholder.png4.13KB2.42KB▼ 41.32%
includes/vendor/mpdf/qrcode/tests/reference/LOREM-IPSUM-2019-Q-250.png183.72KB0.33KB▼ 99.82%