Commit 51a5779d8d for wordpress.org
commit 51a5779d8deb63d31434cc80e448de266f206bc8
Author: SergeyBiryukov <sergeybiryukov@git.wordpress.org>
Date: Mon Oct 5 14:16:51 2026 +0000
Code Quality: Remove redundant `isset( $imagick )` check in `WP_Debug_Data`.
When Site Health debug data was introduced, `$imagick` was instantiated conditionally inside `class_exists( 'Imagick' )`. This commit ensures that the variable is always defined and removes a redundant `isset( $imagick )` check in favor of a more specific and future-proof `$imagick instanceof Imagick` check.
This resolves the only error in the `instanceof.alwaysTrue` PHPStan baseline, which is deleted.
Developed in https://github.com/WordPress/wordpress-develop/pull/13977.
Follow-up to r44986.
Props huzaifaalmesbah.
See #65817.
Built from https://develop.svn.wordpress.org/trunk@64094
git-svn-id: http://core.svn.wordpress.org/trunk@63253 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-admin/includes/class-wp-debug-data.php b/wp-admin/includes/class-wp-debug-data.php
index aada2f88df..76e1cc2c94 100644
--- a/wp-admin/includes/class-wp-debug-data.php
+++ b/wp-admin/includes/class-wp-debug-data.php
@@ -643,6 +643,7 @@ class WP_Debug_Data {
$imagick = new Imagick();
$imagemagick_version = $imagick->getVersion();
} else {
+ $imagick = null;
$imagemagick_version = __( 'Not available' );
}
@@ -694,7 +695,7 @@ class WP_Debug_Data {
);
// If Imagick is used as our editor, provide some more information about its limitations.
- if ( 'WP_Image_Editor_Imagick' === _wp_image_editor_choose() && isset( $imagick ) && $imagick instanceof Imagick ) {
+ if ( 'WP_Image_Editor_Imagick' === _wp_image_editor_choose() && $imagick instanceof Imagick ) {
$limits = array(
'area' => ( defined( 'imagick::RESOURCETYPE_AREA' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_AREA ) ) : $not_available ),
'disk' => ( defined( 'imagick::RESOURCETYPE_DISK' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_DISK ) : $not_available ),
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 52e6ba1d9b..838ef947ef 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.2-alpha-64093';
+$wp_version = '7.2-alpha-64094';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.