78% gateway-for-vantiv-on-wc

Code Review | Gateway for Vantiv on WC

WordPress plugin Gateway for Vantiv on WC scored 78% from 54 tests.

About plugin

  • Plugin page: gateway-for-vanti...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.5
  • WordPress version: 6.3.1
  • First release: Jan 20, 2021
  • Latest release: Apr 2, 2021
  • Number of updates: 7
  • Update frequency: every 10.4 days
  • Top authors: freeua (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 404 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by Gateway for Vantiv on WC
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.49 ▼4.81
Dashboard /wp-admin3.31 ▲0.0145.89 ▼4.75
Posts /wp-admin/edit.php3.36 ▲0.0049.98 ▲1.22
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.74 ▼1.87
Media Library /wp-admin/upload.php3.23 ▲0.0031.82 ▼2.79

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 734 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Gateway for Vantiv on WC
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲9113.63 ▼0.678.59 ▲6.7741.14 ▼2.24
Dashboard /wp-admin2,211 ▲265.84 ▲0.75106.71 ▼9.8440.28 ▼8.12
Posts /wp-admin/edit.php2,099 ▲101.98 ▼0.0239.86 ▲5.0035.72 ▼0.85
Add New Post /wp-admin/post-new.php1,522 ▲317.74 ▼5.58677.43 ▼8.8957.26 ▲5.89
Media Library /wp-admin/upload.php1,399 ▲114.22 ▼0.0195.74 ▼15.5045.15 ▼3.02

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 0% 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 fix the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/gateway-for-vantiv-on-wc/vantiv_sdk/vendor/phpunit/phpunit/build/assertions.php
    • > /wp-content/plugins/gateway-for-vantiv-on-wc/vantiv_sdk/cnp/sdk/Setup.php
  • 395× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/gateway-for-vantiv-on-wc/vantiv_sdk/vendor/phpunit/phpunit/Tests/_files/IncompleteTest.php:2
    • > PHP Warning
      fgets() expects parameter 1 to be resource, string given in wp-content/plugins/gateway-for-vantiv-on-wc/vantiv_sdk/cnp/sdk/Setup.php on line 108
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/gateway-for-vantiv-on-wc/vantiv_sdk/vendor/phpunit/php-code-coverage/Tests/_files/CoverageNoneTest.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/gateway-for-vantiv-on-wc/vantiv_sdk/vendor/phpunit/phpunit/Tests/Framework/Assert/FunctionsTest.php:57
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestSuite' not found in wp-content/plugins/gateway-for-vantiv-on-wc/vantiv_sdk/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite/DataProvider.php:57
    • > PHP Warning
      fgets() expects parameter 1 to be resource, string given in wp-content/plugins/gateway-for-vantiv-on-wc/vantiv_sdk/cnp/sdk/Setup.php on line 108
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/gateway-for-vantiv-on-wc/vantiv_sdk/vendor/phpunit/php-code-coverage/Tests/_files/CoverageFunctionTest.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'cnp\\sdk\\CnpRequest' not found in wp-content/plugins/gateway-for-vantiv-on-wc/vantiv_sdk/samples/Batch/SampleBatchDriver.php:24
    • > PHP Warning
      include(): Failed opening 'test1.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/gateway-for-vantiv-on-wc/vantiv_sdk/vendor/phpunit/php-token-stream/Tests/_files/source3.php on line 5
    • > PHP Fatal error
      require_once(): Failed opening required 'PHP/Token/Stream.php' (include_path='.:/usr/share/php') in wp-content/plugins/gateway-for-vantiv-on-wc/vantiv_sdk/vendor/phpunit/php-token-stream/Tests/Token/FunctionTest.php on line 53

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: credit card, woocommerce, vantiv, payment request

gateway-for-vantiv-on-wc/gateway-vantiv-woocommerce.php 92% from 13 tests

The principal PHP file in "Gateway for Vantiv on WC" v. 1.0.1 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("gateway-for-vantiv-on-wc.php" instead of "gateway-vantiv-woocommerce.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin70,475 lines of code in 659 files:
LanguageFilesBlank linesComment linesLines of code
PHP55011,66637,75758,557
XSD2331844,653
YAML25149893,253
XML3693111,245
JSON12301,066
Ant41020678
CSS4193168519
Markdown162050400
JavaScript911761
HTML11043

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
These items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 124)
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity12.29
▷ Minimum class complexity1.00
▷ Maximum class complexity628.00
Average method complexity3.34
▷ Minimum method complexity1.00
▷ Maximum method complexity124.00
Code structure
Namespaces22
Interfaces28
Traits0
Classes582
▷ Abstract classes233.95%
▷ Concrete classes55996.05%
▷ Final classes10.18%
Methods3,009
▷ Static methods34711.53%
▷ Public methods2,67088.73%
▷ Protected methods2929.70%
▷ Private methods471.56%
Functions194
▷ Named functions16685.57%
▷ Anonymous functions2814.43%
Constants258
▷ Global constants4517.44%
▷ Class constants21382.56%
▷ Public constants213100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 compressed PNG files occupy 0.02MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vantiv_sdk/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/img/glyphicons-halflings-white.png8.57KB9.20KB0.00%
vantiv_sdk/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/img/glyphicons-halflings.png12.50KB10.35KB▼ 17.19%