84% woocommerce-securesubmit-gateway

Code Review | WooCommerce SecureSubmit Gateway

WordPress plugin WooCommerce SecureSubmit Gateway scored84%from 54 tests.

About plugin

  • Plugin page: woocommerce-secur...
  • Plugin version: 2.2.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Sep 15, 2014
  • Latest release: Sep 26, 2023
  • Number of updates: 94
  • Update frequency: every 35.1 days
  • Top authors: markhagan (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active /39,713 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.97ms] Passed 4 tests

This is a short check of server-side resources used by WooCommerce SecureSubmit Gateway
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.42 ▼0.0525.95 ▼15.77
Dashboard /wp-admin3.34 ▲0.0347.68 ▼3.95
Posts /wp-admin/edit.php3.39 ▲0.0351.09 ▼0.81
Add New Post /wp-admin/post-new.php5.92 ▲0.0389.64 ▼2.52
Media Library /wp-admin/upload.php3.26 ▲0.0336.63 ▼1.65

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

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

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce SecureSubmit Gateway
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,454 ▼31814.21 ▼0.510.51 ▼1.2019.49 ▼21.26
Dashboard /wp-admin2,195 ▲185.62 ▼0.0687.63 ▼15.3238.82 ▼12.57
Posts /wp-admin/edit.php2,100 ▲31.98 ▲0.0239.35 ▲2.2633.72 ▼1.11
Add New Post /wp-admin/post-new.php1,526 ▼923.63 ▲5.47644.48 ▲19.4864.69 ▼4.61
Media Library /wp-admin/upload.php1,403 ▲124.16 ▲0.0398.74 ▼4.2942.60 ▼3.38

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 131× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'HpsSoapGatewayService' not found in wp-content/plugins/woocommerce-securesubmit-gateway/classes/includes/src/Services/Fluent/Gateway/HpsFluentCreditService.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'HpsBuilderAbstract' not found in wp-content/plugins/woocommerce-securesubmit-gateway/classes/includes/src/Services/Fluent/Gateway/Credit/HpsCreditServiceChargeBuilder.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'HpsCardinalMPIResponse' not found in wp-content/plugins/woocommerce-securesubmit-gateway/classes/includes/src/Entities/AltPayment/HpsCardinalMPIRefundResponse.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'HpsTransaction' not found in wp-content/plugins/woocommerce-securesubmit-gateway/classes/includes/src/Entities/Credit/HpsReportTransactionSummary.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'HpsTransaction' not found in wp-content/plugins/woocommerce-securesubmit-gateway/classes/includes/src/Entities/Credit/HpsOfflineAuthorization.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'HpsSoapGatewayService' not found in wp-content/plugins/woocommerce-securesubmit-gateway/classes/includes/src/Services/Gateway/HpsCreditService.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'HpsBuilderAbstract' not found in wp-content/plugins/woocommerce-securesubmit-gateway/classes/includes/src/Services/Fluent/Gateway/Check/HpsCheckServiceVoidBuilder.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'HpsGiftCardActivate' not found in wp-content/plugins/woocommerce-securesubmit-gateway/classes/includes/src/Entities/Gift/HpsGiftCardVoid.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'HpsGiftCardActivate' not found in wp-content/plugins/woocommerce-securesubmit-gateway/classes/includes/src/Entities/Gift/HpsGiftCardAddValue.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'HpsBuilderAbstract' not found in wp-content/plugins/woocommerce-securesubmit-gateway/classes/includes/src/Services/Fluent/Gateway/Credit/HpsCreditServiceCaptureBuilder.php:13

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (The SecureSubmit gateway configuration screen), #2 (A view of the front-end payment form), #3 (A view of the Manage Cards section)
The official readme.txt is a good inspiration

woocommerce-securesubmit-gateway/gateway-securesubmit.php 92% from 13 tests

The principal PHP file in "WooCommerce SecureSubmit Gateway" v. 2.2.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woocommerce-securesubmit-gateway.php" instead of "gateway-securesubmit.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected13,370 lines of code in 227 files:
LanguageFilesBlank linesComment linesLines of code
PHP2182,0055,23311,748
CSS114326609
JavaScript37511532
Markdown32360479
SVG2002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity8.09
▷ Minimum class complexity1.00
▷ Maximum class complexity89.00
Average method complexity3.20
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces0
Interfaces5
Traits0
Classes202
▷ Abstract classes2110.40%
▷ Concrete classes18189.60%
▷ Final classes00.00%
Methods681
▷ Static methods7811.45%
▷ Public methods49071.95%
▷ Protected methods12217.91%
▷ Private methods6910.13%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants174
▷ Global constants31.72%
▷ Class constants17198.28%
▷ Public constants171100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
27 PNG files occupy 0.28MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/ss-inputcard-discover@2x.png6.92KB3.44KB▼ 50.33%
assets/images/ss-cvv@2x.png5.57KB2.38KB▼ 57.34%
assets/icon-128x128.png7.23KB3.52KB▼ 51.26%
assets/images/ss-saved-jcb@2x.png10.59KB4.59KB▼ 56.65%
assets/images/input-cards@2x.png54.54KB16.44KB▼ 69.86%