Improving performance by no longer filtering gateway option #99
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thepmpropbc_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 thepmpropbc_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:
Changelog entry