| @@ -47,20 +47,17 @@ | ||
| 47 | 47 | * |
| 48 | 48 | * @return void |
| 49 | 49 | */ |
| 50 | 50 | public static function php_version_notice() { |
| 51 | - load_plugin_textdomain( 'polylang' ); // Plugin i18n. | |
| 51 | + $message = sprintf( | |
| 52 | + /* translators: 1: Plugin name 2: Current PHP version 3: Required PHP version */ | |
| 53 | + esc_html__( '%1$s has deactivated itself because you are using an old version of PHP. You are using using PHP %2$s. %1$s requires PHP %3$s.', 'polylang' ), | |
| 54 | + esc_html( static::get_plugin_name() ), | |
| 55 | + esc_html( pll_get_constant( 'PHP_VERSION', '' ) ), | |
| 56 | + esc_html( static::get_min_php_version() ) | |
| 57 | + ); | |
| 52 | 58 | |
| 53 | - printf( | |
| 54 | - '<div class="error"><p>%s</p></div>', | |
| 55 | - sprintf( | |
| 56 | - /* translators: 1: Plugin name 2: Current PHP version 3: Required PHP version */ | |
| 57 | - esc_html__( '%1$s has deactivated itself because you are using an old version of PHP. You are using using PHP %2$s. %1$s requires PHP %3$s.', 'polylang' ), | |
| 58 | - esc_html( static::get_plugin_name() ), | |
| 59 | - esc_html( pll_get_constant( 'PHP_VERSION', '' ) ), | |
| 60 | - esc_html( static::get_min_php_version() ) | |
| 61 | - ) | |
| 62 | - ); | |
| 59 | + wp_admin_notice( $message, array( 'type' => 'error' ) ); | |
| 63 | 60 | } |
| 64 | 61 | |
| 65 | 62 | /** |
| 66 | 63 | * Displays a notice if WP min version is not met. |
| @@ -73,20 +70,17 @@ | ||
| 73 | 70 | */ |
| 74 | 71 | public static function wp_version_notice() { |
| 75 | 72 | global $wp_version; |
| 76 | 73 | |
| 77 | - load_plugin_textdomain( 'polylang' ); // Plugin i18n. | |
| 74 | + $message = sprintf( | |
| 75 | + /* translators: 1: Plugin name 2: Current WordPress version 3: Required WordPress version */ | |
| 76 | + esc_html__( '%1$s has deactivated itself because you are using an old version of WordPress. You are using using WordPress %2$s. %1$s requires at least WordPress %3$s.', 'polylang' ), | |
| 77 | + esc_html( static::get_plugin_name() ), | |
| 78 | + esc_html( $wp_version ), | |
| 79 | + esc_html( static::get_min_wp_version() ) | |
| 80 | + ); | |
| 78 | 81 | |
| 79 | - printf( | |
| 80 | - '<div class="error"><p>%s</p></div>', | |
| 81 | - sprintf( | |
| 82 | - /* translators: 1: Plugin name 2: Current WordPress version 3: Required WordPress version */ | |
| 83 | - esc_html__( '%1$s has deactivated itself because you are using an old version of WordPress. You are using using WordPress %2$s. %1$s requires at least WordPress %3$s.', 'polylang' ), | |
| 84 | - esc_html( static::get_plugin_name() ), | |
| 85 | - esc_html( $wp_version ), | |
| 86 | - esc_html( static::get_min_wp_version() ) | |
| 87 | - ) | |
| 88 | - ); | |
| 82 | + wp_admin_notice( $message, array( 'type' => 'error' ) ); | |
| 89 | 83 | } |
| 90 | 84 | |
| 91 | 85 | /** |
| 92 | 86 | * Returns the minimal php version required to run the plugin. |