Skip to content

Support changing autoload value for largest autoloaded options #889

@felixarntz

Description

@felixarntz

As discussed a while ago (I believe initially at WCUS 2022 contributor day), the autoloaded options Site Health check needs to be actionable. While showing the largest autoloaded options is great, without a way to fix the issue it's not all that helpful.

The Site Health check should make use of the new wp_set_option_autoload() function introduced in WordPress 6.4 (see this dev note post) to allow disabling autoload for a given option. Any changed option should be stored persistently in a list so that WordPress keeps track of it. The Site Health check should also allow reverting any changed option (in case changing it causes problems).

Requirements

All of the below requirements should only take effect if the wp_set_option_autoload() function is available.

  • The list of the largest autoloaded options should have a new column with a button to "Disable autoload".
  • When the user clicks this button, the option's autoload value should be set to no, and the option's name should be added to the array of options for which the user changed the value (e.g. a new option perflab_aao_modified_options).
  • If the perflab_aao_modified_options list is not empty, the list of these options should be displayed at the bottom of the Site Health check, with each option being accompanied with a "Revert to autoload" CTA link.
    • Important: This list must be displayed even when the check passes, as the user must at any time be able to revert a decision they made before.

Metadata

Metadata

Labels

[Type] EnhancementA suggestion for improvement of an existing feature

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions