67% order-invoice-pdf-for-woocommerce

Code Review | Order Invoice PDF for WooCommerce

WordPress plugin Order Invoice PDF for WooCommerce scored67%from 54 tests.

About plugin

  • Plugin page: order-invoice-pdf...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8.2
  • WordPress version: 6.3.1
  • First release: Sep 21, 2017
  • Latest release: Sep 21, 2017
  • Number of updates: 7
  • Update frequency: every 0.1 days
  • Top authors: Shafayat Alam (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /825 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.87MB] [CPU: ▼36.87ms] Passed 4 tests

Analyzing server-side resources used by Order Invoice PDF for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1142.00 ▲4.86
Dashboard /wp-admin3.09 ▼0.2622.51 ▼36.48
Posts /wp-admin/edit.php3.09 ▼0.2726.86 ▼23.75
Add New Post /wp-admin/post-new.php3.09 ▼2.8023.37 ▼81.89
Media Library /wp-admin/upload.php3.09 ▼0.1424.31 ▼5.34
Invoices /wp-admin/admin.php?page=invoices3.0921.02

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 287 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Order Invoice PDF for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲4514.35 ▲0.171.55 ▲0.0438.24 ▼3.31
Dashboard /wp-admin2,200 ▲205.63 ▼0.0391.40 ▲1.6135.62 ▼7.57
Posts /wp-admin/edit.php2,102 ▲22.08 ▲0.0540.71 ▲4.0934.26 ▼4.86
Add New Post /wp-admin/post-new.php1,530 ▲223.16 ▲0.05603.68 ▼47.8750.51 ▼6.59
Media Library /wp-admin/upload.php1,402 ▲24.21 ▲0.0292.65 ▼0.8542.52 ▼0.20
Invoices /wp-admin/admin.php?page=invoices1,1303.2149.8865.53

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=invoices
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

SRP 50% 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 take a closer look at the following
  • 133× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\AbstractTag' not found in wp-content/plugins/order-invoice-pdf-for-woocommerce/vendor/phenx/php-svg-lib/src/Svg/Document.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Header' not found in wp-content/plugins/order-invoice-pdf-for-woocommerce/vendor/phenx/php-font-lib/src/FontLib/EOT/Header.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\BinaryStream' not found in wp-content/plugins/order-invoice-pdf-for-woocommerce/vendor/phenx/php-font-lib/src/FontLib/Glyph/Outline.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameReflower\\AbstractFrameReflower' not found in wp-content/plugins/order-invoice-pdf-for-woocommerce/vendor/dompdf/dompdf/src/FrameReflower/Page.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Table\\DirectoryEntry' not found in wp-content/plugins/order-invoice-pdf-for-woocommerce/vendor/phenx/php-font-lib/src/FontLib/TrueType/TableDirectoryEntry.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/order-invoice-pdf-for-woocommerce/vendor/dompdf/dompdf/src/FrameDecorator/Page.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Table\\Table' not found in wp-content/plugins/order-invoice-pdf-for-woocommerce/vendor/phenx/php-font-lib/src/FontLib/Table/Type/os2.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\RuleSet\\RuleSet' not found in wp-content/plugins/order-invoice-pdf-for-woocommerce/vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/DeclarationBlock.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\Renderer\\AbstractRenderer' not found in wp-content/plugins/order-invoice-pdf-for-woocommerce/vendor/dompdf/dompdf/src/Renderer.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\TrueType\\Header' not found in wp-content/plugins/order-invoice-pdf-for-woocommerce/vendor/phenx/php-font-lib/src/FontLib/WOFF/Header.php:16

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% 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: Please fix this invalid URI: ""
The official readme.txt is a good inspiration

order-invoice-pdf-for-woocommerce/wpe-wc-invoice-pdf.php 85% from 13 tests

This is the main PHP file of "Order Invoice PDF for WooCommerce" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("order-invoice-pdf-for-woocommerce.php" instead of "wpe-wc-invoice-pdf.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 163 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin48,244 lines of code in 221 files:
LanguageFilesBlank linesComment linesLines of code
PHP1898,25515,22134,486
CSS698717,712
SVG2002,959
JavaScript35822041,611
Markdown62550905
JSON700324
XML432185
YAML312245
HTML10017

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 652)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity35.89
▷ Minimum class complexity1.00
▷ Maximum class complexity765.00
Average method complexity4.39
▷ Minimum method complexity1.00
▷ Maximum method complexity652.00
Code structure
Namespaces32
Interfaces5
Traits0
Classes173
▷ Abstract classes126.94%
▷ Concrete classes16193.06%
▷ Final classes00.00%
Methods1,898
▷ Static methods824.32%
▷ Public methods1,61785.19%
▷ Protected methods1869.80%
▷ Private methods955.01%
Functions14
▷ Named functions17.14%
▷ Anonymous functions1392.86%
Constants158
▷ Global constants31.90%
▷ Class constants15598.10%
▷ Public constants155100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/invoice.png0.29KB0.25KB▼ 15.10%
vendor/dompdf/dompdf/lib/res/broken_image.png0.60KB0.47KB▼ 22.33%