Name Your Price v3.7.4 – Rank Math Subscription Switching Fix
Name Your Price 3.7.4 is a one-fix release for stores that run WooCommerce Subscriptions together with Rank Math SEO. Opening a subscription switch link, the product page a subscriber reaches from the Change price button on My Account, could end in a fatal error while Rank Math generated the page’s canonical URL. 3.7.4 makes Name Your Price’s switch-link code tolerant of that situation. There is no database update with this release.
Fixes
Subscription switch links no longer fail with Rank Math SEO
When a subscriber changes the amount of a Name Your Price subscription, WooCommerce Subscriptions builds a switch link to the product page and lets other plugins add to it through the woocommerce_subscriptions_add_switch_query_args filter. Name Your Price uses that filter to append the subscriber’s current amount as nyp_raw, which is how the price input arrives pre-filled on the switch page. It did that by looking up the subscription’s line item and calling get_product() on whatever came back.
With Rank Math SEO active, the same filter ran while Rank Math generated the canonical URL for that page, and the item reference it carried did not resolve to a product line item. Calling get_product() on it was a fatal error, so the switch page never loaded. 3.7.4 checks that the item is a WC_Order_Item_Product and returns the switch link unchanged when it is not. In the normal case nothing changes: the switch page still opens with the current amount filled in. In the Rank Math case the link is a plain switch link instead of an error.
Why this matters
- Subscribers on stores running Rank Math SEO can open the price-switch page and change their amount
- The switch page still pre-fills the subscriber’s current amount in the normal case
- Name Your Price now returns a plain switch link instead of failing whenever the line item cannot be resolved, whatever triggers the lookup
- One small change; nothing else in the plugin moved