77% pdf-invoice-for-woocommerce

Code Review | PDF Invoice for Woocommerce

WordPress plugin PDF Invoice for Woocommerce scored 77% from 54 tests.

About plugin

  • Plugin page: pdf-invoice-for-w...
  • Plugin version: 1.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.0
  • WordPress version: 6.3.1
  • First release: Aug 10, 2022
  • Latest release: Mar 25, 2023
  • Number of updates: 5
  • Update frequency: every 45.6 days
  • Top authors: jodhavishalsingh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 829 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼4.84ms] Passed 4 tests

A check of server-side resources used by PDF Invoice for Woocommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0537.03 ▼4.72
Dashboard /wp-admin3.35 ▲0.0546.66 ▼1.89
Posts /wp-admin/edit.php3.46 ▲0.1149.11 ▼3.02
Add New Post /wp-admin/post-new.php5.93 ▲0.0484.08 ▼9.74
Media Library /wp-admin/upload.php3.27 ▲0.0434.07 ▲0.14

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 319 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for PDF Invoice for Woocommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.44 ▲0.071.66 ▲0.0141.10 ▼4.39
Dashboard /wp-admin2,206 ▲184.88 ▼1.00108.79 ▲7.9340.60 ▼5.45
Posts /wp-admin/edit.php2,086 ▼31.99 ▼0.0239.48 ▼2.8438.18 ▲1.83
Add New Post /wp-admin/post-new.php1,533 ▼023.37 ▲0.19660.66 ▼67.5951.90 ▼21.21
Media Library /wp-admin/upload.php1,388 ▼34.17 ▲0.0196.92 ▼6.3350.87 ▲5.40

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
The following issues need your attention
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/pdf-invoice-for-woocommerce/dompdf/vendor/masterminds/html5/bin/entities.php
    • > /wp-content/plugins/pdf-invoice-for-woocommerce/preview/template-1.php
  • 131× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/pdf-invoice-for-woocommerce/dompdf/vendor/dompdf/dompdf/src/FrameDecorator/TableRow.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\Value\\PrimitiveValue' not found in wp-content/plugins/pdf-invoice-for-woocommerce/dompdf/vendor/sabberworm/php-css-parser/src/Value/Size.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Table\\Table' not found in wp-content/plugins/pdf-invoice-for-woocommerce/dompdf/vendor/phenx/php-font-lib/src/FontLib/Table/Type/maxp.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\BinaryStream' not found in wp-content/plugins/pdf-invoice-for-woocommerce/dompdf/vendor/phenx/php-font-lib/src/FontLib/Table/Table.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\TrueType\\File' not found in wp-content/plugins/pdf-invoice-for-woocommerce/dompdf/vendor/phenx/php-font-lib/src/FontLib/EOT/File.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\CSSList\\CSSList' not found in wp-content/plugins/pdf-invoice-for-woocommerce/dompdf/vendor/sabberworm/php-css-parser/src/CSSList/CSSBlockList.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Sabberworm\\CSS\\Renderable' not found in wp-content/plugins/pdf-invoice-for-woocommerce/dompdf/vendor/sabberworm/php-css-parser/src/Property/AtRule.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/pdf-invoice-for-woocommerce/templates/template-1.php:167
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\Value\\ValueList' not found in wp-content/plugins/pdf-invoice-for-woocommerce/dompdf/vendor/sabberworm/php-css-parser/src/Value/LineName.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/pdf-invoice-for-woocommerce/dompdf/vendor/dompdf/dompdf/src/FrameDecorator/ListBullet.php:19

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed: Please take inspiration from this readme.txt

pdf-invoice-for-woocommerce/invoice-for-wc.php 77% from 13 tests

The principal PHP file in "PDF Invoice for Woocommerce" v. 1.1 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("pdf-invoice-for-woocommerce.php" instead of "invoice-for-wc.php")
  • Requires at least: The required version number must match the one declared in readme.txt ("5.8" instead of "5.4")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin57,227 lines of code in 243 files:
LanguageFilesBlank linesComment linesLines of code
PHP2128,58716,76040,884
JSON150014,464
Markdown1038101,279
CSS19238391
PO File14955124
YAML19035
JavaScript10025
HTML10017
SVG1008

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity32.26
▷ Minimum class complexity1.00
▷ Maximum class complexity809.00
Average method complexity3.92
▷ Minimum method complexity1.00
▷ Maximum method complexity97.00
Code structure
Namespaces37
Interfaces9
Traits0
Classes190
▷ Abstract classes126.32%
▷ Concrete classes17893.68%
▷ Final classes00.00%
Methods2,210
▷ Static methods1456.56%
▷ Public methods1,75179.23%
▷ Protected methods40018.10%
▷ Private methods592.67%
Functions30
▷ Named functions26.67%
▷ Anonymous functions2893.33%
Constants217
▷ Global constants31.38%
▷ Class constants21498.62%
▷ Public constants20997.66%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
dompdf/vendor/dompdf/dompdf/lib/res/broken_image.png0.60KB0.47KB▼ 22.33%