83% 9pay-gateway

Code Review | Thanh Toán qua cổng thanh toán 9PAY

WordPress plugin Thanh Toán qua cổng thanh toán 9PAY scored 83% from 54 tests.

About plugin

  • Plugin page: 9pay-gateway
  • Plugin version: 2.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 1.0-6.2
  • WordPress version: 6.3.1
  • First release: May 16, 2022
  • Latest release: May 31, 2023
  • Number of updates: 47
  • Update frequency: every 8.2 days
  • Top authors: 9pay (65.96%)quandm (36.17%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 2,421 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.08MB] [CPU: ▼5.64ms] Passed 4 tests

A check of server-side resources used by Thanh Toán qua cổng thanh toán 9PAY
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0940.48 ▲1.73
Dashboard /wp-admin3.38 ▲0.0843.02 ▼5.08
Posts /wp-admin/edit.php3.44 ▲0.0848.37 ▲0.93
Add New Post /wp-admin/post-new.php5.97 ▲0.0882.66 ▼20.13
Media Library /wp-admin/upload.php3.31 ▲0.0836.16 ▲3.72

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 35 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

Thanh Toán qua cổng thanh toán 9PAY: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲6113.14 ▼1.231.07 ▼0.6746.25 ▲4.17
Dashboard /wp-admin2,210 ▲224.86 ▼1.04110.78 ▲6.5041.38 ▼1.62
Posts /wp-admin/edit.php2,092 ▲32.04 ▲0.0140.22 ▲3.3239.63 ▲6.72
Add New Post /wp-admin/post-new.php1,518 ▼122.37 ▼0.86644.18 ▼25.5965.33 ▲6.73
Media Library /wp-admin/upload.php1,392 ▲44.36 ▲0.2197.10 ▼17.1442.85 ▼5.09

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

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 | 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
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'NinePayConstance' not found in wp-content/plugins/9pay-gateway/includes/gateways/core/lang.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found


Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (Đối tác Việt Nam: https://storage.googleapis.com/npay/assets/static/v4/landing/landing_update/dt1.png), #2 (Đối tác Quốc tế: https://storage.googleapis.com/npay/assets/static/v4/landing/landing_update/dt3.png)
You can look at the official readme.txt

9pay-gateway/mc-ninepay.php 85% from 13 tests

The main PHP script in "Thanh Toán qua cổng thanh toán 9PAY" version 2.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("9pay-gateway.php" instead of "mc-ninepay.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin1,764 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity5.40
▷ Minimum class complexity1.00
▷ Maximum class complexity24.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
▷ Static methods46.78%
▷ Public methods4067.80%
▷ Protected methods46.78%
▷ Private methods1525.42%
▷ Named functions1270.59%
▷ Anonymous functions529.41%
▷ Global constants213.33%
▷ Class constants1386.67%
▷ Public constants13100.00%

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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
public/images/logo.png2.25KB1.79KB▼ 20.12%