-
Notifications
You must be signed in to change notification settings - Fork 131
Labels
Good First IssueIssue particularly suitable to be worked on by new contributorsIssue particularly suitable to be worked on by new contributorsNeeds DevAnything that requires development (e.g. a pull request)Anything that requires development (e.g. a pull request)[Plugin] Performance LabIssue relates to work in the Performance Lab Plugin onlyIssue relates to work in the Performance Lab Plugin only[Type] EnhancementA suggestion for improvement of an existing featureA suggestion for improvement of an existing feature
Milestone
Description
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()
.
- 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
- In other words: The AJAX based activation should be implemented as a progressive enhancement.
Metadata
Metadata
Assignees
Labels
Good First IssueIssue particularly suitable to be worked on by new contributorsIssue particularly suitable to be worked on by new contributorsNeeds DevAnything that requires development (e.g. a pull request)Anything that requires development (e.g. a pull request)[Plugin] Performance LabIssue relates to work in the Performance Lab Plugin onlyIssue relates to work in the Performance Lab Plugin only[Type] EnhancementA suggestion for improvement of an existing featureA suggestion for improvement of an existing feature
Type
Projects
Status
Done 😃