84% sampath-bank-paycorp-payment-gateway

Code Review | Sampath bank Paycorp payment gateway

WordPress plugin Sampath bank Paycorp payment gateway scored84%from 54 tests.

About plugin

  • Plugin page: sampath-bank-payc...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.8
  • WordPress version: 6.3.1
  • First release: Jun 9, 2016
  • Latest release: Jan 19, 2017
  • Number of updates: 5
  • Update frequency: every 115.8 days
  • Top authors: Oganro (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,047 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

Server-side resources used by Sampath bank Paycorp payment gateway
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.21 ▼0.71
Dashboard /wp-admin3.31 ▲0.0047.45 ▼7.75
Posts /wp-admin/edit.php3.36 ▲0.0048.08 ▼3.27
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.76 ▼2.85
Media Library /wp-admin/upload.php3.23 ▲0.0038.67 ▲0.58

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 75 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Sampath bank Paycorp payment gateway: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.72 ▲0.531.83 ▼0.0243.50 ▲1.96
Dashboard /wp-admin2,198 ▲215.58 ▼0.0981.23 ▼12.7739.96 ▼4.87
Posts /wp-admin/edit.php2,097 ▼01.96 ▼0.0737.03 ▼5.2433.83 ▼3.48
Add New Post /wp-admin/post-new.php1,526 ▼223.30 ▲0.35682.32 ▲14.2666.54 ▲12.54
Media Library /wp-admin/upload.php1,400 ▼04.12 ▼0.09101.01 ▼5.6041.51 ▼4.27

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 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% 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 no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 15× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'BaseFacade' not found in wp-content/plugins/sampath-bank-paycorp-payment-gateway/au.com.gateway.client.facade/Payment.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'IJsonHelper' not found in wp-content/plugins/sampath-bank-paycorp-payment-gateway/au.com.gateway.client.helpers/BasicReportJsonHelper.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'IJsonHelper' not found in wp-content/plugins/sampath-bank-paycorp-payment-gateway/au.com.gateway.client.helpers/UpdateCardJsonHelper.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'BaseFacade' not found in wp-content/plugins/sampath-bank-paycorp-payment-gateway/au.com.gateway.client.facade/Report.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'IJsonHelper' not found in wp-content/plugins/sampath-bank-paycorp-payment-gateway/au.com.gateway.client.helpers/AmexWalletInitJsonHelper.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'IJsonHelper' not found in wp-content/plugins/sampath-bank-paycorp-payment-gateway/au.com.gateway.client.helpers/VerifyTokenJsonHelper.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'IJsonHelper' not found in wp-content/plugins/sampath-bank-paycorp-payment-gateway/au.com.gateway.client.helpers/RetrieveCardJsonHelper.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'IJsonHelper' not found in wp-content/plugins/sampath-bank-paycorp-payment-gateway/au.com.gateway.client.helpers/PaymentCompleteJsonHelper.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'IJsonHelper' not found in wp-content/plugins/sampath-bank-paycorp-payment-gateway/au.com.gateway.client.helpers/DeleteTokenJsonHelper.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'BaseFacade' not found in wp-content/plugins/sampath-bank-paycorp-payment-gateway/au.com.gateway.client.facade/AmexWallet.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

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 to be fixed:
  • Donate link: Invalid url: ""
The official readme.txt is a good inspiration

sampath-bank-paycorp-payment-gateway/sampath-bank-paycorp-payment-gateway-woocommerce.php 92% from 13 tests

This is the main PHP file of "Sampath bank Paycorp payment gateway" version 1.1, 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: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sampath-bank-paycorp-payment-gateway.php" instead of "sampath-bank-paycorp-payment-gateway-woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected3,149 lines of code in 72 files:
LanguageFilesBlank linesComment linesLines of code
PHP721,013363,149

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.02
Average class complexity1.24
▷ Minimum class complexity1.00
▷ Maximum class complexity17.00
Average method complexity1.03
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes71
▷ Abstract classes11.41%
▷ Concrete classes7098.59%
▷ Final classes45.71%
Methods599
▷ Static methods30.50%
▷ Public methods58898.16%
▷ Protected methods20.33%
▷ Private methods91.50%
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin