[wp-trac] [WordPress Trac] #39165: Add page to assist with debugging and support
WordPress Trac
noreply at wordpress.org
Fri Sep 1 10:45:05 UTC 2017
#39165: Add page to assist with debugging and support
-------------------------+------------------------------
Reporter: jorbin | Owner: Clorith
Type: enhancement | Status: assigned
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
-------------------------+------------------------------
Comment (by birgire):
Here are few suggestions:
- Seperate the list of plugins into '''active-''' and
'''inactive''' plugins. Usually when debugging we need to see list of
active plugins, so I think this separation would make it easier for the
user.
{{{
// List all available plugins
$plugins = get_plugins();
foreach ( $plugins AS $plugin_path => $plugin ) {
$key = ( is_plugin_active( $plugin_path ) ) ? 'Active plugins' :
'Inactive plugins';
$info[$key]['fields'][] = array(
'label' => $plugin['Name'],
'value' => sprintf( 'Version %s by %s',
$plugin['Version'], $plugin['Author'] )
);
}
}}}
- Change "Other themes" to "Available themes", because I
understand "Other" to be the list of all themes, excluding the active
theme.
- I like how it's done in WooCommerce Status, where we get the
'''number''' of active plugins too. So I suggest a {{{show_count}}}
attribute:
{{{
'Available themes' => array(
'fields' => array(),
'show_count' => true
),
'Must Use Plugins' => array(
'fields' => array(),
'show_count' => true
),
'Active plugins' => array(
'fields' => array(),
'show_count' => true
),
'Inactive plugins' => array(
'fields' => array(),
'show_count' => true
),
}}}
and then e.g. when printing out values:
{{{
if( isset( $details['show_count'] ) && (bool) $details['show_count'] ) {
printf(
'<h2>%s (%d)</h2>',
esc_html( $section ),
count( $details['fields'] )
);
} else {
printf(
'<h2>%s</h2>',
esc_html( $section )
);
}
}}}
So instead of these headings:
Other themes
Must Use Plugins
plugins
we have:
Available themes (32)
Must Use Plugins (1)
Active plugins (15)
Inactive plugins (88)
I'm working on this patch.
I like the private fields in copy/paste code, since users might post this
on public forums.
This means we could also e.g. the path as a private field.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39165#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list