10% qr-code-tag

Code Review | QR Code Tag

WordPress plugin QR Code Tag scored10%from 54 tests.

About plugin

  • Plugin page: qr-code-tag
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.8
  • WordPress version: 6.3.1
  • First release: Sep 19, 2009
  • Latest release: Jul 31, 2017
  • Number of updates: 11
  • Update frequency: every 261.2 days
  • Top authors: dspreen (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

1,000+ active /13,478 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/qr-code-tag/lib/qrct/QrctWp.php+11
    Methods with the same name as their class will not be constructors in a future version of PHP; QrctWp has a deprecated constructor

Server metrics [RAM: ▼1.79MB] [CPU: ▼57.16ms] Passed 4 tests

Server-side resources used by QR Code Tag
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.21 ▼1.266.78 ▼31.52
Dashboard /wp-admin2.23 ▼1.126.74 ▼56.45
Posts /wp-admin/edit.php2.23 ▼1.136.59 ▼48.17
Add New Post /wp-admin/post-new.php2.23 ▼3.666.37 ▼92.49
Media Library /wp-admin/upload.php2.23 ▼1.006.26 ▼30.56
QR Code Tag /wp-admin/options-general.php?page=qr-code-tag/qr-code-tag.php2.237.13

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 296 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
qrct_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for QR Code Tag
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,901 ▲15513.66 ▼0.746.87 ▲5.2443.39 ▲3.44
Dashboard /wp-admin2,219 ▲285.05 ▲0.19104.98 ▼4.6237.54 ▼6.78
Posts /wp-admin/edit.php2,102 ▲102.06 ▲0.0043.02 ▼1.8435.18 ▼3.33
Add New Post /wp-admin/post-new.php1,523 ▼517.42 ▼0.84693.94 ▲53.2053.94 ▼6.67
Media Library /wp-admin/upload.php1,401 ▲134.29 ▲0.11101.00 ▼5.1640.59 ▼10.07
QR Code Tag /wp-admin/options-general.php?page=qr-code-tag/qr-code-tag.php1,4721.7129.8755.72

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/qr-code-tag/lib/qrct/QrctWp.php+11
    Methods with the same name as their class will not be constructors in a future version of PHP; QrctWp has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=qr-code-tag/qr-code-tag.php
    • > Deprecated in wp-content/plugins/qr-code-tag/lib/qrct/QrctWp.php+11
    Methods with the same name as their class will not be constructors in a future version of PHP; QrctWp has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=qr-code-tag/qr-code-tag.php
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=qr-code-tag/qr-code-tag.php
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery-tooltip handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=qr-code-tag/qr-code-tag.php
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the qrcodetagging handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=qr-code-tag/qr-code-tag.php
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the qrcodetagging handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=qr-code-tag/qr-code-tag.php
    • > User deprecated in wp-includes/functions.php+5453
    Function register_widget_control is deprecated since version 2.8.0! Use wp_register_widget_control() instead.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=qr-code-tag/qr-code-tag.php
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/options-general.php?page=qr-code-tag/qr-code-tag.php
    • > Deprecated in wp-content/plugins/qr-code-tag/lib/qrct/Qrcode.php+10
    Methods with the same name as their class will not be constructors in a future version of PHP; Qrcode has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=qr-code-tag/qr-code-tag.php
    • > Warning in wp-content/plugins/qr-code-tag/lib/qrct/QrctWp-admin.inc.php+166
    Use of undefined constant WPLANG - assumed 'WPLANG' (this will throw an Error in a future version of PHP)

SRP 50% 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
Please fix the following
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      QRcode : Data do not exist. in wp-content/plugins/qr-code-tag/lib/qr_img/qr_img.php on line 90
    • > PHP Notice
      Undefined variable: qrcode_data_string in wp-content/plugins/qr-code-tag/lib/qr_img/qr_img.php on line 87
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/qr-code-tag/lib/qrct/QrctWp.php:77
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/qr-code-tag/lib/qrct/QrctWp-admin.inc.php:4
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/qr-code-tag/lib/qrct/QrctWp.php on line 74

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=qr-code-tag/qr-code-tag.php
    • > Javascript (severe) in unknown
    /wp-content/plugins/qr-code-tag/js/jquery.tooltip.min.js?ver=6.3.1 13:62 Uncaught TypeError: Cannot read properties of undefined (reading 'msie')
    • > GET request to /wp-admin/options-general.php?page=qr-code-tag/qr-code-tag.php
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).tooltip is not a function" "TypeError: $(...).tooltip is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/qr-code-tag/js/qrct.js?ver=6.3.1:12:24)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=qr-code-tag/qr-code-tag.php
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).tooltip is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Add images for these screenshots: #1 (Tooltip mode), #2 (Widget options), #3 (Admin interface)
The official readme.txt might help

qr-code-tag/qr-code-tag.php Passed 13 tests

The primary PHP file in "QR Code Tag" version 1.0 is used by WordPress to initiate all plugin functionality
64 characters long description:
QR Code tag generator with widget, shortcode and tooltip support

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin1,371 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP82505091,110
PO File15874133
HTML2420102
JavaScript202215
CSS12011

PHP code Passed 2 tests

An overview of 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.25
Average class complexity19.50
▷ Minimum class complexity1.00
▷ Maximum class complexity43.00
Average method complexity3.31
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods32
▷ Static methods00.00%
▷ Public methods32100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
42 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/qr_img/image/qrv29.png0.24KB0.22KB▼ 8.87%
lib/qr_img/image/qrv39.png0.27KB0.25KB▼ 7.19%
lib/qr_img/image/b.png0.83KB0.08KB▼ 90.25%
lib/qr_img/image/qrv32.png0.28KB0.26KB▼ 6.71%
lib/qr_img/image/qrv22.png0.24KB0.22KB▼ 6.64%