68% lh-qr-codes

Code Review | LH QR Codes

WordPress plugin LH QR Codes scored 68% from 54 tests.

About plugin

  • Plugin page: lh-qr-codes
  • Plugin version: 1.06
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9
  • WordPress version: 5.8.1
  • First release: May 24, 2016
  • Latest release: Mar 5, 2018
  • Number of updates: 10
  • Update frequency: every 65.0 days
  • Top authors: shawfactor (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

50+ active / 2,511 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼151.04ms] Passed 4 tests

This is a short check of server-side resources used by LH QR Codes
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.0542.01 ▲11.10
Dashboard /wp-admin3.10 ▲0.0546.56 ▼24.31
Posts /wp-admin/edit.php3.16 ▲0.0540.17 ▼14.11
Add New Post /wp-admin/post-new.php5.46 ▲0.0296.80 ▼561.45
Media Library /wp-admin/upload.php3.04 ▲0.0434.61 ▼4.29

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 432 new files
Database: no new tables, 1 new option
New WordPress options
widget_lh_qr_codes_widget

Browser metrics Passed 4 tests

A check of browser resources used by LH QR Codes
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10715.77 ▲0.328.53 ▼0.1347.69 ▼22.72
Dashboard /wp-admin2,970 ▲365.86 ▼0.14145.02 ▼18.57123.12 ▼16.57
Posts /wp-admin/edit.php2,739 ▲32.70 ▲0.0068.44 ▼3.2790.16 ▲9.13
Add New Post /wp-admin/post-new.php1,683 ▲10218.77 ▼1.42390.59 ▼21.38114.50 ▼26.51
Media Library /wp-admin/upload.php1,810 ▲35.04 ▲0.02149.58 ▼23.22125.31 ▼10.35

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 1 option
    • widget_lh_qr_codes_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/lh-qr-codes/phpqrcode/index.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/lh-qr-codes/lh-qr-codes.php:245

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: thumbnail, svg, self hosted, png, login...

lh-qr-codes/lh-qr-codes.php Passed 13 tests

This is the main PHP file of "LH QR Codes" version 1.06, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
98 characters long description:
Creates an api that gives every user a qr code that points to a url (which can then be redirected)

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Almost there! Just fix the following issues
  • Do not include executable or dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/lh-qr-codes/phpqrcode/tools/merge.bat
6,735 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP211,8212,1666,731
Bourne Shell1002
DOS Batch1002

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity30.21
▷ Minimum class complexity1.00
▷ Maximum class complexity292.00
Average method complexity3.77
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes38
▷ Abstract classes00.00%
▷ Concrete classes38100.00%
▷ Final classes00.00%
Methods401
▷ Static methods14034.91%
▷ Public methods29673.82%
▷ Protected methods9623.94%
▷ Private methods92.24%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants99
▷ Global constants99100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
40 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
phpqrcode/cache/frame_13.png0.21KB0.19KB▼ 5.24%
phpqrcode/cache/frame_18.png0.22KB0.21KB▼ 5.26%
phpqrcode/cache/frame_9.png0.19KB0.19KB▼ 2.01%
phpqrcode/cache/frame_40.png0.26KB0.24KB▼ 7.87%
phpqrcode/cache/frame_2.png0.14KB0.14KB▼ 2.08%