@@ -505,19 +505,19 @@ public function plugin_info() {
505505 * @since 2.8.0
506506 * @since 4.1.0 Added a return value.
507507 *
508- * @param bool|WP_Error $return Upgrade offer return .
509- * @param array $plugin Plugin package arguments.
510- * @return bool|WP_Error The passed in $return param or WP_Error.
508+ * @param bool|WP_Error $response The installation response before the installation has started .
509+ * @param array $plugin Plugin package arguments.
510+ * @return bool|WP_Error The original `$response` parameter or WP_Error.
511511 */
512- public function deactivate_plugin_before_upgrade ( $ return , $ plugin ) {
512+ public function deactivate_plugin_before_upgrade ( $ response , $ plugin ) {
513513
514- if ( is_wp_error ( $ return ) ) { // Bypass.
515- return $ return ;
514+ if ( is_wp_error ( $ response ) ) { // Bypass.
515+ return $ response ;
516516 }
517517
518518 // When in cron (background updates) don't deactivate the plugin, as we require a browser to reactivate it.
519519 if ( wp_doing_cron () ) {
520- return $ return ;
520+ return $ response ;
521521 }
522522
523523 $ plugin = isset ( $ plugin ['plugin ' ] ) ? $ plugin ['plugin ' ] : '' ;
@@ -530,7 +530,7 @@ public function deactivate_plugin_before_upgrade( $return, $plugin ) {
530530 deactivate_plugins ( $ plugin , true );
531531 }
532532
533- return $ return ;
533+ return $ response ;
534534 }
535535
536536 /**
@@ -540,33 +540,33 @@ public function deactivate_plugin_before_upgrade( $return, $plugin ) {
540540 *
541541 * @since 5.4.0
542542 *
543- * @param bool|WP_Error $return Upgrade offer return .
544- * @param array $plugin Plugin package arguments.
545- * @return bool|WP_Error The passed in $return param or WP_Error.
543+ * @param bool|WP_Error $response The installation response before the installation has started .
544+ * @param array $plugin Plugin package arguments.
545+ * @return bool|WP_Error The original `$response` parameter or WP_Error.
546546 */
547- public function active_before ( $ return , $ plugin ) {
548- if ( is_wp_error ( $ return ) ) {
549- return $ return ;
547+ public function active_before ( $ response , $ plugin ) {
548+ if ( is_wp_error ( $ response ) ) {
549+ return $ response ;
550550 }
551551
552552 // Only enable maintenance mode when in cron (background update).
553553 if ( ! wp_doing_cron () ) {
554- return $ return ;
554+ return $ response ;
555555 }
556556
557557 $ plugin = isset ( $ plugin ['plugin ' ] ) ? $ plugin ['plugin ' ] : '' ;
558558
559559 // Only run if plugin is active.
560560 if ( ! is_plugin_active ( $ plugin ) ) {
561- return $ return ;
561+ return $ response ;
562562 }
563563
564564 // Change to maintenance mode. Bulk edit handles this separately.
565565 if ( ! $ this ->bulk ) {
566566 $ this ->maintenance_mode ( true );
567567 }
568568
569- return $ return ;
569+ return $ response ;
570570 }
571571
572572 /**
@@ -576,33 +576,33 @@ public function active_before( $return, $plugin ) {
576576 *
577577 * @since 5.4.0
578578 *
579- * @param bool|WP_Error $return Upgrade offer return .
580- * @param array $plugin Plugin package arguments.
581- * @return bool|WP_Error The passed in $return param or WP_Error.
579+ * @param bool|WP_Error $response The installation response after the installation has finished .
580+ * @param array $plugin Plugin package arguments.
581+ * @return bool|WP_Error The original `$response` parameter or WP_Error.
582582 */
583- public function active_after ( $ return , $ plugin ) {
584- if ( is_wp_error ( $ return ) ) {
585- return $ return ;
583+ public function active_after ( $ response , $ plugin ) {
584+ if ( is_wp_error ( $ response ) ) {
585+ return $ response ;
586586 }
587587
588588 // Only disable maintenance mode when in cron (background update).
589589 if ( ! wp_doing_cron () ) {
590- return $ return ;
590+ return $ response ;
591591 }
592592
593593 $ plugin = isset ( $ plugin ['plugin ' ] ) ? $ plugin ['plugin ' ] : '' ;
594594
595- // Only run if plugin is active
595+ // Only run if plugin is active.
596596 if ( ! is_plugin_active ( $ plugin ) ) {
597- return $ return ;
597+ return $ response ;
598598 }
599599
600600 // Time to remove maintenance mode. Bulk edit handles this separately.
601601 if ( ! $ this ->bulk ) {
602602 $ this ->maintenance_mode ( false );
603603 }
604604
605- return $ return ;
605+ return $ response ;
606606 }
607607
608608 /**
0 commit comments