[wp-trac] [WordPress Trac] #31245: Replace alloptions with a key cache

WordPress Trac noreply at wordpress.org
Tue May 2 21:11:34 UTC 2017

#31245: Replace alloptions with a key cache
 Reporter:  rmccue                   |       Owner:  rmccue
     Type:  enhancement              |      Status:  assigned
 Priority:  normal                   |   Milestone:  Future Release
Component:  Options, Meta APIs       |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:  performance

Comment (by spacedmonkey):

 My feedback

 - Remove check if is_multisite() in WP_Option_Query
 - wp_option:: get_instance should work like get_instance methods in core
 using id. Another method called get_by_name should be added.
 - wp_option:: get_instance $use_cache could be removed and a filter of
 'option_use_cache'. When installing `add_filter( 'option_use_cache',
 - Set no_found_rows to false but default. Pagation will not be needed in
 most use cases.
 - ` if ( ( 'home' === $option ) && empty( $value ) ) {`  should go back
 `if ( 'home' == $option && '' == $value ) `. There might be good reason to
 have a false value in database.
 - populate_options should use WP_option_query and add_option.
 - It is a shame that we have to store the whole object in cache. It would
 be better to just store the option_ids and use something like

 Related: #33958 #37930 #40523 #20875

Ticket URL: <https://core.trac.wordpress.org/ticket/31245#comment:49>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list