Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ wp-tests-config.php
/src/wp-content/fonts
/src/wp-content/languages
/src/wp-content/mu-plugins
/src/wp-content/plugins/*
!/src/wp-content/plugins/hello-dolly
/src/wp-content/plugins
/src/wp-content/themes/*
!/src/wp-content/themes/twentyten
!/src/wp-content/themes/twentyeleven
Expand Down
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = function(grunt) {
'wp-content/themes/index.php',
'wp-content/themes/twenty*/**',
'wp-content/plugins/index.php',
'wp-content/plugins/hello-dolly/**',
'wp-content/plugins/hello.php',
'wp-content/plugins/akismet/**',
'!wp-content/themes/twenty*/node_modules/**',
],
Expand Down
6 changes: 6 additions & 0 deletions src/wp-admin/includes/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ function _get_plugin_data_markup_translate( $plugin_file, $plugin_data, $markup
load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) );
}
}
} elseif ( 'hello.php' === basename( $plugin_file ) ) {
$textdomain = 'default';
}
if ( $textdomain ) {
foreach ( array( 'Name', 'PluginURI', 'Description', 'Author', 'AuthorURI', 'Version' ) as $field ) {
Expand Down Expand Up @@ -1006,6 +1008,10 @@ function delete_plugins( $plugins, $deprecated = '' ) {

$plugin_slug = dirname( $plugin_file );

if ( 'hello.php' === $plugin_file ) {
$plugin_slug = 'hello-dolly';
}

// Remove language files, silently.
if ( '.' !== $plugin_slug && ! empty( $plugin_translations[ $plugin_slug ] ) ) {
$translations = $plugin_translations[ $plugin_slug ];
Expand Down
3 changes: 0 additions & 3 deletions src/wp-admin/includes/update-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -841,8 +841,6 @@
'wp-includes/js/dist/undo-manager.min.js',
'wp-includes/js/dist/fields.min.js',
'wp-includes/js/dist/fields.js',
// 6.9
'wp-content/plugins/hello.php',
);

/**
Expand Down Expand Up @@ -975,7 +973,6 @@
'themes/twentytwentythree/' => '6.1',
'themes/twentytwentyfour/' => '6.4',
'themes/twentytwentyfive/' => '6.7',
'plugins/hello-dolly/' => '6.9',
);

/**
Expand Down
30 changes: 0 additions & 30 deletions src/wp-admin/includes/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -886,10 +886,6 @@ function upgrade_all() {
upgrade_682();
}

if ( $wp_current_db_version < 60717 ) {
upgrade_690();
}

maybe_disable_link_manager();

maybe_disable_automattic_widgets();
Expand Down Expand Up @@ -2418,7 +2414,6 @@ function upgrade_650() {
wp_set_option_autoload_values( $autoload );
}
}

/**
* Executes changes made in WordPress 6.7.0.
*
Expand Down Expand Up @@ -2485,31 +2480,6 @@ function ( $url ) {
}
}

/**
* Executes changes made in WordPress 6.9.0.
*
* @ignore
* @since 6.9.0
*
* @global int $wp_current_db_version The old (current) database version.
*/
function upgrade_690() {
global $wp_current_db_version;

if ( $wp_current_db_version < 60717 ) {
// Switch Hello Dolly from file to directory format. See #53323
$active_plugins = (array) get_option( 'active_plugins', array() );
$old_plugin = 'hello.php';
$new_plugin = 'hello-dolly/hello.php';
$key = array_search( $old_plugin, $active_plugins, true );

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

/**
* Executes network-level upgrade routines.
*
Expand Down
106 changes: 0 additions & 106 deletions src/wp-content/plugins/hello-dolly/hello.php

This file was deleted.

3 changes: 3 additions & 0 deletions src/wp-includes/class-wp-plugin-dependencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,9 @@ protected static function check_for_circular_dependencies( $dependents, $depende
* @return string The plugin's slug.
*/
protected static function convert_to_slug( $plugin_file ) {
if ( 'hello.php' === $plugin_file ) {
return 'hello-dolly';
}
return str_contains( $plugin_file, '/' ) ? dirname( $plugin_file ) : str_replace( '.php', '', $plugin_file );
}
}
30 changes: 15 additions & 15 deletions tests/phpunit/tests/admin/includesPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static function wpTearDownAfterClass() {
}

public function test_get_plugin_data() {
$data = get_plugin_data( DIR_TESTDATA . '/plugins/hello-dolly/hello.php' );
$data = get_plugin_data( DIR_TESTDATA . '/plugins/hello.php' );

$default_headers = array(
'Name' => 'Hello Dolly',
Expand Down Expand Up @@ -374,38 +374,38 @@ public function test_passing_float_as_position_does_not_override_int() {
}

public function test_is_plugin_active_true() {
activate_plugin( 'hello-dolly/hello.php' );
$test = is_plugin_active( 'hello-dolly/hello.php' );
activate_plugin( 'hello.php' );
$test = is_plugin_active( 'hello.php' );
$this->assertTrue( $test );

deactivate_plugins( 'hello-dolly/hello.php' );
deactivate_plugins( 'hello.php' );
}

public function test_is_plugin_active_false() {
deactivate_plugins( 'hello-dolly/hello.php' );
$test = is_plugin_active( 'hello-dolly/hello.php' );
deactivate_plugins( 'hello.php' );
$test = is_plugin_active( 'hello.php' );
$this->assertFalse( $test );
}

public function test_is_plugin_inactive_true() {
deactivate_plugins( 'hello-dolly/hello.php' );
$test = is_plugin_inactive( 'hello-dolly/hello.php' );
deactivate_plugins( 'hello.php' );
$test = is_plugin_inactive( 'hello.php' );
$this->assertTrue( $test );
}

public function test_is_plugin_inactive_false() {
activate_plugin( 'hello-dolly/hello.php' );
$test = is_plugin_inactive( 'hello-dolly/hello.php' );
activate_plugin( 'hello.php' );
$test = is_plugin_inactive( 'hello.php' );
$this->assertFalse( $test );

deactivate_plugins( 'hello-dolly/hello.php' );
deactivate_plugins( 'hello.php' );
}

/**
* @covers ::get_plugin_files
*/
public function test_get_plugin_files_single() {
$name = 'hello-dolly/hello.php';
$name = 'hello.php';
$this->assertSame( array( $name ), get_plugin_files( $name ) );
}

Expand Down Expand Up @@ -550,7 +550,7 @@ public function test_get_dropins_not_empty() {
* @covers ::is_network_only_plugin
*/
public function test_is_network_only_plugin_hello() {
$this->assertFalse( is_network_only_plugin( 'hello-dolly/hello.php' ) );
$this->assertFalse( is_network_only_plugin( 'hello.php' ) );
}

/**
Expand All @@ -570,7 +570,7 @@ public function test_is_network_only_plugin() {
* @covers ::activate_plugins
*/
public function test_activate_plugins_single_no_array() {
$name = 'hello-dolly/hello.php';
$name = 'hello.php';
activate_plugins( $name );
$this->assertTrue( is_plugin_active( $name ) );
deactivate_plugins( $name );
Expand All @@ -580,7 +580,7 @@ public function test_activate_plugins_single_no_array() {
* @covers ::activate_plugins
*/
public function test_activate_plugins_single_array() {
$name = 'hello-dolly/hello.php';
$name = 'hello.php';
activate_plugins( array( $name ) );
$this->assertTrue( is_plugin_active( $name ) );
deactivate_plugins( $name );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ public function test_should_return_false_when_a_plugin_has_no_dependents() {
*/
public function test_should_convert_hellophp_to_hello_dolly() {
$this->set_property_value( 'dependency_slugs', array( 'hello-dolly' ) );
$this->assertTrue( self::$instance::has_dependents( 'hello-dolly/hello.php' ) );
$this->assertTrue( self::$instance::has_dependents( 'hello.php' ) );
}
}
6 changes: 5 additions & 1 deletion tests/phpunit/tests/admin/plugin-dependencies/initialize.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,11 @@ public function test_should_slugify_dependent_files() {
$expected_slugs = array();
foreach ( $plugins as $plugin_file => &$headers ) {
// Create the expected slugs.
$slug = str_replace( '.php', '', explode( '/', $plugin_file )[0] );
if ( 'hello.php' === $plugin_file ) {
$slug = 'hello-dolly';
} else {
$slug = str_replace( '.php', '', explode( '/', $plugin_file )[0] );
}

$expected_slugs[ $plugin_file ] = $slug;

Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/tests/ajax/wpAjaxUpdatePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function test_update_plugin() {
$this->_setRole( 'administrator' );

$_POST['_ajax_nonce'] = wp_create_nonce( 'updates' );
$_POST['plugin'] = 'hello-dolly/hello.php';
$_POST['plugin'] = 'hello.php';
$_POST['slug'] = 'hello-dolly';

// Prevent wp_update_plugins() from running.
Expand All @@ -163,7 +163,7 @@ public function test_update_plugin() {
'slug' => 'hello-dolly',
'oldVersion' => 'Version 1.7.2',
'newVersion' => '',
'plugin' => 'hello-dolly/hello.php',
'plugin' => 'hello.php',
'pluginName' => 'Hello Dolly',
'debug' => array( 'The plugin is at the latest version.' ),
'errorMessage' => 'The plugin is at the latest version.',
Expand Down
1 change: 1 addition & 0 deletions tests/phpunit/tests/block-templates/base.php
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the changes to this file intentional?

Same question for:

  • tests/phpunit/tests/image/base.php
  • tests/phpunit/tests/image/resize.php

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's caused by a mistype from me. I did svn merge -c -60770 . and should have done svn merge -c -60670 . Updated commit just made

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

/**
* @group block-templates
* @covers ::get_template_hierarchy
*/
abstract class WP_Block_Templates_UnitTestCase extends WP_UnitTestCase {
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/tests/dependencies/scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -3024,7 +3024,7 @@ public function test_wp_set_script_translations_dependency() {
* @covers ::wp_enqueue_code_editor
*/
public function test_wp_enqueue_code_editor_when_php_file_will_be_passed() {
$real_file = WP_PLUGIN_DIR . '/hello-dolly/hello.php';
$real_file = WP_PLUGIN_DIR . '/hello.php';
$wp_enqueue_code_editor = wp_enqueue_code_editor( array( 'file' => $real_file ) );
$this->assertNonEmptyMultidimensionalArray( $wp_enqueue_code_editor );

Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/tests/image/base.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Base class for testing image manipulation functionality.
* @group image
*/
abstract class WP_Image_UnitTestCase extends WP_UnitTestCase {

Expand Down
5 changes: 4 additions & 1 deletion tests/phpunit/tests/image/resize.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?php

/**
* Base class for testing image resize functionality.
* @group image
* @group media
* @group upload
* @group resize
*/
require_once __DIR__ . '/base.php';

Expand Down
Loading
Loading