Skip to content

Commit d7c62c3

Browse files
committed
Revert " Add upgrade routine."
This reverts commit 56eb126.
1 parent 494da26 commit d7c62c3

File tree

1 file changed

+0
-45
lines changed

1 file changed

+0
-45
lines changed

inc/class-upgrade.php

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ public function __construct() {
8989
'20.5-RC0' => 'upgrade_205',
9090
'20.7-RC0' => 'upgrade_207',
9191
'20.8-RC0' => 'upgrade_208',
92-
'21.6-rc0' => 'upgrade_216',
9392
];
9493

9594
array_walk( $routines, [ $this, 'run_upgrade_routine' ], $version );
@@ -1014,14 +1013,6 @@ private function upgrade_208() {
10141013
}
10151014
}
10161015

1017-
/**
1018-
* Performs the 21.6 upgrade routine.
1019-
* Avoid storing the full WP_User object in each notification and saves just the user id instead.
1020-
*/
1021-
private function upgrade_216() {
1022-
add_action( 'init', [ $this, 'update_notifications_user_id_for_216' ] );
1023-
}
1024-
10251016
/**
10261017
* Sets the home_url option for the 15.1 upgrade routine.
10271018
*
@@ -1663,42 +1654,6 @@ static function ( $duplicate ) use ( $object_type ) {
16631654
// phpcs:enable
16641655
}
16651656

1666-
/**
1667-
* Function to update all users' notifications to store the user id instead of the full WP_User object.
1668-
*/
1669-
private function update_notifications_user_id_for_216() {
1670-
global $wpdb;
1671-
$meta_key = $wpdb->get_blog_prefix() . Yoast_Notification_Center::STORAGE_KEY;
1672-
1673-
$usermetas = $wpdb->get_results(
1674-
$wpdb->prepare(
1675-
'
1676-
SELECT user_id, meta_value
1677-
FROM ' . $wpdb->usermeta . '
1678-
WHERE meta_key = %s
1679-
',
1680-
$meta_key
1681-
),
1682-
ARRAY_A
1683-
);
1684-
1685-
if ( empty( $usermetas ) ) {
1686-
return;
1687-
}
1688-
1689-
foreach ( $usermetas as $usermeta ) {
1690-
$notifications = maybe_unserialize( $usermeta['meta_value'] );
1691-
1692-
foreach ( $notifications as $notification ) {
1693-
if ( ! empty( $notification['options']['user'] ) ) {
1694-
unset( $notification['options']['user'] );
1695-
$notification['options']['user_id'] = $usermeta['user_id'];
1696-
}
1697-
}
1698-
update_user_meta( $usermeta['user_id'], Yoast_Notification_Center::STORAGE_KEY, $notifications );
1699-
}
1700-
}
1701-
17021657
/**
17031658
* Removes the settings' introduction modal data for users.
17041659
*

0 commit comments

Comments
 (0)