72% flexible-invoices

Code Review | Flexible PDF Invoices for WooCommerce & WordPress

WordPress plugin Flexible PDF Invoices for WooCommerce & WordPress scored72%from 54 tests.

About plugin

  • Plugin page: flexible-invoices
  • Plugin version: 5.6.21
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.4
  • WordPress version: 6.3.1
  • First release: Aug 23, 2016
  • Latest release: Nov 16, 2023
  • Number of updates: 197
  • Update frequency: every 14.0 days
  • Top authors: wpdesk (80.2%)jablonowski (20.3%)

Code review

54 tests

User reviews

30 reviews

Install metrics

5,000+ active /148,574 total downloads

Benchmarks

Plugin footprint 83% 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 gracefully, with no errors

Server metrics [RAM: ▲0.56MB] [CPU: ▲5.17ms] Passed 4 tests

A check of server-side resources used by Flexible PDF Invoices for WooCommerce & WordPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.90 ▲0.4344.35 ▲3.45
Dashboard /wp-admin3.95 ▲0.6462.08 ▲13.07
Posts /wp-admin/edit.php3.98 ▲0.6357.85 ▲9.56
Add New Post /wp-admin/post-new.php6.54 ▲0.6589.17 ▲0.35
Media Library /wp-admin/upload.php3.77 ▲0.5441.92 ▲7.31
Settings /wp-admin/edit.php?post_type=inspire_invoice&page=invoices_settings3.8545.67
Reports /wp-admin/edit.php?post_type=inspire_invoice&page=flexible-invoices-reports-settings3.7941.67
Start Here /wp-admin/edit.php?post_type=inspire_invoice&page=wpdesk-marketing3.86324.80

Server storage [IO: ▲13.24MB] [DB: ▲0.02MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 1,272 new files
Database: no new tables, 28 new options
New WordPress options
can_compress_scripts
inspire_invoices_woocommerce_nip_label
inspire_invoices_correction_number_reset_type
inspire_invoices_invoice_start_number
inspire_invoices_default_values
inspire_invoices_woocommerce_add_invoice_ask_field
inspire_invoices_proforma_number_reset_type
inspire_invoices_correction_number_prefix
inspire_invoices_tax
widget_recent-comments
...

Browser metrics Passed 4 tests

A check of browser resources used by Flexible PDF Invoices for WooCommerce & WordPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,074 ▲31214.34 ▼0.001.82 ▼0.0141.92 ▼2.47
Dashboard /wp-admin2,476 ▲2996.21 ▲0.62120.32 ▲17.3191.43 ▲47.42
Posts /wp-admin/edit.php2,322 ▲2253.39 ▲1.3953.13 ▲13.4336.39 ▲1.28
Add New Post /wp-admin/post-new.php1,581 ▲4423.37 ▼1.88681.37 ▲42.0538.88 ▼38.39
Media Library /wp-admin/upload.php1,456 ▲594.22 ▼0.0384.57 ▼21.8844.13 ▼0.79
Settings /wp-admin/edit.php?post_type=inspire_invoice&page=invoices_settings1,4234.1566.3630.80
Reports /wp-admin/edit.php?post_type=inspire_invoice&page=flexible-invoices-reports-settings1,2414.0852.6626.86
Start Here /wp-admin/edit.php?post_type=inspire_invoice&page=wpdesk-marketing1,6393.7759.29105.76

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options detected upon uninstall: 28 options
    • inspire_invoices_correction_number_reset_type
    • inspire_invoices_currency
    • widget_recent-comments
    • widget_theysaidso_widget
    • inspire_invoices_invoice_number_prefix
    • plugin_activation_flexible-invoices/flexible-invoices.php
    • inspire_invoices_proforma_number_suffix
    • inspire_invoices_woocommerce_nip_label
    • inspire_invoices_woocommerce_add_invoice_ask_field
    • inspire_invoices_proforma_number_prefix
    • ...

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 13× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/flexible-invoices/vendor_prefixed/wpdesk/flexible-invoices-core/templates/settings/invoice-template/row-close.php
    • > /wp-content/plugins/flexible-invoices/vendor_prefixed/wpdesk/wp-wpdesk-marketing/src/Boxes/Views/row_open.php
    • > /wp-content/plugins/flexible-invoices/vendor_prefixed/wpdesk/flexible-invoices-core/templates/settings/footer.php
    • > /wp-content/plugins/flexible-invoices/vendor_prefixed/wpdesk/flexible-invoices-core/templates/settings/woocommerce/form-end.php
    • > /wp-content/plugins/flexible-invoices/vendor_prefixed/wpdesk/wp-forms/templates/form-end.php
    • > /wp-content/plugins/flexible-invoices/vendor_prefixed/wpdesk/flexible-invoices-core/templates/settings/invoice-template/col.php
    • > /wp-content/plugins/flexible-invoices/vendor_prefixed/wpdesk/flexible-invoices-core/templates/settings/invoice-template/row-open.php
    • > /wp-content/plugins/flexible-invoices/vendor_prefixed/wpdesk/wp-wpdesk-marketing/src/Boxes/Views/all.php
    • > /wp-content/plugins/flexible-invoices/vendor_prefixed/wpdesk/flexible-invoices-core/templates/settings/menu.php
    • > /wp-content/plugins/flexible-invoices/vendor_prefixed/wpdesk/flexible-invoices-core/templates/settings/sub-end.php
  • 725× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WPDeskFIVendor\\WPDesk\\Forms\\Field\\BasicField' not found in wp-content/plugins/flexible-invoices/vendor_prefixed/wpdesk/wp-forms/src/Field/WyswigField.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'WPDeskFIVendor\\WPDesk\\Beacon\\BeaconShouldShowStrategy' not found in wp-content/plugins/flexible-invoices/vendor_prefixed/wpdesk/flexible-invoices-core/src/Invoices/Beacon/BeaconShowStrategy.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'WPDeskFIVendor\\WPDesk\\PluginBuilder\\Plugin\\Hookable' not found in wp-content/plugins/flexible-invoices/vendor_prefixed/wpdesk/flexible-invoices-core/src/Invoices/WooCommerce/Order/DeleteDocumentRelation.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WPDeskFIVendor\\Monolog\\Handler\\Handler' not found in wp-content/plugins/flexible-invoices/vendor_prefixed/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php:40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/flexible-invoices/vendor_prefixed/wpdesk/flexible-invoices-core/templates/settings/tax-rates/form-start.php:10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/flexible-invoices/vendor_prefixed/wpdesk/wp-wpdesk-marketing/src/Boxes/Views/video.php on line 19
    • > PHP Fatal error
      Uncaught Error: Class 'WPDeskFIVendor\\WPDesk\\Forms\\Field\\BasicField' not found in wp-content/plugins/flexible-invoices/vendor_prefixed/wpdesk/flexible-invoices-core/src/Invoices/Settings/Fields/GroupedFields.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WPDeskFIVendor\\setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/flexible-invoices/vendor_prefixed/setasign/fpdi/src/PdfParser/Type/PdfName.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WPDeskFIVendor\\WPDesk\\Library\\FlexibleInvoicesCore\\Settings\\Tabs\\FieldSettingsTab' not found in wp-content/plugins/flexible-invoices/vendor_prefixed/wpdesk/flexible-invoices-core/src/Invoices/Settings/Tabs/InvoiceTemplate.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'WPDeskFIVendor\\Mpdf\\Tag\\Tag' not found in wp-content/plugins/flexible-invoices/vendor_prefixed/mpdf/mpdf/src/Tag/Option.php:6

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
    • > GET request to /wp-admin/edit.php?post_type=inspire_invoice&page=flexible-invoices-reports-settings
    • > Rendering (warning) in unknown
    /wp-admin/edit.php?post_type=inspire_invoice&page=flexible-invoices-reports-settings 179 The specified value "yes" does not conform to the required format, "yyyy-MM-dd".
    • > GET request to /wp-admin/edit.php?post_type=inspire_invoice&page=flexible-invoices-reports-settings
    • > Rendering (warning) in unknown
    /wp-admin/edit.php?post_type=inspire_invoice&page=flexible-invoices-reports-settings 194 The specified value "yes" does not conform to the required format, "yyyy-MM-dd".

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: woocommerce invoices, woocommerce pdf invoices, eu vat, invoice, vat invoice

flexible-invoices/flexible-invoices.php 85% from 13 tests

The main file in "Flexible PDF Invoices for WooCommerce & WordPress" v. 5.6.21 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 331 characters long)
  • Requires at least: The required version number must match the one declared in readme.txt ("5.0" instead of "5.8")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected110,103 lines of code in 1,117 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,0392,72634,390102,968
JavaScript176141,0222,974
CSS295351132,710
JSON30001,426
Markdown25025

PHP code 0% from 2 tests

A short review of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 7,012)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 460)
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity25.39
▷ Minimum class complexity1.00
▷ Maximum class complexity7,012.00
Average method complexity6.09
▷ Minimum method complexity1.00
▷ Maximum method complexity460.00
Code structure
Namespaces139
Interfaces95
Traits20
Classes705
▷ Abstract classes324.54%
▷ Concrete classes67395.46%
▷ Final classes497.28%
Methods4,328
▷ Static methods3387.81%
▷ Public methods3,60783.34%
▷ Protected methods2826.52%
▷ Private methods43910.14%
Functions88
▷ Named functions2326.14%
▷ Anonymous functions6573.86%
Constants683
▷ Global constants60.88%
▷ Class constants67799.12%
▷ Public constants65096.01%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
7 PNG files occupy 0.11MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/flexibleshipping.com.png5.63KB3.68KB▼ 34.58%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/logo@2x.png4.17KB4.47KB0.00%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/wpdesk.pl.png2.36KB2.43KB0.00%
vendor_prefixed/wpdesk/wp-wpdesk-marketing/assets/owl-slider/owl.video.play.png4.86KB2.74KB▼ 43.61%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/octolize.com.png88.91KB39.07KB▼ 56.06%