57% payments-stripe-gateway

Code Review | Pay With Stripe - Your WordPress Payments Stripe Gateway

WordPress plugin Pay With Stripe - Your WordPress Payments Stripe Gateway scored57%from 54 tests.

About plugin

  • Plugin page: payments-stripe-g...
  • Plugin version: 1.2.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.9
  • WordPress version: 6.3.1
  • First release: Jun 4, 2021
  • Latest release: Mar 3, 2022
  • Number of updates: 28
  • Update frequency: every 9.8 days
  • Top authors: freshlightlab (85.71%)takanakui (17.86%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /914 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.57MB] [CPU: ▼2.92ms] Passed 4 tests

Analyzing server-side resources used by Pay With Stripe - Your WordPress Payments Stripe Gateway
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.09 ▲0.6342.52 ▼1.17
Dashboard /wp-admin3.93 ▲0.6252.58 ▼3.63
Posts /wp-admin/edit.php3.98 ▲0.6253.09 ▲2.31
Add New Post /wp-admin/post-new.php6.45 ▲0.5697.72 ▼9.20
Media Library /wp-admin/upload.php3.69 ▲0.4645.89 ▲12.46
Freemius Debug [v.2.5.0.1] /wp-admin/admin.php?page=freemius4.0539.76

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 418 new files
Database: no new tables, 10 new options
New WordPress options
fs_active_plugins
widget_recent-comments
fs_accounts
widget_theysaidso_widget
db_upgraded
fs_debug_mode
fs_gdpr
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Pay With Stripe - Your WordPress Payments Stripe Gateway
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲6814.31 ▼0.041.68 ▲0.1828.34 ▼11.40
Dashboard /wp-admin2,235 ▲585.54 ▼0.1498.31 ▲6.7246.46 ▲2.73
Posts /wp-admin/edit.php2,141 ▲412.11 ▲0.0944.31 ▲9.1640.17 ▲0.33
Add New Post /wp-admin/post-new.php1,551 ▲2323.03 ▲0.01693.38 ▲63.3551.10 ▼2.33
Media Library /wp-admin/upload.php1,440 ▲374.26 ▼0.0298.69 ▼7.5844.89 ▼0.21
Freemius Debug [v.2.5.0.1] /wp-admin/admin.php?page=freemius1,0931.6927.5632.85

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/payments-stripe-gateway/freemius/includes/class-freemius.php+8911
    Undefined property: stdClass::$plugins
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • fs_gdpr
    • can_compress_scripts
    • widget_recent-posts
    • fs_active_plugins
    • fs_accounts
    • fs_debug_mode

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)
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 4× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/payments-stripe-gateway/vendor/stripe/update_certs.php
    • > /wp-content/plugins/payments-stripe-gateway/includes/pwstripe-core.php
    • > /wp-content/plugins/payments-stripe-gateway/vendor/stripe/build.php
    • > /wp-content/plugins/payments-stripe-gateway/includes/pwstripe-manager.php
  • 194× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/payments-stripe-gateway/vendor/stripe/lib/Issuing/Cardholder.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Exception\\ApiErrorException' not found in wp-content/plugins/payments-stripe-gateway/vendor/stripe/lib/Exception/OAuth/OAuthErrorException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/payments-stripe-gateway/vendor/stripe/lib/Identity/VerificationReport.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/payments-stripe-gateway/vendor/stripe/lib/Service/Reporting/ReportRunService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\StripeObject' not found in wp-content/plugins/payments-stripe-gateway/vendor/stripe/lib/ApiResource.php:8
    • > PHP Notice
      Undefined variable: argv in wp-content/plugins/payments-stripe-gateway/vendor/stripe/build.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/payments-stripe-gateway/vendor/stripe/lib/CreditNoteLineItem.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/payments-stripe-gateway/vendor/stripe/lib/BitcoinTransaction.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Exception\\OAuth\\OAuthErrorException' not found in wp-content/plugins/payments-stripe-gateway/vendor/stripe/lib/Exception/OAuth/InvalidClientException.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/payments-stripe-gateway/vendor/stripe/lib/Sigma/ScheduledQueryRun.php:26

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
5 plugin tags: stripe, stripe gateway, payment gateway, stripe checkout, stripe payments

payments-stripe-gateway/payments-stripe-gateway.php 85% from 13 tests

"Pay With Stripe - Your WordPress Payments Stripe Gateway" version 1.2.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Domain Path: The domain path is invalid: folder "/languages/" does not exist
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis 3% 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
It is important to 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/payments-stripe-gateway/vendor/stripe/data/ca-certificates.crt
42,533 lines of code in 364 files:
LanguageFilesBlank linesComment linesLines of code
PHP3389,89726,28940,867
Markdown474701,281
JavaScript54060237
JSON20075
XML10031
make19027
CSS120012
YAML1003

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,029)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity18.81
▷ Minimum class complexity1.00
▷ Maximum class complexity3,029.00
Average method complexity3.53
▷ Minimum method complexity1.00
▷ Maximum method complexity89.00
Code structure
Namespaces23
Interfaces6
Traits7
Classes257
▷ Abstract classes124.67%
▷ Concrete classes24595.33%
▷ Final classes00.00%
Methods1,935
▷ Static methods33717.42%
▷ Public methods1,50477.73%
▷ Protected methods462.38%
▷ Private methods38519.90%
Functions103
▷ Named functions9794.17%
▷ Anonymous functions65.83%
Constants871
▷ Global constants10512.06%
▷ Class constants76687.94%
▷ Public constants766100.00%

Plugin size 0% from 2 tests

Image compression 0% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.50MB with 0.35MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) freemius/assets/img/payments-stripe-gateway.png41.27KB0.00KB▼ 100.00%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
includes/assets/img/pws-subscriptions-upsell.png454.26KB131.91KB▼ 70.96%
includes/assets/img/active_arrow.png0.99KB0.15KB▼ 85.24%