File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -390,7 +390,10 @@ protected function get_upgrader( $assoc_args ) {
390390 $ insecure = Utils \get_flag_value ( $ assoc_args , 'insecure ' , false );
391391 $ upgrader_class = $ this ->get_upgrader_class ( $ force );
392392
393- // Use custom upgrader skin for extensions to display update progress
393+ // We need to use ExtensionUpgraderSkin instead of the default UpgraderSkin
394+ // to display which extension is being updated. Since the skin is passed to
395+ // the upgrader constructor and cannot be changed afterward, we must duplicate
396+ // the upgrader creation logic from Utils\get_upgrader() here.
394397 if ( ! class_exists ( '\WP_Upgrader ' ) ) {
395398 if ( file_exists ( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php ' ) ) {
396399 include ABSPATH . 'wp-admin/includes/class-wp-upgrader.php ' ;
@@ -403,6 +406,10 @@ protected function get_upgrader( $assoc_args ) {
403406 }
404407 }
405408
409+ // Check if the upgrader class constructor supports the insecure flag.
410+ // This check is done on each call to maintain compatibility with the
411+ // original Utils\get_upgrader() behavior, though it could be optimized
412+ // with caching if performance becomes a concern.
406413 $ uses_insecure_flag = false ;
407414
408415 $ reflection = new \ReflectionClass ( $ upgrader_class );
You can’t perform that action at this time.
0 commit comments