| @@ -4,8 +4,12 @@ | ||
| 4 | 4 | * |
| 5 | 5 | * @package automattic/jetpack |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 9 | + exit( 0 ); | |
| 10 | +} | |
| 11 | + | |
| 8 | 12 | /** |
| 9 | 13 | * The standard set of admin pages for the user if Jetpack is installed |
| 10 | 14 | */ |
| 11 | 15 | class WordAds_Admin { |
| @@ -45,15 +49,34 @@ | ||
| 45 | 49 | 'color' => 'red', |
| 46 | 50 | 'approved' => 'No', |
| 47 | 51 | ); |
| 48 | 52 | |
| 49 | - $type = $wordads->option( 'wordads_approved' ) ? 'updated' : 'error'; | |
| 50 | - ?> | |
| 51 | - <div class="notice <?php echo esc_attr( $type ); ?> is-dismissible"> | |
| 52 | - <p>Status: <span style="color:<?php echo esc_attr( $status['color'] ); ?>;"><?php echo esc_html( $status ); ?></p> | |
| 53 | - <pre><?php echo esc_html( $response ); ?></pre> | |
| 54 | - </div> | |
| 55 | - <?php | |
| 53 | + $type = $wordads->option( 'wordads_approved' ) ? 'updated' : 'error'; | |
| 54 | + $message = sprintf( | |
| 55 | + wp_kses( | |
| 56 | + /* Translators: %1$s is the status color, %2$s is the status, %3$s is the response */ | |
| 57 | + __( '<p>Status: <span style="color:%1$s;">%2$s</span></p><pre>%3$s</pre>', 'jetpack' ), | |
| 58 | + array( | |
| 59 | + 'p' => array(), | |
| 60 | + 'span' => array( | |
| 61 | + 'style' => array(), | |
| 62 | + ), | |
| 63 | + 'pre' => array(), | |
| 64 | + ) | |
| 65 | + ), | |
| 66 | + esc_attr( $status['color'] ), | |
| 67 | + esc_html( $status ), | |
| 68 | + esc_html( $response ) | |
| 69 | + ); | |
| 70 | + | |
| 71 | + wp_admin_notice( | |
| 72 | + $message, | |
| 73 | + array( | |
| 74 | + 'type' => $type, | |
| 75 | + 'dismissible' => true, | |
| 76 | + 'paragraph_wrap' => false, | |
| 77 | + ) | |
| 78 | + ); | |
| 56 | 79 | } |
| 57 | 80 | } |
| 58 | 81 | |
| 59 | 82 | global $wordads_admin; |