89% vietqr

Code Review | = VietQR

WordPress plugin = VietQR scored89%from 54 tests.

About plugin

  • Plugin page: vietqr
  • Plugin version: 3.4.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.0
  • WordPress version: 6.3.1
  • First release: Jun 22, 2021
  • Latest release: Apr 4, 2023
  • Number of updates: 38
  • Update frequency: every 17.2 days
  • Top authors: thichvivu (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active /4,600 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
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by = VietQR
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0144.70 ▼1.16
Dashboard /wp-admin3.31 ▲0.0150.13 ▼1.51
Posts /wp-admin/edit.php3.36 ▲0.0153.44 ▲3.49
Add New Post /wp-admin/post-new.php5.89 ▲0.0184.10 ▼19.91
Media Library /wp-admin/upload.php3.23 ▲0.0137.09 ▲1.53

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by = VietQR
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.22 ▼1.091.83 ▼0.1746.87 ▲2.96
Dashboard /wp-admin2,203 ▲185.95 ▲0.06121.68 ▲12.9852.34 ▲9.39
Posts /wp-admin/edit.php2,089 ▼02.00 ▲0.0033.73 ▼2.6436.49 ▲1.95
Add New Post /wp-admin/post-new.php1,513 ▼717.59 ▼5.50677.70 ▼9.5764.47 ▲8.65
Media Library /wp-admin/upload.php1,388 ▼04.26 ▲0.08111.09 ▼5.3147.71 ▲0.95

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Congratulations! This plugin passed the SRP test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Screenshots: Add a description for screenshot #5 in vietqr/assets to your readme.txt
Please take inspiration from this readme.txt

vietqr/wc-gateway-vietqr.php 85% from 13 tests

The main PHP script in "= VietQR" version 3.4.1 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 189 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("vietqr.php" instead of "wc-gateway-vietqr.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected720 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP2101149614
PO File1212982
CSS22021
JavaScript1003

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity46.00
▷ Minimum class complexity46.00
▷ Maximum class complexity46.00
Average method complexity3.81
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods1593.75%
▷ Protected methods00.00%
▷ Private methods16.25%
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/vietqr.png1.71KB1.66KB▼ 2.92%