68% wpbkash

Code Review | bKash WordPress Payment

WordPress plugin bKash WordPress Payment scored68%from 54 tests.

About plugin

  • Plugin page: wpbkash
  • Plugin version: 0.1.9.4
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.6.1
  • WordPress version: 6.3.1
  • First release: Mar 18, 2020
  • Latest release: Apr 12, 2021
  • Number of updates: 24
  • Update frequency: every 16.3 days
  • Top authors: mlimon (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /14,722 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼7.40ms] 75% from 4 tests

An overview of server-side resources used by bKash WordPress Payment
Please take the time to fix the following items
  • CPU: You should keep total CPU usage under 500.00ms (currently 936.31ms on /wp-admin/admin.php?page=wpbkash_settings)
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0739.20 ▼6.40
Dashboard /wp-admin3.40 ▲0.0651.59 ▼17.96
Posts /wp-admin/edit.php3.52 ▲0.1654.25 ▲4.37
Add New Post /wp-admin/post-new.php6.00 ▲0.1294.37 ▼6.89
Media Library /wp-admin/upload.php3.33 ▲0.1041.07 ▲1.66
Settings /wp-admin/admin.php?page=wpbkash_settings3.45936.31
API Reuqest Docs /wp-admin/admin.php?page=api-docs3.2937.23
All Entries /wp-admin/admin.php?page=wpbkash3.3338.74

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 65 new files
Database: 2 new tables, 12 new options
New tables
wp_wpbkash
wp_wpbkash_refund
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
wpbkash_invoice
wpbkash_installed
wpbkash_general
wpbkash_extra
wpbkash_debug
...

Browser metrics Passed 4 tests

Checking browser requirements for bKash WordPress Payment
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,852 ▲9113.20 ▼1.081.66 ▼0.2738.31 ▼5.68
Dashboard /wp-admin2,246 ▲435.83 ▼0.08101.34 ▲1.0471.39 ▲27.38
Posts /wp-admin/edit.php2,140 ▲372.04 ▲0.0439.44 ▼1.8431.52 ▼3.40
Add New Post /wp-admin/post-new.php1,567 ▲4123.28 ▲5.66750.34 ▲68.4164.17 ▲0.70
Media Library /wp-admin/upload.php1,431 ▲314.30 ▲0.07103.10 ▼2.8468.81 ▲22.88
Settings /wp-admin/admin.php?page=wpbkash_settings8882.0625.2326.57
API Reuqest Docs /wp-admin/admin.php?page=api-docs8872.0525.3825.29
All Entries /wp-admin/admin.php?page=wpbkash1,0682.1127.8126.19

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • wp_wpbkash
    • wp_wpbkash_refund
  • This plugin did not uninstall successfully, leaving 12 options in the database
    • wpbkash_version
    • wpbkash_invoice
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • wpbkash_installed
    • wpbkash_debug
    • theysaidso_admin_options
    • ...

Smoke tests 50% 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 0% 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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/wpbkash/class-wpbkash.php
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/wpbkash/templates/template-wpbkash-api.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpbkash/includes/functions.php:327
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpbkash/includes/functions.php:327

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

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
6 plugin tags: woocommerce, bangladesh, bkash, bdt, gateway...

wpbkash/class-wpbkash.php 92% from 13 tests

"bKash WordPress Payment" version 0.1.9.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("wpbkash.php" instead of "class-wpbkash.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin6,278 lines of code in 57 files:
LanguageFilesBlank linesComment linesLines of code
PHP421,1881,7544,842
CSS711723775
JavaScript589103639
JSON20021
SVG1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity19.16
▷ Minimum class complexity1.00
▷ Maximum class complexity79.00
Average method complexity3.14
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes32
▷ Abstract classes00.00%
▷ Concrete classes32100.00%
▷ Final classes515.62%
Methods272
▷ Static methods259.19%
▷ Public methods26697.79%
▷ Protected methods31.10%
▷ Private methods31.10%
Functions19
▷ Named functions1789.47%
▷ Anonymous functions210.53%
Constants4
▷ Global constants375.00%
▷ Class constants125.00%
▷ Public constants1100.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
4 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/bkash-logo.png3.99KB1.38KB▼ 65.54%
assets/images/bkash-white.png10.37KB4.30KB▼ 58.54%
assets/images/error.png4.61KB2.43KB▼ 47.22%
assets/images/success.png5.41KB2.93KB▼ 45.79%