sybrew / the-seo-framework

The SEO Framework WordPress plugin.
https://theseoframework.com/
GNU General Public License v3.0
421 stars 47 forks source link

Refactor load sequence of Extension Manager #678

Open sybrew opened 5 months ago

sybrew commented 5 months ago

Extension Manager's load sequence currently loads extensions before account operations. So, if an account downgrades from Premium to Free or upgrades from Free to Premium, the interface doesn't always reflect the change state because some stuff is loaded and cached before the account changes state.

This was never an issue because these actions were invoked manually via a form, after which the user was redirected. Since Extension Manager v2.7, we dynamically upgrade users from Free to Premium when their license reactivates. We also use this new system to downgrade users from Premium to Free.

Refactoring the order of operations would make this less of an issue. In admin, we should always load all pending admin actions before loading in extensions.

Refactoring how we cache options and expensive operations, or even removing some caches entirely, would resolve many quirks yet to be accounted for. At the same time, we should eliminate a lot of needless DRM stuff; it's giving me a headache.

sybrew commented 5 months ago

Speaking of load sequence... We should decouple the "TSF isn't active," "TSF is active," and "TSF is active and meets version requirements" early, perhaps even in the main file. We have already done this to some degree, but the separation needs to be more apparent.