[wp-trac] [WordPress Trac] #53230: Allow nested arrays to be displayed in site health.
WordPress Trac
noreply at wordpress.org
Sun Oct 31 11:56:58 UTC 2021
#53230: Allow nested arrays to be displayed in site health.
--------------------------+------------------------------
Reporter: spacedmonkey | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Site Health | Version: 5.2
Severity: normal | Resolution:
Keywords: needs-patch | Focuses: ui
--------------------------+------------------------------
Comment (by Clorith):
I agree, we need to have some better support here, I'm curious what would
be the preferred way of doing that though.
What would make the most sense, there's two instant thoughts that come to
mind, as I see it:
1. If it's non-scalar (a quick `is_scalar` check), "dump" it using JSON
encoding, PHP serialization, or the "prettier" option of a `pre` wrapped
`print_r`.
2. If it's an array, allow for nested loops.
Option 2 means we need to perhaps be a bit strict on what is allowed to be
included, so you can only go X tiers deep at max, to keep it legible.
Option 1 is the one I'm leaning towards, although it may not _always_ look
as pretty to the naked eye, it does mean those adding information to the
debug section can include "anything" they feel is relevant. It would also
allow for any non-scalar value to be output (for that weird edge case
where someone has decided to make the data an object instead of an array,
unlikely, but if they want to quickly push the data into some tool on
their end from the debug output, that would likely make this easier if for
example JSON encoding were used?)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53230#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list