82% pdf-invoices-and-packing-slips-bundle-woocommerce

Code Review | Pdf Invoices and Packing Slips Bundle Woocommerce

WordPress plugin Pdf Invoices and Packing Slips Bundle Woocommerce scored 82% from 54 tests.

About plugin

  • Plugin page: pdf-invoices-and-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 5.9.2
  • First release: Dec 30, 2019
  • Latest release: Oct 6, 2021
  • Number of updates: 14
  • Update frequency: every 46.4 days
  • Top authors: avdevelopers426 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active / 1,274 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.02MB] [CPU: ▼303.67ms] Passed 4 tests

Analyzing server-side resources used by Pdf Invoices and Packing Slips Bundle Woocommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0153.40 ▲1.58
Dashboard /wp-admin3.41 ▲0.0032.80 ▼1.82
Posts /wp-admin/edit.php3.64 ▲0.0036.68 ▼1.79
Add New Post /wp-admin/post-new.php6.88 ▼0.0990.01 ▼1,209.88
Media Library /wp-admin/upload.php3.30 ▲0.0024.18 ▼1.17
PDF Packing Slip /wp-admin/admin.php?page=pdf-packing-slip3.1017.62
Essential Kit /wp-admin/admin.php?page=ocpsw_kit3.1018.98

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 348 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 Bundle Woocommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,038 ▲29417.60 ▲1.985.52 ▼1.001.98 ▼0.19
Dashboard /wp-admin2,888 ▲276.13 ▼0.03114.24 ▼18.82157.23 ▼4.40
Posts /wp-admin/edit.php2,694 ▲33.24 ▼0.0068.13 ▲3.08138.19 ▼8.13
Add New Post /wp-admin/post-new.php1,719 ▲822.05 ▲0.76404.27 ▼28.54160.76 ▲1.93
Media Library /wp-admin/upload.php1,695 ▼35.49 ▲0.02102.07 ▼48.90180.62 ▼3.29
PDF Packing Slip /wp-admin/admin.php?page=pdf-packing-slip280.940.0316.68
Essential Kit /wp-admin/admin.php?page=ocpsw_kit280.940.0417.06

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstaller ran successfully

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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 fix the following
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/pdf-invoices-and-packing-slips-bundle-woocommerce/oc-packing-slip.php
    • > /wp-content/plugins/pdf-invoices-and-packing-slips-bundle-woocommerce/includes/dompdf/lib/php-css-parser/tests/quickdump.php
    • > /wp-content/plugins/pdf-invoices-and-packing-slips-bundle-woocommerce/includes/dompdf/demo2.php
  • 185× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: fontDir in wp-content/plugins/pdf-invoices-and-packing-slips-bundle-woocommerce/includes/dompdf/lib/fonts/dompdf_font_family_cache.php on line 54
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/pdf-invoices-and-packing-slips-bundle-woocommerce/includes/dompdf/src/FrameDecorator/Table.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameReflower\\Block' not found in wp-content/plugins/pdf-invoices-and-packing-slips-bundle-woocommerce/includes/dompdf/src/FrameReflower/TableCell.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\Shape' not found in wp-content/plugins/pdf-invoices-and-packing-slips-bundle-woocommerce/includes/dompdf/lib/php-svg-lib/src/Svg/Tag/Polyline.php:11
    • > PHP Notice
      Undefined variable: fontDir in wp-content/plugins/pdf-invoices-and-packing-slips-bundle-woocommerce/includes/dompdf/lib/fonts/dompdf_font_family_cache.php on line 41
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\AbstractTag' not found in wp-content/plugins/pdf-invoices-and-packing-slips-bundle-woocommerce/includes/dompdf/lib/php-svg-lib/src/Svg/Tag/StyleTag.php:13
    • > PHP Notice
      Undefined variable: fontDir in wp-content/plugins/pdf-invoices-and-packing-slips-bundle-woocommerce/includes/dompdf/lib/fonts/dompdf_font_family_cache.php on line 17
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/pdf-invoices-and-packing-slips-bundle-woocommerce/includes/dompdf/src/FrameDecorator/Page.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/pdf-invoices-and-packing-slips-bundle-woocommerce/includes/dompdf/lib/php-css-parser/tests/Sabberworm/CSS/RuleSet/DeclarationBlockTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/pdf-invoices-and-packing-slips-bundle-woocommerce/includes/dompdf/src/FrameDecorator/Inline.php:22

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=pdf-packing-slip
    • > Network (severe)
    wp-admin/admin.php?page=pdf-packing-slip - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=ocpsw_kit
    • > Network (severe)
    wp-admin/admin.php?page=ocpsw_kit - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention: You can take inspiration from this readme.txt

pdf-invoices-and-packing-slips-bundle-woocommerce/oc-packing-slip.php 92% from 13 tests

"Pdf Invoices and Packing Slips Bundle Woocommerce" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("pdf-invoices-and-packing-slips-bundle-woocommerce.php" instead of "oc-packing-slip.php")

Code Analysis 97% from 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
Success! There were no dangerous files found in this plugin43,532 lines of code in 266 files:
LanguageFilesBlank linesComment linesLines of code
PHP2048,86515,39441,079
CSS3513762984
Markdown62610930
XML632202
JSON500148
JavaScript395100
YAML416363
HTML10017
SVG2009

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 652)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity37.22
▷ Minimum class complexity1.00
▷ Maximum class complexity797.00
Average method complexity4.39
▷ Minimum method complexity1.00
▷ Maximum method complexity652.00
Code structure
Namespaces33
Interfaces5
Traits0
Classes181
▷ Abstract classes126.63%
▷ Concrete classes16993.37%
▷ Final classes00.00%
Methods2,056
▷ Static methods844.09%
▷ Public methods1,75385.26%
▷ Protected methods21010.21%
▷ Private methods934.52%
Functions15
▷ Named functions00.00%
▷ Anonymous functions15100.00%
Constants181
▷ Global constants94.97%
▷ Class constants17295.03%
▷ Public constants172100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.06MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/dompdf/lib/res/broken_image.png0.60KB0.47KB▼ 22.33%
images/review.png15.87KB11.90KB▼ 25.01%
images/pdf.png0.37KB0.30KB▼ 18.18%
images/bill.png0.50KB0.50KB▼ 1.36%
images/support.png6.44KB5.59KB▼ 13.09%