Skip to content

Commit f906ea5

Browse files
committed
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. git-svn-id: https://develop.svn.wordpress.org/trunk@61006 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 752105a commit f906ea5

File tree

14 files changed

+42
-62
lines changed

14 files changed

+42
-62
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ wp-tests-config.php
5050
/src/wp-content/fonts
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
5756
!/src/wp-content/themes/twentyeleven

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module.exports = function(grunt) {
2828
'wp-content/themes/index.php',
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/**',
3434
],

src/wp-admin/includes/plugin.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ function _get_plugin_data_markup_translate( $plugin_file, $plugin_data, $markup
153153
load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) );
154154
}
155155
}
156+
} elseif ( 'hello.php' === basename( $plugin_file ) ) {
157+
$textdomain = 'default';
156158
}
157159
if ( $textdomain ) {
158160
foreach ( array( 'Name', 'PluginURI', 'Description', 'Author', 'AuthorURI', 'Version' ) as $field ) {
@@ -1006,6 +1008,10 @@ function delete_plugins( $plugins, $deprecated = '' ) {
10061008

10071009
$plugin_slug = dirname( $plugin_file );
10081010

1011+
if ( 'hello.php' === $plugin_file ) {
1012+
$plugin_slug = 'hello-dolly';
1013+
}
1014+
10091015
// Remove language files, silently.
10101016
if ( '.' !== $plugin_slug && ! empty( $plugin_translations[ $plugin_slug ] ) ) {
10111017
$translations = $plugin_translations[ $plugin_slug ];

src/wp-admin/includes/update-core.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -841,8 +841,6 @@
841841
'wp-includes/js/dist/undo-manager.min.js',
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

848846
/**
@@ -975,7 +973,6 @@
975973
'themes/twentytwentythree/' => '6.1',
976974
'themes/twentytwentyfour/' => '6.4',
977975
'themes/twentytwentyfive/' => '6.7',
978-
'plugins/hello-dolly/' => '6.9',
979976
);
980977

981978
/**

src/wp-admin/includes/upgrade.php

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -886,10 +886,6 @@ function upgrade_all() {
886886
upgrade_682();
887887
}
888888

889-
if ( $wp_current_db_version < 60717 ) {
890-
upgrade_690();
891-
}
892-
893889
maybe_disable_link_manager();
894890

895891
maybe_disable_automattic_widgets();
@@ -2485,31 +2481,6 @@ function ( $url ) {
24852481
}
24862482
}
24872483

2488-
/**
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-
25132484
/**
25142485
* Executes network-level upgrade routines.
25152486
*
File renamed without changes.

src/wp-includes/class-wp-plugin-dependencies.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -870,6 +870,9 @@ protected static function check_for_circular_dependencies( $dependents, $depende
870870
* @return string The plugin's slug.
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
}
875878
}
File renamed without changes.

tests/phpunit/tests/admin/includesPlugin.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static function wpTearDownAfterClass() {
2222
}
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(
2828
'Name' => 'Hello Dolly',
@@ -374,38 +374,38 @@ public function test_passing_float_as_position_does_not_override_int() {
374374
}
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

404404
/**
405405
* @covers ::get_plugin_files
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
}
411411

@@ -550,7 +550,7 @@ public function test_get_dropins_not_empty() {
550550
* @covers ::is_network_only_plugin
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

556556
/**
@@ -570,7 +570,7 @@ public function test_is_network_only_plugin() {
570570
* @covers ::activate_plugins
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 ) );
576576
deactivate_plugins( $name );
@@ -580,7 +580,7 @@ public function test_activate_plugins_single_no_array() {
580580
* @covers ::activate_plugins
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 ) );
586586
deactivate_plugins( $name );

tests/phpunit/tests/admin/plugin-dependencies/hasDependents.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ public function test_should_return_false_when_a_plugin_has_no_dependents() {
5353
*/
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
}

0 commit comments

Comments
 (0)