| @@ -31,9 +31,9 @@ | ||
| 31 | 31 | |
| 32 | 32 | // Security check. |
| 33 | 33 | $wp_nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) : ''; // input var okay. |
| 34 | 34 | if ( ! wp_verify_nonce( $wp_nonce, 'wpda-back-end-settings' ) ) { |
| 35 | - wp_die( __( 'ERROR: Not authorized', 'wp-data-access' ) ); | |
| 35 | + wp_die( esc_attr__( 'ERROR: Not authorized', 'wp-data-access' ) ); | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | if ( 'save' === $action ) { |
| 39 | 39 | // Save options. |
| @@ -70,9 +70,9 @@ | ||
| 70 | 70 | // Add existing table to list. |
| 71 | 71 | $table_access_selected_new_value_checked[ $key ] = $value; |
| 72 | 72 | } else { |
| 73 | 73 | // An invalid table name was provided. Might be an sql injection attack or an invalid state. |
| 74 | - wp_die( __( 'ERROR: Invalid table name', 'wp-data-access' ) ); | |
| 74 | + wp_die( esc_attr__( 'ERROR: Invalid table name', 'wp-data-access' ) ); | |
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | } else { |
| 78 | 78 | $table_access_selected_new_value_checked = ''; |
| @@ -166,9 +166,9 @@ | ||
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | $wpda_hide_manage_link = get_option( 'wpda_hide_manage_link' ); |
| 169 | 169 | if ( is_array( $wpda_hide_manage_link ) ) { |
| 170 | - $wpda_hide_manage_list = array_flip( $wpda_hide_manage_link ); //phpcs:ignore - 8.1 proof | |
| 170 | + $wpda_hide_manage_list = array_flip( $wpda_hide_manage_link ); // phpcs:ignore -- 8.1 proof | |
| 171 | 171 | } else { |
| 172 | 172 | $wpda_hide_manage_list = array(); |
| 173 | 173 | } |
| 174 | 174 | ?> |
| @@ -176,9 +176,9 @@ | ||
| 176 | 176 | <form id="wpda_settings_backend" method="post" |
| 177 | 177 | action="?page=<?php echo esc_attr( $this->page ); ?>&tab=backend"> |
| 178 | 178 | <table class="wpda-table-settings"> |
| 179 | 179 | <tr> |
| 180 | - <th><?php echo __( 'Table access', 'wp-data-access' ); ?></th> | |
| 180 | + <th><?php esc_html_e( 'Table access', 'wp-data-access' ); ?></th> | |
| 181 | 181 | <td> |
| 182 | 182 | <select name="database" id="schema_name"> |
| 183 | 183 | <?php |
| 184 | 184 | $schema_names = WPDA_Dictionary_Lists::get_db_schemas(); |
| @@ -194,9 +194,9 @@ | ||
| 194 | 194 | type="radio" |
| 195 | 195 | name="table_access" |
| 196 | 196 | value="show" |
| 197 | 197 | <?php echo 'show' === $table_access ? 'checked' : ''; ?> |
| 198 | - ><?php echo $is_wp_database ? __( 'Show WordPress tables', 'wp-data-access' ) : __( 'Show all tables', 'wp-data-access' ); ?> | |
| 198 | + ><?php echo $is_wp_database ? esc_attr__( 'Show WordPress tables', 'wp-data-access' ) : esc_attr__( 'Show all tables', 'wp-data-access' ); ?> | |
| 199 | 199 | </label> |
| 200 | 200 | <br/> |
| 201 | 201 | <?php |
| 202 | 202 | if ( $is_wp_database ) { |
| @@ -206,9 +206,9 @@ | ||
| 206 | 206 | type="radio" |
| 207 | 207 | name="table_access" |
| 208 | 208 | value="hide" |
| 209 | 209 | <?php echo 'hide' === $table_access ? 'checked' : ''; ?> |
| 210 | - ><?php echo __( 'Hide WordPress tables', 'wp-data-access' ); ?> | |
| 210 | + ><?php esc_html_e( 'Hide WordPress tables', 'wp-data-access' ); ?> | |
| 211 | 211 | </label> |
| 212 | 212 | <br/> |
| 213 | 213 | <?php |
| 214 | 214 | } |
| @@ -218,9 +218,9 @@ | ||
| 218 | 218 | type="radio" |
| 219 | 219 | name="table_access" |
| 220 | 220 | value="select" |
| 221 | 221 | <?php echo 'select' === $table_access ? 'checked' : ''; ?> |
| 222 | - ><?php echo __( 'Show only selected tables', 'wp-data-access' ); ?> | |
| 222 | + ><?php esc_html_e( 'Show only selected tables', 'wp-data-access' ); ?> | |
| 223 | 223 | </label> |
| 224 | 224 | <div id="tables_selected" <?php echo 'select' === $table_access ? '' : 'style="display:none"'; ?>> |
| 225 | 225 | <br/> |
| 226 | 226 | <select name="table_access_selected[]" multiple size="10"> |
| @@ -251,9 +251,9 @@ | ||
| 251 | 251 | </script> |
| 252 | 252 | </td> |
| 253 | 253 | </tr> |
| 254 | 254 | <tr> |
| 255 | - <th><?php echo __( 'Restrict table management', 'wp-data-access' ); ?></th> | |
| 255 | + <th><?php esc_html_e( 'Restrict table management', 'wp-data-access' ); ?></th> | |
| 256 | 256 | <td> |
| 257 | 257 | <select name="wpda_hide_manage_link[]" multiple="true"> |
| 258 | 258 | <?php |
| 259 | 259 | foreach ( get_users( array( 'role' => 'administrator' ) ) as $user ) { |
| @@ -280,9 +280,9 @@ | ||
| 280 | 280 | </div> |
| 281 | 281 | </td> |
| 282 | 282 | </tr> |
| 283 | 283 | <tr> |
| 284 | - <th><?php echo __( 'Default database', 'wp-data-access' ); ?></th> | |
| 284 | + <th><?php esc_html_e( 'Default database', 'wp-data-access' ); ?></th> | |
| 285 | 285 | <td> |
| 286 | 286 | <div> |
| 287 | 287 | <?php |
| 288 | 288 | $users = array(); |
| @@ -317,9 +317,9 @@ | ||
| 317 | 317 | } |
| 318 | 318 | ?> |
| 319 | 319 | </div> |
| 320 | 320 | <?php |
| 321 | - if ( count( $default_databases ) > 0 ) {//phpcs:ignore - 8.1 proof | |
| 321 | + if ( count( $default_databases ) > 0 ) { // phpcs:ignore -- 8.1 proof | |
| 322 | 322 | echo '<br/>'; |
| 323 | 323 | } |
| 324 | 324 | ?> |
| 325 | 325 | <div> |
| @@ -358,18 +358,18 @@ | ||
| 358 | 358 | <div class="wpda-table-settings-button"> |
| 359 | 359 | <input type="hidden" name="action" value="save"/> |
| 360 | 360 | <button type="submit" class="button button-primary"> |
| 361 | 361 | <i class="fas fa-check wpda_icon_on_button"></i> |
| 362 | - <?php echo __( 'Save Back-end Settings', 'wp-data-access' ); ?> | |
| 362 | + <?php esc_html_e( 'Save Back-end Settings', 'wp-data-access' ); ?> | |
| 363 | 363 | </button> |
| 364 | 364 | <a href="javascript:void(0)" |
| 365 | - onclick="if (confirm('<?php echo __( 'Reset to defaults?', 'wp-data-access' ); ?>')) { | |
| 365 | + onclick="if (confirm('<?php esc_html_e( 'Reset to defaults?', 'wp-data-access' ); ?>')) { | |
| 366 | 366 | jQuery('input[name="action"]').val('setdefaults'); |
| 367 | 367 | jQuery('#wpda_settings_backend').trigger('submit') |
| 368 | 368 | }" |
| 369 | 369 | class="button"> |
| 370 | 370 | <i class="fas fa-times-circle wpda_icon_on_button"></i> |
| 371 | - <?php echo __( 'Reset Back-end Settings To Defaults', 'wp-data-access' ); ?> | |
| 371 | + <?php esc_html_e( 'Reset Back-end Settings To Defaults', 'wp-data-access' ); ?> | |
| 372 | 372 | </a> |
| 373 | 373 | </div> |
| 374 | 374 | <?php wp_nonce_field( 'wpda-back-end-settings', '_wpnonce', false ); ?> |
| 375 | 375 | </form> |