mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-29 07:37:44 +02:00
Site Health: Include more ImageMagick/Imagick information in the Media Handling section.
This adds additional information to the Media Handling section of the Site Health Info page. When ImageMagick is used as the site’s image editor, a full list of file formats supported will now be shown. This will help site owners debug any issues they encounter as support for newer, more modern image formats is added (such as WebP in [50810]). Additionally, the version of Imagick installed. This will help site owners debug issues with generating images on the PHP side. Some variables have also been renamed to more accurately represent what is being stored. Props Clorith, desrosj. Fixes #53022. Built from https://develop.svn.wordpress.org/trunk@50817 git-svn-id: http://core.svn.wordpress.org/trunk@50426 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f415fa5ea2
commit
af4b043a69
@ -515,20 +515,27 @@ class WP_Debug_Data {
|
||||
// Get ImageMagic information, if available.
|
||||
if ( class_exists( 'Imagick' ) ) {
|
||||
// Save the Imagick instance for later use.
|
||||
$imagick = new Imagick();
|
||||
$imagick_version = $imagick->getVersion();
|
||||
$imagick = new Imagick();
|
||||
$imagemagick_version = $imagick->getVersion();
|
||||
} else {
|
||||
$imagick_version = __( 'Not available' );
|
||||
$imagemagick_version = __( 'Not available' );
|
||||
}
|
||||
|
||||
$info['wp-media']['fields']['imagick_module_version'] = array(
|
||||
'label' => __( 'ImageMagick version number' ),
|
||||
'value' => ( is_array( $imagick_version ) ? $imagick_version['versionNumber'] : $imagick_version ),
|
||||
'value' => ( is_array( $imagemagick_version ) ? $imagemagick_version['versionNumber'] : $imagemagick_version ),
|
||||
);
|
||||
|
||||
$info['wp-media']['fields']['imagemagick_version'] = array(
|
||||
'label' => __( 'ImageMagick version string' ),
|
||||
'value' => ( is_array( $imagick_version ) ? $imagick_version['versionString'] : $imagick_version ),
|
||||
'value' => ( is_array( $imagemagick_version ) ? $imagemagick_version['versionString'] : $imagemagick_version ),
|
||||
);
|
||||
|
||||
$imagick_version = phpversion( 'imagick' );
|
||||
|
||||
$info['wp-media']['fields']['imagick_version'] = array(
|
||||
'label' => __( 'Imagick version' ),
|
||||
'value' => ( $imagick_version ) ? $imagick_version : __( 'Not available' ),
|
||||
);
|
||||
|
||||
if ( ! function_exists( 'ini_get' ) ) {
|
||||
@ -597,6 +604,18 @@ class WP_Debug_Data {
|
||||
'value' => $limits,
|
||||
'debug' => $limits_debug,
|
||||
);
|
||||
|
||||
try {
|
||||
$formats = Imagick::queryFormats( '*' );
|
||||
} catch ( Exception $e ) {
|
||||
$formats = array();
|
||||
}
|
||||
|
||||
$info['wp-media']['fields']['imagemagick_file_formats'] = array(
|
||||
'label' => __( 'ImageMagick supported file formats' ),
|
||||
'value' => ( empty( $formats ) ) ? __( 'Unable to determine' ) : implode( ', ', $formats ),
|
||||
'debug' => ( empty( $formats ) ) ? 'Unable to determine' : implode( ', ', $formats ),
|
||||
);
|
||||
}
|
||||
|
||||
// Get GD information, if available.
|
||||
|
@ -13,7 +13,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.8-alpha-50816';
|
||||
$wp_version = '5.8-alpha-50817';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user