78% qr-code-payment

Code Review | QR Code Payment

WordPress plugin QR Code Payment scored 78% from 54 tests.

About plugin

  • Plugin page: qr-code-payment
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.2
  • WordPress version: 5.9.2
  • First release: Nov 7, 2019
  • Latest release: Nov 13, 2019
  • Number of updates: 26
  • Update frequency: every 0.7 days
  • Top authors: blueservices (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 622 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.16MB] [CPU: ▼320.22ms] Passed 4 tests

A check of server-side resources used by QR Code Payment
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2268.33 ▲4.39
Dashboard /wp-admin3.57 ▲0.1635.13 ▲0.26
Posts /wp-admin/edit.php3.79 ▲0.1541.03 ▲1.03
Add New Post /wp-admin/post-new.php7.09 ▲0.1294.96 ▼1,283.56
Media Library /wp-admin/upload.php3.51 ▲0.2127.16 ▲1.40
QRCode Payment /wp-admin/admin.php?page=woo-subpage-qrcode3.4174.82

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 603 new files
Database: no new tables, 2 new options
New WordPress options
bs_qrcode_promotion_text
bs_qrcode_title

Browser metrics Passed 4 tests

A check of browser resources used by QR Code Payment
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,765 ▲1115.77 ▲0.076.31 ▲0.372.25 ▼0.63
Dashboard /wp-admin2,895 ▲516.10 ▼0.03127.16 ▼16.65158.90 ▼54.12
Posts /wp-admin/edit.php2,685 ▼93.24 ▲0.0162.02 ▼3.06147.18 ▲4.50
Add New Post /wp-admin/post-new.php1,687 ▲2619.68 ▲4.17411.51 ▼12.33170.45 ▼4.52
Media Library /wp-admin/upload.php1,698 ▲45.45 ▼0.09146.54 ▼38.12202.20 ▲15.56
QRCode Payment /wp-admin/admin.php?page=woo-subpage-qrcode1,0612.3856.39103.93

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled successfully, without leaving any zombie files or tables

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
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 16× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/qr-code-payment/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/cookie_samesite_lax.php
    • > /wp-content/plugins/qr-code-payment/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/empty_destroys.php
    • > /wp-content/plugins/qr-code-payment/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/cookie_samesite_strict.php
    • > /wp-content/plugins/qr-code-payment/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/storage.php
    • > /wp-content/plugins/qr-code-payment/qrcode-payment.php
    • > /wp-content/plugins/qr-code-payment/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_cookie.php
    • > /wp-content/plugins/qr-code-payment/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/invalid_cookie_name.php
    • > /wp-content/plugins/qr-code-payment/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite.php
    • > /wp-content/plugins/qr-code-payment/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/cookie_urlencode.php
    • > /wp-content/plugins/qr-code-payment/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/regenerate.php
  • 311× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\PropertyAccess\\Exception\\ExceptionInterface' not found in wp-content/plugins/qr-code-payment/vendor/symfony/property-access/Exception/OutOfBoundsException.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\HttpFoundation\\File\\Exception\\FileException' not found in wp-content/plugins/qr-code-payment/vendor/symfony/http-foundation/File/Exception/CannotWriteFileException.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/qr-code-payment/vendor/symfony/http-foundation/Tests/Session/Storage/MockFileSessionStorageTest.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Mime\\Header\\AbstractHeader' not found in wp-content/plugins/qr-code-payment/vendor/symfony/mime/Header/MailboxHeader.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Zxing\\LuminanceSource' not found in wp-content/plugins/qr-code-payment/vendor/khanamiryan/qrcode-detector-decoder/lib/RGBLuminanceSource.php:27
    • > PHP Fatal error
      Uncaught Error: Interface 'BaconQrCode\\Renderer\\Module\\ModuleInterface' not found in wp-content/plugins/qr-code-payment/vendor/bacon/bacon-qr-code/src/Renderer/Module/DotsModule.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\HttpFoundation\\Response' not found in wp-content/plugins/qr-code-payment/vendor/symfony/http-foundation/BinaryFileResponse.php:26
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\HttpFoundation\\Exception\\RequestExceptionInterface' not found in wp-content/plugins/qr-code-payment/vendor/symfony/http-foundation/Exception/ConflictingHeadersException.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Mime\\Tests\\AbstractMimeTypeGuesserTest' not found in wp-content/plugins/qr-code-payment/vendor/symfony/mime/Tests/FileinfoMimeTypeGuesserTest.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\HttpFoundation\\Tests\\ResponseTestCase' not found in wp-content/plugins/qr-code-payment/vendor/symfony/http-foundation/Tests/ResponseTest.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: qrcode payment, payment, qrcode

qr-code-payment/qrcode-payment.php 85% from 13 tests

The primary PHP file in "QR Code Payment" version 1.0.1 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("qr-code-payment.php" instead of "qrcode-payment.php")
  • 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

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Please make sure to remedy the following
  • For security reasons, never distribute binary or executable files with your plugin
    • .xlsm - Excel Macro-Enabled Workbook in Microsoft Excel
      • wp-content/plugins/qr-code-payment/vendor/symfony/http-foundation/Tests/File/Fixtures/case-sensitive-mime-type.xlsm
48,921 lines of code in 542 files:
LanguageFilesBlank linesComment linesLines of code
PHP4849,84616,04146,106
JSON17001,387
Markdown222450838
XML11363410
Pascal2417479
YAML422071
PO File1121326
CSS1004

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity8.96
▷ Minimum class complexity1.00
▷ Maximum class complexity219.00
Average method complexity2.11
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces85
Interfaces37
Traits0
Classes437
▷ Abstract classes194.35%
▷ Concrete classes41895.65%
▷ Final classes14935.65%
Methods3,605
▷ Static methods3058.46%
▷ Public methods3,17988.18%
▷ Protected methods1684.66%
▷ Private methods2587.16%
Functions280
▷ Named functions7225.71%
▷ Anonymous functions20874.29%
Constants309
▷ Global constants4414.24%
▷ Class constants26585.76%
▷ Public constants16361.51%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/endroid/qr-code/assets/images/symfony.png15.90KB16.60KB0.00%
vendor/khanamiryan/qrcode-detector-decoder/tests/qrcodes/hello_world.png3.05KB0.24KB▼ 92.25%