78% wpwing-pdf-invoice-packing-slip-for-woocommerce

Code Review | PDF Invoice and Packing Slip for WooCommerce

WordPress plugin PDF Invoice and Packing Slip for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: wpwing-pdf-invoic...
  • Plugin version: 1.4.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.2
  • WordPress version: 6.3.1
  • First release: Oct 14, 2021
  • Latest release: Jun 17, 2023
  • Number of updates: 18
  • Update frequency: every 34.3 days
  • Top authors: wpwing (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,017 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.92ms] Passed 4 tests

Analyzing server-side resources used by PDF Invoice and Packing Slip for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.20 ▼2.19
Dashboard /wp-admin3.31 ▲0.0043.93 ▼7.16
Posts /wp-admin/edit.php3.36 ▲0.0049.30 ▲0.59
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.21 ▼14.92
Media Library /wp-admin/upload.php3.23 ▲0.0039.37 ▲6.76

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

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

Browser metrics Passed 4 tests

Checking browser requirements for PDF Invoice and Packing Slip for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.65 ▼0.721.68 ▼0.1539.42 ▼4.53
Dashboard /wp-admin2,206 ▲185.86 ▲0.97100.62 ▼0.4539.54 ▲0.62
Posts /wp-admin/edit.php2,089 ▼02.06 ▲0.0139.13 ▲1.3334.76 ▲0.33
Add New Post /wp-admin/post-new.php1,514 ▼2817.78 ▼0.39658.53 ▼1.7360.09 ▲7.56
Media Library /wp-admin/upload.php1,388 ▲34.23 ▲0.02107.77 ▲7.1146.05 ▲0.43

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
Please fix the following items
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wpwing-pdf-invoice-packing-slip-for-woocommerce/vendor/masterminds/html5/bin/entities.php
    • > /wp-content/plugins/wpwing-pdf-invoice-packing-slip-for-woocommerce/templates/default/packing/footer.php
    • > /wp-content/plugins/wpwing-pdf-invoice-packing-slip-for-woocommerce/templates/default/invoice/footer.php
  • 133× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Table\\Table' not found in wp-content/plugins/wpwing-pdf-invoice-packing-slip-for-woocommerce/vendor/phenx/php-font-lib/src/FontLib/Table/Type/head.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Table\\Table' not found in wp-content/plugins/wpwing-pdf-invoice-packing-slip-for-woocommerce/vendor/phenx/php-font-lib/src/FontLib/Table/Type/kern.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\Value\\ValueList' not found in wp-content/plugins/wpwing-pdf-invoice-packing-slip-for-woocommerce/vendor/sabberworm/php-css-parser/src/Value/LineName.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\Shape' not found in wp-content/plugins/wpwing-pdf-invoice-packing-slip-for-woocommerce/vendor/phenx/php-svg-lib/src/Svg/Tag/Text.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\TrueType\\File' not found in wp-content/plugins/wpwing-pdf-invoice-packing-slip-for-woocommerce/vendor/phenx/php-font-lib/src/FontLib/EOT/File.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\AbstractTag' not found in wp-content/plugins/wpwing-pdf-invoice-packing-slip-for-woocommerce/vendor/phenx/php-svg-lib/src/Svg/Tag/Group.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Masterminds\\HTML5\\Parser\\StringInputStream' not found in wp-content/plugins/wpwing-pdf-invoice-packing-slip-for-woocommerce/vendor/masterminds/html5/src/HTML5/Parser/FileInputStream.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\TrueType\\Header' not found in wp-content/plugins/wpwing-pdf-invoice-packing-slip-for-woocommerce/vendor/phenx/php-font-lib/src/FontLib/WOFF/Header.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\BinaryStream' not found in wp-content/plugins/wpwing-pdf-invoice-packing-slip-for-woocommerce/vendor/phenx/php-font-lib/src/FontLib/Table/Table.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\Renderer\\AbstractRenderer' not found in wp-content/plugins/wpwing-pdf-invoice-packing-slip-for-woocommerce/vendor/dompdf/dompdf/src/Renderer.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
9 plugin tags: pdf, invoice, packing list, delivery notes, shipping labels...

wpwing-pdf-invoice-packing-slip-for-woocommerce/wpwing-pdf-invoice-packing-slip-for-woocommerce.php 92% from 13 tests

The entry point to "PDF Invoice and Packing Slip for WooCommerce" version 1.4.0 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected65,885 lines of code in 251 files:
LanguageFilesBlank linesComment linesLines of code
PHP2189,08717,28141,409
JSON100022,151
Markdown1139001,314
CSS514742637
JavaScript32369262
Sass111052
YAML19035
HTML10017
SVG1008

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity32.57
▷ Minimum class complexity1.00
▷ Maximum class complexity811.00
Average method complexity3.91
▷ Minimum method complexity1.00
▷ Maximum method complexity98.00
Code structure
Namespaces37
Interfaces9
Traits0
Classes193
▷ Abstract classes136.74%
▷ Concrete classes18093.26%
▷ Final classes00.00%
Methods2,269
▷ Static methods1396.13%
▷ Public methods1,79679.15%
▷ Protected methods40417.81%
▷ Private methods693.04%
Functions36
▷ Named functions616.67%
▷ Anonymous functions3083.33%
Constants227
▷ Global constants135.73%
▷ Class constants21494.27%
▷ Public constants20997.66%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
103 PNG files occupy 2.81MB with 1.98MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/public/images/09.png70.03KB23.58KB▼ 66.32%
assets/public/images/09-icon.png1.42KB0.38KB▼ 73.63%
assets/src/images/04.png37.45KB13.92KB▼ 62.83%
assets/src/images/04-icon.png1.35KB0.57KB▼ 57.72%
assets/src/images/12-bg.png16.45KB1.24KB▼ 92.47%