78% finance-gateway-for-woocommerce

Code Review | Finance Gateway for WooCommerce

WordPress plugin Finance Gateway for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: finance-gateway-f...
  • Plugin version: 2.7.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.2-6.3.2
  • WordPress version: 6.3.1
  • First release: Mar 18, 2019
  • Latest release: Oct 16, 2023
  • Number of updates: 81
  • Update frequency: every 20.7 days
  • Top authors: integrations (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /3,768 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.25MB] [CPU: ▼5.51ms] Passed 4 tests

A check of server-side resources used by Finance Gateway for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2639.70 ▲3.17
Dashboard /wp-admin3.57 ▲0.2247.25 ▼12.40
Posts /wp-admin/edit.php3.68 ▲0.3245.95 ▼0.62
Add New Post /wp-admin/post-new.php6.15 ▲0.2681.07 ▼12.18
Media Library /wp-admin/upload.php3.49 ▲0.2637.10 ▲7.30

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 264 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Finance Gateway for WooCommerce: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.17 ▼0.201.63 ▲0.1637.25 ▼7.80
Dashboard /wp-admin2,195 ▲175.61 ▲0.0282.79 ▼20.1439.95 ▼0.17
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0434.17 ▼2.7336.07 ▼1.86
Add New Post /wp-admin/post-new.php1,526 ▼223.77 ▲0.63660.68 ▲14.7163.67 ▲6.39
Media Library /wp-admin/upload.php1,397 ▼64.27 ▲0.0894.28 ▼4.2841.47 ▼5.30

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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 fix the following
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/finance-gateway-for-woocommerce/includes/calculator.php
    • > /wp-content/plugins/finance-gateway-for-woocommerce/includes/checkout.php
    • > /wp-content/plugins/finance-gateway-for-woocommerce/includes/widget.php
    • > /wp-content/plugins/finance-gateway-for-woocommerce/class-wc-gateway-finance.php
  • 108× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Divido\\MerchantSDK\\Test\\Unit\\MerchantSDKTestCase' not found in wp-content/plugins/finance-gateway-for-woocommerce/vendor/divido/merchant-sdk/tests/unit/Handlers/PlatformEnvironmentsHandlerTest.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Message\\Exception' not found in wp-content/plugins/finance-gateway-for-woocommerce/vendor/php-http/message/src/Exception/UnexpectedValueException.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Message\\Authentication' not found in wp-content/plugins/finance-gateway-for-woocommerce/vendor/php-http/message/src/Authentication/Bearer.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Discovery\\Strategy\\DiscoveryStrategy' not found in wp-content/plugins/finance-gateway-for-woocommerce/vendor/php-http/discovery/src/Strategy/PuliBetaStrategy.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Divido\\MerchantSDK\\Handlers\\AbstractHttpHandler' not found in wp-content/plugins/finance-gateway-for-woocommerce/vendor/divido/merchant-sdk/lib/Handlers/PlatformEnvironments/Handler.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Http\\Discovery\\ClassDiscovery' not found in wp-content/plugins/finance-gateway-for-woocommerce/vendor/php-http/discovery/src/MessageFactoryDiscovery.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Psr\\Log\\AbstractLogger' not found in wp-content/plugins/finance-gateway-for-woocommerce/vendor/psr/log/Psr/Log/Test/TestLogger.php:57
    • > PHP Fatal error
      Uncaught Error: Class 'Http\\Discovery\\ClassDiscovery' not found in wp-content/plugins/finance-gateway-for-woocommerce/vendor/php-http/discovery/src/UriFactoryDiscovery.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Http\\Message\\Encoding\\FilteredStream' not found in wp-content/plugins/finance-gateway-for-woocommerce/vendor/php-http/message/src/Encoding/DechunkStream.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Divido\\MerchantSDK\\Test\\Unit\\MerchantSDKTestCase' not found in wp-content/plugins/finance-gateway-for-woocommerce/vendor/divido/merchant-sdk/tests/unit/Helpers/StrTest.php:10

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

Optimizations

Plugin configuration 93% 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
7 plugin tags: payment gateway, ecommerce, woocommerce, woothemes, module...

finance-gateway-for-woocommerce/class-wc-gateway-finance.php 85% from 13 tests

"Finance Gateway for WooCommerce" version 2.7.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("finance-gateway-for-woocommerce.php" instead of "class-wc-gateway-finance.php")

Code Analysis Passed 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 plugin29,180 lines of code in 238 files:
LanguageFilesBlank linesComment linesLines of code
JSON290016,957
PHP1832,9395,83010,592
Markdown1466401,327
JavaScript2205122
YAML56188
make113235
XML11018
Bourne Shell161517
CSS17116
Dockerfile1308

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity5.63
▷ Minimum class complexity1.00
▷ Maximum class complexity211.00
Average method complexity2.06
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces47
Interfaces22
Traits15
Classes129
▷ Abstract classes64.65%
▷ Concrete classes12395.35%
▷ Final classes3931.71%
Methods826
▷ Static methods657.87%
▷ Public methods74089.59%
▷ Protected methods455.45%
▷ Private methods414.96%
Functions23
▷ Named functions834.78%
▷ Anonymous functions1565.22%
Constants42
▷ Global constants49.52%
▷ Class constants3890.48%
▷ Public constants3592.11%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.08MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png4.20KB2.18KB▼ 48.12%
images/finance.png5.53KB0.10KB▼ 98.11%
assets/banner-772x250.png59.72KB24.19KB▼ 59.50%
images/finance-icon.png3.43KB0.08KB▼ 97.52%
images/finance-small.png3.43KB0.08KB▼ 97.52%