51% stripe

Code Review | Stripe Payment Forms by WP Simple Pay - Accept Payments with Stripe

WordPress plugin Stripe Payment Forms by WP Simple Pay - Accept Payments with Stripe scored51%from 54 tests.

About plugin

  • Plugin page: stripe
  • Plugin version: 4.7.10
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.3
  • WordPress version: 6.3.1
  • First release: Mar 27, 2014
  • Latest release: Oct 12, 2023
  • Number of updates: 224
  • Update frequency: every 15.6 days
  • Top authors: pderksen (62.95%)SpencerFinnell (23.21%)nickyoung87 (8.48%)BrashRebel (5.36%)nekojira (1.34%)

Code review

54 tests

User reviews

99 reviews

Install metrics

10,000+ active /665,889 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲8.18MB] [CPU: ▲61.36ms] 50% from 4 tests

This is a short check of server-side resources used by Stripe Payment Forms by WP Simple Pay - Accept Payments with Stripe
Please take the time to fix the following items
  • RAM: Total memory usage should be kept under 10MB (currently 12.49MB on /wp-admin/edit.php?post_type=simple-pay&page=simpay-about-us)
  • Extra RAM: The extra memory usage must be under 5MB (currently 8.18MB on /wp-admin/edit.php?post_type=simple-pay&page=simpay-about-us)
PageMemory (MB)CPU Time (ms)
Home /9.75 ▲6.2994.13 ▲53.59
Dashboard /wp-admin12.10 ▲8.75124.91 ▲65.56
Posts /wp-admin/edit.php12.21 ▲8.85117.39 ▲66.46
Add New Post /wp-admin/post-new.php14.97 ▲9.08157.65 ▲59.82
Media Library /wp-admin/upload.php12.04 ▲8.81111.70 ▲75.76
System Report /wp-admin/edit.php?post_type=simple-pay&page=system-report11.7893.36
Add New /wp-admin/post-new.php?post_type=simple-pay12.13120.90
Scheduled Actions /wp-admin/tools.php?page=action-scheduler12.31127.69
Payment Forms /wp-admin/edit.php?post_type=simple-pay12.58129.93
Settings /wp-admin/edit.php?post_type=simple-pay&page=simpay_settings12.49119.27
Activity & Reports /wp-admin/edit.php?post_type=simple-pay&page=simpay-activity-reports12.49129.39
Coupons /wp-admin/edit.php?post_type=simple-pay&page=simpay_coupons12.49127.27
Form Templates /wp-admin/edit.php?post_type=simple-pay&page=simpay_form_templates12.49129.57
Setup Wizard /wp-admin/edit.php?post_type=simple-pay&page=simpay-setup-wizard12.49113.81
About Us /wp-admin/edit.php?post_type=simple-pay&page=simpay-about-us12.49118.83

Server storage [IO: ▲7.08MB] [DB: ▲0.08MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 1,277 new files
Database: 6 new tables, 19 new options
New tables
wp_actionscheduler_logs
wp_actionscheduler_actions
wp_actionscheduler_claims
wp_wpsp_notifications
wp_wpsp_transactions
wp_actionscheduler_groups
New WordPress options
simpay_has_seen_help_icon
widget_recent-posts
simpay_completed_migrations
simpay_settings
db_upgraded
schema-ActionScheduler_LoggerSchema
simpay_installed
wpdb_wpsp_transactions_version
wpdb_wpsp_notifications_version
action_scheduler_hybrid_store_demarkation
...

Browser metrics Passed 4 tests

Stripe Payment Forms by WP Simple Pay - Accept Payments with Stripe: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,256 ▲51016.61 ▲2.30170.42 ▲168.6032.74 ▼11.33
Dashboard /wp-admin2,421 ▲2445.58 ▼0.0490.35 ▼8.2843.84 ▲3.51
Posts /wp-admin/edit.php2,260 ▲1602.23 ▲0.2837.35 ▲0.6640.19 ▲10.07
Add New Post /wp-admin/post-new.php6,535 ▲4,99925.37 ▲2.23996.53 ▲370.7747.17 ▼15.36
Media Library /wp-admin/upload.php1,552 ▲1494.25 ▲0.09103.70 ▲0.4647.28 ▲3.41
System Report /wp-admin/edit.php?post_type=simple-pay&page=system-report2,18611.31282.03110.37
Add New /wp-admin/post-new.php?post_type=simple-pay1,50110.77145.75124.71
Scheduled Actions /wp-admin/tools.php?page=action-scheduler1,6721.9127.7834.88
Payment Forms /wp-admin/edit.php?post_type=simple-pay1,48610.71152.38129.11
Settings /wp-admin/edit.php?post_type=simple-pay&page=simpay_settings1,65610.40123.23155.83
Activity & Reports /wp-admin/edit.php?post_type=simple-pay&page=simpay-activity-reports1,33812.29295.52139.54
Coupons /wp-admin/edit.php?post_type=simple-pay&page=simpay_coupons1,42810.42122.78119.42
Form Templates /wp-admin/edit.php?post_type=simple-pay&page=simpay_form_templates2,60410.06162.03136.24
Setup Wizard /wp-admin/edit.php?post_type=simple-pay&page=simpay-setup-wizard1,21911.29171.8820.12
About Us /wp-admin/edit.php?post_type=simple-pay&page=simpay-about-us1,90910.31124.18174.55

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 tables in the database
    • wp_wpsp_transactions
    • wp_actionscheduler_groups
    • wp_actionscheduler_actions
    • wp_actionscheduler_claims
    • wp_actionscheduler_logs
    • wp_wpsp_notifications
  • The uninstall procedure has failed, leaving 20 options in the database
    • wpdb_wpsp_notifications_version
    • theysaidso_admin_options
    • widget_recent-posts
    • simpay_installed
    • action_scheduler_hybrid_store_demarkation
    • schema-ActionScheduler_LoggerSchema
    • widget_theysaidso_widget
    • simpay_settings
    • simpay_customer_achievements
    • simpay_setup_wizard_launched
    • ...

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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 items
  • 4× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/stripe/lib/Stripe/update_certs.php
    • > /wp-content/plugins/stripe/lib/Stripe/build.php
    • > /wp-content/plugins/stripe/views/admin-notice-license-upgrade-top-of-page.php
    • > /wp-content/plugins/stripe/views/admin-dashboard-widget-report.php
  • 591× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_RecurringSchedule' not found in wp-content/plugins/stripe/lib/woocommerce/action-scheduler/classes/schedules/ActionScheduler_CronSchedule.php:6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/stripe/views/admin-notice-expired-license.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'SimplePay\\Vendor\\Stripe\\Service\\AbstractServiceFactory' not found in wp-content/plugins/stripe/lib/Stripe/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'SimplePay\\Vendor\\Interop\\Container\\Exception\\ContainerException' not found in wp-content/plugins/stripe/lib/Interop/Container/Exception/NotFoundException.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/stripe/views/admin-payment-forms-license-expired.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'SimplePay\\Vendor\\Stripe\\ApiResource' not found in wp-content/plugins/stripe/lib/Stripe/lib/Payout.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'SimplePay\\Vendor\\Symfony\\Component\\CssSelector\ode\\AbstractNode' not found in wp-content/plugins/stripe/lib/Symfony/Component/CssSelector/Node/PseudoNode.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'SimplePay\\Vendor\\Stripe\\BaseStripeClientInterface' not found in wp-content/plugins/stripe/lib/Stripe/lib/StripeStreamingClientInterface.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'SimplePay\\Vendor\\Stripe\\ApiResource' not found in wp-content/plugins/stripe/lib/Stripe/lib/Treasury/ReceivedCredit.php:31
    • > PHP Fatal error
      Uncaught Error: Interface 'SimplePay\\Core\\EventManagement\\SubscriberInterface' not found in wp-content/plugins/stripe/src/Block/BlockSubscriber.php:21

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
    • > GET request to /wp-admin/edit.php?post_type=simple-pay&page=system-report
    • > Javascript (severe) in unknown
    /wp-admin/site-health.php?tab=debug&simpay=1 161:17 Uncaught TypeError: Cannot read properties of null (reading 'nextElementSibling')
    • > GET request to /wp-admin/edit.php?post_type=simple-pay&page=simpay-activity-reports
    • > Console-api (warning) in wp-includes/js/dist/deprecated.min.js?ver=73ad3591e7bc95f4777a+1:627
    `position` prop in wp.components.Dropdown is deprecated since version 6.2. Please use `popoverProps.placement` prop instead. Note: Note that the `position` prop will override any values passed through the `popoverProps.placement` prop.

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
5 plugin tags: credit card payments, stripe, stripe payments, stripe gateway, stripe checkout

stripe/stripe-checkout.php 85% from 13 tests

The main PHP file in "Stripe Payment Forms by WP Simple Pay - Accept Payments with Stripe" ver. 4.7.10 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:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("stripe.php" instead of "stripe-checkout.php")
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Please fix the following items
  • Do not include executable or dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/stripe/lib/Stripe/data/ca-certificates.crt
90,090 lines of code in 1,220 files:
LanguageFilesBlank linesComment linesLines of code
PHP90315,30046,49564,245
JavaScript1561,7271,9889,538
JSON90008,456
Sass21991695,071
Markdown884301,694
CSS177444610
HTML200356
XML33070
make110029
SVG190021

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity6.76
▷ Minimum class complexity1.00
▷ Maximum class complexity270.00
Average method complexity2.30
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces175
Interfaces57
Traits22
Classes683
▷ Abstract classes558.05%
▷ Concrete classes62891.95%
▷ Final classes40.64%
Methods3,476
▷ Static methods38911.19%
▷ Public methods2,85081.99%
▷ Protected methods2497.16%
▷ Private methods37710.85%
Functions489
▷ Named functions36274.03%
▷ Anonymous functions12725.97%
Constants1,166
▷ Global constants171.46%
▷ Class constants1,14998.54%
▷ Public constants1,149100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
37 PNG files occupy 1.31MB with 0.38MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/core/assets/images/about/plugin-sb-youtube.png2.63KB2.07KB▼ 21.43%
includes/core/assets/images/settings/coupons-thumb.png110.55KB61.02KB▼ 44.80%
includes/core/assets/images/settings/captcha-recaptcha-badge.png16.35KB15.87KB▼ 2.92%
includes/core/assets/images/settings/coupons-full.png110.55KB61.02KB▼ 44.80%
includes/core/assets/images/icon.png6.07KB4.15KB▼ 31.68%