84% paytrail-for-woocommerce

Code Review | Paytrail for WooCommerce

WordPress plugin Paytrail for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: paytrail-for-wooc...
  • Plugin version: 1.3.10
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.4
  • WordPress version: 6.3.1
  • First release: Nov 4, 2021
  • Latest release: Nov 23, 2023
  • Number of updates: 27
  • Update frequency: every 27.8 days
  • Top authors: loueranta (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

2,000+ active /32,956 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by Paytrail for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0032.69 ▼43.95
Dashboard /wp-admin3.31 ▲0.0044.65 ▼9.45
Posts /wp-admin/edit.php3.36 ▲0.0051.17 ▼1.33
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.63 ▼2.19
Media Library /wp-admin/upload.php3.23 ▲0.0034.81 ▼1.31

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 146 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Paytrail for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲1314.57 ▲0.231.57 ▼1.8638.38 ▼20.57
Dashboard /wp-admin2,189 ▲95.49 ▼0.16101.36 ▼27.7744.79 ▼14.00
Posts /wp-admin/edit.php2,103 ▼01.98 ▼0.0139.74 ▼4.2042.61 ▲3.22
Add New Post /wp-admin/post-new.php1,526 ▼022.97 ▼0.15642.41 ▼78.0555.49 ▼3.86
Media Library /wp-admin/upload.php1,400 ▼04.19 ▼0.0095.31 ▼4.9640.70 ▼1.14

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • 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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 70× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Trait 'Paytrail\\SDK\\Util\\ObjectPropertyConverter' not found in wp-content/plugins/paytrail-for-woocommerce/vendor/paytrail/paytrail-php-sdk/src/Model/Token/Customer.php on line 20
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/paytrail-for-woocommerce/vendor/paytrail/paytrail-php-sdk/tests/Model/CustomerTest.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Paytrail\\WooCommercePaymentGateway\\Controllers\\AbstractController' not found in wp-content/plugins/paytrail-for-woocommerce/src/Controllers/CardCancel.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Paytrail\\SDK\\Interfaces\\ResponseInterface' not found in wp-content/plugins/paytrail-for-woocommerce/vendor/paytrail/paytrail-php-sdk/src/Response/RevertPaymentAuthHoldResponse.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Paytrail\\SDK\\Interfaces\\ResponseInterface' not found in wp-content/plugins/paytrail-for-woocommerce/vendor/paytrail/paytrail-php-sdk/src/Response/SettlementResponse.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Paytrail\\SDK\\PaytrailClient' not found in wp-content/plugins/paytrail-for-woocommerce/vendor/paytrail/paytrail-php-sdk/src/Client.php:50
    • > PHP Fatal error
      Uncaught Error: Interface 'Paytrail\\SDK\\Interfaces\\ResponseInterface' not found in wp-content/plugins/paytrail-for-woocommerce/vendor/paytrail/paytrail-php-sdk/src/Response/PaymentStatusResponse.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/paytrail-for-woocommerce/vendor/paytrail/paytrail-php-sdk/tests/Model/AddressTest.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/paytrail-for-woocommerce/vendor/paytrail/paytrail-php-sdk/tests/Model/Token/CardTest.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/paytrail-for-woocommerce/vendor/paytrail/paytrail-php-sdk/tests/Request/GetTokenRequestTest.php:11

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 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
1 plugin tags: woocommerce

paytrail-for-woocommerce/plugin.php 92% from 13 tests

The main PHP script in "Paytrail for WooCommerce" version 1.3.10 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("paytrail-for-woocommerce.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected16,193 lines of code in 137 files:
LanguageFilesBlank linesComment linesLines of code
PHP1092,1894,6647,793
JSON5007,046
PO File2130146388
Markdown41260347
Sass1321242
JavaScript41515199
SVG80890
XML25348
YAML17039
CSS1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity8.16
▷ Minimum class complexity1.00
▷ Maximum class complexity128.00
Average method complexity2.02
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces18
Interfaces9
Traits3
Classes84
▷ Abstract classes44.76%
▷ Concrete classes8095.24%
▷ Final classes22.50%
Methods666
▷ Static methods365.41%
▷ Public methods58888.29%
▷ Protected methods466.91%
▷ Private methods324.80%
Functions54
▷ Named functions00.00%
▷ Anonymous functions54100.00%
Constants23
▷ Global constants00.00%
▷ Class constants23100.00%
▷ Public constants1773.91%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin