Make WordPress Core

Opened 8 weeks ago

Last modified 8 weeks ago

#64908 new defect (bug)

PHP Warnings in Site Health information copy button

Reported by: tunyk's profile tunyk Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.9.4
Component: Site Health Keywords:
Focuses: administration, php-compatibility Cc:

Description

System Environment:

WordPress Version: 6.9.4

PHP Version: 8.5.4 (upgraded from 8.3)

Description:
After upgrading the server from PHP 8.3 to PHP 8.5.4, I am experiencing UI and technical issues on the Site Health page (/wp-admin/site-health.php?tab=debug).

Observed Issues:

UI Glitch: The "Copy site info to clipboard" button is rendered incorrectly/distorted on the debug tab.

PHP Warnings in Logs:

PHP Warning: Undefined array key "value" in .../www/wp-admin/includes/class-wp-debug-data.php

PHP Warning: Undefined array key "label" in .../www/wp-admin/site-health-info.php

Troubleshooting performed:
I have checked Query Monitor and the site error logs. No specific plugins were identified as the source of these errors; the "Component" column in Query Monitor consistently points to WordPress Core. It appears that the debug_data_to_text() or related functions in the core are attempting to access array keys that are not explicitly set, which PHP 8.5 now handles more strictly.

Could you please investigate if this is a known compatibility issue with PHP 8.5 and if there is a recommended fix for these core files?

Attachments (2)

scrnli_hI08KYBCPYRF4l.png (93.7 KB) - added by tunyk 8 weeks ago.
Site Health
Query Monitor.jpg (153.2 KB) - added by tunyk 8 weeks ago.

Download all attachments as: .zip

Change History (5)

@tunyk
8 weeks ago

Site Health

#1 follow-up: @Soean
8 weeks ago

I can't reproduce it with PHP 8.5, WP 6.9.4 and Українська language.

Can you look into the source code of the browser. I should look like this:

<button type="button" class="button copy-button" data-clipboard-text="`
### wp-core ###
...
`">

#2 in reply to: ↑ 1 @tunyk
8 weeks ago

Replying to Soean:

I can't reproduce it with PHP 8.5, WP 6.9.4 and Українська language.

Can you look into the source code of the browser. I should look like this:

<button type="button" class="button copy-button" data-clipboard-text="`
### wp-core ###
...
`">

The website name has been changed in the following fragment:

<button type="button" class="button copy-button" data-clipboard-text="&lt;br /&gt;
&lt;b&gt;Warning&lt;/b&gt;:  Undefined array key " value"="" in="" <b="">/home/websiteua/website.club/www/wp-admin/includes/class-wp-debug-data.php on line <b>1819</b><br>
`
### wp-core ###

version: 6.9.4
site_language: uk
user_language: uk
timezone: Europe/Kyiv
permalink: /blog/%postname%/
https_status: true
multisite: false
user_registration: 0
blog_public: 1
default_comment_status: open
environment_type: production
user_count: 5
dotorg_communication: true

### wp-paths-sizes ###

wordpress_path: /home/websiteua/website.club/www
wordpress_size: loading...
uploads_path: /home/websiteua/website.club/www/wp-content/uploads
uploads_size: loading...
themes_path: /home/websiteua/website.club/www/wp-content/themes
themes_size: loading...
plugins_path: /home/websiteua/website.club/www/wp-content/plugins
plugins_size: loading...
fonts_path: /home/websiteua/website.club/www/wp-content/uploads/fonts
fonts_size: loading...
database_size: loading...
total_size: loading...

### wp-dropins (2) ###

advanced-cache.php: true
object-cache.php: true

### wp-active-theme ###

name: Woodmart Child (woodmart-child)
version: 1.0.0
author: Xtemos
author_website: http://xtemos.com
parent_theme: Woodmart (woodmart)
theme_features: core-block-patterns, woocommerce, wc-product-gallery-zoom, widgets-block-editor, block-templates, post-thumbnails, post-formats, automatic-feed-links, title-tag, html5, menus, editor-styles, editor-style, align-wide, widgets
theme_path: /home/websiteua/website.club/www/wp-content/themes/woodmart-child
auto_update: Вимкнено

### wp-parent-theme ###

name: Woodmart (woodmart)
version: 8.4.1
author: Xtemos
author_website: http://themeforest.net/user/xtemos
theme_path: /home/websiteua/website.club/www/wp-content/themes/woodmart
auto_update: Вимкнено

### wp-themes-inactive (1) ###

Twenty Twenty-Five: version: 1.4, author: the WordPress team, Автоматичні оновлення вимкнено

### wp-plugins-active (19) ###

Advanced Google reCAPTCHA: version: 1.32, author: WebFactory Ltd, Автоматичні оновлення вимкнено
Classic Widgets: version: 0.3, author: WordPress Contributors, Автоматичні оновлення вимкнено
Code Snippets: version: 3.9.5, author: Code Snippets Pro, Автоматичні оновлення вимкнено
Custom Taxonomy Order: version: 4.0.2, author: Marcel Pol, Автоматичні оновлення вимкнено
Cyr-To-Lat: version: 6.6.0, author: Sergey Biryukov, Mikhail Kobzarev, Igor Gergel, Автоматичні оновлення вимкнено
Google for WooCommerce: version: 3.6.0, author: WooCommerce, Автоматичні оновлення вимкнено
Instant Indexing: version: 1.1.22, author: Rank Math, Автоматичні оновлення вимкнено
Loco Translate: version: 2.8.3, author: Tim Whitlock, Автоматичні оновлення вимкнено
MC4WP: Mailchimp for WordPress: version: 4.12.0, author: ibericode, Автоматичні оновлення вимкнено
Polylang: version: 3.8.1, author: WP SYNTEX, Автоматичні оновлення вимкнено
Polylang for WooCommerce: version: 2.2.2, author: WP SYNTEX, Автоматичні оновлення вимкнено
Print Invoice &amp; Delivery Notes for WooCommerce: version: 6.0.0, author: Tyche Softwares, Автоматичні оновлення вимкнено
PWA: version: 0.8.2, author: PWA Plugin Contributors, Автоматичні оновлення вимкнено
Rank Math SEO: version: 1.0.266.1, author: Rank Math SEO, Автоматичні оновлення вимкнено
Safe SVG: version: 2.4.0, author: 10up, Автоматичні оновлення вимкнено
W3 Total Cache: version: 2.9.2, author: BoldGrid, Автоматичні оновлення вимкнено
WooCommerce: version: 10.6.1, author: Automattic, Автоматичні оновлення вимкнено
Woodmart Core: author: (undefined), version: 1.1.6, Автоматичні оновлення вимкнено
WP Mail SMTP: version: 4.7.1, author: WP Mail SMTP, Автоматичні оновлення вимкнено

### wp-plugins-inactive (1) ###

Query Monitor: version: 3.20.4, author: John Blackbourn, Автоматичні оновлення вимкнено

### code-snippets (27) ###

snippet-9: name: WooCommerce - сторінка оформлення - додати описи до доставки, scope: front-end, modified: 2025-05-12 08:00:04
snippet-11: name: WooCommerce - сторінка оформлення - маска для телефону, scope: front-end, modified: 2024-01-04 13:05:16
snippet-13: name: Woocommerce - сторінка оформлення - галка - згоден з умовами, scope: global, modified: 2025-03-09 19:29:05
snippet-14: name: WooCommerce - сторінка оформлення - нові поля та послідовність, scope: global, modified: 2025-10-22 18:13:38
snippet-19: name: WooCommerce - admin - редагування замовлення у всіх статусах. Ставимо всім в обробці, scope: global, modified: 2024-01-04 12:49:54
snippet-30: name: Polylang - опис доставки реєстрація, scope: global, modified: 2023-12-31 11:03:07
snippet-32: name: Woocommerce - head - сторінка оформлення - бібліотека jQuerry, головна - фото слайдера, scope: front-end, modified: 2025-06-01 14:45:33
snippet-33: name: Woocommerce - footer - сторінка оформлення - скрипт переміщення, scope: front-end, modified: 2025-03-09 19:37:29
snippet-37: name: WordPress - коментарі - прибрати поле сайт, scope: global, modified: 2024-03-29 09:48:36
snippet-40: name: Woocommerce - сторінка оформлення - lyshe-dostavka, scope: global, modified: 2024-09-18 14:24:07
snippet-41: name: Woocommerce - сторінка оформлення - приховати IBAN при самовивозі чи курєрі, scope: front-end, modified: 2024-08-20 18:11:17
snippet-43: name: Woocommerce - сторінка оформлення - заголовок способи доставки та оплати, scope: global, modified: 2024-01-04 12:55:44
snippet-44: name: WooCommerce - сторінка оформлення - поля при різній доставці, scope: global, modified: 2025-03-09 17:22:34
snippet-48: name: Печатная форма - редактирование, scope: global, modified: 2024-01-15 17:42:33
snippet-49: name: Head, scope: head-content, modified: 2025-12-01 16:06:26
snippet-51: name: Rank Math - return shipping, виключити фото з карти, ноіндекс для фільтр, scope: global, modified: 2025-11-13 09:49:17
snippet-55: name: Згода Google для блогу, scope: front-end, modified: 2025-12-01 16:07:59
snippet-58: name: Empty, scope: front-end, modified: 2024-01-24 11:41:32
snippet-59: name: Переглянути українською, scope: front-end, modified: 2025-08-10 13:25:49
snippet-62: name: Language x-default + manifest, scope: front-end, modified: 2025-08-11 11:36:14
snippet-67: name: Попап - перейти на українську, scope: front-end, modified: 2025-08-30 09:35:25
snippet-72: name: Шорткод кросс-сейли2, scope: front-end, modified: 2025-06-01 11:04:45
snippet-79: name: Завантаження головного фото товару, scope: front-end, modified: 2026-03-11 20:18:11
snippet-80: name: Завантаження головного фото товару - 2, scope: global, modified: 2025-05-31 20:27:18
snippet-81: name: Виключити з Speculative - встроєнний - NEW, scope: global, modified: 2025-07-02 19:40:52
snippet-82: name: XML-RPC disable та пінгбеки і т.д., scope: global, modified: 2025-07-09 17:16:33
snippet-83: name: Woocoomerce - новинки за новизною, scope: global, modified: 2025-07-19 21:23:11

### wp-media ###

image_editor: WP_Image_Editor_Imagick
imagick_module_version: 1810
imagemagick_version: ImageMagick 7.1.2-15 Q16-HDRI x86_64 818ee6363:20260222 https://imagemagick.org
imagick_version: 3.8.1
file_uploads: 1
post_max_size: 1000M
upload_max_filesize: 1000M
max_effective_size: 1&nbsp;000 МБ
max_file_uploads: 200
imagick_limits: 
	imagick::RESOURCETYPE_AREA: 1&nbsp;005 ГБ
	imagick::RESOURCETYPE_DISK: 9.2233720368548E+18
	imagick::RESOURCETYPE_FILE: 269652
	imagick::RESOURCETYPE_MAP: 502 ГБ
	imagick::RESOURCETYPE_MEMORY: 251 ГБ
	imagick::RESOURCETYPE_THREAD: 1
	imagick::RESOURCETYPE_TIME: 9.2233720368548E+18
imagemagick_file_formats: 3FR, 3G2, 3GP, A, AAI, AI, APNG, ART, ARW, ASHLAR, AVCI, AVI, AVIF, AVS, B, BAYER, BAYERA, BGR, BGRA, BGRO, BMP, BMP2, BMP3, BRF, C, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUBE, CUR, CUT, DATA, DCM, DCR, DCRAW, DCX, DDS, DFONT, DNG, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, FARBFELD, FAX, FF, FFF, FILE, FITS, FL32, FLV, FRACTAL, FTP, FTS, FTXT, G, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, HALD, HDR, HEIC, HEIF, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICN, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, JNG, JNX, JPE, JPEG, JPG, JPS, JSON, K, K25, KDC, LABEL, M, M2V, M4V, MAC, MAP, MASK, MAT, MATTE, MDC, MEF, MIFF, MKV, MNG, MONO, MOS, MOV, MP4, MPC, MPEG, MPG, MPO, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, O, ORA, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PHM, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PS, PS2, PS3, PSB, PSD, PTIF, PWP, QOI, R, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGB565, RGBA, RGBO, RGF, RLA, RLE, RMF, RSVG, RW2, RWL, SCR, SCREENSHOT, SCT, SF3, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, SRW, STEGANO, STI, STRIMG, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TM2, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMV, WPG, X3F, XBM, XC, XCF, XPM, XPS, XV, Y, YAML, YCBCR, YCBCRA, YUV
image_format_transforms: image/heic → image/jpeg, image/heif → image/jpeg, image/heic-sequence → image/jpeg, image/heif-sequence → image/jpeg
gd_version: 2.3.3
gd_formats: GIF, JPEG, PNG, WebP, BMP, AVIF
ghostscript_version: 9.27

### wp-server ###

server_architecture: Linux 4.18.0-553.34.1.lve.el8.x86_64 x86_64
httpd_software: Apache
php_version: 8.5.4 64bit
php_sapi: litespeed
max_input_variables: 10000
time_limit: 300
memory_limit: 2000M
max_input_time: 180
upload_max_filesize: 1000M
php_post_max_size: 1000M
curl_version: 7.61.1 OpenSSL/1.1.1k
suhosin: false
imagick_availability: true
pretty_permalinks: true
htaccess_extra_rules: true
static_robotstxt_file: true
current: 2026-03-19T21:30:27+00:00
utc-time: Thursday, 19-Mar-26 21:30:27 UTC
server-time: 2026-03-19T23:30:26+02:00

### wp-database ###

extension: mysqli
server_version: 5.7.44-53-log
client_version: mysqlnd 8.5.4
max_allowed_packet: 67108864
max_connections: 600

### wp-constants ###

WP_HOME: undefined
WP_SITEURL: undefined
WP_CONTENT_DIR: /home/websiteua/website.club/www/wp-content
WP_PLUGIN_DIR: /home/websiteua/website.club/www/wp-content/plugins
WP_MEMORY_LIMIT: 256M
WP_MAX_MEMORY_LIMIT: 2000M
WP_DEBUG: false
WP_DEBUG_DISPLAY: true
WP_DEBUG_LOG: false
SCRIPT_DEBUG: false
WP_CACHE: true
CONCATENATE_SCRIPTS: undefined
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_ENVIRONMENT_TYPE: undefined
WP_DEVELOPMENT_MODE: undefined
DB_CHARSET: utf8mb4
DB_COLLATE: undefined

### wp-filesystem ###

wordpress: writable
wp-content: writable
uploads: writable
plugins: writable
themes: writable
fonts: does not exist

### wp_mail_smtp ###

version: 4.7.1
license_key_type: lite
debug: Повідомлення відладки не знайдені.
lite_install_date: Лис 20, 2023 @ 1:31pm

### pll_options ###

browser: 0: Визначення мови браузера вимкнено
rewrite: 1: Видаліть `/language/` у гарних постійних посиланнях
hide_default: 1: Приховати інформацію мови в URL для мови за замовчуванням
force_lang: 1: Мова встановлена з назви каталогу в постійному посиланні
redirect_lang: 1: URL головної сторінки містить код мови замість назви сторінки або id сторінки
media_support: 1: Медіа перекладено
sync: taxonomies, post_meta, comment_status, ping_status, sticky_posts, post_date, post_format, post_parent, _wp_page_template, menu_order, _thumbnail_id
version: 3.8.1
first_activation: 07.01.2023
default_lang: uk
previous_version: 3.8
nav_menus: undefined
cpt: post, page, wp_block, woodmart_layout, woodmart_woo_lv, woodmart_woo_fbt, wd_product_tabs, attachment, mc4wp-form, cms_block, wd_popup, wd_floating_block, product, product_variation, shop_order, shop_order_placehold
taxonomies: category, post_tag, cms_block_cat, product_cat, product_tag, pa_active-substances, pa_age, pa_application-method, pa_branches, pa_brand, pa_classification, pa_dosage, pa_forma, pa_manufacturer, pa_not-contain, pa_quantity, pa_release-form, pa_sex, pa_status, pa_system, pa_volume, pa_weight, product_brand

### pll_language_uk ###

name: UK
slug: uk
term_group: 1
term_id: 16
locale: uk
is_rtl: 0
w3c: uk
facebook: uk_UA
home_url: https://website.club/
search_url: https://website.club/
page_on_front: 15576
page_for_posts: 9628
flag_code: ua
flag_url: https://website.club/wp-content/plugins/polylang/flags/ua.png
custom_flag_url: 0
active: true
fallbacks: 0
is_default: true
term_props: 
	language/term_id: 16
	language/term_taxonomy_id: 16
	language/count: 3174
	term_language/term_id: 17
	term_language/term_taxonomy_id: 17
	term_language/count: 1215

### pll_language_ru ###

name: RU
slug: ru
term_group: 2
term_id: 19
locale: ru_RU
is_rtl: 0
w3c: ru-RU
facebook: ru_RU
home_url: https://website.club/ru/
search_url: https://website.club/ru/
page_on_front: 19797
page_for_posts: 19845
flag_code: ru
flag_url: https://website.club/wp-content/plugins/polylang/flags/ru.png
custom_flag_url: https://website.club/wp-content/polylang/ru_RU.png
active: true
fallbacks: 0
is_default: 0
term_props: 
	language/term_id: 19
	language/term_taxonomy_id: 19
	language/count: 2254
	term_language/term_id: 20
	term_language/term_taxonomy_id: 20
	term_language/count: 1188

### pll_language_en ###

name: EN
slug: en
term_group: 3
term_id: 703
locale: en_US
is_rtl: 0
w3c: en-US
facebook: en_US
home_url: https://website.club/en/
search_url: https://website.club/en/
page_on_front: 19798
page_for_posts: 19847
flag_code: gb
flag_url: https://website.club/wp-content/plugins/polylang/flags/gb.png
custom_flag_url: 0
active: true
fallbacks: 0
is_default: 0
term_props: 
	language/term_id: 703
	language/term_taxonomy_id: 703
	language/count: 43
	term_language/term_id: 704
	term_language/term_taxonomy_id: 704
	term_language/count: 28

### pll_warnings ###

wpml: 
	plugins/mailchimp-for-wp: /home/websiteua/website.club/www/wp-content/plugins/mailchimp-for-wp/wpml-config.xml
	plugins/seo-by-rank-math: /home/websiteua/website.club/www/wp-content/plugins/seo-by-rank-math/wpml-config.xml
	themes/woodmart: /home/websiteua/website.club/www/wp-content/themes/woodmart/wpml-config.xml

### polylang-wc ###

pllwc: Усі сторінки WooCommerce перекладено.

`"&gt;
				Скопіювати інформацію в буфер обміну			</button>

@tunyk
8 weeks ago

#3 @sabernhardt
8 weeks ago

  • Summary changed from WordPress Core Warnings in Site Health (PHP 8.5.4 Compatibility Issue) to PHP Warnings in Site Health information copy button

WP_Debug_Data::format() expects that $field['label'] and $field['value'] are set because both the label and value are required. Query Monitor seems to indicate 3 items missing a value and 1 missing a label on your site. The copy-to-clipboard button has esc_attr(), but that does not escape a PHP error right now.

I was able to force the error in PHP 8.2.26 and WordPress trunk by intentionally unsetting both $field['debug'] and $field['value'] when the value matched the version number of my active theme.

if(isset($field['value'])&&'4.1'===$field['value']){unset($field['debug']);unset($field['value']);}

To determine where the missing values are, the class could check isset( $field['value'] ) before using it and return a message if it is not set:

if ( 'debug' === $data_type && isset( $field['debug'] ) ) {
	$debug_data = $field['debug'];
} elseif ( isset( $field['value'] ) ) {
	$debug_data = $field['value'];
} else {
	$debug_data = 'Missing value in ' . __METHOD__ . '()';
}

(And the $label variable could have a similar condition for a missing $field['label'], but that does not affect the button.)

If the copy-to-clipboard button is the main issue for core to fix, then site-health-info.php could fetch the data before inserting it into the attribute:

<?php $clipboard_text = WP_Debug_Data::format( $info, 'debug' ); ?>
<div class="site-health-copy-buttons">
	<div class="copy-button-wrapper">
		<button type="button" class="button copy-button" data-clipboard-text="<?php echo esc_attr( $clipboard_text ); ?>">
			<?php _e( 'Copy site info to clipboard' ); ?>
		</button>
		<span class="success hidden" aria-hidden="true"><?php _e( 'Copied!' ); ?></span>
	</div>
</div>
Note: See TracTickets for help on using tickets.