68% wc-stripe-checkout-payment-gateway

Code Review | Payment Gateway with Stripe for WooCommerce

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

About plugin

  • Plugin page: wc-stripe-checkou...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.0
  • WordPress version: 6.3.1
  • First release: Sep 19, 2021
  • Latest release: May 27, 2022
  • Number of updates: 10
  • Update frequency: every 25.5 days
  • Top authors: cloudbasemy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,341 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by Payment Gateway with Stripe for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0042.12 ▲0.70
Dashboard /wp-admin3.31 ▼0.0455.51 ▼7.52
Posts /wp-admin/edit.php3.36 ▲0.0051.88 ▲3.92
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.87 ▼7.67
Media Library /wp-admin/upload.php3.23 ▲0.0036.85 ▼2.31

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 251 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Payment Gateway with Stripe for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.27 ▼0.131.70 ▲0.0243.33 ▼3.05
Dashboard /wp-admin2,195 ▲185.61 ▲0.0184.52 ▼6.9038.14 ▼4.30
Posts /wp-admin/edit.php2,100 ▼01.94 ▼0.0141.28 ▲1.9436.19 ▼2.99
Add New Post /wp-admin/post-new.php1,528 ▲223.11 ▲0.11681.49 ▲19.0460.13 ▼2.82
Media Library /wp-admin/upload.php1,397 ▼04.11 ▼0.10111.04 ▼10.6448.25 ▼2.37

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/wc-stripe-checkout-payment-gateway/includes/stripe-php-master/update_certs.php
    • > /wp-content/plugins/wc-stripe-checkout-payment-gateway/includes/stripe-php-master/build.php
  • 197× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Exception\\ApiErrorException' not found in wp-content/plugins/wc-stripe-checkout-payment-gateway/includes/stripe-php-master/lib/Exception/AuthenticationException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wc-stripe-checkout-payment-gateway/includes/stripe-php-master/lib/TaxCode.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Exception\\ApiErrorException' not found in wp-content/plugins/wc-stripe-checkout-payment-gateway/includes/stripe-php-master/lib/Exception/PermissionException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wc-stripe-checkout-payment-gateway/includes/stripe-php-master/lib/Price.php:46
    • > PHP Fatal error
      Uncaught Error: Interface 'Stripe\\StripeClientInterface' not found in wp-content/plugins/wc-stripe-checkout-payment-gateway/includes/stripe-php-master/lib/BaseStripeClient.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wc-stripe-checkout-payment-gateway/includes/stripe-php-master/lib/UsageRecord.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/wc-stripe-checkout-payment-gateway/includes/stripe-php-master/lib/Service/Issuing/AuthorizationService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Exception\\OAuth\\OAuthErrorException' not found in wp-content/plugins/wc-stripe-checkout-payment-gateway/includes/stripe-php-master/lib/Exception/OAuth/UnsupportedGrantTypeException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wc-stripe-checkout-payment-gateway/includes/stripe-php-master/lib/Issuing/CardDetails.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Exception\\ApiErrorException' not found in wp-content/plugins/wc-stripe-checkout-payment-gateway/includes/stripe-php-master/lib/Exception/OAuth/OAuthErrorException.php:9

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 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: sca-ready, payment gateway, stripe, pci-compliant, stripe checkout...

wc-stripe-checkout-payment-gateway/wc-stripe-checkout.php 85% from 13 tests

This is the main PHP file of "Payment Gateway with Stripe for WooCommerce" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wc-stripe-checkout-payment-gateway.php" instead of "wc-stripe-checkout.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 172 characters long)

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
It is important to fix the following items
  • Do not distribute dangerous files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/wc-stripe-checkout-payment-gateway/includes/stripe-php-master/data/ca-certificates.crt
8,995 lines of code in 243 files:
LanguageFilesBlank linesComment linesLines of code
PHP2362,0139,7027,777
Markdown368801,109
JSON10048
XML10031
make19027
YAML1003

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity2.88
▷ Minimum class complexity1.00
▷ Maximum class complexity74.00
Average method complexity1.54
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces23
Interfaces9
Traits7
Classes213
▷ Abstract classes104.69%
▷ Concrete classes20395.31%
▷ Final classes00.00%
Methods737
▷ Static methods16522.39%
▷ Public methods65488.74%
▷ Protected methods324.34%
▷ Private methods516.92%
Functions15
▷ Named functions320.00%
▷ Anonymous functions1280.00%
Constants756
▷ Global constants20.26%
▷ Class constants75499.74%
▷ Public constants754100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin