[x] Have you checked to ensure there aren't other open Pull Requests for the same update/change?
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:
[x] Have you added an explanation of what your changes do and why you'd like us to include them?
[x] 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.
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