Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkout Performance logs #279

Draft
wants to merge 13 commits into
base: trunk
Choose a base branch
from
Draft

Checkout Performance logs #279

wants to merge 13 commits into from

Conversation

derekherman
Copy link

@derekherman derekherman commented Feb 1, 2025

All Submissions:

  • Does your code follow the WooCommerce Sniffs variant of WordPress coding standards?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?
  • Will this change require new documentation or changes to existing documentation?

Changes proposed in this Pull Request:

Closes # .

Steps to Test the Changes in this Pull Request:

  1. Install and activate the WooCommerce Square plugin.
  2. Enable the Square payment methods, such as Square – Credit Card, Cash App Pay (Square), and Gift Cards (Square).
  3. Go to the Shop page and place an order using different payment methods.
  4. Navigate to Admin > WooCommerce > Status > Logs.
  5. Browse the log files related to Square to view the time taken by each process.

Note: You can also check the performance log for WooCommerce Subscription products using a similar process.

Screenshot

Screenshot 2025-03-06 at 2 33 58 PM

Performance Log for various payment methods

This PR add the performance log for the transaction with various payment methods.

Products with Credit Card
2025-03-05T04:57:28+00:00 NOTICE [Performance] create_order completed in 653ms with 241.74KB of memory usage CONTEXT: {"_legacy":true}
2025-03-05T04:57:29+00:00 NOTICE [Performance] payment_transaction completed in 1.037s with 41.53KB of memory usage CONTEXT: {"_legacy":true}
2025-03-05T04:57:29+00:00 NOTICE [Performance] handle_payment_response completed in 11ms with 18.25KB of memory usage CONTEXT: {"_legacy":true}
2025-03-05T04:57:29+00:00 NOTICE [Performance] process_payment completed in 1.851s with 989.49KB of memory usage CONTEXT: {"_legacy":true}
Products with Cash App Pay
2025-03-05T04:58:42+00:00 NOTICE [Performance] create_order completed in 520ms with 293.69KB of memory usage CONTEXT: {"_legacy":true}
2025-03-05T04:58:43+00:00 NOTICE [Performance] handle_payment_response completed in 15ms with 15.49KB of memory usage CONTEXT: {"_legacy":true}
Gift card with Credit Card
2025-03-05T05:50:12+00:00 NOTICE [Performance] create_order completed in 575ms with 70.99KB of memory usage CONTEXT: {"_legacy":true}
2025-03-05T05:50:13+00:00 NOTICE [Performance] payment_transaction completed in 914ms with 140.87KB of memory usage CONTEXT: {"_legacy":true}
2025-03-05T05:50:13+00:00 NOTICE [Performance] handle_payment_response completed in 17ms with 49.25KB of memory usage CONTEXT: {"_legacy":true}
2025-03-05T05:50:14+00:00 NOTICE [Performance] process_payment completed in 2.760s with 1.14MB of memory usage CONTEXT: {"_legacy":true}
2025-03-05T05:50:15+00:00 NOTICE [Performance] force_tokenization completed in 0ms with -2.72KB of memory usage CONTEXT: {"_legacy":true}
2025-03-05T05:50:15+00:00 NOTICE [Performance] force_tokenization completed in 0ms with 0.00KB of memory usage CONTEXT: {"_legacy":true}
Subscription Product with Credit Card
2025-03-05T05:09:09+00:00 NOTICE [Performance] create_order completed in 1.634s with 140.50KB of memory usage CONTEXT: {"_legacy":true}
2025-03-05T05:09:10+00:00 NOTICE [Performance] payment_transaction completed in 1.027s with 80.16KB of memory usage CONTEXT: {"_legacy":true}
2025-03-05T05:09:10+00:00 NOTICE [Performance] handle_payment_response completed in 16ms with 71.73KB of memory usage CONTEXT: {"_legacy":true}
2025-03-05T05:09:10+00:00 NOTICE [Performance] process_payment completed in 2.822s with 1.30MB of memory usage CONTEXT: {"_legacy":true}
2025-03-05T05:09:10+00:00 NOTICE [Performance] force_tokenization completed in 0ms with -2.72KB of memory usage CONTEXT: {"_legacy":true}
2025-03-05T05:09:10+00:00 NOTICE [Performance] force_tokenization completed in 0ms with 0.00KB of memory usage CONTEXT: {"_legacy":true}

According to the logs, the process_payment for a Subscription Product takes a few extra seconds due to the token and subscription processing.

@mukeshpanchal27
Copy link
Member

@mukeshpanchal27 it would be great if you can also update the PR description here with "Steps to test the changes" along with any screenshots/videos.

@vikrampm1 Requested details added in PR description. Please take a look and let me know if you need any more information.

@mukeshpanchal27
Copy link
Member

@dkotter Ready for your review.

@qasumitbagthariya
Copy link
Contributor

qasumitbagthariya commented Mar 19, 2025

QA Update: ❌

@derekherman

I noticed that the Gift Card section is not appearing in this branch. Could you please check.

image
Screen.Recording.2025-03-19.at.6.28.30.PM.mov

Testing Environment

  • WordPress: 6.7.2
  • Theme: Storefront 4.6.1
  • WooCommerce - 9.7.1
  • PHP: 8.0.30
  • Web Server: Nginx 1.20.2
  • Browser: Chrome
  • OS: macOS 15.2
  • Branch: payment-perf-logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants