78% ra-qrcode

Code Review | ra_qrcode

WordPress plugin ra_qrcode scored78%from 54 tests.

About plugin

  • Plugin page: ra-qrcode
  • Plugin version: 2.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.2.3
  • WordPress version: 6.3.1
  • First release: Jul 16, 2015
  • Latest release: Jul 25, 2015
  • Number of updates: 24
  • Update frequency: every 0.4 days
  • Top authors: RobertoAlicata (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /1,257 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by ra_qrcode
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0449.20 ▲0.37
Dashboard /wp-admin3.34 ▲0.0454.46 ▼1.45
Posts /wp-admin/edit.php3.40 ▲0.0451.51 ▲1.10
Add New Post /wp-admin/post-new.php5.93 ▲0.0491.27 ▼3.93
Media Library /wp-admin/upload.php3.27 ▲0.0437.10 ▼0.96

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_ra_qrcode_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for ra_qrcode
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲7214.73 ▲0.202.20 ▲0.4942.74 ▼1.46
Dashboard /wp-admin2,217 ▲375.80 ▲0.1587.73 ▼10.9842.36 ▼1.50
Posts /wp-admin/edit.php2,124 ▲242.44 ▲0.4136.45 ▲0.2333.72 ▼1.50
Add New Post /wp-admin/post-new.php1,540 ▲1422.95 ▼0.06673.49 ▼9.9738.42 ▼16.40
Media Library /wp-admin/upload.php1,422 ▲254.48 ▲0.2599.29 ▼12.2845.06 ▲1.05

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • widget_ra_qrcode_widget
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/ra-qrcode/ra-qrcode.php
  • 17× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined index: bgcolor in wp-content/plugins/ra-qrcode/inc/image.php on line 5
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/ra-qrcode/inc/image.php on line 14
    • > PHP Warning
      imagecreatefrompng(https://chart.googleapis.com/chart?cht=qr&chs=x&chl=&choe=UTF-8): failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request\r in wp-content/plugins/ra-qrcode/inc/image.php on line 9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/ra-qrcode/inc/image.php on line 15
    • > PHP Warning
      imagetruecolortopalette() expects parameter 1 to be resource, bool given in wp-content/plugins/ra-qrcode/inc/image.php on line 27
    • > PHP Warning
      imagecolorat() expects parameter 1 to be resource, bool given in wp-content/plugins/ra-qrcode/inc/image.php on line 28
    • > PHP Notice
      Undefined index: size in wp-content/plugins/ra-qrcode/inc/image.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/ra-qrcode/inc/image.php on line 15
    • > PHP Warning
      imagedestroy() expects parameter 1 to be resource, bool given in wp-content/plugins/ra-qrcode/inc/image.php on line 19
    • > PHP Warning
      imagepng() expects parameter 1 to be resource, bool given in wp-content/plugins/ra-qrcode/inc/image.php on line 18

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (The simplest shortcode), #2 (The qr code generated)
You can look at the official readme.txt

ra-qrcode/ra-qrcode.php Passed 13 tests

The main PHP file in "ra_qrcode" ver. 2.1.0 adds more information about the plugin and also serves as the entry point for this plugin
64 characters long description:
a simple WordPress plugin to generate a QR code with a shortcode

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin315 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP27137217
JavaScript113895
CSS1003

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
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/qr-icon.png2.05KB1.65KB▼ 19.22%