10% trust-payments-hosted-payment-pages-integration

Code Review | Trust Payments Gateway for WooCommerce

WordPress plugin Trust Payments Gateway for WooCommerce scored10%from 54 tests.

About plugin

  • Plugin page: trust-payments-ho...
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3.2
  • WordPress version: 6.3.1
  • First release: Nov 26, 2021
  • Latest release: Nov 7, 2023
  • Number of updates: 34
  • Update frequency: every 21.7 days
  • Top authors: trustpayments (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /2,325 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/trust-payments-hosted-payment-pages-integration/woocommerce-securetrading-gateway.php+264
    include_once(wp-content/plugins/woocommerce/includes/admin/wc-admin-functions.php): failed to open stream: No such file or directory

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

Server-side resources used by Trust Payments Gateway for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0041.65 ▲0.44
Dashboard /wp-admin3.31 ▲0.0046.24 ▼9.15
Posts /wp-admin/edit.php3.36 ▲0.0050.41 ▲2.04
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.32 ▼13.34
Media Library /wp-admin/upload.php3.23 ▲0.0035.44 ▲1.17

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 190 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Trust Payments Gateway for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.22 ▼0.411.67 ▼0.1043.78 ▼1.02
Dashboard /wp-admin2,198 ▲185.59 ▼0.0690.90 ▼2.7938.33 ▼0.31
Posts /wp-admin/edit.php2,100 ▼01.95 ▼0.0238.85 ▲2.6134.44 ▼5.05
Add New Post /wp-admin/post-new.php1,526 ▲123.32 ▲0.27702.14 ▲50.1068.25 ▲9.44
Media Library /wp-admin/upload.php1,403 ▲64.23 ▲0.0896.08 ▼6.8843.46 ▼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
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

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
Even though everything seems fine, this is not 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
Please fix the following
  • 60× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Securetrading\\Exception' not found in wp-content/plugins/trust-payments-hosted-payment-pages-integration/vendor/securetrading/stpp_json/src/ConfigException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Securetrading\\Unittest\\UnittestAbstract' not found in wp-content/plugins/trust-payments-hosted-payment-pages-integration/vendor/securetrading/stpp_json/tests/unit/ConverterTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Psr\\Log\\AbstractLogger' not found in wp-content/plugins/trust-payments-hosted-payment-pages-integration/vendor/securetrading/log/src/Filter.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Securetrading\\Unittest\\IntegrationtestAbstract' not found in wp-content/plugins/trust-payments-hosted-payment-pages-integration/vendor/securetrading/log/tests/integration/FactoryTest.php:7
    • > PHP Fatal error
      Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 7.4.16. in wp-content/plugins/trust-payments-hosted-payment-pages-integration/vendor/composer/platform_check.php on line 24
    • > PHP Fatal error
      Uncaught Error: Class 'Securetrading\\Unittest\\UnittestAbstract' not found in wp-content/plugins/trust-payments-hosted-payment-pages-integration/vendor/securetrading/log/tests/unit/FileWriterTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Securetrading\\Unittest\\UnittestAbstract' not found in wp-content/plugins/trust-payments-hosted-payment-pages-integration/vendor/securetrading/stpp_json/tests/unit/RequestsTest.php:5
    • > PHP Fatal error
      Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 7.4.16. in wp-content/plugins/trust-payments-hosted-payment-pages-integration/vendor/composer/platform_check.php on line 24
    • > PHP Fatal error
      Uncaught Error: Class 'Securetrading\\Data\\Data' not found in wp-content/plugins/trust-payments-hosted-payment-pages-integration/vendor/securetrading/data/tests/unit/DataTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Securetrading\\Exception' not found in wp-content/plugins/trust-payments-hosted-payment-pages-integration/vendor/securetrading/log/src/FilterException.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: Too many tags (45 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

trust-payments-hosted-payment-pages-integration/woocommerce-securetrading-gateway.php 92% from 13 tests

"Trust Payments Gateway for WooCommerce" version 1.1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
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 ("trust-payments-hosted-payment-pages-integration.php" instead of "woocommerce-securetrading-gateway.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
There were no executable files found in this plugin15,832 lines of code in 164 files:
LanguageFilesBlank linesComment linesLines of code
PHP1322,4463,23514,529
JSON1210549
Markdown111950535
CSS2130124
SVG30153
JavaScript30137
INI1005

PHP code Passed 2 tests

An short overview of 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.30
Average class complexity14.65
▷ Minimum class complexity1.00
▷ Maximum class complexity391.00
Average method complexity2.84
▷ Minimum method complexity1.00
▷ Maximum method complexity96.00
Code structure
Namespaces20
Interfaces7
Traits2
Classes99
▷ Abstract classes44.04%
▷ Concrete classes9595.96%
▷ Final classes00.00%
Methods862
▷ Static methods526.03%
▷ Public methods77690.02%
▷ Protected methods687.89%
▷ Private methods182.09%
Functions52
▷ Named functions1223.08%
▷ Anonymous functions4076.92%
Constants87
▷ Global constants3135.63%
▷ Class constants5664.37%
▷ Public constants56100.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.20MB with 0.07MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/TRUST_Payments_White.png200.47KB126.56KB▼ 36.87%