68% qr-scanner-redirect

Code Review | QR Scanner Redirect

WordPress plugin QR Scanner Redirect scored68%from 54 tests.

About plugin

  • Plugin page: qr-scanner-redirect
  • Plugin version: 1.2.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.8.1
  • WordPress version: 6.3.1
  • First release: May 29, 2019
  • Latest release: Dec 28, 2021
  • Number of updates: 27
  • Update frequency: every 35.0 days
  • Top authors: aigenseer (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

400+ active /4,938 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▲18.36ms] Passed 4 tests

An overview of server-side resources used by QR Scanner Redirect
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2368.99 ▲25.68
Dashboard /wp-admin3.40 ▲0.1080.89 ▲26.48
Posts /wp-admin/edit.php3.51 ▲0.1669.21 ▲15.04
Add New Post /wp-admin/post-new.php6.00 ▲0.12106.83 ▲7.66
Media Library /wp-admin/upload.php3.32 ▲0.0962.46 ▲25.07

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 27 new files
Database: 1 new table, 7 new options
New tables
wp_qrscannerredirect_settings
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_qrscannerredirect_widget
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for QR Scanner Redirect
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲2514.47 ▼0.281.73 ▼0.3443.53 ▼5.10
Dashboard /wp-admin2,205 ▲285.04 ▼0.6087.73 ▼5.0086.71 ▲43.16
Posts /wp-admin/edit.php2,119 ▲192.42 ▲0.4235.08 ▼1.0838.39 ▲7.39
Add New Post /wp-admin/post-new.php6,369 ▲4,84325.47 ▲7.97870.23 ▲165.6234.61 ▼32.96
Media Library /wp-admin/upload.php1,419 ▲194.67 ▲0.53100.53 ▼11.5274.22 ▲23.23

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_qrscannerredirect_settings
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_qrscannerredirect_widget
    • widget_theysaidso_widget
    • can_compress_scripts

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
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/qr-scanner-redirect/httpsWarning.php
    • > /wp-content/plugins/qr-scanner-redirect/include/httpsWarning.php
  • 16× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/qr-scanner-redirect/include/widget.php:11
    • > PHP Notice
      Undefined variable: formvalues in wp-content/plugins/qr-scanner-redirect/pluginsettingsform.php on line 23
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/qr-scanner-redirect/include/pluginsettingsform.php on line 25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/qr-scanner-redirect/widget.php:11
    • > PHP Fatal error
      Uncaught Error: Call to a member function fetchPost() on null in wp-content/plugins/qr-scanner-redirect/language.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/qr-scanner-redirect/include/shortcode.php:55
    • > PHP Fatal error
      Uncaught Error: Call to undefined function submit_button() in wp-content/plugins/qr-scanner-redirect/include/pluginsettingsform.php:107
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/qr-scanner-redirect/metaboxes.php:35
    • > PHP Notice
      Undefined variable: formvalues in wp-content/plugins/qr-scanner-redirect/include/pluginsettingsform.php on line 25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/qr-scanner-redirect/include/metaboxes.php:34

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: redirect, wordpress, qr, scanner, plugin...

qr-scanner-redirect/index.php 77% from 13 tests

The entry point to "QR Scanner Redirect" version 1.2.2 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.0.1" instead of "5.2")
  • Requires PHP: Required version must be the same as the one declared in readme.txt ("5.2.5" instead of "7.2")
  • Main file name: The principal plugin file should be the same as the plugin slug ("qr-scanner-redirect.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin842 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP14103189755
CSS211064
JavaScript407123

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity11.00
▷ Minimum class complexity1.00
▷ Maximum class complexity35.00
Average method complexity3.22
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods1473.68%
▷ Protected methods00.00%
▷ Private methods526.32%
Functions23
▷ Named functions1878.26%
▷ Anonymous functions521.74%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/icon.png2.79KB0.14KB▼ 94.93%