From 645714775db285ef48ec53ca3708c78311d5d987 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Wed, 30 Sep 2026 13:44:03 -0700 Subject: [PATCH 1/5] Pass null for the deprecated argument to wp_upload_bits() The `$deprecated` parameter of `wp_upload_bits()` is documented as "Not used. Set to null." `wp_generate_attachment_metadata()` passed an empty string instead when uploading the cover art embedded in audio and video files. The value is ignored either way, so this changes no behavior; it brings the call in line with the documented type. Co-Authored-By: Claude Opus 5.5 --- src/wp-admin/includes/image.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/image.php b/src/wp-admin/includes/image.php index 935c613d561e9..c3a4a8d769be0 100644 --- a/src/wp-admin/includes/image.php +++ b/src/wp-admin/includes/image.php @@ -635,7 +635,7 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) { break; } $basename = str_replace( '.', '-', wp_basename( $file ) ) . '-image' . $ext; - $uploaded = wp_upload_bits( $basename, '', $metadata['image']['data'] ); + $uploaded = wp_upload_bits( $basename, null, $metadata['image']['data'] ); if ( false === $uploaded['error'] ) { $image_attachment = array( 'post_mime_type' => $metadata['image']['mime'], From 17a77b74292825018fb9f05c9c06175058e44750 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Wed, 30 Sep 2026 13:46:09 -0700 Subject: [PATCH 2/5] Pass an empty string for the deprecated argument to add_option() The `$deprecated` parameter of `add_option()` is documented as a string, defaulting to an empty string. `upgrade_340()` passed null when re-adding the `uninstall_plugins` option without autoloading. `add_option()` only warns when the argument is non-empty, so this changes no behavior; it brings the call in line with the documented type. Co-Authored-By: Claude Opus 5.5 --- src/wp-admin/includes/upgrade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php index 244401cf24013..833167da3476f 100644 --- a/src/wp-admin/includes/upgrade.php +++ b/src/wp-admin/includes/upgrade.php @@ -1865,7 +1865,7 @@ function upgrade_340() { if ( 'yes' === $wpdb->get_var( "SELECT autoload FROM $wpdb->options WHERE option_name = 'uninstall_plugins'" ) ) { $uninstall_plugins = get_option( 'uninstall_plugins' ); delete_option( 'uninstall_plugins' ); - add_option( 'uninstall_plugins', $uninstall_plugins, null, false ); + add_option( 'uninstall_plugins', $uninstall_plugins, '', false ); } } } From 4680ee4abb315f00a5b05daed962c65d61f6282d Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Wed, 30 Sep 2026 13:48:03 -0700 Subject: [PATCH 3/5] Stop passing the unused second argument to iframe_header() The second parameter of `iframe_header()` was renamed to `$deprecated` in WordPress 4.2 and has not been used since. The plugin reactivation screen in `wp-admin/update.php` still passed `true` for it. Dropping the argument changes no behavior. Co-Authored-By: Claude Opus 5.5 --- src/wp-admin/update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/update.php b/src/wp-admin/update.php index a6c59ec06dab2..a0ba9cfc069b2 100644 --- a/src/wp-admin/update.php +++ b/src/wp-admin/update.php @@ -87,7 +87,7 @@ wp_redirect( admin_url( 'update.php?action=activate-plugin&success=true&plugin=' . urlencode( $plugin ) . '&_wpnonce=' . $_GET['_wpnonce'] ) ); die(); } - iframe_header( __( 'Plugin Reactivation' ), true ); + iframe_header( __( 'Plugin Reactivation' ) ); if ( isset( $_GET['success'] ) ) { echo '

' . __( 'Plugin reactivated successfully.' ) . '

'; } From 8cb638a42fa027376b3ccd63f58029479b8bac0c Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Wed, 30 Sep 2026 13:49:01 -0700 Subject: [PATCH 4/5] Pass an empty string for the deprecated argument to wp_install() in tests The `$deprecated` parameter of `wp_install()` is documented as a string, defaulting to an empty string, which is also what `wp-admin/install.php` passes. The PHPUnit install bootstrap passed null instead. `wp_install()` only warns when the argument is non-empty, so this changes no behavior; it brings the call in line with the documented type. Co-Authored-By: Claude Opus 5.5 --- tests/phpunit/includes/install.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/includes/install.php b/tests/phpunit/includes/install.php index 01b438289b6f5..0f33f668ce782 100644 --- a/tests/phpunit/includes/install.php +++ b/tests/phpunit/includes/install.php @@ -91,7 +91,7 @@ // Prefill a permalink structure so that WP doesn't try to determine one itself. add_action( 'populate_options', '_set_default_permalink_structure_for_tests' ); -wp_install( WP_TESTS_TITLE, 'admin', WP_TESTS_EMAIL, true, null, 'password' ); +wp_install( WP_TESTS_TITLE, 'admin', WP_TESTS_EMAIL, true, '', 'password' ); // Delete dummy permalink structure, as prefilled above. if ( ! is_multisite() ) { From e7347291b8c96b313d666db9be196305116401bd Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Wed, 30 Sep 2026 14:02:25 -0700 Subject: [PATCH 5/5] Regenerate baselines --- tests/phpstan/baselines/argument.type.neon | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/phpstan/baselines/argument.type.neon b/tests/phpstan/baselines/argument.type.neon index 9697035667cac..fb8aa57695485 100644 --- a/tests/phpstan/baselines/argument.type.neon +++ b/tests/phpstan/baselines/argument.type.neon @@ -318,11 +318,6 @@ parameters: identifier: argument.type count: 1 path: ../../../src/wp-admin/includes/upgrade.php - - - message: '#^Parameter \#3 \$deprecated of function add_option expects string, null given\.$#' - identifier: argument.type - count: 1 - path: ../../../src/wp-admin/includes/upgrade.php - message: '#^Parameter \#1 \$bookmark_id of function clean_bookmark_cache expects int, string\|null given\.$#' identifier: argument.type