77% jim-soft-swiss-qr-invoice

Code Review | Jim Soft Swiss QR Invoice

WordPress plugin Jim Soft Swiss QR Invoice scored77%from 54 tests.

About plugin

  • Plugin page: jim-soft-swiss-qr...
  • Plugin version: 1.2.6
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2
  • WordPress version: 6.3.1
  • First release: Dec 9, 2021
  • Latest release: Oct 16, 2023
  • Number of updates: 46
  • Update frequency: every 14.8 days
  • Top authors: jimsoft (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

200+ active /2,939 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲6.90MB] [CPU: ▲26.97ms] 75% from 4 tests

Analyzing server-side resources used by Jim Soft Swiss QR Invoice
Please fix the following
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 6.90MB on /wp-admin/upload.php)
PageMemory (MB)CPU Time (ms)
Home /10.59 ▲7.1271.56 ▲30.96
Dashboard /wp-admin10.61 ▲7.3075.92 ▲23.49
Posts /wp-admin/edit.php10.61 ▲7.2587.85 ▲39.42
Add New Post /wp-admin/post-new.php11.82 ▲5.94116.49 ▲15.44
Media Library /wp-admin/upload.php10.61 ▲7.3870.27 ▲37.97

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 130 new files
Database: no new tables, 27 new options
New WordPress options
jimsoft-qr-bill_creditor_city
jimsoft-qr-bill_pdf_date_x
jimsoft-qr-bill_pdf_color_primary
jimsoft-qr-bill_pdf_font_size
jimsoft-qr-bill_creditor_street
jimsoft-qr-bill_pdf_address_x
jimsoft-qr-bill_pdf_creditor_x
db_upgraded
jimsoft-qr-bill_pdf_table_cellpadding
can_compress_scripts
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Jim Soft Swiss QR Invoice
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.24 ▼0.351.59 ▲0.0139.18 ▼3.68
Dashboard /wp-admin2,199 ▲225.56 ▼0.0785.53 ▼13.6940.81 ▼3.12
Posts /wp-admin/edit.php2,104 ▲42.01 ▲0.0539.10 ▲4.1135.72 ▼1.99
Add New Post /wp-admin/post-new.php1,534 ▲822.91 ▼0.58678.20 ▲1.0352.42 ▼6.79
Media Library /wp-admin/upload.php1,404 ▲14.17 ▼0.0195.78 ▼3.6443.32 ▼2.19

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 27 options in the database
    • jimsoft-qr-bill_creditor_zip
    • jimsoft-qr-bill_pdf_address_y
    • jimsoft-qr-bill_pdf_order_details
    • jimsoft-qr-bill_pdf_date_x
    • jimsoft-qr-bill_creditor_company
    • jimsoft-qr-bill_pdf_address
    • jimsoft-qr-bill_pdf_date
    • jimsoft-qr-bill_pdf_logo_w
    • theysaidso_admin_options
    • jimsoft-qr-bill_pdf_address_x
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/jim-soft-swiss-qr-invoice/admin/partials/jimsoft-qr-bill-admin-display.php
    • > /wp-content/plugins/jim-soft-swiss-qr-invoice/includes/tcpdf_min/tools/tcpdf_addfont.php
  • 151× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Sprain\\SwissQrBill\\DataGroup\\QrCodeableInterface' not found in wp-content/plugins/jim-soft-swiss-qr-invoice/includes/swiss-qr-bill/src/DataGroup/Element/PaymentAmountInformation.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Sprain\\SwissQrBill\\PaymentPart\\Output\\AbstractOutput' not found in wp-content/plugins/jim-soft-swiss-qr-invoice/includes/swiss-qr-bill/src/PaymentPart/Output/HtmlOutput/HtmlOutput.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\OptionsResolver\\Exception\\InvalidArgumentException' not found in wp-content/plugins/jim-soft-swiss-qr-invoice/includes/swiss-qr-bill/vendor/symfony/options-resolver/Exception/UndefinedOptionsException.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'DASPRiD\\Enum\\Exception\\ExceptionInterface' not found in wp-content/plugins/jim-soft-swiss-qr-invoice/includes/swiss-qr-bill/vendor/dasprid/enum/src/Exception/IllegalArgumentException.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Sprain\\SwissQrBill\\DataGroup\\AddressInterface' not found in wp-content/plugins/jim-soft-swiss-qr-invoice/includes/swiss-qr-bill/src/DataGroup/Element/CombinedAddress.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Sprain\\SwissQrBill\\DataGroup\\QrCodeableInterface' not found in wp-content/plugins/jim-soft-swiss-qr-invoice/includes/swiss-qr-bill/src/DataGroup/Element/Header.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Endroid\\QrCode\\Exception\\QrCodeException' not found in wp-content/plugins/jim-soft-swiss-qr-invoice/includes/swiss-qr-bill/vendor/endroid/qr-code/src/Exception/InvalidWriterException.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\PropertyInfo\\PropertyTypeExtractorInterface' not found in wp-content/plugins/jim-soft-swiss-qr-invoice/includes/swiss-qr-bill/vendor/symfony/property-info/Extractor/PhpStanExtractor.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'Endroid\\QrCode\\Exception\\QrCodeException' not found in wp-content/plugins/jim-soft-swiss-qr-invoice/includes/swiss-qr-bill/vendor/endroid/qr-code/src/Exception/UnsupportedExtensionException.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/jim-soft-swiss-qr-invoice/includes/swiss-qr-bill/vendor/endroid/qr-code/tests/QrCodeTest.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: qr, invoice, woocommerce

jim-soft-swiss-qr-invoice/jimsoft-qr-bill.php 85% from 13 tests

"Jim Soft Swiss QR Invoice" version 1.2.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important 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: Name the main plugin file the same as the plugin slug ("jim-soft-swiss-qr-invoice.php" instead of "jimsoft-qr-bill.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin87,720 lines of code in 428 files:
LanguageFilesBlank linesComment linesLines of code
PHP3617,33120,65883,839
JSON22102,015
Markdown263140877
PO File3270315669
XML57290
SVG40486
JavaScript3123973
YAML313071
CSS1040

PHP code 0% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 4,382)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 504)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity31.02
▷ Minimum class complexity1.00
▷ Maximum class complexity4,382.00
Average method complexity5.19
▷ Minimum method complexity1.00
▷ Maximum method complexity504.00
Code structure
Namespaces71
Interfaces36
Traits0
Classes282
▷ Abstract classes103.55%
▷ Concrete classes27296.45%
▷ Final classes15356.25%
Methods2,362
▷ Static methods39416.68%
▷ Public methods1,76874.85%
▷ Protected methods30412.87%
▷ Private methods29012.28%
Functions182
▷ Named functions15384.07%
▷ Anonymous functions2915.93%
Constants420
▷ Global constants12429.52%
▷ Class constants29670.48%
▷ Public constants14448.65%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
6 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/swiss-qr-bill/assets/marks_40x15mm.png2.63KB0.32KB▼ 87.97%
includes/swiss-qr-bill/assets/marks_65x25mm.png3.34KB0.39KB▼ 88.28%
includes/swiss-qr-bill/assets/swiss-cross.optimized.png0.12KB0.13KB0.00%
includes/swiss-qr-bill/assets/marks_30x10mm.png2.35KB0.28KB▼ 88.19%
includes/swiss-qr-bill/assets/marks_52x20mm.png3.01KB0.35KB▼ 88.41%