10% simple-qr-code-creator-widget

Code Review | Simple QR Code Creator Widget

WordPress plugin Simple QR Code Creator Widget scored10%from 54 tests.

About plugin

  • Plugin page: simple-qr-code-cr...
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-3.8.1
  • WordPress version: 6.3.1
  • First release: Oct 19, 2010
  • Latest release: Mar 10, 2014
  • Number of updates: 15
  • Update frequency: every 82.5 days
  • Top authors: richard_steeleagency (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /6,385 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
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/simple-qr-code-creator-widget/qr_generator.php+89
    Methods with the same name as their class will not be constructors in a future version of PHP; QR_Generator has a deprecated constructor

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

A check of server-side resources used by Simple QR Code Creator Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.394.63 ▼35.97
Dashboard /wp-admin2.10 ▼1.216.40 ▼43.85
Posts /wp-admin/edit.php2.10 ▼1.265.62 ▼40.41
Add New Post /wp-admin/post-new.php2.10 ▼3.795.56 ▼95.48
Media Library /wp-admin/upload.php2.10 ▼1.135.65 ▼27.62

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Simple QR Code Creator Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,899 ▲11313.38 ▼1.068.70 ▲6.3346.80 ▲2.20
Dashboard /wp-admin2,195 ▲215.63 ▼0.0386.54 ▼14.0538.74 ▼6.72
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0634.86 ▼2.4333.81 ▼6.21
Add New Post /wp-admin/post-new.php1,527 ▼123.32 ▲0.30630.42 ▼43.7461.16 ▲7.17
Media Library /wp-admin/upload.php1,397 ▼34.22 ▲0.0397.70 ▼8.1447.73 ▲0.96

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/simple-qr-code-creator-widget/qr_generator.php+89
    Methods with the same name as their class will not be constructors in a future version of PHP; QR_Generator has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_qr_generator
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 11× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: image_src in wp-content/plugins/simple-qr-code-creator-widget/qrcode.php on line 35
    • > PHP Warning
      imagejpeg() expects parameter 1 to be resource, bool given in wp-content/plugins/simple-qr-code-creator-widget/qrcode.php on line 41
    • > PHP Warning
      imagestring() expects parameter 1 to be resource, bool given in wp-content/plugins/simple-qr-code-creator-widget/qrcode.php on line 37
    • > PHP Notice
      Undefined index: qrtype in wp-content/plugins/simple-qr-code-creator-widget/qrcode.php on line 26
    • > PHP Notice
      Undefined index: qrtype in wp-content/plugins/simple-qr-code-creator-widget/qrcode.php on line 21
    • > PHP Notice
      Undefined variable: qr_height in wp-content/plugins/simple-qr-code-creator-widget/qrcode.php on line 37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-qr-code-creator-widget/qr_generator.php:21
    • > PHP Warning
      imagecreatefrompng(): Filename cannot be empty in wp-content/plugins/simple-qr-code-creator-widget/qrcode.php on line 35
    • > PHP Notice
      Undefined index: qrtype in wp-content/plugins/simple-qr-code-creator-widget/qrcode.php on line 15
    • > PHP Notice
      Undefined variable: qr_width in wp-content/plugins/simple-qr-code-creator-widget/qrcode.php on line 37

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% 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
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Contact/Business Card QR), #2 (Different types), #3 (URL code), #4 (Business Card Code), #5 (Tracking), #6 (In posts and pages)
The official readme.txt is a good inspiration

simple-qr-code-creator-widget/qr_generator.php 85% from 13 tests

The primary PHP file in "Simple QR Code Creator Widget" version 1.1.3 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 150 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("simple-qr-code-creator-widget.php" instead of "qr_generator.php")

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
No dangerous file extensions were detected264 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP23836150
CSS181468
JavaScript18046

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.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%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.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
6 PNG files occupy 0.23MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png18.78KB7.38KB▼ 60.73%
screenshot-5.png51.87KB18.90KB▼ 63.56%
screenshot-4.png61.36KB37.36KB▼ 39.12%
screenshot-3.png36.49KB24.10KB▼ 33.94%
screenshot-2.png12.17KB5.82KB▼ 52.15%