73% qr-redirector

Code Review | QR Redirector

WordPress plugin QR Redirector scored73%from 54 tests.

About plugin

  • Plugin page: qr-redirector
  • Plugin version: 2.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2.0-6.1
  • WordPress version: 6.3.1
  • First release: Oct 20, 2012
  • Latest release: Nov 7, 2022
  • Number of updates: 28
  • Update frequency: every 131.1 days
  • Top authors: kionae (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

4,000+ active /36,040 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.03MB] [CPU: ▼6.64ms] Passed 4 tests

Server-side resources used by QR Redirector
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0440.17 ▲1.99
Dashboard /wp-admin3.34 ▲0.0447.24 ▼4.31
Posts /wp-admin/edit.php3.39 ▲0.0346.14 ▲0.22
Add New Post /wp-admin/post-new.php5.92 ▲0.0476.59 ▼24.44
Media Library /wp-admin/upload.php3.26 ▲0.0337.42 ▲2.30
QR Redirects /wp-admin/edit.php?post_type=qrcode3.2833.95
Add QR Redirect /wp-admin/post-new.php?post_type=qrcode3.3043.51

Server storage [IO: ▲16.80MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

A check of browser resources used by QR Redirector
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲6614.25 ▼0.111.74 ▲0.1243.11 ▼1.20
Dashboard /wp-admin2,233 ▲595.66 ▲0.0979.22 ▼8.8470.67 ▲25.35
Posts /wp-admin/edit.php2,128 ▲281.98 ▼0.0334.16 ▼3.0534.26 ▲0.03
Add New Post /wp-admin/post-new.php1,551 ▲2523.51 ▲0.49671.55 ▲15.7252.72 ▼1.61
Media Library /wp-admin/upload.php1,431 ▲314.13 ▼0.0293.96 ▲0.2672.92 ▲28.67
QR Redirects /wp-admin/edit.php?post_type=qrcode1,1712.3144.9428.84
Add QR Redirect /wp-admin/post-new.php?post_type=qrcode1,9053.6386.4672.15

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
    • > GET request to /wp-admin/edit.php?post_type=qrcode
    • > Notice in wp-content/plugins/qr-redirector/qr-redirector.php+371
    Trying to get property 'ID' of non-object

SRP 50% 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
Please fix the following
  • 93× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'BaconQrCode\\Renderer\\Color\\ColorInterface' not found in wp-content/plugins/qr-redirector/vendor/bacon/bacon-qr-code/src/Renderer/Color/Alpha.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Endroid\\QrCode\\ErrorCorrectionLevel\\ErrorCorrectionLevelInterface' not found in wp-content/plugins/qr-redirector/vendor/endroid/qr-code/src/ErrorCorrectionLevel/ErrorCorrectionLevelQuartile.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'BaconQrCode\\Renderer\\Path\\OperationInterface' not found in wp-content/plugins/qr-redirector/vendor/bacon/bacon-qr-code/src/Renderer/Path/Move.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'Endroid\\QrCode\\Label\\Font\\FontInterface' not found in wp-content/plugins/qr-redirector/vendor/endroid/qr-code/src/Label/Font/NotoSans.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Endroid\\QrCode\\Label\\Alignment\\LabelAlignmentInterface' not found in wp-content/plugins/qr-redirector/vendor/endroid/qr-code/src/Label/Alignment/LabelAlignmentLeft.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Endroid\\QrCode\\Matrix\\MatrixInterface' not found in wp-content/plugins/qr-redirector/vendor/endroid/qr-code/src/Matrix/Matrix.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'BaconQrCode\\Renderer\\Image\\ImageBackEndInterface' not found in wp-content/plugins/qr-redirector/vendor/bacon/bacon-qr-code/src/Renderer/Image/EpsImageBackEnd.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Endroid\\QrCode\\Writer\\WriterInterface' not found in wp-content/plugins/qr-redirector/vendor/endroid/qr-code/src/Writer/EpsWriter.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'DASPRiD\\Enum\\AbstractEnum' not found in wp-content/plugins/qr-redirector/vendor/dasprid/enum/test/WeekDay.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'BaconQrCode\\Renderer\\Color\\ColorInterface' not found in wp-content/plugins/qr-redirector/vendor/bacon/bacon-qr-code/src/Renderer/Color/Gray.php:8

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
    • > GET request to /wp-admin/edit.php?post_type=qrcode
    • > Javascript (severe) in unknown
    /wp-admin/edit.php?post_type=qrcode 295:18 Uncaught SyntaxError: Unexpected token '}'

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (QR Redirector index screen), #2 (QR Redirector edit screen), #3 (QR Redirector edit screen), #4 (QR Redirector edit screen)
You can look at the official readme.txt

qr-redirector/qr-redirector.php Passed 13 tests

The primary PHP file in "QR Redirector" version 2.0.2 is used by WordPress to initiate all plugin functionality
140 characters long description:
QR Redirector lets you create dynamic QR Codes by a generating a QR code for a URL on your site, and redirecting that URL anywhere you want.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin11,210 lines of code in 171 files:
LanguageFilesBlank linesComment linesLines of code
PHP1582,4812,43510,490
JSON500313
Markdown3800305
JavaScript2172450
CSS16435
XML11016
YAML1001

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity7.19
▷ Minimum class complexity1.00
▷ Maximum class complexity73.00
Average method complexity2.37
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces36
Interfaces26
Traits0
Classes125
▷ Abstract classes21.60%
▷ Concrete classes12398.40%
▷ Final classes10383.74%
Methods765
▷ Static methods11214.64%
▷ Public methods66887.32%
▷ Protected methods40.52%
▷ Private methods9312.16%
Functions31
▷ Named functions1961.29%
▷ Anonymous functions1238.71%
Constants107
▷ Global constants00.00%
▷ Class constants107100.00%
▷ Public constants2321.50%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
9 PNG files occupy 0.44MB with 0.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/bacon/bacon-qr-code/test/Integration/__snapshots__/files/ImagickRenderingTest__testIssue79__1.png8.17KB4.75KB▼ 41.88%
screenshot-1.png86.61KB33.75KB▼ 61.04%
screenshot-4.png111.05KB46.79KB▼ 57.87%
vendor/bacon/bacon-qr-code/test/Integration/__snapshots__/files/ImagickRenderingTest__testGenericQrCode__1.png3.04KB1.72KB▼ 43.30%
assets/qr-menu-icon-dark.png0.76KB0.54KB▼ 28.81%