10% qr-code

Code Review | QR Code

WordPress plugin QR Code scored10%from 54 tests.

About plugin

  • Plugin page: qr-code
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-5.7.2
  • WordPress version: 6.3.1
  • First release: Oct 8, 2014
  • Latest release: Jun 23, 2021
  • Number of updates: 13
  • Update frequency: every 232.3 days
  • Top authors: tomek00 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /4,444 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/qr-code/qrcode.php+19
    Methods with the same name as their class will not be constructors in a future version of PHP; WP_Widget_QR_Code has a deprecated constructor

Server metrics [RAM: ▼1.91MB] [CPU: ▼54.16ms] Passed 4 tests

An overview of server-side resources used by QR Code
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.384.70 ▼35.41
Dashboard /wp-admin2.11 ▼1.246.14 ▼56.95
Posts /wp-admin/edit.php2.11 ▼1.255.67 ▼38.55
Add New Post /wp-admin/post-new.php2.11 ▼3.786.20 ▼85.72
Media Library /wp-admin/upload.php2.11 ▼1.135.46 ▼33.19

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_qr-code-widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by QR Code
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.71 ▼0.671.77 ▲0.0738.72 ▼6.99
Dashboard /wp-admin2,209 ▲215.90 ▲0.02100.75 ▼12.9238.01 ▼8.21
Posts /wp-admin/edit.php2,089 ▲32.01 ▲0.0139.16 ▲0.9635.04 ▲0.73
Add New Post /wp-admin/post-new.php1,514 ▼1917.52 ▼5.66606.11 ▼75.3346.56 ▼4.84
Media Library /wp-admin/upload.php1,391 ▲34.14 ▼0.0999.16 ▼8.9440.74 ▼4.47

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
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/qr-code/qrcode.php+19
    Methods with the same name as their class will not be constructors in a future version of PHP; WP_Widget_QR_Code has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_qr-code-widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/qr-code/qrcode.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Please describe screenshot #2 in qr-code/assets to your readme.txt
You can look at the official readme.txt

qr-code/qrcode.php 92% from 13 tests

"QR Code" version 1.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("qr-code.php" instead of "qrcode.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin132 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP17899
PO File18933

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png26.82KB11.09KB▼ 58.65%
screenshot-1.png9.05KB5.17KB▼ 42.90%