Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoloaded Options Health Check: Disabled options reappear in Site Health after external update #1340

Closed
mukeshpanchal27 opened this issue Jul 10, 2024 · 2 comments · Fixed by #1374
Assignees
Labels
[Plugin] Performance Lab Issue relates to work in the Performance Lab Plugin only [Type] Bug An existing feature is broken

Comments

@mukeshpanchal27
Copy link
Member

Bug Description

In #1048, support for changing the autoload value for the largest autoloaded options in the Site Health check was added. However, there is a potential bug when the option value is updated through external code, meaning some external code autoloads the option.

Steps to Reproduce

Add filter code to show the site health check.

If you use WP 6.6 version, use the filter:

add_filter( 'site_status_autoloaded_options_size_limit', '__return_zero' );

If you use WP < 6.6 version, use the filter:

add_filter( 'perflab_aao_autoloaded_options_limit_size_in_bytes', '__return_zero' );
  1. Go to Admin Panel > Site Health > Autoloaded options could affect performance.
  2. Click on 'Disable autoload' for any option.
  3. Check that the option is moved to the new disabled option table and removed from the top table.
  4. Update that option through code update_option( 'option_name', 'value', true );.
  5. Reload the site health page.
  6. See the error. The option is displayed in both tables.

Screenshots

Screenshot 2024-07-10 at 6 20 49 PM

Suggested Approach

We should perform an early check in the disabled table to see if any option is autoloaded again, and if so, remove that option from perflab_aao_disabled_options so it will not show up again. Additionally, when anyone clicks on "Revert to autoload" for a duplicate option, it shows a Failed to disable autoload. error.

@mukeshpanchal27 mukeshpanchal27 added [Type] Bug An existing feature is broken [Plugin] Performance Lab Issue relates to work in the Performance Lab Plugin only labels Jul 10, 2024
@mukeshpanchal27
Copy link
Member Author

@joemcgill As we discussed earlier, I drafted the issues, and it confirms our suspicions. It shows issues when the option is autoloaded through external codes.

@joemcgill
Copy link
Member

Thanks for investigating this! I agree that we can do a check of the autoloaded options to filter out any that have been reenabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Plugin] Performance Lab Issue relates to work in the Performance Lab Plugin only [Type] Bug An existing feature is broken
2 participants