78% bangladeshi-payment-gateways

Code Review | Bangladeshi Payment Gateways - Make Payment Using QR Code

WordPress plugin Bangladeshi Payment Gateways - Make Payment Using QR Code scored78%from 54 tests.

About plugin

  • Plugin page: bangladeshi-payme...
  • Plugin version: 2.0.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: Jul 7, 2020
  • Latest release: Nov 3, 2023
  • Number of updates: 44
  • Update frequency: every 27.6 days
  • Top authors: ultradevs (100%)

Code review

54 tests

User reviews

50 reviews

Install metrics

3,000+ active /24,614 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼7.18ms] Passed 4 tests

This is a short check of server-side resources used by Bangladeshi Payment Gateways - Make Payment Using QR Code
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.72 ▼3.47
Dashboard /wp-admin3.32 ▲0.0247.58 ▼15.23
Posts /wp-admin/edit.php3.38 ▲0.0245.28 ▼4.07
Add New Post /wp-admin/post-new.php5.91 ▲0.0280.89 ▼5.94
Media Library /wp-admin/upload.php3.25 ▲0.0234.73 ▲1.62

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 54 new files
Database: no new tables, 9 new options
New WordPress options
bdpg_installed_datetime
bdpg_version
theysaidso_admin_options
widget_recent-posts
db_upgraded
bdpg_do_activation_redirect
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Bangladeshi Payment Gateways - Make Payment Using QR Code: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲6314.21 ▼0.352.34 ▲0.6544.74 ▼0.80
Dashboard /wp-admin2,218 ▲415.61 ▼0.0491.03 ▼0.7043.60 ▼0.84
Posts /wp-admin/edit.php2,120 ▲171.99 ▲0.0034.71 ▼1.9837.38 ▲4.48
Add New Post /wp-admin/post-new.php1,552 ▲2418.26 ▼4.91602.70 ▼34.0481.07 ▲31.78
Media Library /wp-admin/upload.php1,423 ▲234.18 ▼0.0597.52 ▼4.3441.49 ▼2.47

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 9 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • bdpg_installed_datetime
    • bdpg_do_activation_redirect
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • bdpg_version
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/bangladeshi-payment-gateways/uninstall.php
    • > /wp-content/plugins/bangladeshi-payment-gateways/bd-payment-gateways.php
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/bangladeshi-payment-gateways/includes/Gateways/Upay.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/bangladeshi-payment-gateways/includes/Gateways/Nagad.php:17
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/bangladeshi-payment-gateways/vendor/appsero/client/vendor/tareq1988/wp-php-cs-fixer/loader.php' (include_path='.:/usr/share/php') in wp-content/plugins/bangladeshi-payment-gateways/vendor/appsero/client/.php-cs-fixer.dist.php on line 3
    • > PHP Warning
      require_once(wp-content/plugins/bangladeshi-payment-gateways/vendor/appsero/client/vendor/tareq1988/wp-php-cs-fixer/loader.php): failed to open stream: No such file or directory in wp-content/plugins/bangladeshi-payment-gateways/vendor/appsero/client/.php-cs-fixer.dist.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/bangladeshi-payment-gateways/includes/Gateways/Bkash.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/bangladeshi-payment-gateways/includes/Gateways/Rocket.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

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
9 plugin tags: bangladeshi mobile banking, nagad, mobile payment gateways, upay qr code, rocket...

bangladeshi-payment-gateways/bd-payment-gateways.php 92% from 13 tests

The primary PHP file in "Bangladeshi Payment Gateways - Make Payment Using QR Code" version 2.0.8 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("bangladeshi-payment-gateways.php" instead of "bd-payment-gateways.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin4,683 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
PHP289301,6224,098
Markdown1820255
JSON200109
XML161195
CSS211161
JavaScript251433
YAML16032

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity27.00
▷ Minimum class complexity1.00
▷ Maximum class complexity86.00
Average method complexity3.08
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes15.88%
Methods214
▷ Static methods2511.68%
▷ Public methods17883.18%
▷ Protected methods62.80%
▷ Private methods3014.02%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.06MB with 0.04MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/Surecash.png24.78KB7.82KB▼ 68.43%
assets/images/bKash.png9.35KB4.22KB▼ 54.92%
assets/images/Rocket.png17.58KB7.21KB▼ 58.99%
assets/images/Nagad.png10.80KB5.07KB▼ 53.12%