Make WordPress Core

Changeset 61006


Ignore:
Timestamp:
10/21/2025 04:31:04 AM (7 weeks ago)
Author:
peterwilsoncc
Message:

Upgrade/Install: Revert relocation of Hello Dolly plugin.

Reverts Hello Dolly changes moving the plugin to a containing folder. Removes the upgrade_690() function in it's entirety as the upgrade routine is no longer required.

Fully reverted commits: [60666], [60670], [60716], [60725]; partially reverts [60721].

Porps johnbillion, whyisjake, SirLouen, mindctrl, afragen, jorbin, Otto42, swissspidy, welcher, davidbaumwald.
See #53323.

Location:
trunk
Files:
12 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/.gitignore

    r60934 r61006  
    5151/src/wp-content/languages
    5252/src/wp-content/mu-plugins
    53 /src/wp-content/plugins/*
    54 !/src/wp-content/plugins/hello-dolly
     53/src/wp-content/plugins
    5554/src/wp-content/themes/*
    5655!/src/wp-content/themes/twentyten
  • trunk/Gruntfile.js

    r60934 r61006  
    2929            'wp-content/themes/twenty*/**',
    3030            'wp-content/plugins/index.php',
    31             'wp-content/plugins/hello-dolly/**',
     31            'wp-content/plugins/hello.php',
    3232            'wp-content/plugins/akismet/**',
    3333            '!wp-content/themes/twenty*/node_modules/**',
  • trunk/src/wp-admin/includes/plugin.php

    r60995 r61006  
    154154                }
    155155            }
     156        } elseif ( 'hello.php' === basename( $plugin_file ) ) {
     157            $textdomain = 'default';
    156158        }
    157159        if ( $textdomain ) {
     
    10061008
    10071009        $plugin_slug = dirname( $plugin_file );
     1010
     1011        if ( 'hello.php' === $plugin_file ) {
     1012            $plugin_slug = 'hello-dolly';
     1013        }
    10081014
    10091015        // Remove language files, silently.
  • trunk/src/wp-admin/includes/update-core.php

    r60666 r61006  
    842842    'wp-includes/js/dist/fields.min.js',
    843843    'wp-includes/js/dist/fields.js',
    844     // 6.9
    845     'wp-content/plugins/hello.php',
    846844);
    847845
     
    976974    'themes/twentytwentyfour/'  => '6.4',
    977975    'themes/twentytwentyfive/'  => '6.7',
    978     'plugins/hello-dolly/'      => '6.9',
    979976);
    980977
  • trunk/src/wp-admin/includes/upgrade.php

    r60789 r61006  
    887887    }
    888888
    889     if ( $wp_current_db_version < 60717 ) {
    890         upgrade_690();
    891     }
    892 
    893889    maybe_disable_link_manager();
    894890
     
    24872483
    24882484/**
    2489  * Executes changes made in WordPress 6.9.0.
    2490  *
    2491  * @ignore
    2492  * @since 6.9.0
    2493  *
    2494  * @global int $wp_current_db_version The old (current) database version.
    2495  */
    2496 function upgrade_690() {
    2497     global $wp_current_db_version;
    2498 
    2499     if ( $wp_current_db_version < 60717 ) {
    2500         // Switch Hello Dolly from file to directory format. See #53323
    2501         $active_plugins = (array) get_option( 'active_plugins', array() );
    2502         $old_plugin     = 'hello.php';
    2503         $new_plugin     = 'hello-dolly/hello.php';
    2504         $key            = array_search( $old_plugin, $active_plugins, true );
    2505 
    2506         if ( $key ) {
    2507             $active_plugins[ $key ] = $new_plugin;
    2508             update_option( 'active_plugins', $active_plugins );
    2509         }
    2510     }
    2511 }
    2512 
    2513 /**
    25142485 * Executes network-level upgrade routines.
    25152486 *
  • trunk/src/wp-includes/class-wp-plugin-dependencies.php

    r60666 r61006  
    871871     */
    872872    protected static function convert_to_slug( $plugin_file ) {
     873        if ( 'hello.php' === $plugin_file ) {
     874            return 'hello-dolly';
     875        }
    873876        return str_contains( $plugin_file, '/' ) ? dirname( $plugin_file ) : str_replace( '.php', '', $plugin_file );
    874877    }
  • trunk/tests/phpunit/tests/admin/includesPlugin.php

    r60666 r61006  
    2323
    2424    public function test_get_plugin_data() {
    25         $data = get_plugin_data( DIR_TESTDATA . '/plugins/hello-dolly/hello.php' );
     25        $data = get_plugin_data( DIR_TESTDATA . '/plugins/hello.php' );
    2626
    2727        $default_headers = array(
     
    375375
    376376    public function test_is_plugin_active_true() {
    377         activate_plugin( 'hello-dolly/hello.php' );
    378         $test = is_plugin_active( 'hello-dolly/hello.php' );
     377        activate_plugin( 'hello.php' );
     378        $test = is_plugin_active( 'hello.php' );
    379379        $this->assertTrue( $test );
    380380
    381         deactivate_plugins( 'hello-dolly/hello.php' );
     381        deactivate_plugins( 'hello.php' );
    382382    }
    383383
    384384    public function test_is_plugin_active_false() {
    385         deactivate_plugins( 'hello-dolly/hello.php' );
    386         $test = is_plugin_active( 'hello-dolly/hello.php' );
     385        deactivate_plugins( 'hello.php' );
     386        $test = is_plugin_active( 'hello.php' );
    387387        $this->assertFalse( $test );
    388388    }
    389389
    390390    public function test_is_plugin_inactive_true() {
    391         deactivate_plugins( 'hello-dolly/hello.php' );
    392         $test = is_plugin_inactive( 'hello-dolly/hello.php' );
     391        deactivate_plugins( 'hello.php' );
     392        $test = is_plugin_inactive( 'hello.php' );
    393393        $this->assertTrue( $test );
    394394    }
    395395
    396396    public function test_is_plugin_inactive_false() {
    397         activate_plugin( 'hello-dolly/hello.php' );
    398         $test = is_plugin_inactive( 'hello-dolly/hello.php' );
     397        activate_plugin( 'hello.php' );
     398        $test = is_plugin_inactive( 'hello.php' );
    399399        $this->assertFalse( $test );
    400400
    401         deactivate_plugins( 'hello-dolly/hello.php' );
     401        deactivate_plugins( 'hello.php' );
    402402    }
    403403
     
    406406     */
    407407    public function test_get_plugin_files_single() {
    408         $name = 'hello-dolly/hello.php';
     408        $name = 'hello.php';
    409409        $this->assertSame( array( $name ), get_plugin_files( $name ) );
    410410    }
     
    551551     */
    552552    public function test_is_network_only_plugin_hello() {
    553         $this->assertFalse( is_network_only_plugin( 'hello-dolly/hello.php' ) );
     553        $this->assertFalse( is_network_only_plugin( 'hello.php' ) );
    554554    }
    555555
     
    571571     */
    572572    public function test_activate_plugins_single_no_array() {
    573         $name = 'hello-dolly/hello.php';
     573        $name = 'hello.php';
    574574        activate_plugins( $name );
    575575        $this->assertTrue( is_plugin_active( $name ) );
     
    581581     */
    582582    public function test_activate_plugins_single_array() {
    583         $name = 'hello-dolly/hello.php';
     583        $name = 'hello.php';
    584584        activate_plugins( array( $name ) );
    585585        $this->assertTrue( is_plugin_active( $name ) );
  • trunk/tests/phpunit/tests/admin/plugin-dependencies/hasDependents.php

    r60666 r61006  
    5454    public function test_should_convert_hellophp_to_hello_dolly() {
    5555        $this->set_property_value( 'dependency_slugs', array( 'hello-dolly' ) );
    56         $this->assertTrue( self::$instance::has_dependents( 'hello-dolly/hello.php' ) );
     56        $this->assertTrue( self::$instance::has_dependents( 'hello.php' ) );
    5757    }
    5858}
  • trunk/tests/phpunit/tests/admin/plugin-dependencies/initialize.php

    r60666 r61006  
    282282        foreach ( $plugins as $plugin_file => &$headers ) {
    283283            // Create the expected slugs.
    284             $slug = str_replace( '.php', '', explode( '/', $plugin_file )[0] );
     284            if ( 'hello.php' === $plugin_file ) {
     285                $slug = 'hello-dolly';
     286            } else {
     287                $slug = str_replace( '.php', '', explode( '/', $plugin_file )[0] );
     288            }
    285289
    286290            $expected_slugs[ $plugin_file ] = $slug;
  • trunk/tests/phpunit/tests/ajax/wpAjaxUpdatePlugin.php

    r60666 r61006  
    139139
    140140        $_POST['_ajax_nonce'] = wp_create_nonce( 'updates' );
    141         $_POST['plugin']      = 'hello-dolly/hello.php';
     141        $_POST['plugin']      = 'hello.php';
    142142        $_POST['slug']        = 'hello-dolly';
    143143
     
    164164                'oldVersion'   => 'Version 1.7.2',
    165165                'newVersion'   => '',
    166                 'plugin'       => 'hello-dolly/hello.php',
     166                'plugin'       => 'hello.php',
    167167                'pluginName'   => 'Hello Dolly',
    168168                'debug'        => array( 'The plugin is at the latest version.' ),
  • trunk/tests/phpunit/tests/dependencies/scripts.php

    r60948 r61006  
    29952995     */
    29962996    public function test_wp_enqueue_code_editor_when_php_file_will_be_passed() {
    2997         $real_file              = WP_PLUGIN_DIR . '/hello-dolly/hello.php';
     2997        $real_file              = WP_PLUGIN_DIR . '/hello.php';
    29982998        $wp_enqueue_code_editor = wp_enqueue_code_editor( array( 'file' => $real_file ) );
    29992999        $this->assertNonEmptyMultidimensionalArray( $wp_enqueue_code_editor );
  • trunk/tests/phpunit/tests/multisite/network.php

    r60729 r61006  
    274274
    275275    public function test_active_network_plugins() {
    276         $path = 'hello-dolly/hello.php';
     276        $path = 'hello.php';
    277277
    278278        // Local activate, should be invisible for the network.
     
    286286        activate_plugin( $path, '', true ); // Enable the plugin for all sites in the network.
    287287        $active_plugins = wp_get_active_network_plugins();
    288         $this->assertSame( array( WP_PLUGIN_DIR . '/hello-dolly/hello.php' ), $active_plugins );
     288        $this->assertSame( array( WP_PLUGIN_DIR . '/hello.php' ), $active_plugins );
    289289
    290290        // Deactivate the plugin.
     
    305305     */
    306306    public function test_duplicate_network_active_plugin() {
    307         $path = 'hello-dolly/hello.php';
     307        $path = 'hello.php';
    308308        $mock = new MockAction();
    309309        add_action( 'activate_' . $path, array( $mock, 'action' ) );
     
    325325
    326326    public function test_is_plugin_active_for_network_true() {
    327         activate_plugin( 'hello-dolly/hello.php', '', true );
    328         $this->assertTrue( is_plugin_active_for_network( 'hello-dolly/hello.php' ) );
     327        activate_plugin( 'hello.php', '', true );
     328        $this->assertTrue( is_plugin_active_for_network( 'hello.php' ) );
    329329    }
    330330
    331331    public function test_is_plugin_active_for_network_false() {
    332         deactivate_plugins( 'hello-dolly/hello.php', false, true );
    333         $this->assertFalse( is_plugin_active_for_network( 'hello-dolly/hello.php' ) );
     332        deactivate_plugins( 'hello.php', false, true );
     333        $this->assertFalse( is_plugin_active_for_network( 'hello.php' ) );
    334334    }
    335335
Note: See TracChangeset for help on using the changeset viewer.