67% payment-gateway-stripe-and-woocommerce-integration

Code Review | Stripe Payment Plugin for WooCommerce

WordPress plugin Stripe Payment Plugin for WooCommerce scored67%from 54 tests.

About plugin

  • Plugin page: payment-gateway-s...
  • Plugin version: 3.9.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2
  • WordPress version: 6.3.1
  • First release: Sep 4, 2016
  • Latest release: Nov 21, 2023
  • Number of updates: 137
  • Update frequency: every 19.2 days
  • Top authors: webtoffee (60.58%)extensionhawk (16.79%)xadapter (15.33%)mujeebur (9.49%)

Code review

54 tests

User reviews

52 reviews

Install metrics

10,000+ active /404,611 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼7.57ms] Passed 4 tests

An overview of server-side resources used by Stripe Payment Plugin for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0035.28 ▼1.49
Dashboard /wp-admin3.31 ▼0.0447.85 ▼15.44
Posts /wp-admin/edit.php3.36 ▲0.0048.74 ▼1.65
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.22 ▼11.71
Media Library /wp-admin/upload.php3.23 ▲0.0033.32 ▲0.95

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Stripe Payment Plugin for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲4314.34 ▲0.041.82 ▲0.2137.05 ▼1.13
Dashboard /wp-admin2,198 ▲205.60 ▼0.1794.42 ▼20.7642.79 ▲1.79
Posts /wp-admin/edit.php2,103 ▼01.97 ▼0.0339.71 ▼1.0237.61 ▼1.96
Add New Post /wp-admin/post-new.php1,526 ▼023.01 ▼0.38662.12 ▲63.2960.31 ▼5.19
Media Library /wp-admin/upload.php1,397 ▼04.25 ▲0.0999.81 ▼2.4044.49 ▼0.01

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/payment-gateway-stripe-and-woocommerce-integration/vendor/stripe/stripe-php/build.php
    • > /wp-content/plugins/payment-gateway-stripe-and-woocommerce-integration/vendor/stripe/stripe-php/update_certs.php
  • 251× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/payment-gateway-stripe-and-woocommerce-integration/vendor/stripe/stripe-php/lib/Card.php:44
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/payment-gateway-stripe-and-woocommerce-integration/vendor/stripe/stripe-php/lib/LineItem.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/payment-gateway-stripe-and-woocommerce-integration/vendor/stripe/stripe-php/lib/Service/RefundService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/payment-gateway-stripe-and-woocommerce-integration/vendor/stripe/stripe-php/lib/Event.php:56
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractServiceFactory' not found in wp-content/plugins/payment-gateway-stripe-and-woocommerce-integration/vendor/stripe/stripe-php/lib/Service/CoreServiceFactory.php:70
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/payment-gateway-stripe-and-woocommerce-integration/vendor/stripe/stripe-php/lib/Service/PriceService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/payment-gateway-stripe-and-woocommerce-integration/vendor/stripe/stripe-php/lib/Service/TestHelpers/Treasury/ReceivedCreditService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/payment-gateway-stripe-and-woocommerce-integration/vendor/stripe/stripe-php/lib/Service/FileService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\StripeObject' not found in wp-content/plugins/payment-gateway-stripe-and-woocommerce-integration/vendor/stripe/stripe-php/lib/OAuthErrorObject.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/payment-gateway-stripe-and-woocommerce-integration/vendor/stripe/stripe-php/lib/Service/ChargeService.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
Please take inspiration from this readme.txt

payment-gateway-stripe-and-woocommerce-integration/payment-gateway-stripe-and-woocommerce-integration.php 85% from 13 tests

The main PHP file in "Stripe Payment Plugin for WooCommerce" ver. 3.9.3 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 289 characters long)
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.6" instead of "3.0")

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Please fix the following items
  • For security reasons, never distribute binary or executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/payment-gateway-stripe-and-woocommerce-integration/vendor/stripe/stripe-php/data/ca-certificates.crt
43,890 lines of code in 400 files:
LanguageFilesBlank linesComment linesLines of code
PHP3316,13914,07524,576
JavaScript263,2461,51814,610
CSS8169211,736
Markdown377201,454
PO File2372568968
SVG2609368
JSON200118
XML10031
make110029

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
The following items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 104)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity12.13
▷ Minimum class complexity1.00
▷ Maximum class complexity288.00
Average method complexity3.53
▷ Minimum method complexity1.00
▷ Maximum method complexity104.00
Code structure
Namespaces36
Interfaces9
Traits9
Classes298
▷ Abstract classes103.36%
▷ Concrete classes28896.64%
▷ Final classes00.00%
Methods1,389
▷ Static methods21415.41%
▷ Public methods1,29593.23%
▷ Protected methods423.02%
▷ Private methods523.74%
Functions48
▷ Named functions2858.33%
▷ Anonymous functions2041.67%
Constants1,014
▷ Global constants90.89%
▷ Class constants1,00599.11%
▷ Public constants1,005100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
33 PNG files occupy 1.25MB with 0.67MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/ideal-preview.png43.47KB13.54KB▼ 68.85%
assets/img/boleto-preview.png34.60KB11.47KB▼ 66.85%
assets/img/support.png1.63KB1.69KB0.00%
assets/img/afterpay.png51.68KB17.84KB▼ 65.48%
assets/img/bitcoin.png43.46KB14.04KB▼ 67.69%