[wp-trac] [WordPress Trac] #61103: update all update_option calling in core to set the autoload option

WordPress Trac noreply at wordpress.org
Mon Aug 26 23:06:23 UTC 2024


#61103: update all update_option calling in core to set the autoload option
--------------------------------+--------------------------
 Reporter:  pbearne             |       Owner:  pbearne
     Type:  defect (bug)        |      Status:  assigned
 Priority:  normal              |   Milestone:  6.7
Component:  Options, Meta APIs  |     Version:
 Severity:  normal              |  Resolution:
 Keywords:  has-patch early     |     Focuses:  performance
--------------------------------+--------------------------

Comment (by flixos90):

 I just left a thorough review on the PR in https://github.com/WordPress
 /wordpress-develop/pull/6465#pullrequestreview-2261711999, where I
 reviewed each potentially modified option individually.

 Summarizing here:
 * We should only pass an explicit `$autoload` of `true|false` to
 `update_option()` if the option is ''not'' added to the database as part
 of the WordPress installation (and therefore always present when calling
 `update_option()`.
 * For any arbitrary `update_option()` calls where `$option` is a variable
 that could be anything, we should not provide a value either since we have
 no idea about whether or not to autoload the option. The default value
 `null` works best in such cases.
 * The following options (which are ''not'' part of WordPress installation)
 are set by the PR to no longer be autoloaded, which make sense to me
 because all of them are only used in one specific admin screen or one
 specific process that doesn't run on regular page loads:
         * `recently_activated`
         * `_wp_suggested_policy_text_has_changed`
         * `{upgradeLock}.lock`
         * `dashboard_widget_options`
         * `ftp_credentials`
         * `adminhash`
         * `nav_menu_options`
         * `wp_force_deactivated_plugins`
         * `delete_blog_hash`
         * `allowedthemes`
         * `{sessionId}_paused_extensions`
         * `recovery_keys`
         * `https_detection_errors`

 There are a few other options in the PR that are set to no longer
 autoload, which I think is risky and should therefore not be included.
 More complicated options can still be discussed in separate tickets for
 whether it makes sense to stop autoloading them.

 I think once those changes are made, the PR will be in a good state to
 land.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61103#comment:26>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list