83% nagad-payment-gateway

Code Review | Nagad Payment Gateway

WordPress plugin Nagad Payment Gateway scored83%from 54 tests.

About plugin

  • Plugin page: nagad-payment-gat...
  • Plugin version: 1.1.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Oct 6, 2021
  • Latest release: Sep 3, 2023
  • Number of updates: 28
  • Update frequency: every 24.9 days
  • Top authors: ashik1198911 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /6,863 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.07MB] [CPU: ▼1.57ms] Passed 4 tests

Analyzing server-side resources used by Nagad Payment Gateway
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0735.44 ▼1.98
Dashboard /wp-admin3.37 ▲0.0744.52 ▼3.35
Posts /wp-admin/edit.php3.49 ▲0.1346.75 ▲0.12
Add New Post /wp-admin/post-new.php5.95 ▲0.0791.96 ▼1.06
Media Library /wp-admin/upload.php3.30 ▲0.0735.69 ▲0.55

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

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

Browser metrics Passed 4 tests

Nagad Payment Gateway: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.65 ▼0.931.66 ▲0.0440.92 ▼4.02
Dashboard /wp-admin2,203 ▲155.91 ▲0.03103.17 ▼0.8741.75 ▼2.14
Posts /wp-admin/edit.php2,089 ▼02.02 ▼0.0136.00 ▼4.6636.21 ▼3.57
Add New Post /wp-admin/post-new.php1,537 ▲1823.41 ▲0.21677.24 ▲67.5253.91 ▲3.01
Media Library /wp-admin/upload.php1,385 ▼04.19 ▲0.02102.94 ▲0.9246.02 ▲2.24

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

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

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)
Everything seems fine, however this is by no means 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
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/nagad-payment-gateway/txn_list.php on line 6
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/nagad-payment-gateway/txn_list.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'Nagad\\Gateway\\Payment\\gateway' not found in wp-content/plugins/nagad-payment-gateway/helper.php:6
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/nagad-payment-gateway/txn_list.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/nagad-payment-gateway/gateway.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Contributors: Plugin contributors not specified
The official readme.txt might help

nagad-payment-gateway/index.php 85% from 13 tests

The principal PHP file in "Nagad Payment Gateway" v. 1.1.4 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("nagad-payment-gateway.php" instead of "index.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Everything looks great! No dangerous files found in this plugin956 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP12310271936
JSON20020

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity14.00
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.46
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods72
▷ Static methods2331.94%
▷ Public methods6894.44%
▷ Protected methods11.39%
▷ Private methods34.17%
Functions4
▷ Named functions250.00%
▷ Anonymous functions250.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
3 PNG files occupy 0.07MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
logo/nagad_cover.png68.90KB68.91KB0.00%
logo/nagad.png4.44KB2.74KB▼ 38.24%
logo/ngd.png2.14KB1.23KB▼ 42.73%