diff --git a/src/wp-admin/includes/class-wp-site-health.php b/src/wp-admin/includes/class-wp-site-health.php index 4fec62defa4cd..b4231e3f640fc 100644 --- a/src/wp-admin/includes/class-wp-site-health.php +++ b/src/wp-admin/includes/class-wp-site-health.php @@ -2598,8 +2598,11 @@ public function get_autoloaded_options_size() { $total_length = 0; - foreach ( $alloptions as $option_name => $option_value ) { - $total_length += strlen( $option_value ); + foreach ( $alloptions as $option_value ) { + if ( is_array( $option_value ) || is_object( $option_value ) ) { + $option_value = maybe_serialize( $option_value ); + } + $total_length += strlen( (string) $option_value ); } return $total_length;