| @@ -1,6 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | namespace EverCompare\Admin; |
| 3 | + | |
| 4 | +defined( 'ABSPATH' ) || exit; | |
| 3 | 5 | /** |
| 4 | 6 | * Notices handlers class |
| 5 | 7 | */ |
| 6 | 8 | class Notices { |
| @@ -47,9 +49,13 @@ | ||
| 47 | 49 | if( ! current_user_can( 'activate_plugins' ) ) { |
| 48 | 50 | return; |
| 49 | 51 | } |
| 50 | 52 | $activation_url = wp_nonce_url( 'plugins.php?action=activate&plugin=' . $woocommerce . '&plugin_status=all&paged=1&s', 'activate-plugin_' . $woocommerce ); |
| 51 | - $message = sprintf( __( '%1$sHT Compare%2$s requires %1$s"WooCommerce"%2$s plugin to be active. Please activate WooCommerce to continue.', 'ever-compare' ), '<strong>', '</strong>'); | |
| 53 | + /* | |
| 54 | + * translators: %1$s: strong tag start | |
| 55 | + * translators: %2$s: strong tag end | |
| 56 | + */ | |
| 57 | + $message = sprintf( __( '%1$sEver Compare%2$s requires %1$s"WooCommerce"%2$s plugin to be active. Please activate WooCommerce to continue.', 'ever-compare' ), '<strong>', '</strong>'); | |
| 52 | 58 | $button_text = __( 'Activate WooCommerce', 'ever-compare' ); |
| 53 | 59 | } else { |
| 54 | 60 | if( ! current_user_can( 'activate_plugins' ) ) { |
| 55 | 61 | return; |
| @@ -54,13 +60,17 @@ | ||
| 54 | 60 | if( ! current_user_can( 'activate_plugins' ) ) { |
| 55 | 61 | return; |
| 56 | 62 | } |
| 57 | 63 | $activation_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=woocommerce' ), 'install-plugin_woocommerce' ); |
| 58 | - $message = sprintf( __( '%1$sHT Compare%2$s requires %1$s"WooCommerce"%2$s plugin to be installed and activated. Please install WooCommerce to continue.', 'ever-compare' ), '<strong>', '</strong>' ); | |
| 64 | + /* | |
| 65 | + * translators: %1$s: strong tag start | |
| 66 | + * translators: %2$s: strong tag end | |
| 67 | + */ | |
| 68 | + $message = sprintf( __( '%1$sEver Compare%2$s requires %1$s"WooCommerce"%2$s plugin to be installed and activated. Please install WooCommerce to continue.', 'ever-compare' ), '<strong>', '</strong>' ); | |
| 59 | 69 | $button_text = __( 'Install WooCommerce', 'ever-compare' ); |
| 60 | 70 | } |
| 61 | 71 | $button = '<p><a href="' . $activation_url . '" class="button-primary">' . $button_text . '</a></p>'; |
| 62 | - printf( '<div class="error"><p>%1$s</p>%2$s</div>', __( $message ), $button ); | |
| 72 | + printf( '<div class="error"><p>%1$s</p>%2$s</div>', wp_kses_post($message) , wp_kses_post($button) ); | |
| 63 | 73 | } |
| 64 | 74 | |
| 65 | 75 | |
| 66 | 76 | } |