62% stripe-payments

Code Review | Accept Stripe Payments

WordPress plugin Accept Stripe Payments scored62%from 54 tests.

About plugin

  • Plugin page: stripe-payments
  • Plugin version: 2.0.82
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Mar 3, 2015
  • Latest release: Nov 24, 2023
  • Number of updates: 307
  • Update frequency: every 10.4 days
  • Top authors: mra13 (97.39%)wptipsntricks (2.93%)

Code review

54 tests

User reviews

96 reviews

Install metrics

30,000+ active /1,642,080 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
This plugin's installer ran successfully

Server metrics [RAM: ▲2.60MB] [CPU: ▲18.32ms] Passed 4 tests

A check of server-side resources used by Accept Stripe Payments
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /5.74 ▲2.2752.37 ▲11.47
Dashboard /wp-admin6.02 ▲2.6774.40 ▲9.47
Posts /wp-admin/edit.php6.09 ▲2.7376.25 ▲29.61
Add New Post /wp-admin/post-new.php8.64 ▲2.75117.64 ▲23.93
Media Library /wp-admin/upload.php5.96 ▲2.7362.19 ▲28.40
Settings /wp-admin/edit.php?post_type=asp-products&page=stripe-payments-settings6.0178.51
Add-ons /wp-admin/edit.php?post_type=asp-products&page=stripe-payments-addons5.9961.89
Orders /wp-admin/edit.php?post_type=stripe_order6.0157.85
Coupons /wp-admin/edit.php?post_type=asp-products&page=stripe-payments-coupons5.9657.65
Add New Product /wp-admin/post-new.php?post_type=asp-products6.1775.58
Products /wp-admin/edit.php?post_type=asp-products6.0168.60

Server storage [IO: ▲3.37MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 402 new files
Database: no new tables, 10 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
asp_plugin_user_feedback_notice
asp_hash_private_key_one
asp_cache_key
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts
AcceptStripePayments-settings

Browser metrics Passed 4 tests

This is an overview of browser requirements for Accept Stripe Payments
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,964 ▲20213.48 ▼0.658.62 ▲6.7037.22 ▼7.38
Dashboard /wp-admin2,243 ▲635.56 ▼0.1197.20 ▲9.3471.52 ▲33.62
Posts /wp-admin/edit.php2,163 ▲632.13 ▲0.1339.63 ▲2.1634.92 ▲1.36
Add New Post /wp-admin/post-new.php6,243 ▲4,71719.33 ▼3.56840.10 ▲251.71165.73 ▲115.28
Media Library /wp-admin/upload.php1,463 ▲604.19 ▼0.01100.32 ▲1.2275.29 ▲34.17
Settings /wp-admin/edit.php?post_type=asp-products&page=stripe-payments-settings4,2964.6779.87117.32
Add-ons /wp-admin/edit.php?post_type=asp-products&page=stripe-payments-addons1,0462.3328.3341.36
Orders /wp-admin/edit.php?post_type=stripe_order1,1501.9737.6031.38
Coupons /wp-admin/edit.php?post_type=asp-products&page=stripe-payments-coupons1,0862.3327.7730.43
Add New Product /wp-admin/post-new.php?post_type=asp-products3,5727.73183.72135.37
Products /wp-admin/edit.php?post_type=asp-products1,2201.9737.7834.41

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 10 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • asp_plugin_user_feedback_notice
    • asp_hash_private_key_one
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • asp_cache_key
    • theysaidso_admin_options
    • AcceptStripePayments-settings

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/stripe-payments/includes/stripe/build.php
    • > /wp-content/plugins/stripe-payments/includes/stripe/update_certs.php
  • 221× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/stripe-payments/includes/stripe/lib/Service/Terminal/ConnectionTokenService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/stripe-payments/includes/stripe/lib/TaxRate.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/stripe-payments/includes/stripe/lib/Issuing/CardDetails.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/stripe-payments/includes/stripe/lib/Service/Issuing/CardholderService.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Stripe\\Exception\\ExceptionInterface' not found in wp-content/plugins/stripe-payments/includes/stripe/lib/Exception/SignatureVerificationException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\BaseStripeClient' not found in wp-content/plugins/stripe-payments/includes/stripe/lib/StripeClient.php:66
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractServiceFactory' not found in wp-content/plugins/stripe-payments/includes/stripe/lib/Service/BillingPortal/BillingPortalServiceFactory.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/stripe-payments/includes/stripe/lib/Service/Identity/VerificationSessionService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'AcceptStripePayments' not found in wp-content/plugins/stripe-payments/admin/includes/class-asp-admin-product-meta-boxes.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/stripe-payments/includes/stripe/lib/Service/Identity/VerificationReportService.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/edit.php?post_type=asp-products
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: aspEditProdData is not defined" "ReferenceError: aspEditProdData is not defined\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/stripe-payments/admin/assets/js/edit-product.js?ver=2.0.82:2:28)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/edit.php?post_type=asp-products
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught ReferenceError: aspEditProdData is not defined

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 18 tag instead of maximum 10
You can take inspiration from this readme.txt

stripe-payments/accept-stripe-payments.php 92% from 13 tests

The main PHP file in "Accept Stripe Payments" ver. 2.0.82 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("stripe-payments.php" instead of "accept-stripe-payments.php")

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
It is important to 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-payments/includes/stripe/data/ca-certificates.crt
39,058 lines of code in 332 files:
LanguageFilesBlank linesComment linesLines of code
PHP2754,26510,73221,285
PO File54,9235,87911,667
JavaScript183271013,110
CSS262911421,708
Markdown370501,173
JSON10047
XML10031
make18023
SVG10011
YAML1003

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 132)
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity10.39
▷ Minimum class complexity1.00
▷ Maximum class complexity239.00
Average method complexity3.16
▷ Minimum method complexity1.00
▷ Maximum method complexity132.00
Code structure
Namespaces23
Interfaces9
Traits7
Classes248
▷ Abstract classes104.03%
▷ Concrete classes23895.97%
▷ Final classes00.00%
Methods1,147
▷ Static methods24020.92%
▷ Public methods1,03890.50%
▷ Protected methods332.88%
▷ Private methods766.63%
Functions15
▷ Named functions320.00%
▷ Anonymous functions1280.00%
Constants783
▷ Global constants111.40%
▷ Class constants77298.60%
▷ Public constants772100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
36 PNG files occupy 0.08MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/mailer-lite-integration.png2.61KB1.69KB▼ 35.07%
admin/assets/images/additional-custom-fields.png1.76KB0.83KB▼ 52.71%
admin/assets/css/jquery-ui-theme/images/ui-icons_888888_256x240.png4.27KB4.11KB▼ 3.78%
assets/screenshot-2.png4.04KB4.26KB0.00%
admin/assets/images/maichimp-integration.png3.62KB3.72KB0.00%