78% invoice-payment-for-woocommerce

Code Review | Invoice Payment for WooCommerce

WordPress plugin Invoice Payment for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: invoice-payment-f...
  • Plugin version: 1.3.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.3
  • WordPress version: 6.3.1
  • First release: Jun 2, 2022
  • Latest release: Nov 6, 2023
  • Number of updates: 33
  • Update frequency: every 15.8 days
  • Top authors: linknacional (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,218 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.45MB] [CPU: ▼7.23ms] Passed 4 tests

This is a short check of server-side resources used by Invoice Payment for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.95 ▲0.4839.34 ▲0.32
Dashboard /wp-admin3.79 ▲0.4950.87 ▼0.14
Posts /wp-admin/edit.php3.84 ▲0.4851.16 ▲2.18
Add New Post /wp-admin/post-new.php6.31 ▲0.4382.38 ▼28.98
Media Library /wp-admin/upload.php3.65 ▲0.4237.09 ▼0.10

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 354 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Invoice Payment for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲5514.34 ▼0.011.77 ▲0.1638.62 ▼6.41
Dashboard /wp-admin2,207 ▲335.51 ▼0.0784.50 ▼0.9240.42 ▲3.99
Posts /wp-admin/edit.php2,116 ▲131.97 ▲0.0341.18 ▲1.1040.06 ▲0.08
Add New Post /wp-admin/post-new.php1,547 ▲1125.07 ▲1.97681.51 ▼115.7178.08 ▲25.73
Media Library /wp-admin/upload.php1,412 ▲154.24 ▲0.0398.80 ▼19.4142.13 ▼6.16

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/invoice-payment-for-woocommerce/includes/libs/dompdf/vendor/masterminds/html5/bin/entities.php
    • > /wp-content/plugins/invoice-payment-for-woocommerce/public/partials/wc-invoice-payment-public-display.php
    • > /wp-content/plugins/invoice-payment-for-woocommerce/admin/partials/wc-invoice-payment-admin-display.php
  • 138× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\Block' not found in wp-content/plugins/invoice-payment-for-woocommerce/includes/libs/dompdf/vendor/dompdf/dompdf/src/FrameDecorator/TableCell.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\BinaryStream' not found in wp-content/plugins/invoice-payment-for-woocommerce/includes/libs/dompdf/vendor/phenx/php-font-lib/src/FontLib/Glyph/Outline.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\Shape' not found in wp-content/plugins/invoice-payment-for-woocommerce/includes/libs/dompdf/vendor/phenx/php-svg-lib/src/Svg/Tag/Polygon.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\Positioner\\AbstractPositioner' not found in wp-content/plugins/invoice-payment-for-woocommerce/includes/libs/dompdf/vendor/dompdf/dompdf/src/Positioner/Absolute.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Sabberworm\\CSS\\Renderable' not found in wp-content/plugins/invoice-payment-for-woocommerce/includes/libs/dompdf/vendor/sabberworm/php-css-parser/src/Comment/Comment.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\Value\\CSSFunction' not found in wp-content/plugins/invoice-payment-for-woocommerce/includes/libs/dompdf/vendor/sabberworm/php-css-parser/src/Value/Color.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\Value\\Value' not found in wp-content/plugins/invoice-payment-for-woocommerce/includes/libs/dompdf/vendor/sabberworm/php-css-parser/src/Value/ValueList.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/invoice-payment-for-woocommerce/includes/libs/dompdf/vendor/dompdf/dompdf/src/FrameDecorator/TableRowGroup.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\Shape' not found in wp-content/plugins/invoice-payment-for-woocommerce/includes/libs/dompdf/vendor/phenx/php-svg-lib/src/Svg/Tag/Circle.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\Positioner\\AbstractPositioner' not found in wp-content/plugins/invoice-payment-for-woocommerce/includes/libs/dompdf/vendor/dompdf/dompdf/src/Positioner/NullPositioner.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
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
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (Add new invoice utilizing our convenient invoice builder;), #2 (Get an URL for your client to pay;), #3 (See all generated invoices and their status.)
Please take inspiration from this readme.txt

invoice-payment-for-woocommerce/wc-invoice-payment.php 85% from 13 tests

The main PHP file in "Invoice Payment for WooCommerce" ver. 1.3.1 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("invoice-payment-for-woocommerce.php" instead of "wc-invoice-payment.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected51,826 lines of code in 271 files:
LanguageFilesBlank linesComment linesLines of code
PHP2279,67418,40244,628
JSON19004,632
Markdown1342201,367
CSS619750868
JavaScript24436171
PO File1491100
YAML19035
HTML10017
SVG1008

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity31.56
▷ Minimum class complexity1.00
▷ Maximum class complexity811.00
Average method complexity3.92
▷ Minimum method complexity1.00
▷ Maximum method complexity98.00
Code structure
Namespaces37
Interfaces9
Traits0
Classes213
▷ Abstract classes125.63%
▷ Concrete classes20194.37%
▷ Final classes94.48%
Methods2,396
▷ Static methods2018.39%
▷ Public methods1,91179.76%
▷ Protected methods42117.57%
▷ Private methods642.67%
Functions43
▷ Named functions818.60%
▷ Anonymous functions3581.40%
Constants252
▷ Global constants3815.08%
▷ Class constants21484.92%
▷ Public constants20997.66%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and 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
includes/libs/dompdf/vendor/dompdf/dompdf/lib/res/broken_image.png0.60KB0.47KB▼ 22.33%