84% custom-payment-gateway-for-billdesk

Code Review | Custom Payment Gateway for BillDesk

WordPress plugin Custom Payment Gateway for BillDesk scored84%from 54 tests.

About plugin

  • Plugin page: custom-payment-ga...
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.1
  • WordPress version: 6.3.1
  • First release: Jan 23, 2017
  • Latest release: Jan 16, 2021
  • Number of updates: 7
  • Update frequency: every 207.6 days
  • Top authors: manojsingh1989 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /2,313 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.05MB] [CPU: ▼5.49ms] Passed 4 tests

This is a short check of server-side resources used by Custom Payment Gateway for BillDesk
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0537.75 ▼7.49
Dashboard /wp-admin3.36 ▲0.0547.19 ▼3.36
Posts /wp-admin/edit.php3.41 ▲0.0544.63 ▼1.49
Add New Post /wp-admin/post-new.php5.94 ▲0.0582.78 ▼8.73
Media Library /wp-admin/upload.php3.28 ▲0.0534.19 ▼2.39

Server storage [IO: ▲0.05MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Custom Payment Gateway for BillDesk
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.32 ▼1.091.61 ▼0.1540.43 ▼10.16
Dashboard /wp-admin2,203 ▲145.79 ▼0.07100.55 ▼8.9340.53 ▲2.11
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0535.48 ▼1.7132.10 ▼0.66
Add New Post /wp-admin/post-new.php1,514 ▼017.52 ▲0.06676.57 ▼15.5551.09 ▲0.20
Media Library /wp-admin/upload.php1,388 ▼34.15 ▼0.0495.28 ▲3.0143.77 ▼0.78

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% 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
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-payment-gateway-for-billdesk/index.php:10

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Payment), #2 (Logo)
The official readme.txt might help

custom-payment-gateway-for-billdesk/index.php 92% from 13 tests

The main file in "Custom Payment Gateway for BillDesk" v. 1.3.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("custom-payment-gateway-for-billdesk.php" instead of "index.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 plugin257 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP13748257

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity18.00
▷ Minimum class complexity18.00
▷ Maximum class complexity18.00
Average method complexity2.89
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
Payment.png38.42KB20.83KB▼ 45.79%
Logo.png2.11KB1.37KB▼ 35.05%