84% nganluongvn-payment-gateway-for-woocommerce

Code Review | NganLuong.vn cho Woocommerce

WordPress plugin NganLuong.vn cho Woocommerce scored84%from 54 tests.

About plugin

  • Plugin page: nganluongvn-payme...
  • Plugin version: 1.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-3.8
  • WordPress version: 6.3.1
  • First release: Oct 18, 2013
  • Latest release: Feb 21, 2014
  • Number of updates: 33
  • Update frequency: every 3.8 days
  • Top authors: justdoit123 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

40+ active /6,252 total downloads

Benchmarks

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.03MB] [CPU: ▼4.55ms] Passed 4 tests

A check of server-side resources used by NganLuong.vn cho Woocommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.33 ▼10.88
Dashboard /wp-admin3.33 ▲0.0355.64 ▼1.80
Posts /wp-admin/edit.php3.38 ▲0.0355.19 ▼1.15
Add New Post /wp-admin/post-new.php5.91 ▲0.03100.08 ▼4.07
Media Library /wp-admin/upload.php3.26 ▲0.0337.59 ▼1.46

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for NganLuong.vn cho Woocommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.72 ▲0.361.76 ▼0.4042.56 ▼1.74
Dashboard /wp-admin2,195 ▲155.57 ▼0.0992.45 ▲3.2139.33 ▼0.60
Posts /wp-admin/edit.php2,100 ▼01.99 ▲0.0341.34 ▲1.7336.65 ▲0.62
Add New Post /wp-admin/post-new.php1,534 ▲618.17 ▼4.65661.61 ▼21.0673.70 ▲17.38
Media Library /wp-admin/upload.php1,397 ▼34.23 ▲0.03104.55 ▼12.9442.18 ▼6.05

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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 take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/nganluongvn-payment-gateway-for-woocommerce/nganluongvn.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: woocommerce, vietnamese, nganluong

nganluongvn-payment-gateway-for-woocommerce/nganluongvn.php 92% from 13 tests

The primary PHP file in "NganLuong.vn cho Woocommerce" version 1.4.1 is used by WordPress to initiate all plugin functionality
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 ("nganluongvn-payment-gateway-for-woocommerce.php" instead of "nganluongvn.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin129 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP12999129

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity1.89
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.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
No PNG images were found in this plugin