10% swiss-qr-bill

Code Review | Swiss QR Bill

WordPress plugin Swiss QR Bill scored 10% from 54 tests.

About plugin

  • Plugin page: swiss-qr-bill
  • Plugin version: 1.2.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-5.8
  • WordPress version: 6.3.1
  • First release: Jun 25, 2020
  • Latest release: May 31, 2022
  • Number of updates: 18
  • Update frequency: every 39.2 days
  • Top authors: hostbliss (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active / 3,637 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • Install procedure had errors
    • > User error in wp-content/plugins/swiss-qr-bill/includes/class-wc-swiss-qr-bill-activator.php+27

Server metrics [RAM: ▲0.08MB] [CPU: ▼7.22ms] Passed 4 tests

A check of server-side resources used by Swiss QR Bill
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0936.02 ▼3.33
Dashboard /wp-admin3.39 ▲0.0846.87 ▼5.70
Posts /wp-admin/edit.php3.50 ▲0.1447.07 ▼5.65
Add New Post /wp-admin/post-new.php5.97 ▲0.0884.91 ▼14.18
Media Library /wp-admin/upload.php3.31 ▲0.0835.88 ▼0.14

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 2,045 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Swiss QR Bill
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲6013.24 ▼1.111.54 ▼0.2942.16 ▲1.69
Dashboard /wp-admin2,223 ▲354.85 ▼1.06110.14 ▼3.4738.78 ▼9.46
Posts /wp-admin/edit.php2,108 ▲192.05 ▼0.0042.07 ▲0.9136.14 ▼0.33
Add New Post /wp-admin/post-new.php1,540 ▲323.32 ▲0.16647.19 ▼48.6454.70 ▼1.18
Media Library /wp-admin/upload.php1,408 ▲204.21 ▲0.07103.97 ▼12.8443.83 ▼5.46

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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 fix the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/swiss-qr-bill/includes/gateway/vendor/symfony/intl/Resources/bin/update-data.php
    • > /wp-content/plugins/swiss-qr-bill/includes/tcpdf/tools/tcpdf_addfont.php
  • 401× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Validator\\Constraint' not found in wp-content/plugins/swiss-qr-bill/includes/gateway/vendor/symfony/validator/Constraints/Isbn.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Validator\\Constraints\\LessThan' not found in wp-content/plugins/swiss-qr-bill/includes/gateway/vendor/symfony/validator/Constraints/Negative.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Intl\\DateFormatter\\DateFormat\\Transformer' not found in wp-content/plugins/swiss-qr-bill/includes/gateway/vendor/symfony/intl/DateFormatter/DateFormat/HourTransformer.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'BaconQrCode\\Exception\\ExceptionInterface' not found in wp-content/plugins/swiss-qr-bill/includes/gateway/vendor/bacon/bacon-qr-code/src/Exception/WriterException.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Validator\\ConstraintValidator' not found in wp-content/plugins/swiss-qr-bill/includes/gateway/vendor/symfony/validator/Constraints/AtLeastOneOfValidator.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Validator\\ConstraintValidator' not found in wp-content/plugins/swiss-qr-bill/includes/gateway/vendor/symfony/validator/Constraints/ExpressionValidator.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Sprain\\SwissQrBill\\PaymentPart\\Output\\AbstractOutput' not found in wp-content/plugins/swiss-qr-bill/includes/gateway/vendor/sprain/swiss-qr-bill/src/PaymentPart/Output/HtmlOutput/HtmlOutput.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\String\\AbstractString' not found in wp-content/plugins/swiss-qr-bill/includes/gateway/vendor/symfony/string/AbstractUnicodeString.php:29
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Intl\\Exception\\ExceptionInterface' not found in wp-content/plugins/swiss-qr-bill/includes/gateway/vendor/symfony/intl/Exception/OutOfBoundsException.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Validator\\Constraints\\AbstractComparison' not found in wp-content/plugins/swiss-qr-bill/includes/gateway/vendor/symfony/validator/Constraints/GreaterThan.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: There are too many tags (11 tag instead of maximum 10)
  • Donate link: Invalid url: ""
Please take inspiration from this readme.txt

swiss-qr-bill/swiss-qr-bill.php 92% from 13 tests

Analyzing the main PHP file in "Swiss QR Bill" version 1.2.4
It is important to fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.6" instead of "2.6")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin456,253 lines of code in 1,900 files:
LanguageFilesBlank linesComment linesLines of code
JSON1,13900336,503
PHP67811,58831,01597,306
XML521020,188
PO File54907051,348
Markdown221660669
XSD1180142
JavaScript1201580
Bourne Again Shell12011
CSS1006

PHP code 0% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
The following items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 4,380)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 502)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity19.24
▷ Minimum class complexity1.00
▷ Maximum class complexity4,380.00
Average method complexity4.47
▷ Minimum method complexity1.00
▷ Maximum method complexity502.00
Code structure
Namespaces100
Interfaces63
Traits6
Classes559
▷ Abstract classes407.16%
▷ Concrete classes51992.84%
▷ Final classes13325.63%
Methods3,505
▷ Static methods56516.12%
▷ Public methods2,69977.00%
▷ Protected methods41111.73%
▷ Private methods39511.27%
Functions231
▷ Named functions16370.56%
▷ Anonymous functions6829.44%
Constants853
▷ Global constants12815.01%
▷ Class constants72584.99%
▷ Public constants58480.55%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/tcpdf/asset/scissor-left-right.png9.44KB6.58KB▼ 30.25%
includes/tcpdf/asset/scissor-up-down.png12.38KB7.96KB▼ 35.71%
includes/gateway/vendor/sprain/swiss-qr-bill/assets/swiss-cross.optimized.png0.12KB0.13KB0.00%