84% qr-coder

Code Review | QR Coder

WordPress plugin QR Coder scored84%from 54 tests.

About plugin

  • Plugin page: qr-coder
  • Plugin version: 2.0.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8
  • WordPress version: 6.3.1
  • First release: Feb 4, 2018
  • Latest release: Nov 27, 2021
  • Number of updates: 6
  • Update frequency: every 241.8 days
  • Top authors: matmattia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /396 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.01MB] [CPU: ▼15.92ms] Passed 4 tests

Server-side resources used by QR Coder
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0039.56 ▼2.22
Dashboard /wp-admin3.31 ▲0.0148.09 ▼15.89
Posts /wp-admin/edit.php3.36 ▲0.0149.84 ▼9.75
Add New Post /wp-admin/post-new.php5.89 ▲0.0188.60 ▼35.83
Media Library /wp-admin/upload.php3.24 ▲0.0137.84 ▼1.05

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 113 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by QR Coder
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.23 ▼1.181.81 ▲0.0743.48 ▲4.85
Dashboard /wp-admin2,206 ▲304.88 ▲0.02100.51 ▼51.1839.21 ▼21.04
Posts /wp-admin/edit.php2,086 ▼62.05 ▲0.0037.15 ▼22.1232.24 ▼18.70
Add New Post /wp-admin/post-new.php1,514 ▼717.54 ▼5.67672.59 ▼173.7761.35 ▼5.44
Media Library /wp-admin/upload.php1,382 ▼64.23 ▼0.01101.32 ▼10.1043.75 ▼4.82

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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 take a closer look at the following
  • 62× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/qr-coder/inc/vendor/chillerlan/php-settings-container/examples/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/qr-coder/inc/vendor/chillerlan/php-settings-container/examples/simple.php on line 13
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/qr-coder/inc/vendor/chillerlan/php-qrcode/tests/Helpers/PolynomialTest.php:22
    • > PHP Warning
      require_once(wp-content/plugins/qr-coder/inc/vendor/chillerlan/php-settings-container/examples/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/qr-coder/inc/vendor/chillerlan/php-settings-container/examples/simple.php on line 13
    • > PHP Fatal error
      require_once(): Failed opening required '../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/qr-coder/inc/vendor/chillerlan/php-qrcode/examples/html.php on line 15
    • > PHP Fatal error
      Uncaught Error: Class 'chillerlan\\Settings\\SettingsContainerAbstract' not found in wp-content/plugins/qr-coder/inc/vendor/chillerlan/php-qrcode/src/QROptions.php:52
    • > PHP Warning
      require_once(../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/qr-coder/inc/vendor/chillerlan/php-qrcode/public/qrcode.php on line 15
    • > PHP Warning
      require_once(wp-content/plugins/qr-coder/inc/vendor/chillerlan/php-qrcode/examples/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/qr-coder/inc/vendor/chillerlan/php-qrcode/examples/svg.php on line 15
    • > PHP Fatal error
      Uncaught Error: Class 'chillerlan\\QRCodeTest\\Output\\QROutputTestAbstract' not found in wp-content/plugins/qr-coder/inc/vendor/chillerlan/php-qrcode/tests/Output/QRImagickTest.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/qr-coder/inc/vendor/chillerlan/php-qrcode/tests/Data/DatainterfaceTestAbstract.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'chillerlan\\QRCode\\Output\\QROutputAbstract' not found in wp-content/plugins/qr-coder/inc/vendor/chillerlan/php-qrcode/src/Output/QRFpdf.php:30

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
1 plugin tags: qr code

qr-coder/qr_coder.php 92% from 13 tests

The main PHP script in "QR Coder" version 2.0.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("qr-coder.php" instead of "qr_coder.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin5,956 lines of code in 94 files:
LanguageFilesBlank linesComment linesLines of code
PHP761,9147,7945,091
JSON300255
Markdown3510224
YAML6469164
HTML1260137
XML30072
Dockerfile15210
Bourne Shell1203

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity8.07
▷ Minimum class complexity1.00
▷ Maximum class complexity77.00
Average method complexity2.47
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces15
Interfaces3
Traits4
Classes52
▷ Abstract classes59.62%
▷ Concrete classes4790.38%
▷ Final classes1634.04%
Methods291
▷ Static methods196.53%
▷ Public methods21573.88%
▷ Protected methods7224.74%
▷ Private methods41.37%
Functions5
▷ Named functions240.00%
▷ Anonymous functions360.00%
Constants51
▷ Global constants00.00%
▷ Class constants51100.00%
▷ Public constants4486.27%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/vendor/chillerlan/php-qrcode/examples/octocat.png2.41KB2.46KB0.00%
inc/vendor/chillerlan/php-qrcode/examples/example_image.png2.23KB1.09KB▼ 50.94%
inc/vendor/chillerlan/php-qrcode/examples/example_svg.png15.55KB6.70KB▼ 56.90%