89% duitku-social-payment-gateway

Code Review | Duitku Payment Gateway

WordPress plugin Duitku Payment Gateway scored89%from 54 tests.

About plugin

  • Plugin page: duitku-social-pay...
  • Plugin version: 2.11.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.0.1
  • WordPress version: 6.3.1
  • First release: Apr 8, 2021
  • Latest release: Jan 6, 2023
  • Number of updates: 18
  • Update frequency: every 35.5 days
  • Top authors: rayhanduitku (72.22%)hanithiojuwono (33.33%)

Code review

54 tests

User reviews

1 review

Install metrics

900+ active /10,335 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.14ms] Passed 4 tests

Analyzing server-side resources used by Duitku Payment Gateway
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0038.56 ▼5.21
Dashboard /wp-admin3.31 ▲0.0056.55 ▲2.05
Posts /wp-admin/edit.php3.36 ▲0.0051.48 ▼3.00
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.49 ▼9.77
Media Library /wp-admin/upload.php3.23 ▲0.0033.93 ▼6.56

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 57 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Duitku Payment Gateway
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲3014.74 ▲0.623.81 ▲2.3043.12 ▼3.76
Dashboard /wp-admin2,198 ▲245.65 ▲0.0186.60 ▼11.3438.47 ▼10.51
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0539.32 ▲2.3935.32 ▼2.00
Add New Post /wp-admin/post-new.php1,534 ▼318.05 ▼0.45597.10 ▼31.4285.67 ▲24.46
Media Library /wp-admin/upload.php1,400 ▲34.21 ▼0.0198.80 ▼12.8442.35 ▼5.93

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% 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
These attributes need your attention:
  • Tags: Too many tags (26 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

duitku-social-payment-gateway/woocommerce-gateway-duitku.php 92% from 13 tests

This is the main PHP file of "Duitku Payment Gateway" version 2.11.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("duitku-social-payment-gateway.php" instead of "woocommerce-gateway-duitku.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
There were no executable files found in this plugin1,898 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP284108101,849
JavaScript112649

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity4.93
▷ Minimum class complexity1.00
▷ Maximum class complexity41.00
Average method complexity2.59
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes28
▷ Abstract classes13.57%
▷ Concrete classes2796.43%
▷ Final classes00.00%
Methods69
▷ Static methods1420.29%
▷ Public methods6797.10%
▷ Protected methods11.45%
▷ Private methods11.45%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
27 PNG files occupy 0.09MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/assets/bca-klikpay.png3.53KB2.37KB▼ 32.93%
includes/assets/Ritel.png10.10KB3.86KB▼ 61.76%
includes/assets/pospay.png3.09KB2.05KB▼ 33.85%
includes/assets/credit-card.png3.72KB2.28KB▼ 38.69%
includes/assets/va_permata.png3.01KB2.12KB▼ 29.46%