83% vnpay-for-woocommerce

Code Review | VNPAY Payment gateway

WordPress plugin VNPAY Payment gateway scored83%from 54 tests.

About plugin

  • Plugin page: vnpay-for-woocomm...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9
  • WordPress version: 6.3.1
  • First release: Nov 16, 2017
  • Latest release: Nov 16, 2017
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: teyldoan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,428 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.06MB] [CPU: ▼1.13ms] Passed 4 tests

Analyzing server-side resources used by VNPAY Payment gateway
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0745.30 ▼1.67
Dashboard /wp-admin3.37 ▲0.0656.37 ▲2.79
Posts /wp-admin/edit.php3.48 ▲0.1350.37 ▲0.19
Add New Post /wp-admin/post-new.php5.95 ▲0.0687.62 ▼5.84
Media Library /wp-admin/upload.php3.29 ▲0.0639.69 ▲5.12

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 27 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
vnpay_settings
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for VNPAY Payment gateway
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.42 ▲1.171.77 ▼2.6644.49 ▼0.99
Dashboard /wp-admin2,198 ▲215.69 ▲0.0486.64 ▼11.9537.34 ▼3.79
Posts /wp-admin/edit.php2,097 ▼61.99 ▲0.0539.34 ▼2.7933.96 ▼2.57
Add New Post /wp-admin/post-new.php1,526 ▼023.30 ▼0.18686.94 ▼20.6860.40 ▲8.77
Media Library /wp-admin/upload.php1,400 ▼04.27 ▲0.00106.14 ▲3.9145.63 ▲0.59

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • vnpay_settings
    • widget_recent-comments
    • can_compress_scripts
    • 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 everything seems fine, this is not 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
The following issues need your attention
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'vnpay\\Responses\\vnpayResponse' not found in wp-content/plugins/vnpay-for-woocommerce/src/gateways/international/vnpayInternationalResponse.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/vnpay-for-woocommerce/src/gateways/international/vnpayGateway.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/vnpay-for-woocommerce/vnpay.php:44
    • > PHP Fatal error
      Uncaught Error: Interface 'vnpay\\Facades\\FacadeResponse' not found in wp-content/plugins/vnpay-for-woocommerce/src/vnpayResponse.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Donate link: Please fix this invalid URI: ""
Please take inspiration from this readme.txt

vnpay-for-woocommerce/vnpay.php 85% from 13 tests

The main file in "VNPAY Payment gateway" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("vnpay-for-woocommerce.php" instead of "vnpay.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin846 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP1518487834
JSON20011
Markdown1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity8.09
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces7
Interfaces1
Traits1
Classes9
▷ Abstract classes111.11%
▷ Concrete classes888.89%
▷ Final classes00.00%
Methods55
▷ Static methods35.45%
▷ Public methods5498.18%
▷ Protected methods00.00%
▷ Private methods11.82%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants1
▷ Global constants1100.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
5 PNG files occupy 0.25MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
logo.png15.67KB4.36KB▼ 72.19%
screenshot-1.png45.34KB15.34KB▼ 66.16%
screenshot-3.png88.41KB28.91KB▼ 67.30%
images/logo.png15.67KB4.36KB▼ 72.19%
screenshot-2.png93.38KB30.00KB▼ 67.87%