Feature Description
This is part of the improving the onboarding experience for Performance Lab (#1032).
A problem today is that activating a feature causes a full page reload. This makes it tedious to quickly activate multiple features, since you can't activate multiple at a time. It can even lead to errors, if users manage to click another feature activation button before the page reloads due to already having clicked another one.
We should implement the feature activation logic in a WP AJAX handler callback and adjust the JavaScript logic to use that.
Technical notes
- The AJAX callback should use the perflab_install_and_activate_plugin() function, which already has this logic abstracted away from the concrete technical use-case.
- The existing admin_action_* callback should remain in place, and the buttons should still link to the relevant URL, as it allows the functionality to still work, should the administrator have JavaScript disabled or in case there is a bug in the JavaScript code.
- While this is not very crucial to support in today's time, there's very little overhead in maintaining the extra code, particularly because the bulk of the logic is already abstracted away to be reusable via perflab_install_and_activate_plugin().
- In other words: The AJAX based activation should be implemented as a progressive enhancement.
Reactions are currently unavailable
Feature Description
This is part of the improving the onboarding experience for Performance Lab (#1032).
A problem today is that activating a feature causes a full page reload. This makes it tedious to quickly activate multiple features, since you can't activate multiple at a time. It can even lead to errors, if users manage to click another feature activation button before the page reloads due to already having clicked another one.
We should implement the feature activation logic in a WP AJAX handler callback and adjust the JavaScript logic to use that.
Technical notes