[wp-trac] [WordPress Trac] #33741: Remove references to my-hacks.php and the hack_file option

WordPress Trac noreply at wordpress.org
Sat Sep 19 10:02:47 UTC 2015


#33741: Remove references to my-hacks.php and the hack_file option
--------------------------+-----------------------
 Reporter:  bobbingwide   |       Owner:  jorbin
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  4.4
Component:  Plugins       |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------
Changes (by bobbingwide):

 * keywords:   => has-patch


Comment:

 I'd just like to point out that I didn't actually read the code properly.
 In my mind I'd read the array_unshift line as something completely
 different.
 I thought it was ''removing'' the my-hacks plugin from active plugins
 rather than adding it to the list.

 After due consideration I've decided that my patch to remove redundant
 code is still valid.

 hack_file is only an autoloaded option if it exists.
 When it does not exist another query is run after the first one to load
 the autoload options
 {{{
 1,0.030197,SELECT option_name, option_value FROM wp_options WHERE
 autoload = 'yes'
 2,0.001128,SELECT option_value FROM wp_options WHERE option_name =
 'hack_file' LIMIT 1
 }}}

 The TRAC that removed the my-hacks checkbox was #9551.

 I can't see the point in adding an options field that should have been
 unused for 6 years into the $unusedoptions array.

 In actual fact, you could actually break some code that was written since
 WordPress 2.8 and has nothing to do with wp-hacks but inadvertently used
 the option name 'hack_file'.

 In my opinion the $unusedoptions array should be pruned every now and
 then.
 There should at least be some documentation to list the options names that
 you shouldn't use!

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


More information about the wp-trac mailing list