83% usb-qr-code-scanner-for-woocommerce

Code Review | USB Qr Code Scanner For Woocommerce

WordPress plugin USB Qr Code Scanner For Woocommerce scored 83% from 54 tests.

About plugin

  • Plugin page: usb-qr-code-scann...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Mar 30, 2023
  • Latest release: Mar 30, 2023
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: behzadrohizadeh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 143 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼6.80ms] Passed 4 tests

This is a short check of server-side resources used by USB Qr Code Scanner For Woocommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0838.40 ▼0.02
Dashboard /wp-admin3.37 ▲0.0744.72 ▼8.37
Posts /wp-admin/edit.php3.42 ▲0.0748.82 ▼2.37
Add New Post /wp-admin/post-new.php5.95 ▲0.0793.79 ▼16.43
Media Library /wp-admin/upload.php3.30 ▲0.0734.18 ▲1.05

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for USB Qr Code Scanner For Woocommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,927 ▲19213.52 ▼0.785.85 ▲4.1540.42 ▲1.24
Dashboard /wp-admin2,222 ▲344.85 ▼1.06108.70 ▼2.4439.00 ▼2.66
Posts /wp-admin/edit.php2,105 ▲161.99 ▼0.0040.60 ▼0.9734.58 ▼1.52
Add New Post /wp-admin/post-new.php1,527 ▲1317.67 ▲0.05583.56 ▼21.4956.31 ▼8.98
Media Library /wp-admin/upload.php1,404 ▲194.17 ▼0.0297.17 ▲1.3041.12 ▲1.02

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 55× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Picqer\\Barcode\\Types\\TypeRms4cc' not found in wp-content/plugins/usb-qr-code-scanner-for-woocommerce/vendor/picqer/php-barcode-generator/src/Types/TypeKix.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Picqer\\Barcode\\Types\\TypeMsiChecksum' not found in wp-content/plugins/usb-qr-code-scanner-for-woocommerce/vendor/picqer/php-barcode-generator/src/Types/TypeMsi.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Picqer\\Barcode\\BarcodeGenerator' not found in wp-content/plugins/usb-qr-code-scanner-for-woocommerce/vendor/picqer/php-barcode-generator/src/BarcodeGeneratorPNG.php:10
    • > PHP Fatal error
      require(): Failed opening required 'vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/usb-qr-code-scanner-for-woocommerce/vendor/picqer/php-barcode-generator/generate-verified-files.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Picqer\\Barcode\\Exceptions\\BarcodeException' not found in wp-content/plugins/usb-qr-code-scanner-for-woocommerce/vendor/picqer/php-barcode-generator/src/Exceptions/InvalidFormatException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Picqer\\Barcode\\BarcodeGenerator' not found in wp-content/plugins/usb-qr-code-scanner-for-woocommerce/vendor/picqer/php-barcode-generator/src/BarcodeGeneratorDynamicHTML.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Picqer\\Barcode\\Types\\TypeCode128' not found in wp-content/plugins/usb-qr-code-scanner-for-woocommerce/vendor/picqer/php-barcode-generator/src/Types/TypeCode128A.php:13
    • > PHP Fatal error
      require(): Failed opening required 'vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/usb-qr-code-scanner-for-woocommerce/vendor/picqer/php-barcode-generator/generate-examples.php on line 7
    • > PHP Fatal error
      Uncaught Error: Interface 'Picqer\\Barcode\\Types\\TypeInterface' not found in wp-content/plugins/usb-qr-code-scanner-for-woocommerce/vendor/picqer/php-barcode-generator/src/Types/TypePharmacodeTwoCode.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Picqer\\Barcode\\Types\\TypeUpcExtension2' not found in wp-content/plugins/usb-qr-code-scanner-for-woocommerce/vendor/picqer/php-barcode-generator/src/Types/TypeUpcExtension5.php:11

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)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (Usb Barcode Scanner settings Header and Footer For Printer), #2 (Sample Barcode Image), #3 (Sample Product After Added By Scanner), #4 (Printer Preview)
The official readme.txt might help

usb-qr-code-scanner-for-woocommerce/usb-qrcode-scanner-for-woocommerce.php 85% from 13 tests

"USB Qr Code Scanner For Woocommerce" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("usb-qr-code-scanner-for-woocommerce.php" instead of "usb-qrcode-scanner-for-woocommerce.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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 plugin7,079 lines of code in 122 files:
LanguageFilesBlank linesComment linesLines of code
PHP729328704,352
SVG32001,708
Markdown41420331
HTML400194
JSON300140
PO File24447140
JavaScript11022108
CSS1282261
XML10023
YAML29022

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity7.37
▷ Minimum class complexity1.00
▷ Maximum class complexity69.00
Average method complexity3.29
▷ Minimum method complexity1.00
▷ Maximum method complexity64.00
Code structure
Namespaces6
Interfaces1
Traits0
Classes61
▷ Abstract classes23.28%
▷ Concrete classes5996.72%
▷ Final classes00.00%
Methods175
▷ Static methods2011.43%
▷ Public methods14985.14%
▷ Protected methods2112.00%
▷ Private methods52.86%
Functions4
▷ Named functions250.00%
▷ Anonymous functions250.00%
Constants34
▷ Global constants00.00%
▷ Class constants34100.00%
▷ Public constants3397.06%

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
4 PNG files occupy 0.11MB with 0.06MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png29.37KB12.99KB▼ 55.78%
screenshot-3.png34.01KB15.22KB▼ 55.26%
screenshot-1.png33.41KB12.75KB▼ 61.85%
screenshot-2.png14.87KB8.26KB▼ 44.49%