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

Improving performance by no longer filtering gateway option #99

Merged

Conversation

dparker1005
Copy link
Member

@dparker1005 dparker1005 commented Aug 29, 2023

All Submissions:

Changes proposed in this Pull Request:

In the last update, we began using the pmpro_getLevelAtCheckout() function to avoid pulling level IDs directly from the $_REQUEST variable. This came with some performance issues where some sites were running out of PHP memory. Looking at the backtrace for a site, the issue originated from the pmpropbc_pmpro_get_gateway() function.

The first thought here was to try to make that function more efficient by using caching or limiting when it runs, but taking a step back, that plugin seems unnecessary altogether. The pmpropbc_pmpro_get_gateway() function only actually ever has an effect if the level being purchased is a "pay by check only" level. Levels that can be purchased via check or another gateway do not use this code and work correctly. So the pmpropbc_pmpro_get_gateway() function does not actually seem necessary and is clearly a liability.

This PR proposes deprecating the pmpropbc_pmpro_get_gateway() function entirely and instead switching to using the method that is already being used by levels that can be paid for by both check or another gateway, which is also the same method that is used in the Add PayPal Express Add On.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you successfully run tests with your changes locally?

Changelog entry

Enter a summary of all changes on this Pull Request. This will appear in the changelog if accepted.

@ideadude ideadude merged commit d61496e into strangerstudios:dev Aug 30, 2023
@dparker1005 dparker1005 deleted the stop-filtering-gateway-option branch August 30, 2023 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants