83% trust-payments-gateway-3ds2

Code Review | Trust Payments Gateway for WooCommerce (JavaScript Library)

WordPress plugin Trust Payments Gateway for WooCommerce (JavaScript Library) scored83%from 54 tests.

About plugin

  • Plugin page: trust-payments-ga...
  • Plugin version: 1.3.4
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.2
  • WordPress version: 6.3.1
  • First release: Aug 9, 2021
  • Latest release: Oct 5, 2023
  • Number of updates: 62
  • Update frequency: every 12.8 days
  • Top authors: trustpayments (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

700+ active /8,359 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.18MB] [CPU: ▼3.99ms] Passed 4 tests

An overview of server-side resources used by Trust Payments Gateway for WooCommerce (JavaScript Library)
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1841.62 ▼0.22
Dashboard /wp-admin3.49 ▲0.1848.81 ▼0.58
Posts /wp-admin/edit.php3.54 ▲0.1846.10 ▼1.96
Add New Post /wp-admin/post-new.php6.07 ▲0.1884.96 ▼13.20
Media Library /wp-admin/upload.php3.41 ▲0.1838.11 ▲4.61

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Trust Payments Gateway for WooCommerce (JavaScript Library)
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.27 ▼1.104.70 ▲2.8143.59 ▼5.90
Dashboard /wp-admin2,206 ▲215.90 ▲0.02102.49 ▼13.8039.94 ▼5.80
Posts /wp-admin/edit.php2,089 ▲31.98 ▼0.0236.77 ▲1.2132.25 ▼3.55
Add New Post /wp-admin/post-new.php1,514 ▼2017.80 ▼5.31666.02 ▼5.8750.80 ▼4.91
Media Library /wp-admin/upload.php1,388 ▼04.26 ▲0.0794.37 ▼11.9640.91 ▼5.70

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

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
Good news, no errors were detected

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
Please fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Gateway_Cheque' not found in wp-content/plugins/trust-payments-gateway-3ds2/classes/class-wc-tp-gateway.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
6 plugin tags: gateway, trust payments, woocommerce, payment, api...

trust-payments-gateway-3ds2/trust-payments-gateway-3ds2.php 77% from 13 tests

This is the main PHP file of "Trust Payments Gateway for WooCommerce (JavaScript Library)" version 1.3.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 184 characters long)
  • Domain Path: Use only dashes and lowercase characters for the domain path ("/i18n/languages/.")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin2,727 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP22709102,597
Markdown1190130

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity253.00
▷ Minimum class complexity253.00
▷ Maximum class complexity253.00
Average method complexity9.79
▷ Minimum method complexity1.00
▷ Maximum method complexity66.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods29
▷ Static methods13.45%
▷ Public methods2896.55%
▷ Protected methods00.00%
▷ Private methods13.45%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected