Changeset 61006
- Timestamp:
- 10/21/2025 04:31:04 AM (7 weeks ago)
- Location:
- trunk
- Files:
-
- 12 edited
- 2 moved
-
.gitignore (modified) (1 diff)
-
Gruntfile.js (modified) (1 diff)
-
src/wp-admin/includes/plugin.php (modified) (2 diffs)
-
src/wp-admin/includes/update-core.php (modified) (2 diffs)
-
src/wp-admin/includes/upgrade.php (modified) (2 diffs)
-
src/wp-content/plugins/hello.php (moved) (moved from trunk/src/wp-content/plugins/hello-dolly/hello.php)
-
src/wp-includes/class-wp-plugin-dependencies.php (modified) (1 diff)
-
tests/phpunit/data/plugins/hello.php (moved) (moved from trunk/tests/phpunit/data/plugins/hello-dolly/hello.php)
-
tests/phpunit/tests/admin/includesPlugin.php (modified) (6 diffs)
-
tests/phpunit/tests/admin/plugin-dependencies/hasDependents.php (modified) (1 diff)
-
tests/phpunit/tests/admin/plugin-dependencies/initialize.php (modified) (1 diff)
-
tests/phpunit/tests/ajax/wpAjaxUpdatePlugin.php (modified) (2 diffs)
-
tests/phpunit/tests/dependencies/scripts.php (modified) (1 diff)
-
tests/phpunit/tests/multisite/network.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/.gitignore
r60934 r61006 51 51 /src/wp-content/languages 52 52 /src/wp-content/mu-plugins 53 /src/wp-content/plugins/* 54 !/src/wp-content/plugins/hello-dolly 53 /src/wp-content/plugins 55 54 /src/wp-content/themes/* 56 55 !/src/wp-content/themes/twentyten -
trunk/Gruntfile.js
r60934 r61006 29 29 'wp-content/themes/twenty*/**', 30 30 'wp-content/plugins/index.php', 31 'wp-content/plugins/hello -dolly/**',31 'wp-content/plugins/hello.php', 32 32 'wp-content/plugins/akismet/**', 33 33 '!wp-content/themes/twenty*/node_modules/**', -
trunk/src/wp-admin/includes/plugin.php
r60995 r61006 154 154 } 155 155 } 156 } elseif ( 'hello.php' === basename( $plugin_file ) ) { 157 $textdomain = 'default'; 156 158 } 157 159 if ( $textdomain ) { … … 1006 1008 1007 1009 $plugin_slug = dirname( $plugin_file ); 1010 1011 if ( 'hello.php' === $plugin_file ) { 1012 $plugin_slug = 'hello-dolly'; 1013 } 1008 1014 1009 1015 // Remove language files, silently. -
trunk/src/wp-admin/includes/update-core.php
r60666 r61006 842 842 'wp-includes/js/dist/fields.min.js', 843 843 'wp-includes/js/dist/fields.js', 844 // 6.9845 'wp-content/plugins/hello.php',846 844 ); 847 845 … … 976 974 'themes/twentytwentyfour/' => '6.4', 977 975 'themes/twentytwentyfive/' => '6.7', 978 'plugins/hello-dolly/' => '6.9',979 976 ); 980 977 -
trunk/src/wp-admin/includes/upgrade.php
r60789 r61006 887 887 } 888 888 889 if ( $wp_current_db_version < 60717 ) {890 upgrade_690();891 }892 893 889 maybe_disable_link_manager(); 894 890 … … 2487 2483 2488 2484 /** 2489 * Executes changes made in WordPress 6.9.0.2490 *2491 * @ignore2492 * @since 6.9.02493 *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 #533232501 $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 /**2514 2485 * Executes network-level upgrade routines. 2515 2486 * -
trunk/src/wp-includes/class-wp-plugin-dependencies.php
r60666 r61006 871 871 */ 872 872 protected static function convert_to_slug( $plugin_file ) { 873 if ( 'hello.php' === $plugin_file ) { 874 return 'hello-dolly'; 875 } 873 876 return str_contains( $plugin_file, '/' ) ? dirname( $plugin_file ) : str_replace( '.php', '', $plugin_file ); 874 877 } -
trunk/tests/phpunit/tests/admin/includesPlugin.php
r60666 r61006 23 23 24 24 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' ); 26 26 27 27 $default_headers = array( … … 375 375 376 376 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' ); 379 379 $this->assertTrue( $test ); 380 380 381 deactivate_plugins( 'hello -dolly/hello.php' );381 deactivate_plugins( 'hello.php' ); 382 382 } 383 383 384 384 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' ); 387 387 $this->assertFalse( $test ); 388 388 } 389 389 390 390 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' ); 393 393 $this->assertTrue( $test ); 394 394 } 395 395 396 396 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' ); 399 399 $this->assertFalse( $test ); 400 400 401 deactivate_plugins( 'hello -dolly/hello.php' );401 deactivate_plugins( 'hello.php' ); 402 402 } 403 403 … … 406 406 */ 407 407 public function test_get_plugin_files_single() { 408 $name = 'hello -dolly/hello.php';408 $name = 'hello.php'; 409 409 $this->assertSame( array( $name ), get_plugin_files( $name ) ); 410 410 } … … 551 551 */ 552 552 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' ) ); 554 554 } 555 555 … … 571 571 */ 572 572 public function test_activate_plugins_single_no_array() { 573 $name = 'hello -dolly/hello.php';573 $name = 'hello.php'; 574 574 activate_plugins( $name ); 575 575 $this->assertTrue( is_plugin_active( $name ) ); … … 581 581 */ 582 582 public function test_activate_plugins_single_array() { 583 $name = 'hello -dolly/hello.php';583 $name = 'hello.php'; 584 584 activate_plugins( array( $name ) ); 585 585 $this->assertTrue( is_plugin_active( $name ) ); -
trunk/tests/phpunit/tests/admin/plugin-dependencies/hasDependents.php
r60666 r61006 54 54 public function test_should_convert_hellophp_to_hello_dolly() { 55 55 $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' ) ); 57 57 } 58 58 } -
trunk/tests/phpunit/tests/admin/plugin-dependencies/initialize.php
r60666 r61006 282 282 foreach ( $plugins as $plugin_file => &$headers ) { 283 283 // 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 } 285 289 286 290 $expected_slugs[ $plugin_file ] = $slug; -
trunk/tests/phpunit/tests/ajax/wpAjaxUpdatePlugin.php
r60666 r61006 139 139 140 140 $_POST['_ajax_nonce'] = wp_create_nonce( 'updates' ); 141 $_POST['plugin'] = 'hello -dolly/hello.php';141 $_POST['plugin'] = 'hello.php'; 142 142 $_POST['slug'] = 'hello-dolly'; 143 143 … … 164 164 'oldVersion' => 'Version 1.7.2', 165 165 'newVersion' => '', 166 'plugin' => 'hello -dolly/hello.php',166 'plugin' => 'hello.php', 167 167 'pluginName' => 'Hello Dolly', 168 168 'debug' => array( 'The plugin is at the latest version.' ), -
trunk/tests/phpunit/tests/dependencies/scripts.php
r60948 r61006 2995 2995 */ 2996 2996 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'; 2998 2998 $wp_enqueue_code_editor = wp_enqueue_code_editor( array( 'file' => $real_file ) ); 2999 2999 $this->assertNonEmptyMultidimensionalArray( $wp_enqueue_code_editor ); -
trunk/tests/phpunit/tests/multisite/network.php
r60729 r61006 274 274 275 275 public function test_active_network_plugins() { 276 $path = 'hello -dolly/hello.php';276 $path = 'hello.php'; 277 277 278 278 // Local activate, should be invisible for the network. … … 286 286 activate_plugin( $path, '', true ); // Enable the plugin for all sites in the network. 287 287 $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 ); 289 289 290 290 // Deactivate the plugin. … … 305 305 */ 306 306 public function test_duplicate_network_active_plugin() { 307 $path = 'hello -dolly/hello.php';307 $path = 'hello.php'; 308 308 $mock = new MockAction(); 309 309 add_action( 'activate_' . $path, array( $mock, 'action' ) ); … … 325 325 326 326 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' ) ); 329 329 } 330 330 331 331 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' ) ); 334 334 } 335 335
Note: See TracChangeset
for help on using the changeset viewer.