84% qr-code-woocommerce

Code Review | QR Code Woocommerce

WordPress plugin QR Code Woocommerce scored84%from 54 tests.

About plugin

  • Plugin page: qr-code-woocommerce
  • Plugin version: 2.0.5
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.1
  • WordPress version: 6.3.1
  • First release: Jan 7, 2020
  • Latest release: Dec 12, 2022
  • Number of updates: 48
  • Update frequency: every 22.3 days
  • Top authors: gangesh (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

2,000+ active /15,721 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

Analyzing server-side resources used by QR Code Woocommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.79 ▼3.21
Dashboard /wp-admin3.32 ▼0.0246.00 ▼15.87
Posts /wp-admin/edit.php3.37 ▲0.0248.31 ▲4.78
Add New Post /wp-admin/post-new.php5.90 ▲0.0289.37 ▼7.01
Media Library /wp-admin/upload.php3.24 ▲0.0234.72 ▲0.19

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

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

Browser metrics Passed 4 tests

QR Code Woocommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲6314.47 ▲0.071.74 ▼0.0943.75 ▲1.49
Dashboard /wp-admin2,206 ▲184.85 ▼0.0799.21 ▼22.5941.37 ▼1.02
Posts /wp-admin/edit.php2,098 ▲92.02 ▼0.0940.43 ▼0.1438.41 ▲2.05
Add New Post /wp-admin/post-new.php1,523 ▼517.84 ▼5.49717.86 ▼15.4957.90 ▼2.48
Media Library /wp-admin/upload.php1,400 ▲124.18 ▼0.0695.22 ▼2.6442.50 ▼1.84

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/qr-code-woocommerce/includes/class-woo-coupon-public-url.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/qr-code-woocommerce/includes/class-woo-bulk-qr-codes.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: qr-code, qrcode, woocommerce

qr-code-woocommerce/woocommerce-qrc.php 85% from 13 tests

The primary PHP file in "QR Code Woocommerce" version 2.0.5 is used by WordPress to initiate all plugin functionality
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-woocommerce.php" instead of "woocommerce-qrc.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected14,524 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript72,2282,97713,029
PHP6187136769
CSS55410448
SVG100239
PO File1101139

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity18.80
▷ Minimum class complexity3.00
▷ Maximum class complexity64.00
Average method complexity2.89
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes240.00%
Methods47
▷ Static methods510.64%
▷ Public methods4493.62%
▷ Protected methods00.00%
▷ Private methods36.38%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/admin/images/wooqr-icon.png26.12KB9.40KB▼ 64.02%