Use AJAX for activating features / plugins in Performance Lab #1583
Labels
Good First Issue
Issue particularly suitable to be worked on by new contributors
Needs Dev
Anything that requires development (e.g. a pull request)
[Plugin] Performance Lab
Issue relates to work in the Performance Lab Plugin only
[Type] Enhancement
A suggestion for improvement of an existing feature
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
perflab_install_and_activate_plugin()
function, which already has this logic abstracted away from the concrete technical use-case.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.perflab_install_and_activate_plugin()
.The text was updated successfully, but these errors were encountered: