wp/wp-includes/class-wp-recovery-mode-email-service.php
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
--- a/wp/wp-includes/class-wp-recovery-mode-email-service.php	Thu Sep 29 08:06:27 2022 +0200
+++ b/wp/wp-includes/class-wp-recovery-mode-email-service.php	Fri Sep 05 18:40:08 2025 +0200
@@ -11,6 +11,7 @@
  *
  * @since 5.2.0
  */
+#[AllowDynamicProperties]
 final class WP_Recovery_Mode_Email_Service {
 
 	const RATE_LIMIT_OPTION = 'recovery_mode_email_last_sent';
@@ -115,12 +116,7 @@
 		$url      = $this->link_service->generate_url();
 		$blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
 
-		$switched_locale = false;
-
-		// The switch_to_locale() function is loaded before it can actually be used.
-		if ( function_exists( 'switch_to_locale' ) && isset( $GLOBALS['wp_locale_switcher'] ) ) {
-			$switched_locale = switch_to_locale( get_locale() );
-		}
+		$switched_locale = switch_to_locale( get_locale() );
 
 		if ( $extension ) {
 			$cause   = $this->get_cause( $extension );
@@ -157,7 +153,7 @@
 		$message = __(
 			'Howdy!
 
-Since WordPress 5.2 there is a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.
+WordPress has a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.
 ###CAUSE###
 First, visit your website (###SITEURL###) and check for any visible issues. Next, visit the page where the error was caught (###PAGEURL###) and check for any visible issues.
 
@@ -318,7 +314,7 @@
 			return $plugins[ "{$extension['slug']}/{$extension['slug']}.php" ];
 		} else {
 			foreach ( $plugins as $file => $plugin_data ) {
-				if ( 0 === strpos( $file, "{$extension['slug']}/" ) || $file === $extension['slug'] ) {
+				if ( str_starts_with( $file, "{$extension['slug']}/" ) || $file === $extension['slug'] ) {
 					return $plugin_data;
 				}
 			}