84% transafe-payments-for-woocommerce

Code Review | TranSafe Payments for WooCommerce

WordPress plugin TranSafe Payments for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: transafe-payments...
  • Plugin version: 2.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 2, 2019
  • Latest release: Oct 9, 2023
  • Number of updates: 18
  • Update frequency: every 78.5 days
  • Top authors: gwestontransafe (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,113 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.13MB] [CPU: ▼9.80ms] Passed 4 tests

Analyzing server-side resources used by TranSafe Payments for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1338.35 ▼0.13
Dashboard /wp-admin3.43 ▲0.1345.22 ▼0.56
Posts /wp-admin/edit.php3.54 ▲0.1947.61 ▼4.36
Add New Post /wp-admin/post-new.php6.01 ▲0.1379.46 ▼32.50
Media Library /wp-admin/upload.php3.35 ▲0.1235.81 ▼1.79

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 37 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for TranSafe Payments for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲6113.16 ▼1.401.71 ▼0.1243.54 ▲3.76
Dashboard /wp-admin2,210 ▲225.85 ▲0.96108.40 ▲5.0039.71 ▼3.82
Posts /wp-admin/edit.php2,098 ▲62.02 ▲0.0140.48 ▼2.6537.11 ▲0.27
Add New Post /wp-admin/post-new.php1,535 ▲1622.99 ▼0.21670.18 ▲17.5354.94 ▲2.74
Media Library /wp-admin/upload.php1,398 ▲104.19 ▼0.1897.78 ▼1.5645.44 ▲3.59

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
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Defuse\\Crypto\\Exception\\CryptoException' not found in wp-content/plugins/transafe-payments-for-woocommerce/includes/dependencies/defuse/php-encryption/src/Exception/IOException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Defuse\\Crypto\\Crypto' not found in wp-content/plugins/transafe-payments-for-woocommerce/includes/dependencies/defuse/php-encryption/src/RuntimeTests.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Defuse\\Crypto\\Exception\\CryptoException' not found in wp-content/plugins/transafe-payments-for-woocommerce/includes/dependencies/defuse/php-encryption/src/Exception/WrongKeyOrModifiedCiphertextException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Defuse\\Crypto\\Exception\\CryptoException' not found in wp-content/plugins/transafe-payments-for-woocommerce/includes/dependencies/defuse/php-encryption/src/Exception/EnvironmentIsBrokenException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Defuse\\Crypto\\Exception\\CryptoException' not found in wp-content/plugins/transafe-payments-for-woocommerce/includes/dependencies/defuse/php-encryption/src/Exception/BadFormatException.php:5

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: transafe, iframe, gateway, payment, credit card...

transafe-payments-for-woocommerce/woocommerce-gateway-transafe.php 85% from 13 tests

This is the main PHP file of "TranSafe Payments for WooCommerce" version 2.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Requires PHP: The required version number must match the one declared in readme.txt ("7.0.0" instead of "7.0")
  • Main file name: The principal plugin file should be the same as the plugin slug ("transafe-payments-for-woocommerce.php" instead of "woocommerce-gateway-transafe.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected3,133 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP296311,2272,759
JavaScript2700205
JSON100128
CSS20041

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity14.45
▷ Minimum class complexity1.00
▷ Maximum class complexity60.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes731.82%
Methods124
▷ Static methods7661.29%
▷ Public methods9778.23%
▷ Protected methods32.42%
▷ Private methods2419.35%
Functions10
▷ Named functions770.00%
▷ Anonymous functions330.00%
Constants34
▷ Global constants00.00%
▷ Class constants34100.00%
▷ Public constants34100.00%

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
There are no PNG files in this plugin