74% wc-qr-codes

Code Review | QR Code for WooCommerce

WordPress plugin QR Code for WooCommerce scored74%from 54 tests.

About plugin

  • Plugin page: wc-qr-codes
  • Plugin version: 1.2.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.2
  • WordPress version: 6.3.1
  • First release: Mar 14, 2017
  • Latest release: Jun 7, 2019
  • Number of updates: 24
  • Update frequency: every 33.8 days
  • Top authors: bappa1995 (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

800+ active /18,488 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼5.81ms] Passed 4 tests

Server-side resources used by QR Code for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0041.81 ▼2.59
Dashboard /wp-admin3.31 ▼0.0452.94 ▼15.27
Posts /wp-admin/edit.php3.36 ▲0.0052.53 ▲2.87
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.76 ▼7.22
Media Library /wp-admin/upload.php3.23 ▲0.0040.13 ▲1.86

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for QR Code for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,849 ▲8813.32 ▼1.332.21 ▼0.0448.16 ▲2.49
Dashboard /wp-admin2,233 ▲304.86 ▼0.02104.78 ▼13.9843.02 ▼3.34
Posts /wp-admin/edit.php2,110 ▲132.00 ▼0.0537.15 ▼0.4637.32 ▲0.07
Add New Post /wp-admin/post-new.php1,555 ▲2223.17 ▼0.10620.10 ▼76.3566.50 ▲3.08
Media Library /wp-admin/upload.php1,412 ▲124.23 ▲0.07105.70 ▼6.2845.09 ▼4.11

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% 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 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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wc-qr-codes/includes/lib/phpqrcode/index.php

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: quick response code, woocommerce qr code, qr codes

wc-qr-codes/wc-qr-codes.php Passed 13 tests

The principal PHP file in "QR Code for WooCommerce" v. 1.2.0 is loaded by WordPress automatically on each request
43 characters long description:
Generate QR Codes for woocommerce products.

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
It is important to fix the following items
  • Do not include executable or dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/wc-qr-codes/includes/lib/phpqrcode/tools/merge.bat
7,102 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP271,6992,3777,067
JavaScript11117
CSS10014
Bourne Shell1002
DOS Batch1002

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity27.63
▷ Minimum class complexity1.00
▷ Maximum class complexity292.00
Average method complexity3.62
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes43
▷ Abstract classes00.00%
▷ Concrete classes43100.00%
▷ Final classes24.65%
Methods437
▷ Static methods13430.66%
▷ Public methods33476.43%
▷ Protected methods9621.97%
▷ Private methods71.60%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants105
▷ Global constants105100.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
41 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/lib/phpqrcode/cache/frame_19.png0.22KB0.21KB▼ 4.89%
includes/lib/phpqrcode/cache/frame_13.png0.21KB0.19KB▼ 5.24%
includes/lib/phpqrcode/cache/frame_5.png0.15KB0.14KB▼ 1.33%
includes/lib/phpqrcode/cache/frame_32.png0.26KB0.25KB▼ 4.20%
includes/lib/phpqrcode/cache/frame_14.png0.21KB0.20KB▼ 4.69%