[wp-trac] [WordPress Trac] #53323: Place Hello Dolly in containing folder

WordPress Trac noreply at wordpress.org
Tue May 27 23:19:11 UTC 2025


#53323: Place Hello Dolly in containing folder
-------------------------------------------------+-------------------------
 Reporter:  afragen                              |       Owner:  afragen
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Upgrade/Install                      |     Version:  5.8
 Severity:  normal                               |  Resolution:
 Keywords:  has-unit-tests has-test-info         |     Focuses:
  changes-requested has-patch                    |
-------------------------------------------------+-------------------------

Comment (by SirLouen):

 Replying to [comment:59 afragen]:
 > The code referenced above specifically removes `hello.php`.

 I think I've found why it's not bringing the plugin back:

 [https://github.com/WordPress/WordPress/blob/eb6737146a16978684c037c805b008a823642390
 /wp-admin/includes/update-core.php#L976 In this line] you should be adding

 {{{
 'plugins/hello-dolly/'      => '6.9',
 }}}

 But still there is one problem to solve: if `hello.php` was active before
 update, it should remind active, but with the current pach is not.

 This is something to be updated in the database during the upgrade.

 For example in
 [https://github.com/WordPress/WordPress/blob/eb6737146a16978684c037c805b008a823642390
 /wp-admin/includes/update-core.php#L1563 this line]

 {{{
 // Switch Hello Dolly from file to directory format. See #53323
 _upgrade_690_update_active_hello_dolly_option();
 }}}

 And then by the end of the file:
 {{{
 function _upgrade_690_update_active_hello_dolly_option() {
     $active_plugins = get_option('active_plugins');
     $old_plugin = 'hello.php';
     $new_plugin = 'hello-dolly/hello.php';
         $key = array_search($old_plugin, $active_plugins);

     if ( $key ) {
         $active_plugins[$key] = $new_plugin;
         update_option('active_plugins', $active_plugins);
     }
 }
 }}}

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


More information about the wp-trac mailing list