62% woo-payment-bkash

Code Review | Payment Gateway bKash for WC

WordPress plugin Payment Gateway bKash for WC scored62%from 54 tests.

About plugin

  • Plugin page: woo-payment-bkash
  • Plugin version: 3.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Feb 20, 2020
  • Latest release: Apr 11, 2023
  • Number of updates: 47
  • Update frequency: every 24.4 days
  • Top authors: kapilpaul (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

800+ active /31,192 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

An overview of server-side resources used by Payment Gateway bKash for WC
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0641.38 ▲5.36
Dashboard /wp-admin3.36 ▲0.0656.43 ▲5.65
Posts /wp-admin/edit.php3.42 ▲0.0649.47 ▲2.77
Add New Post /wp-admin/post-new.php6.01 ▲0.1289.47 ▼5.03
Media Library /wp-admin/upload.php3.29 ▲0.0643.39 ▲9.17

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 71 new files
Database: 1 new table, 8 new options
New tables
wp_bkash_transactions
New WordPress options
can_compress_scripts
widget_theysaidso_widget
dc_bkash_version
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
dc_bkash_installed

Browser metrics Passed 4 tests

An overview of browser requirements for Payment Gateway bKash for WC
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,860 ▲7414.40 ▼0.171.72 ▼0.0346.79 ▲8.68
Dashboard /wp-admin2,254 ▲805.75 ▲0.0796.14 ▼4.4579.99 ▲35.90
Posts /wp-admin/edit.php2,177 ▲772.38 ▲0.4233.22 ▼3.4034.22 ▼1.67
Add New Post /wp-admin/post-new.php1,587 ▲6123.11 ▼0.34744.57 ▲70.3656.39 ▲1.90
Media Library /wp-admin/upload.php1,464 ▲614.29 ▲0.0697.25 ▲0.7381.89 ▲36.26
Refund /wp-admin/admin.php?page=dc-bkash#/refund1,0544.6183.3030.46
Transactions /wp-admin/admin.php?page=dc-bkash#/1,1014.9486.3131.34
Search Transaction /wp-admin/admin.php?page=dc-bkash#/search-transaction1,0514.5674.7526.69
Settings /wp-admin/admin.php?page=dc-bkash#/settings1,0584.7584.9029.95

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie tables detected upon uninstall: 1 table
    • wp_bkash_transactions
  • This plugin does not fully uninstall, leaving 8 options in the database
    • dc_bkash_version
    • can_compress_scripts
    • db_upgraded
    • dc_bkash_installed
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 25% 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 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/woo-payment-bkash/templates/admin/upgrade-notice.php
  • 14× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/woo-payment-bkash/templates/admin/transaction-charge.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'DCoders\\Bkash\\API\\BkashBaseRestController' not found in wp-content/plugins/woo-payment-bkash/includes/API/Transaction.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'DCoders\\Bkash\\Abstracts\\BkashProcessor' not found in wp-content/plugins/woo-payment-bkash/includes/Gateway/IntegrationTypes/CheckoutUrl.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'DCoders\\Bkash\\Abstracts\\DcBkashUpgrader' not found in wp-content/plugins/woo-payment-bkash/includes/Upgrade/Upgrades/V_2_0_0.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/woo-payment-bkash/templates/frontend/transaction-charge.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'DCoders\\Bkash\\API\\BkashBaseRestController' not found in wp-content/plugins/woo-payment-bkash/includes/API/Payment.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'DCoders\\Bkash\\Abstracts\\BkashProcessor' not found in wp-content/plugins/woo-payment-bkash/includes/Gateway/IntegrationTypes/Checkout.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/woo-payment-bkash/includes/API/BkashBaseRestController.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'DCoders\\Bkash\\API\\BkashBaseRestController' not found in wp-content/plugins/woo-payment-bkash/includes/API/Settings.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'DCoders\\Bkash\\Abstracts\\DcBkashUpgrader' not found in wp-content/plugins/woo-payment-bkash/includes/Upgrade/Upgrades/V_2_1_0.php:19

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=dc-bkash#/
    • > Console-api (warning) in wp-content/plugins/woo-payment-bkash/assets/js/vendors.js?ver=1681053646+1:399095
    (react-paginate): The pageCount prop value provided is not an integer (0). Did you forget a Math.ceil()?
    • > GET request to /wp-admin/admin.php?page=dc-bkash#/settings
    • > Network (severe)
    index.php/wp-json/dc-bkash/v1/settings?_locale=user - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: mobilebanking, bangladesh, bdt, woocommerce pgw, bkash

woo-payment-bkash/woo-payment-bkash.php 92% from 13 tests

"Payment Gateway bKash for WC" version 3.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected5,303 lines of code in 62 files:
LanguageFilesBlank linesComment linesLines of code
PHP491,2253,0254,538
Markdown21170408
JavaScript5337244
JSON30096
CSS34017

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity14.92
▷ Minimum class complexity1.00
▷ Maximum class complexity70.00
Average method complexity2.82
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces12
Interfaces0
Traits0
Classes36
▷ Abstract classes25.56%
▷ Concrete classes3494.44%
▷ Final classes12.94%
Methods283
▷ Static methods3412.01%
▷ Public methods23984.45%
▷ Protected methods72.47%
▷ Private methods3713.07%
Functions26
▷ Named functions2284.62%
▷ Anonymous functions415.38%
Constants10
▷ Global constants880.00%
▷ Class constants220.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/bkash.png1.98KB0.74KB▼ 62.83%
assets/images/checked.png0.71KB0.53KB▼ 25.10%
assets/images/bkash_logo.png9.59KB3.67KB▼ 61.70%