| 1 |
<?php |
| 2 |
|
| 3 |
namespace Yoast\WP\SEO\Presenters\Admin; |
| 4 |
|
| 5 |
use Yoast\WP\SEO\Presenters\Abstract_Presenter; |
| 6 |
|
| 7 |
/** |
| 8 |
* Class Search_Engines_Discouraged_Presenter. |
| 9 |
*/ |
| 10 |
class Search_Engines_Discouraged_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 |
return \sprintf( |
| 32 |
'<strong>%1$s</strong> %2$s <button type="button" id="robotsmessage-dismiss-button" class="button-link hide-if-no-js" data-nonce="%3$s">%4$s</button>', |
| 33 |
\esc_html__( 'Huge SEO Issue: You\'re blocking access to robots.', 'wordpress-seo' ), |
| 34 |
\sprintf( |
| 35 |
/* translators: 1: Link start tag to the WordPress Reading Settings page, 2: Link closing tag. */ |
| 36 |
\esc_html__( 'If you want search engines to show this site in their results, you must %1$sgo to your Reading Settings%2$s and uncheck the box for Search Engine Visibility.', 'wordpress-seo' ), |
| 37 |
'<a href="' . \esc_url( \admin_url( 'options-reading.php' ) ) . '">', |
| 38 |
'</a>', |
| 39 |
), |
| 40 |
\esc_js( \wp_create_nonce( 'wpseo-ignore' ) ), |
| 41 |
\esc_html__( 'I don\'t want this site to show in the search results.', 'wordpress-seo' ), |
| 42 |
); |
| 43 |
} |
| 44 |
} |
| 45 |
|