89% edd-midtrans-gateway

Code Review | Midtrans Payment Gateway for Easy Digital Downloads

WordPress plugin Midtrans Payment Gateway for Easy Digital Downloads scored 89% from 54 tests.

About plugin

  • Plugin page: edd-midtrans-gateway
  • Plugin version: 2.5.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.1-5.7
  • WordPress version: 5.8.1
  • First release: May 16, 2019
  • Latest release: Mar 3, 2021
  • Number of updates: 9
  • Update frequency: every 73.0 days
  • Top authors: yocki (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 1,789 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.13MB] [CPU: ▼146.87ms] Passed 4 tests

An overview of server-side resources used by Midtrans Payment Gateway for Easy Digital Downloads
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.10 ▲0.3832.81 ▲10.49
Dashboard /wp-admin3.41 ▲0.3650.03 ▲2.02
Posts /wp-admin/edit.php3.46 ▲0.3550.28 ▲3.34
Add New Post /wp-admin/post-new.php4.94 ▼0.5061.76 ▼596.97
Media Library /wp-admin/upload.php3.29 ▲0.2936.01 ▲4.12

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 20 new files
Database: no new tables, 1 new option
New WordPress options
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

An overview of browser requirements for Midtrans Payment Gateway for Easy Digital Downloads
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,522 ▼7415.83 ▲0.406.39 ▼2.0728.90 ▼21.00
Dashboard /wp-admin2,970 ▲366.07 ▲0.10148.56 ▼3.67116.99 ▼7.41
Posts /wp-admin/edit.php2,739 ▼02.69 ▼0.0167.86 ▼3.7595.50 ▼3.68
Add New Post /wp-admin/post-new.php45 ▼1,6380.90 ▼15.530.11 ▼354.7428.40 ▼84.38
Media Library /wp-admin/upload.php1,810 ▲35.01 ▼0.00158.51 ▲3.07126.96 ▲0.67

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
  • This plugin does not fully uninstall, leaving 1 option in the database
    • recovery_mode_email_last_sent

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
9 plugin tags: payment, commerce, credit-card, e-commerce, edd...

edd-midtrans-gateway/midtrans-standard.php 85% from 13 tests

"Midtrans Payment Gateway for Easy Digital Downloads" version 2.5.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("edd-midtrans-gateway.php" instead of "midtrans-standard.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 190 characters long)

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 detected1,864 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP142077781,745
Markdown120056
JSON10034
XML10029

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity6.50
▷ Minimum class complexity1.00
▷ Maximum class complexity16.00
Average method complexity2.42
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods33
▷ Static methods2781.82%
▷ Public methods2266.67%
▷ Protected methods00.00%
▷ Private methods1133.33%
Functions31
▷ Named functions2993.55%
▷ Anonymous functions26.45%
Constants5
▷ Global constants120.00%
▷ Class constants480.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin