[wp-trac] [WordPress Trac] #25670: update_option() values persist even when no longer exist in the code

WordPress Trac noreply at wordpress.org
Wed Oct 23 13:09:15 UTC 2013


#25670: update_option() values persist even when no longer exist in the code
-------------------------+-------------------------------------
 Reporter:  carlesjove   |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Database     |    Version:  3.6.1
 Severity:  normal       |   Keywords:  2nd-opinion needs-patch
-------------------------+-------------------------------------
 The default WordPress' behaviour is to store the `update_option()` values
 to the database. Thus, if an option was once updated it will keep the same
 value forever, even after the theme author or mantainer removes
 `update_option()` from the code. This can lead to difficulties when
 debugging issues related to options, because even if in the actual code no
 option's value is being updated, the once set value will still run.

 '''Expected behaviour'''
 Only when an `update_option()` is passed in the actual code should its
 value apply. Otherwise, the default value should apply.

 '''Proposed solution(s)'''
 1 - Instead of permanently storing options in the database, only do it as
 longs as `update_option()` it's in the code. Otherwise, set the value back
 to the default.
 2 - Set option values only at runtime, without any database storing.



 PS: Hope my english is good enough ;-)

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25670>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list