| 1 |
<?php |
| 2 |
|
| 3 |
namespace Yoast\WP\SEO\Presenters\Admin; |
| 4 |
|
| 5 |
use Yoast\WP\SEO\Presenters\Abstract_Presenter; |
| 6 |
|
| 7 |
/** |
| 8 |
* Class Auto_Update_Notification_Presenter. |
| 9 |
*/ |
| 10 |
class Auto_Update_Notification_Presenter extends Abstract_Presenter { |
| 11 |
|
| 12 |
/** |
| 13 |
* Returns the notification as an HTML string. |
| 14 |
* |
| 15 |
* @return string The notification in an HTML string representation. |
| 16 |
*/ |
| 17 |
public function present() { |
| 18 |
$notification_text = '<p>'; |
| 19 |
$notification_text .= $this->get_message(); |
| 20 |
$notification_text .= '</p>'; |
| 21 |
|
| 22 |
return $notification_text; |
| 23 |
} |
| 24 |
|
| 25 |
/** |
| 26 |
* Returns the message to show. |
| 27 |
* |
| 28 |
* @return string The message. |
| 29 |
*/ |
| 30 |
protected function get_message() { |
| 31 |
if ( \is_multisite() ) { |
| 32 |
return \sprintf( |
| 33 |
/* Translators: %1$s expands to 'Yoast SEO', %2$s to an opening anchor tag for a link leading to the Plugins page, and %3$s to a closing anchor tag. */ |
| 34 |
\esc_html__( |
| 35 |
'We see that you enabled automatic updates for WordPress. We recommend that you do this for %1$s as well. This way we can guarantee that WordPress and %1$s will continue to run smoothly together. Please contact your network admin to enable auto-updates for %1$s.', |
| 36 |
'wordpress-seo' |
| 37 |
), |
| 38 |
'Yoast SEO' |
| 39 |
); |
| 40 |
} |
| 41 |
|
| 42 |
return \sprintf( |
| 43 |
/* Translators: %1$s expands to 'Yoast SEO', %2$s to an opening anchor tag for a link leading to the Plugins page, and %3$s to a closing anchor tag. */ |
| 44 |
\esc_html__( |
| 45 |
'We see that you enabled automatic updates for WordPress. We recommend that you do this for %1$s as well. This way we can guarantee that WordPress and %1$s will continue to run smoothly together. %2$sGo to your plugins overview to enable auto-updates for %1$s.%3$s', |
| 46 |
'wordpress-seo' |
| 47 |
), |
| 48 |
'Yoast SEO', |
| 49 |
'<a href="' . \esc_url( \get_admin_url( null, 'plugins.php' ) ) . '">', |
| 50 |
'</a>' |
| 51 |
); |
| 52 |
} |
| 53 |
} |
| 54 |
|