From e4fd34d03656f05c1fd3467a3f60b67edc7eb450 Mon Sep 17 00:00:00 2001 From: Stefan Kalscheuer Date: Fri, 22 May 2020 11:20:26 +0200 Subject: [PATCH] do not rely on WP core translation and add textdomain for all texts --- inc/class-statifyblacklist-admin.php | 4 ++-- phpcs.xml | 6 ++++++ views/settings-page.php | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/inc/class-statifyblacklist-admin.php b/inc/class-statifyblacklist-admin.php index caed7fc..7fa7b4d 100644 --- a/inc/class-statifyblacklist-admin.php +++ b/inc/class-statifyblacklist-admin.php @@ -209,7 +209,7 @@ class StatifyBlacklist_Admin extends StatifyBlacklist { if ( STATIFYBLACKLIST_BASE === $file && current_user_can( 'manage_options' ) ) { array_unshift( $links, - sprintf( '%s', esc_attr( add_query_arg( 'page', 'statify-blacklist', $base ) ), __( 'Settings' ) ) + sprintf( '%s', esc_attr( add_query_arg( 'page', 'statify-blacklist', $base ) ), __( 'Settings', 'statify-blacklist' ) ) ); } @@ -226,7 +226,7 @@ class StatifyBlacklist_Admin extends StatifyBlacklist { public static function cleanup_database() { // Check user permissions. if ( ! current_user_can( 'manage_options' ) && ! ( defined( 'DOING_CRON' ) && DOING_CRON ) ) { - die( esc_html__( 'Are you sure you want to do this?' ) ); + die( esc_html__( 'Are you sure you want to do this?', 'statify-blacklist' ) ); } if ( defined( 'DOING_CRON' ) && DOING_CRON ) { diff --git a/phpcs.xml b/phpcs.xml index 3e2fb67..88352a0 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -18,6 +18,12 @@ + + + + + + diff --git a/views/settings-page.php b/views/settings-page.php index 4b188e4..2143f05 100755 --- a/views/settings-page.php +++ b/views/settings-page.php @@ -21,7 +21,7 @@ if ( ! empty( $_POST['statifyblacklist'] ) ) { // Check user capabilities. if ( ! current_user_can( 'manage_options' ) ) { - die( esc_html__( 'Are you sure you want to do this?' ) ); + die( esc_html__( 'Are you sure you want to do this?', 'statify-blacklist' ) ); } if ( ! empty( $_POST['cleanUp'] ) ) { @@ -375,7 +375,7 @@ if ( ! empty( $_POST['statifyblacklist'] ) ) {

- +