From 21550f4d4dae0cff39be5496e3233c2bf51ea0bd Mon Sep 17 00:00:00 2001 From: Paolo Luigi Scala Date: Wed, 25 Oct 2023 16:34:35 +0200 Subject: [PATCH] Revert "Add upgrade routine." This reverts commit 11276f9d668775675d76f3a0b41b1f720a948516. --- inc/class-upgrade.php | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/inc/class-upgrade.php b/inc/class-upgrade.php index b99876f535e..1dc29a93d2d 100644 --- a/inc/class-upgrade.php +++ b/inc/class-upgrade.php @@ -89,7 +89,6 @@ public function __construct() { '20.5-RC0' => 'upgrade_205', '20.7-RC0' => 'upgrade_207', '20.8-RC0' => 'upgrade_208', - '21.6-rc0' => 'upgrade_216' ]; array_walk( $routines, [ $this, 'run_upgrade_routine' ], $version ); @@ -1014,46 +1013,6 @@ private function upgrade_208() { } } - /** - * Performs the 21.6 upgrade routine. - * Avoid storing the full WP_User object in each notification and saves just the user id instead. - */ - private function upgrade_216() { - add_action( 'init', [ $this, 'update_notifications_user_id_for_216' ] ); - } - - protected function update_notifications_user_id_for_216() { - global $wpdb; - $meta_key = $wpdb->get_blog_prefix() . Yoast_Notification_Center::STORAGE_KEY; - - $usermetas = $wpdb->get_results( - $wpdb->prepare( - ' - SELECT user_id, meta_value - FROM ' . $wpdb->usermeta . ' - WHERE meta_key = %s - ', - $meta_key - ), - ARRAY_A - ); - - if ( empty( $usermetas ) ) { - return; - } - - foreach ( $usermetas as $usermeta ) { - $notifications = maybe_unserialize( $usermeta['meta_value'] ); - - foreach ( $notifications as $notification ) { - if ( ! empty( $notification['options']['user'] ) ) { - unset( $notification['options']['user'] ); - $notification['options']['user_id'] = $usermeta['user_id']; - } - } - update_user_meta( $usermeta['user_id'], Yoast_Notification_Center::STORAGE_KEY, $notifications ); - } - } /** * Sets the home_url option for the 15.1 upgrade routine. *