78% pdf-invoices-and-packing-slips

Code Review | PDF Invoices & Packing Slips

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

About plugin

  • Plugin page: pdf-invoices-and-...
  • Plugin version: 1.2.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0
  • WordPress version: 6.3.1
  • First release: Apr 21, 2022
  • Latest release: Jul 24, 2022
  • Number of updates: 6
  • Update frequency: every 15.8 days
  • Top authors: ok9xnirab (83.33%)springdevs (33.33%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /365 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.27MB] [CPU: ▼7.28ms] Passed 4 tests

This is a short check of server-side resources used by PDF Invoices & Packing Slips
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1345.67 ▼0.16
Dashboard /wp-admin3.67 ▲0.3352.18 ▼12.75
Posts /wp-admin/edit.php3.72 ▲0.3751.75 ▼4.63
Add New Post /wp-admin/post-new.php6.21 ▲0.3390.74 ▼11.57
Media Library /wp-admin/upload.php3.53 ▲0.3146.01 ▲9.69
Preview PDF /wp-admin/admin.php?page=pips_view_pdf3.5037.08

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 314 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by PDF Invoices & Packing Slips
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲9913.23 ▼1.522.24 ▲0.4545.02 ▲1.19
Dashboard /wp-admin2,251 ▲605.81 ▲0.8897.99 ▼11.6775.22 ▲29.56
Posts /wp-admin/edit.php2,131 ▲392.04 ▲0.0538.11 ▼3.4033.98 ▼2.13
Add New Post /wp-admin/post-new.php1,708 ▲19422.62 ▲4.94767.18 ▲93.1359.34 ▲1.33
Media Library /wp-admin/upload.php1,433 ▲424.30 ▲0.16102.79 ▲0.4077.93 ▲33.90
Preview PDF /wp-admin/admin.php?page=pips_view_pdf8002.0825.0623.29

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

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
Good news, no errors were detected

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
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/pdf-invoices-and-packing-slips/vendor/masterminds/html5/bin/entities.php
    • > /wp-content/plugins/pdf-invoices-and-packing-slips/templates/simple/packing/footer.php
    • > /wp-content/plugins/pdf-invoices-and-packing-slips/templates/simple/invoice/footer.php
  • 137× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Masterminds\\HTML5\\Parser\\StringInputStream' not found in wp-content/plugins/pdf-invoices-and-packing-slips/vendor/masterminds/html5/src/HTML5/Parser/FileInputStream.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Masterminds\\HTML5\\Parser\\EventHandler' not found in wp-content/plugins/pdf-invoices-and-packing-slips/vendor/masterminds/html5/src/HTML5/Parser/DOMTreeBuilder.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/pdf-invoices-and-packing-slips/vendor/dompdf/dompdf/src/FrameDecorator/NullFrameDecorator.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\Shape' not found in wp-content/plugins/pdf-invoices-and-packing-slips/vendor/phenx/php-svg-lib/src/Svg/Tag/Polygon.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\Value\\ValueList' not found in wp-content/plugins/pdf-invoices-and-packing-slips/vendor/sabberworm/php-css-parser/src/Value/RuleValueList.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/pdf-invoices-and-packing-slips/templates/simple/packing/header.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\Shape' not found in wp-content/plugins/pdf-invoices-and-packing-slips/vendor/phenx/php-svg-lib/src/Svg/Tag/Line.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Table\\DirectoryEntry' not found in wp-content/plugins/pdf-invoices-and-packing-slips/vendor/phenx/php-font-lib/src/FontLib/TrueType/TableDirectoryEntry.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\AbstractTag' not found in wp-content/plugins/pdf-invoices-and-packing-slips/vendor/phenx/php-svg-lib/src/Svg/Tag/StyleTag.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Table\\Table' not found in wp-content/plugins/pdf-invoices-and-packing-slips/vendor/phenx/php-font-lib/src/FontLib/Table/Type/post.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Donate link: Invalid URI ("")
Please take inspiration from this readme.txt

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

The main file in "PDF Invoices & Packing Slips" v. 1.2.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected43,866 lines of code in 246 files:
LanguageFilesBlank linesComment linesLines of code
PHP2308,71816,94941,163
JSON5001,565
CSS518652824
PO File18593189
Markdown228058
JavaScript14042
HTML10017
SVG1008

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity30.67
▷ Minimum class complexity1.00
▷ Maximum class complexity809.00
Average method complexity3.88
▷ Minimum method complexity1.00
▷ Maximum method complexity97.00
Code structure
Namespaces42
Interfaces9
Traits1
Classes201
▷ Abstract classes125.97%
▷ Concrete classes18994.03%
▷ Final classes10.53%
Methods2,254
▷ Static methods1406.21%
▷ Public methods1,79279.50%
▷ Protected methods40017.75%
▷ Private methods622.75%
Functions36
▷ Named functions719.44%
▷ Anonymous functions2980.56%
Constants223
▷ Global constants83.59%
▷ Class constants21596.41%
▷ Public constants21097.67%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/woocommerce.png7.05KB3.41KB▼ 51.68%
vendor/dompdf/dompdf/lib/res/broken_image.png0.60KB0.47KB▼ 22.33%