84% qr-code-and-barcode-scanner-reader

Code Review | Qr Code and Barcode Scanner Reader

WordPress plugin Qr Code and Barcode Scanner Reader scored84%from 54 tests.

About plugin

  • Plugin page: qr-code-and-barco...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.7.1
  • WordPress version: 6.3.1
  • First release: Jun 30, 2021
  • Latest release: Jun 30, 2021
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: 4wpbari (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

500+ active /3,823 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
Install script ran successfully

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

Analyzing server-side resources used by Qr Code and Barcode Scanner Reader
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0139.99 ▼3.50
Dashboard /wp-admin3.32 ▲0.0144.86 ▼4.66
Posts /wp-admin/edit.php3.37 ▲0.0148.92 ▼0.54
Add New Post /wp-admin/post-new.php5.90 ▲0.0192.20 ▼16.73
Media Library /wp-admin/upload.php3.24 ▲0.0135.52 ▼0.06

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Qr Code and Barcode Scanner Reader
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,884 ▲14914.50 ▲0.2018.15 ▲16.4539.41 ▼7.54
Dashboard /wp-admin2,206 ▲144.87 ▼0.04110.64 ▼6.5243.52 ▼0.26
Posts /wp-admin/edit.php2,092 ▲31.98 ▼0.0343.06 ▲3.3837.87 ▲1.22
Add New Post /wp-admin/post-new.php1,542 ▲818.32 ▼4.70607.26 ▼137.3954.86 ▲0.97
Media Library /wp-admin/upload.php1,385 ▼04.21 ▼0.0395.26 ▼5.5741.33 ▼2.11

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/qr-code-and-barcode-scanner-reader/qr-code-and-barcode-scanner-reader.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: reader, web reader, qrcode scan, qrcode reader, scanner

qr-code-and-barcode-scanner-reader/qr-code-and-barcode-scanner-reader.php Passed 13 tests

"Qr Code and Barcode Scanner Reader" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
59 characters long description:
Simple Web QR code and barcode scanner reader for Wordpress

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 detected71 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1141166
JavaScript1035

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.06
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.20
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin