| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template for display error wp_remote. |
| 4 |
*/ |
| 5 |
|
| 6 |
if ( ! defined( 'ABSPATH' ) ) { |
| 7 |
exit; // Exit if accessed directly |
| 8 |
} |
| 9 |
|
| 10 |
if ( ! isset( $data ) || ! isset( $data['check'] ) ) { |
| 11 |
return; |
| 12 |
} |
| 13 |
|
| 14 |
if ( ! is_wp_error( $data['check'] ) ) { |
| 15 |
return; |
| 16 |
} |
| 17 |
|
| 18 |
/** |
| 19 |
* @var WP_Error $wp_error |
| 20 |
*/ |
| 21 |
$wp_error = $data['check']; |
| 22 |
$message_error = $wp_error->get_error_message(); |
| 23 |
?> |
| 24 |
|
| 25 |
<div class="lp-admin-notice notice notice-error"> |
| 26 |
<p> |
| 27 |
<?php |
| 28 |
echo sprintf( |
| 29 |
'%s %s. <a href="%s">%s</a>', |
| 30 |
'<strong>wp_remote_get</strong>: ', |
| 31 |
$message_error, |
| 32 |
admin_url( 'site-health.php' ), |
| 33 |
__( 'Check Site Health', 'learnpress' ) |
| 34 |
); |
| 35 |
?> |
| 36 |
</p> |
| 37 |
</div> |
| 38 |
|