[wp-trac] [WordPress Trac] #58962: Provide a way to load multiple specific options with a single database request

WordPress Trac noreply at wordpress.org
Wed Oct 18 09:56:58 UTC 2023


#58962: Provide a way to load multiple specific options with a single database
request
-------------------------------------------------+-------------------------
 Reporter:  flixos90                             |       Owner:  flixos90
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  6.4
Component:  Options, Meta APIs                   |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests has-dev-    |     Focuses:
  note                                           |  performance
-------------------------------------------------+-------------------------

Comment (by ReneHermi):

 I like the purpose of `prime_options` but find the name `prime_options`
 kind of too fancy, complex, and confusing as `prime` has multiple
 meanings, especially when not used in caching context and when the verb
 prime does not stand beside `cache`.

 By just reading the name and not the code I would never expect this
 function has the purpose of priming a cache.

 A few more suggestions:

 `save_options_cache`,
 `update_options_cache`
 `cache_options`
 `set_options_cache`

 But to be consistent with the other internal prime* methods and to shift
 `prime` into the caching context, I vote for `prime_options_cache` and go
 with @peterwilsoncc

 Although, the other suggestions could be slightly more self-explanatory
 and even shorter but there is no need to get too deep into naming
 discussions.

 > even for developers that may not be very familiar with caching

 I claim every *developer* is aware at least of the basic concept of
 caching.

 Btw. Even chatGPT does not understand the meaning of prime_options:-)

 > There is a function named `prime_options`. What do you think this
 function does?


 {{{
 Based on the name "prime_options," I can make an educated guess about its
 functionality, but without a concrete context or the actual function
 definition, it's speculative. Here's what I infer:

 Prime Numbers: The function might deal with prime numbers in some
 capacity. For example:

 It might return a list of prime numbers up to a given limit.
 It might check if a given number is prime.
 It might generate the next prime number after a given number.
 Options or Choices: The word "options" suggests some choices or
 configurations.

 The function might return prime-related configurations or parameters.
 It could possibly take a number as an argument and return its prime
 factors.
 It might provide multiple methods or algorithms for determining primes and
 allow a user to select one.
 Interactivity: If it's meant for a user interface or a command-line tool,
 "options" might refer to various choices a user has related to prime
 numbers. For instance:

 "Would you like to find all primes up to X or just check if X is prime?"
 Combinations: Maybe it deals with combinations of prime numbers, or ways
 in which primes can be combined or used in particular scenarios.

 To provide a definitive answer, I'd need the actual code or at least a
 more detailed description of the function. If you have the function's
 definition or its documentation, please share, and I'll be happy to help
 further!
 }}}

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


More information about the wp-trac mailing list