83% wc-securionpay

Code Review | Payment Gateway for Woocommerce - SecurionPay

WordPress plugin Payment Gateway for Woocommerce - SecurionPay scored83%from 54 tests.

About plugin

  • Plugin page: wc-securionpay
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3
  • WordPress version: 6.3.1
  • First release: Apr 5, 2020
  • Latest release: Aug 27, 2023
  • Number of updates: 7
  • Update frequency: every 177.3 days
  • Top authors: sajjad67 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /598 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: ▼1.16ms] Passed 4 tests

Analyzing server-side resources used by Payment Gateway for Woocommerce - SecurionPay
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0043.05 ▲1.69
Dashboard /wp-admin3.31 ▲0.0145.81 ▼8.04
Posts /wp-admin/edit.php3.36 ▲0.0046.56 ▲0.81
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.79 ▲2.87
Media Library /wp-admin/upload.php3.23 ▲0.0033.09 ▲0.90

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Payment Gateway for Woocommerce - SecurionPay
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.26 ▼1.181.68 ▼0.0844.29 ▲0.14
Dashboard /wp-admin2,203 ▲295.83 ▼0.0796.79 ▼10.8539.52 ▼8.32
Posts /wp-admin/edit.php2,086 ▼32.05 ▲0.0240.47 ▲2.7734.31 ▲1.83
Add New Post /wp-admin/post-new.php1,542 ▲918.54 ▼4.64605.98 ▼76.6268.84 ▲18.56
Media Library /wp-admin/upload.php1,382 ▼04.31 ▲0.1297.98 ▼4.1640.30 ▼3.21

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 72× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'SecurionPay\\Request\\AbstractRequest' not found in wp-content/plugins/wc-securionpay/includes/vendor/securionpay/securionpay-php/lib/SecurionPay/Request/ChargeListRequest.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'SecurionPay\\Connection\\Connection' not found in wp-content/plugins/wc-securionpay/includes/vendor/securionpay/securionpay-php/lib/SecurionPay/Connection/CurlConnection.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'SecurionPay\\Request\\AbstractRequest' not found in wp-content/plugins/wc-securionpay/includes/vendor/securionpay/securionpay-php/lib/SecurionPay/Request/CustomerRecordFeeListRequest.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'SecurionPay\\Request\\AbstractRequest' not found in wp-content/plugins/wc-securionpay/includes/vendor/securionpay/securionpay-php/lib/SecurionPay/Request/CheckoutRequestCharge.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'SecurionPay\\Request\\AbstractRequest' not found in wp-content/plugins/wc-securionpay/includes/vendor/securionpay/securionpay-php/lib/SecurionPay/Request/CardRequest.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'SecurionPay\\Request\\AbstractRequest' not found in wp-content/plugins/wc-securionpay/includes/vendor/securionpay/securionpay-php/lib/SecurionPay/Request/BillingRequest.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'SecurionPay\\Request\\AbstractRequest' not found in wp-content/plugins/wc-securionpay/includes/vendor/securionpay/securionpay-php/lib/SecurionPay/Request/PlanRequest.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'SecurionPay\\Request\\AbstractRequest' not found in wp-content/plugins/wc-securionpay/includes/vendor/securionpay/securionpay-php/lib/SecurionPay/Request/CaptureRequest.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'SecurionPay\\Request\\AbstractRequest' not found in wp-content/plugins/wc-securionpay/includes/vendor/securionpay/securionpay-php/lib/SecurionPay/Request/CustomerListRequest.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'SecurionPay\\Response\\AbstractResponse' not found in wp-content/plugins/wc-securionpay/includes/vendor/securionpay/securionpay-php/lib/SecurionPay/Response/Card.php:4

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 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
9 plugin tags: woocommerce-payment-gateway, secure-payment, securionpay, woocommerce, woo...

wc-securionpay/woo-securionpay.php 69% from 13 tests

Analyzing the main PHP file in "Payment Gateway for Woocommerce - SecurionPay" version 1.0.2
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("wc-securionpay.php" instead of "woo-securionpay.php")
  • Domain Path: You should use only dashes and lowercase characters for the domain path ("languages")
  • Domain Path: The domain path should be prefixed with a forward slash character ("/languages")

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
There were no executable files found in this plugin4,875 lines of code in 92 files:
LanguageFilesBlank linesComment linesLines of code
PHP891,1996794,763
JSON20061
Markdown121051

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity2.60
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity1.15
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes84
▷ Abstract classes22.38%
▷ Concrete classes8297.62%
▷ Final classes00.00%
Methods881
▷ Static methods40.45%
▷ Public methods86397.96%
▷ Protected methods10.11%
▷ Private methods171.93%
Functions10
▷ Named functions770.00%
▷ Anonymous functions330.00%
Constants5
▷ Global constants360.00%
▷ Class constants240.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/logo.png5.02KB3.06KB▼ 39.00%