68% wc-stripe-payment

Code Review | Payments via Stripe for WooCommerce

WordPress plugin Payments via Stripe for WooCommerce scored68%from 54 tests.

About plugin

  • Plugin page: wc-stripe-payment
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.0
  • WordPress version: 6.3.1
  • First release: Aug 10, 2022
  • Latest release: Aug 10, 2022
  • Number of updates: 2
  • Update frequency: every 2.5 days
  • Top authors: websitelearners17 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /919 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
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Payments via Stripe for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.08 ▼1.80
Dashboard /wp-admin3.31 ▲0.0045.14 ▼7.02
Posts /wp-admin/edit.php3.36 ▲0.0043.87 ▲2.46
Add New Post /wp-admin/post-new.php5.89 ▲0.0093.41 ▼6.07
Media Library /wp-admin/upload.php3.23 ▲0.0033.55 ▼3.98

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 567 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
wpp_stripe_version
widget_recent-comments
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Payments via Stripe for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲8313.57 ▼0.811.71 ▼0.3139.65 ▼10.11
Dashboard /wp-admin2,206 ▲184.83 ▼1.22107.55 ▼1.0642.76 ▼3.47
Posts /wp-admin/edit.php2,092 ▲32.03 ▲0.0438.94 ▼2.0132.73 ▼3.59
Add New Post /wp-admin/post-new.php1,533 ▼023.10 ▼0.20603.41 ▼40.7151.17 ▼7.85
Media Library /wp-admin/upload.php1,391 ▼04.22 ▲0.0598.53 ▼4.4940.42 ▼4.97

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • wpp_stripe_version

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
  • 16× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/wc-stripe-payment/templates/cart/applepay.php
    • > /wp-content/plugins/wc-stripe-payment/templates/product/googlepay.php
    • > /wp-content/plugins/wc-stripe-payment/templates/checkout/payment-request.php
    • > /wp-content/plugins/wc-stripe-payment/templates/cart/googlepay.php
    • > /wp-content/plugins/wc-stripe-payment/templates/mini-cart/googlepay.php
    • > /wp-content/plugins/wc-stripe-payment/templates/cart/payment-request.php
    • > /wp-content/plugins/wc-stripe-payment/templates/checkout/applepay.php
    • > /wp-content/plugins/wc-stripe-payment/templates/mini-cart/payment-methods.php
    • > /wp-content/plugins/wc-stripe-payment/templates/card-icons.php
    • > /wp-content/plugins/wc-stripe-payment/templates/product/applepay.php
  • 260× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wc-stripe-payment/vendor/stripe/stripe-php/lib/Invoice.php:110
    • > PHP Fatal error
      Uncaught Error: Interface 'Stripe\\Exception\\ExceptionInterface' not found in wp-content/plugins/wc-stripe-payment/vendor/stripe/stripe-php/lib/Exception/UnexpectedValueException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wc-stripe-payment/vendor/stripe/stripe-php/lib/TaxRate.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/wc-stripe-payment/vendor/stripe/stripe-php/lib/Service/TransferService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/wc-stripe-payment/vendor/stripe/stripe-php/lib/Service/MandateService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/wc-stripe-payment/vendor/stripe/stripe-php/lib/Service/Issuing/DisputeService.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Stripe\\HttpClient\\ClientInterface' not found in wp-content/plugins/wc-stripe-payment/vendor/stripe/stripe-php/lib/HttpClient/CurlClient.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wc-stripe-payment/vendor/stripe/stripe-php/lib/Source.php:55
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wc-stripe-payment/includes/admin/meta-boxes/views/html-order-actions.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wc-stripe-payment/vendor/stripe/stripe-php/lib/UsageRecordSummary.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% 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
6 plugin tags: credit card, ach, google pay, payments, apple pay...

wc-stripe-payment/wc-stripe-payments.php 77% from 13 tests

The main PHP file in "Payments via Stripe for WooCommerce" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and 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: Required version does not match the one declared in readme.txt ("3.0.1" instead of "3.0.0")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wc-stripe-payment.php" instead of "wc-stripe-payments.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Please make sure to remedy the following
  • For security reasons, never distribute binary or executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/wc-stripe-payment/vendor/stripe/stripe-php/data/ca-certificates.crt
29,681 lines of code in 526 files:
LanguageFilesBlank linesComment linesLines of code
PHP3713,93412,75319,127
JavaScript877314325,973
CSS1137911,919
Markdown467001,028
SVG36168860
Sass12910622
JSON10066
XML20056
make19027
YAML1003

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity5.65
▷ Minimum class complexity1.00
▷ Maximum class complexity169.00
Average method complexity1.96
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces32
Interfaces6
Traits14
Classes284
▷ Abstract classes175.99%
▷ Concrete classes26794.01%
▷ Final classes00.00%
Methods1,426
▷ Static methods26518.58%
▷ Public methods1,26888.92%
▷ Protected methods594.14%
▷ Private methods996.94%
Functions100
▷ Named functions7070.00%
▷ Anonymous functions3030.00%
Constants713
▷ Global constants60.84%
▷ Class constants70799.16%
▷ Public constants707100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.14MB with 0.09MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/logo.png68.30KB21.21KB▼ 68.95%
assets/img/favicon.png3.13KB1.39KB▼ 55.59%
assets/img/company-info.png70.22KB25.76KB▼ 63.31%