78% link-qr-code

Code Review | Link QR Code

WordPress plugin Link QR Code scored78%from 54 tests.

About plugin

  • Plugin page: link-qr-code
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.5.1
  • WordPress version: 6.3.1
  • First release: Sep 6, 2020
  • Latest release: Sep 6, 2020
  • Number of updates: 2
  • Update frequency: every 1.5 days
  • Top authors: qarib (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /693 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.27MB] [CPU: ▼0.50ms] Passed 4 tests

An overview of server-side resources used by Link QR Code
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2941.97 ▲0.80
Dashboard /wp-admin3.59 ▲0.2853.85 ▲1.83
Posts /wp-admin/edit.php3.64 ▲0.2851.50 ▲0.84
Add New Post /wp-admin/post-new.php7.24 ▲1.35110.34 ▲17.61
Media Library /wp-admin/upload.php3.45 ▲0.2236.76 ▼5.49
QR Code Settings /wp-admin/options-general.php?page=sqhrqrcsp-settings3.4541.50

Server storage [IO: ▲18.59MB] [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: 461 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
sqhrqrcsp_settings
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Link QR Code: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5713.91 ▼0.331.89 ▲0.2440.16 ▼3.09
Dashboard /wp-admin2,199 ▲195.66 ▲0.0684.43 ▼11.3037.09 ▼4.01
Posts /wp-admin/edit.php2,101 ▲11.96 ▼0.0436.40 ▼2.4234.96 ▼8.09
Add New Post /wp-admin/post-new.php6,223 ▲4,69725.89 ▲2.81865.81 ▲214.4663.02 ▼1.37
Media Library /wp-admin/upload.php1,401 ▲44.25 ▼0.01102.00 ▼26.5542.13 ▼5.38
QR Code Settings /wp-admin/options-general.php?page=sqhrqrcsp-settings1,1264.2771.0627.47

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
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • sqhrqrcsp_settings
    • theysaidso_admin_options
    • can_compress_scripts

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)
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/link-qr-code/views/metabox-qrcode.php
    • > /wp-content/plugins/link-qr-code/vendor/wp-user-manager/wp-optionskit/includes/views/settings-page.php
  • 231× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/link-qr-code/vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/link-qr-code/vendor/bacon/bacon-qr-code/test/Common/BitMatrixTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/link-qr-code/vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/link-qr-code/vendor/composer/installers/src/Composer/Installers/TaoInstaller.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Endroid\\QrCode\\QrCodeInterface' not found in wp-content/plugins/link-qr-code/vendor/endroid/qr-code/src/QrCode.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\PropertyInfo\\PropertyListExtractorInterface' not found in wp-content/plugins/link-qr-code/vendor/symfony/property-info/Extractor/ReflectionExtractor.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/link-qr-code/vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Endroid\\QrCode\\Writer\\AbstractWriter' not found in wp-content/plugins/link-qr-code/vendor/endroid/qr-code/src/Writer/FpdfWriter.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'BaconQrCode\\Renderer\\Eye\\EyeInterface' not found in wp-content/plugins/link-qr-code/vendor/bacon/bacon-qr-code/src/Renderer/Eye/CompositeEye.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/link-qr-code/vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: qr, qrcode, scan, link

link-qr-code/sqhr-link-qr-code.php 85% from 13 tests

"Link QR Code" version 1.0.1'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:
  • Main file name: The principal plugin file should be the same as the plugin slug ("link-qr-code.php" instead of "sqhr-link-qr-code.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 Passed 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 plugin39,593 lines of code in 423 files:
LanguageFilesBlank linesComment linesLines of code
PHP3715,6138,94636,772
JSON19002,006
Markdown232370708
XML43061
YAML22038
JavaScript30177
CSS1011

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity10.24
▷ Minimum class complexity1.00
▷ Maximum class complexity153.00
Average method complexity3.02
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces53
Interfaces31
Traits0
Classes321
▷ Abstract classes123.74%
▷ Concrete classes30996.26%
▷ Final classes12038.83%
Methods1,662
▷ Static methods25815.52%
▷ Public methods1,38183.09%
▷ Protected methods492.95%
▷ Private methods23213.96%
Functions122
▷ Named functions8569.67%
▷ Anonymous functions3730.33%
Constants232
▷ Global constants125.17%
▷ Class constants22094.83%
▷ Public constants12054.55%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.19MB with 0.11MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/khanamiryan/qrcode-detector-decoder/tests/qrcodes/hello_world.png3.05KB0.24KB▼ 92.25%
assets/screenshot-1.png128.64KB35.78KB▼ 72.19%
assets/screenshot-2.png47.28KB11.35KB▼ 76.00%
vendor/endroid/qr-code/assets/images/symfony.png15.90KB16.60KB0.00%