68% funnelkit-stripe-woo-payment-gateway

Code Review | Stripe Payment Gateway for WooCommerce

WordPress plugin Stripe Payment Gateway for WooCommerce scored68%from 54 tests.

About plugin

  • Plugin page: funnelkit-stripe-...
  • Plugin version: 1.6.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Jan 11, 2023
  • Latest release: Nov 24, 2023
  • Number of updates: 67
  • Update frequency: every 5.4 days
  • Top authors: teamwoofunnels (79.1%)amans2k (22.39%)

Code review

54 tests

User reviews

16 reviews

Install metrics

4,000+ active /28,952 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼4.35ms] Passed 4 tests

A check of server-side resources used by Stripe Payment Gateway for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0542.19 ▼0.27
Dashboard /wp-admin3.36 ▲0.0152.29 ▼12.20
Posts /wp-admin/edit.php3.48 ▲0.1250.73 ▼1.30
Add New Post /wp-admin/post-new.php5.95 ▲0.0593.00 ▼3.61
Media Library /wp-admin/upload.php3.29 ▲0.0536.13 ▲4.78

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 385 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Stripe Payment 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,799 ▲5214.72 ▲0.371.65 ▲0.0343.88 ▼1.44
Dashboard /wp-admin2,204 ▲275.62 ▲0.0392.68 ▼9.2541.53 ▼3.03
Posts /wp-admin/edit.php2,113 ▲132.01 ▲0.0641.36 ▲3.3637.80 ▲5.42
Add New Post /wp-admin/post-new.php1,535 ▲923.42 ▲0.23626.75 ▲4.4348.93 ▼4.10
Media Library /wp-admin/upload.php1,409 ▲94.23 ▲0.0397.85 ▲3.4742.72 ▼0.82

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

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)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/funnelkit-stripe-woo-payment-gateway/library/stripe-php/update_certs.php
    • > /wp-content/plugins/funnelkit-stripe-woo-payment-gateway/library/stripe-php/build.php
  • 241× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractServiceFactory' not found in wp-content/plugins/funnelkit-stripe-woo-payment-gateway/library/stripe-php/lib/Service/Radar/RadarServiceFactory.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/funnelkit-stripe-woo-payment-gateway/admin/parts/webhook_delete.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/funnelkit-stripe-woo-payment-gateway/library/stripe-php/lib/Service/TransferService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/funnelkit-stripe-woo-payment-gateway/library/stripe-php/lib/Service/Issuing/TransactionService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'FKWCS\\Gateway\\Stripe\\Abstract_Payment_Gateway' not found in wp-content/plugins/funnelkit-stripe-woo-payment-gateway/gateways/sepa.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/funnelkit-stripe-woo-payment-gateway/library/stripe-php/lib/Service/ApplePayDomainService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/funnelkit-stripe-woo-payment-gateway/library/stripe-php/lib/Service/QuoteService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Exception\\OAuth\\OAuthErrorException' not found in wp-content/plugins/funnelkit-stripe-woo-payment-gateway/library/stripe-php/lib/Exception/OAuth/UnsupportedGrantTypeException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/funnelkit-stripe-woo-payment-gateway/library/stripe-php/lib/ExchangeRate.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/funnelkit-stripe-woo-payment-gateway/library/stripe-php/lib/Event.php:56

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention: The official readme.txt might help

funnelkit-stripe-woo-payment-gateway/funnelkit-stripe-woo-payment-gateway.php 85% from 13 tests

"Stripe Payment Gateway for WooCommerce" version 1.6.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Requires at least: Required version must match the one declared in readme.txt ("5.4.0" instead of "3.0")
  • Requires PHP: Required version must match the one declared in readme.txt ("7.0" instead of "7.4")

Code Analysis 5% from 3 tests

File types 0% from 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
These items require your attention
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/funnelkit-stripe-woo-payment-gateway/library/stripe-php/data/ca-certificates.crt
23,001 lines of code in 344 files:
LanguageFilesBlank linesComment linesLines of code
PHP2844,49613,84217,174
JavaScript134431942,009
Markdown373001,265
PO File13934751,050
CSS719581,000
SVG3511472
XML10031

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity8.01
▷ Minimum class complexity1.00
▷ Maximum class complexity247.00
Average method complexity2.45
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces32
Interfaces9
Traits10
Classes252
▷ Abstract classes124.76%
▷ Concrete classes24095.24%
▷ Final classes00.00%
Methods1,288
▷ Static methods22817.70%
▷ Public methods1,16390.30%
▷ Protected methods665.12%
▷ Private methods594.58%
Functions18
▷ Named functions00.00%
▷ Anonymous functions18100.00%
Constants849
▷ Global constants111.30%
▷ Class constants83898.70%
▷ Public constants838100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 PNG files occupy 0.11MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/Inactive.png7.82KB3.35KB▼ 57.11%
admin/assets/images/Failed.png10.17KB4.77KB▼ 53.07%
admin/assets/images/PayNow.png5.98KB3.13KB▼ 47.69%
admin/assets/images/Success.png11.47KB5.02KB▼ 56.21%
admin/assets/images/Shopping.png9.46KB4.73KB▼ 50.03%