73% payvision-payment-gateway

Code Review | Payvision Payment Gateway

WordPress plugin Payvision Payment Gateway scored 73% from 54 tests.

About plugin

  • Plugin page: payvision-payment...
  • Plugin version: 2.7.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.2-5.9
  • WordPress version: 5.8.1
  • First release: Sep 24, 2019
  • Latest release: Feb 9, 2022
  • Number of updates: 67
  • Update frequency: every 13.2 days
  • Top authors: jterheggen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 2,815 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.43MB] [CPU: ▼180.95ms] Passed 4 tests

This is a short check of server-side resources used by Payvision Payment Gateway
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.26 ▲0.4230.18 ▲6.57
Dashboard /wp-admin3.54 ▲0.4834.87 ▼6.89
Posts /wp-admin/edit.php3.59 ▲0.4834.58 ▼6.98
Add New Post /wp-admin/post-new.php5.84 ▲0.4074.42 ▼712.22
Media Library /wp-admin/upload.php3.43 ▲0.4227.54 ▲2.28

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 805 new files
Database: 1 new table, 1 new option
New tables
wp_payvision_webhook
New WordPress options
payvision_db_version

Browser metrics Passed 4 tests

An overview of browser requirements for Payvision Payment Gateway
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,666 ▲6516.04 ▲0.225.11 ▼0.7176.07 ▲1.83
Dashboard /wp-admin2,929 ▲336.13 ▲0.04113.63 ▼16.91174.16 ▲3.00
Posts /wp-admin/edit.php2,740 ▼03.23 ▼0.0060.50 ▼2.54132.37 ▼3.69
Add New Post /wp-admin/post-new.php3,815 ▲819.44 ▲0.53436.03 ▼20.32164.36 ▲5.17
Media Library /wp-admin/upload.php1,752 ▼05.51 ▼0.04138.68 ▼0.62191.87 ▲10.64

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie tables were found after uninstall: 1 table
    • wp_payvision_webhook
  • This plugin does not fully uninstall, leaving 1 option in the database
    • payvision_db_version

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 441× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Payvision\\WooCommerce\\Handler\\ResultHandlerInterface' not found in wp-content/plugins/payvision-payment-gateway/payvision/src/Handler/Result/AbstractFailed.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Payvision_Vendor\\Payvision\\SDK\\Domain\\Service\\Builder\\Basic' not found in wp-content/plugins/payvision-payment-gateway/payvision/vendor_prefixed/payvision/src/Domain/Paymentlinks/Service/Builder/Link/Response.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Payvision_Vendor\\GuzzleHttp\\Cookie\\CookieJarInterface' not found in wp-content/plugins/payvision-payment-gateway/payvision/vendor_prefixed/guzzlehttp/guzzle/src/Cookie/CookieJar.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Payvision_Vendor\\Payvision\\SDK\\Domain\\Service\\Builder\\Basic' not found in wp-content/plugins/payvision-payment-gateway/payvision/vendor_prefixed/payvision/src/Domain/Checkouts/Service/Builder/Checkout/ResponseHeader.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Payvision\\WooCommerce\\Handler\\Result\\Refund\\AbstractRefund' not found in wp-content/plugins/payvision-payment-gateway/payvision/src/Handler/Result/Refund/Timeout.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Payvision\\WooCommerce\\Gateway\\AbstractReceiptPagePaymentGateway' not found in wp-content/plugins/payvision-payment-gateway/payvision/src/Gateway/Cards.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Payvision\\WooCommerce\\Handler\\Result\\AbstractFailed' not found in wp-content/plugins/payvision-payment-gateway/payvision/src/Handler/Result/Payment/Timeout.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/payvision-payment-gateway/payvision/src/PaymentGateway.php:58
    • > PHP Fatal error
      Uncaught Error: Class 'Payvision_Vendor\\Payvision\\SDK\\Domain\\Service\\Builder\\Basic' not found in wp-content/plugins/payvision-payment-gateway/payvision/vendor_prefixed/payvision/src/Domain/Checkouts/Service/Builder/Request/Header.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Payvision_Vendor\\Payvision\\SDK\\Domain\\Service\\Builder\\Basic' not found in wp-content/plugins/payvision-payment-gateway/payvision/vendor_prefixed/payvision/src/Domain/Payments/Service/Builder/Payment/Request.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
8 plugin tags: psp, paypal, woocommerce, bancontact, payment...

payvision-payment-gateway/payvision-payment-gateway.php 85% from 13 tests

The primary PHP file in "Payvision Payment Gateway" version 2.7.0 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Requires at least: The required version number must match the one declared in readme.txt ("5.2" instead of "3.6.2")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin57,887 lines of code in 775 files:
LanguageFilesBlank linesComment linesLines of code
PHP7403,19526,18754,330
PO File47801,2201,624
JSON16001,493
XML3817257
Markdown143078
XSD10448
SVG70035
CSS22021
JavaScript1001

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
It is recommended to fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity6.10
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity1.92
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces103
Interfaces35
Traits7
Classes665
▷ Abstract classes243.61%
▷ Concrete classes64196.39%
▷ Final classes233.59%
Methods3,859
▷ Static methods2787.20%
▷ Public methods3,23283.75%
▷ Protected methods38610.00%
▷ Private methods2416.25%
Functions184
▷ Named functions7440.22%
▷ Anonymous functions11059.78%
Constants1,175
▷ Global constants453.83%
▷ Class constants1,13096.17%
▷ Public constants1,12999.91%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
7 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
payvision/assets/images/payvision_eps.png1.08KB1.07KB▼ 1.62%
payvision/assets/images/payvision_sofort.png0.83KB0.70KB▼ 15.11%
payvision/assets/images/payvision_paypal.png1.74KB1.65KB▼ 5.18%
payvision/assets/images/payvision_afterpay.png2.56KB1.95KB▼ 23.81%
payvision/assets/images/payvision_ideal.png1.03KB0.95KB▼ 7.57%