← All changes
|
WPDataAccess/Settings/WPDA_Settings_ManageRepository.php
+69
-69
5.5.40
→
5.5.85
View file →
| @@ -29,9 +29,9 @@ | ||
| 29 | 29 | if ( isset( $_REQUEST['repos'] ) && 'true' === sanitize_text_field( wp_unslash( $_REQUEST['repos'] ) ) ) { |
| 30 | 30 | // Security check. |
| 31 | 31 | $wp_nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) : ''; // input var okay. |
| 32 | 32 | if ( ! wp_verify_nonce( $wp_nonce, 'wpda-settings-recreate-repository-' . WPDA::get_current_user_login() ) ) { |
| 33 | - wp_die( __( 'ERROR: Not authorized', 'wp-data-access' ) ); | |
| 33 | + wp_die( esc_attr__( 'ERROR: Not authorized', 'wp-data-access' ) ); | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | // Recreate repository. |
| 37 | 37 | $wpda_repository = new WPDA_Repository(); |
| @@ -54,9 +54,9 @@ | ||
| 54 | 54 | protected function count_repository_backup_table( $table_name ) { |
| 55 | 55 | global $wpdb; |
| 56 | 56 | |
| 57 | 57 | $suppress = $wpdb->suppress_errors( true ); |
| 58 | - $wpdb->get_results( | |
| 58 | + $wpdb->get_results( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- plugin table | |
| 59 | 59 | $wpdb->prepare( |
| 60 | 60 | 'select 1 from `%1s`', // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders |
| 61 | 61 | array( |
| 62 | 62 | WPDA::remove_backticks( $table_name ), |
| @@ -84,9 +84,9 @@ | ||
| 84 | 84 | |
| 85 | 85 | // Security check. |
| 86 | 86 | $wp_nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) : ''; // input var okay. |
| 87 | 87 | if ( ! wp_verify_nonce( $wp_nonce, 'wpda-repository-settings-' . WPDA::get_current_user_login() ) ) { |
| 88 | - wp_die( __( 'ERROR: Not authorized', 'wp-data-access' ) ); | |
| 88 | + wp_die( esc_attr__( 'ERROR: Not authorized', 'wp-data-access' ) ); | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | if ( 'save' === $action ) { |
| 92 | 92 | // Save changes. |
| @@ -199,9 +199,9 @@ | ||
| 199 | 199 | if ( isset( $_REQUEST['create_backup'] ) && 'true' === $_REQUEST['create_backup'] ) { |
| 200 | 200 | // Security check |
| 201 | 201 | $wp_nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) : ''; // input var okay. |
| 202 | 202 | if ( ! wp_verify_nonce( $wp_nonce, 'wpda-settings-create_backup-repository-' . WPDA::get_current_user_login() ) ) { |
| 203 | - wp_die( __( 'ERROR: Not authorized', 'wp-data-access' ) ); | |
| 203 | + wp_die( esc_attr__( 'ERROR: Not authorized', 'wp-data-access' ) ); | |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | $wpda_repository = new WPDA_Repository(); |
| 207 | 207 | $wpda_repository->create_new_backup(); |
| @@ -208,9 +208,9 @@ | ||
| 208 | 208 | } elseif ( isset( $_REQUEST['remove_one_backup'] ) && 'true' === $_REQUEST['remove_one_backup'] ) { |
| 209 | 209 | // Security check |
| 210 | 210 | $wp_nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) : ''; // input var okay. |
| 211 | 211 | if ( ! wp_verify_nonce( $wp_nonce, 'wpda-settings-remove_backup-repository-' . WPDA::get_current_user_login() ) ) { |
| 212 | - wp_die( __( 'ERROR: Not authorized', 'wp-data-access' ) ); | |
| 212 | + wp_die( esc_attr__( 'ERROR: Not authorized', 'wp-data-access' ) ); | |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | if ( isset( $_REQUEST['backup_date'] ) ) { |
| 216 | 216 | $backup_date = sanitize_text_field( wp_unslash( $_REQUEST['backup_date'] ) ); // input var okay. |
| @@ -228,13 +228,13 @@ | ||
| 228 | 228 | } |
| 229 | 229 | } elseif ( isset( $_REQUEST['remove_backup'] ) && 'true' === $_REQUEST['remove_backup'] ) { |
| 230 | 230 | $wp_nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) : ''; // input var okay. |
| 231 | 231 | if ( ! wp_verify_nonce( $wp_nonce, 'wpda-settings-remove_backup-repository-' . WPDA::get_current_user_login() ) ) { |
| 232 | - wp_die( __( 'ERROR: Not authorized', 'wp-data-access' ) ); | |
| 232 | + wp_die( esc_attr__( 'ERROR: Not authorized', 'wp-data-access' ) ); | |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | // Remove all repository backups |
| 236 | - $backup_tables = $wpdb->get_results( | |
| 236 | + $backup_tables = $wpdb->get_results( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter -- plugin table | |
| 237 | 237 | $wpdb->prepare( |
| 238 | 238 | $query, // phpcs:ignore WordPress.DB.PreparedSQL |
| 239 | 239 | array( |
| 240 | 240 | $wpdb->dbname, |
| @@ -255,11 +255,11 @@ | ||
| 255 | 255 | ), |
| 256 | 256 | 'ARRAY_N' |
| 257 | 257 | ); |
| 258 | 258 | foreach ( $backup_tables as $backup_table ) { |
| 259 | - $wpdb->query( | |
| 259 | + $wpdb->query( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- plugin table | |
| 260 | 260 | $wpdb->prepare( |
| 261 | - 'drop table `%1s`', // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders | |
| 261 | + 'drop table `%1s`', // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders, WordPress.DB.DirectDatabaseQuery.SchemaChange | |
| 262 | 262 | array( |
| 263 | 263 | WPDA::remove_backticks( $backup_table[0] ), |
| 264 | 264 | ) |
| 265 | 265 | ) |
| @@ -275,9 +275,9 @@ | ||
| 275 | 275 | } elseif ( isset( $_REQUEST['restore_backup'] ) ) { |
| 276 | 276 | if ( isset( $_REQUEST['restore_date'] ) ) { |
| 277 | 277 | $wp_nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) : ''; // input var okay. |
| 278 | 278 | if ( ! wp_verify_nonce( $wp_nonce, 'wpda-settings-restore_backup-repository-' . WPDA::get_current_user_login() ) ) { |
| 279 | - wp_die( __( 'ERROR: Not authorized', 'wp-data-access' ) ); | |
| 279 | + wp_die( esc_attr__( 'ERROR: Not authorized', 'wp-data-access' ) ); | |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | // Start repository restore procedure |
| 283 | 283 | $restore_date = sanitize_text_field( wp_unslash( $_REQUEST['restore_date'] ) ); // input var okay. |
| @@ -287,75 +287,75 @@ | ||
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | // Count backup tables rows |
| 290 | 290 | if ( $app_table_name_exists ) { |
| 291 | - $no_app_items = WPDA_App_Model::count();//phpcs:ignore - 8.1 proof | |
| 291 | + $no_app_items = WPDA_App_Model::count(); // phpcs:ignore -- 8.1 proof | |
| 292 | 292 | } else { |
| 293 | 293 | $no_app_items = 0; |
| 294 | 294 | } |
| 295 | 295 | if ( $app_container_table_name_exists ) { |
| 296 | - $no_app_container_items = WPDA_App_Container_Model::count();//phpcs:ignore - 8.1 proof | |
| 296 | + $no_app_container_items = WPDA_App_Container_Model::count(); // phpcs:ignore -- 8.1 proof | |
| 297 | 297 | } else { |
| 298 | 298 | $no_app_container_items = 0; |
| 299 | 299 | } |
| 300 | 300 | if ( $app_apps_table_name_exists ) { |
| 301 | - $no_app_apps_items = WPDA_App_Apps_Model::count();//phpcs:ignore - 8.1 proof | |
| 301 | + $no_app_apps_items = WPDA_App_Apps_Model::count(); // phpcs:ignore -- 8.1 proof | |
| 302 | 302 | } else { |
| 303 | 303 | $no_app_apps_items = 0; |
| 304 | 304 | } |
| 305 | 305 | if ( $menus_table_name_exists ) { |
| 306 | - $no_menu_items = WPDA_User_Menus_Model::count();//phpcs:ignore - 8.1 proof | |
| 306 | + $no_menu_items = WPDA_User_Menus_Model::count(); // phpcs:ignore -- 8.1 proof | |
| 307 | 307 | } else { |
| 308 | 308 | $no_menu_items = 0; |
| 309 | 309 | } |
| 310 | 310 | if ( $design_table_name_exists ) { |
| 311 | - $no_table_designs = WPDA_Design_Table_Model::count();//phpcs:ignore - 8.1 proof | |
| 311 | + $no_table_designs = WPDA_Design_Table_Model::count(); // phpcs:ignore -- 8.1 proof | |
| 312 | 312 | } else { |
| 313 | 313 | $no_table_designs = 0; |
| 314 | 314 | } |
| 315 | 315 | if ( $logging_table_exists ) { |
| 316 | - $no_logs = WPDA_Logging_Model::count();//phpcs:ignore - 8.1 proof | |
| 316 | + $no_logs = WPDA_Logging_Model::count(); // phpcs:ignore -- 8.1 proof | |
| 317 | 317 | } else { |
| 318 | 318 | $no_logs = 0; |
| 319 | 319 | } |
| 320 | 320 | if ( $media_table_exists ) { |
| 321 | - $no_media = WPDA_Media_Model::count();//phpcs:ignore - 8.1 proof | |
| 321 | + $no_media = WPDA_Media_Model::count(); // phpcs:ignore -- 8.1 proof | |
| 322 | 322 | } else { |
| 323 | 323 | $no_media = 0; |
| 324 | 324 | } |
| 325 | 325 | if ( $data_projects_project_name_exists ) { |
| 326 | - $no_projects = WPDP_Project_Model::count();//phpcs:ignore - 8.1 proof | |
| 326 | + $no_projects = WPDP_Project_Model::count(); // phpcs:ignore -- 8.1 proof | |
| 327 | 327 | } else { |
| 328 | 328 | $no_projects = 0; |
| 329 | 329 | } |
| 330 | 330 | if ( $data_projects_page_name_exists ) { |
| 331 | - $no_pages = WPDP_Page_Model::count();//phpcs:ignore - 8.1 proof | |
| 331 | + $no_pages = WPDP_Page_Model::count(); // phpcs:ignore -- 8.1 proof | |
| 332 | 332 | } else { |
| 333 | 333 | $no_pages = 0; |
| 334 | 334 | } |
| 335 | 335 | if ( $data_projects_table_name_exists ) { |
| 336 | - $no_project_table_designs = WPDP_Project_Design_Table_Model::count();//phpcs:ignore - 8.1 proof | |
| 336 | + $no_project_table_designs = WPDP_Project_Design_Table_Model::count(); // phpcs:ignore -- 8.1 proof | |
| 337 | 337 | } else { |
| 338 | 338 | $no_project_table_designs = 0; |
| 339 | 339 | } |
| 340 | 340 | if ( $data_publication_table_name_exists ) { |
| 341 | - $no_data_publication = WPDA_Publisher_Model::count();//phpcs:ignore - 8.1 proof | |
| 341 | + $no_data_publication = WPDA_Publisher_Model::count(); // phpcs:ignore -- 8.1 proof | |
| 342 | 342 | } else { |
| 343 | 343 | $no_data_publication = 0; |
| 344 | 344 | } |
| 345 | 345 | if ( $table_settings_table_exists ) { |
| 346 | - $no_table_settings = WPDA_Table_Settings_Model::count();//phpcs:ignore - 8.1 proof | |
| 346 | + $no_table_settings = WPDA_Table_Settings_Model::count(); // phpcs:ignore -- 8.1 proof | |
| 347 | 347 | } else { |
| 348 | 348 | $no_table_settings = 0; |
| 349 | 349 | } |
| 350 | 350 | if ( $csv_import_table_exists ) { |
| 351 | - $no_csv_import = WPDA_CSV_Uploads_Model::count();//phpcs:ignore - 8.1 proof | |
| 351 | + $no_csv_import = WPDA_CSV_Uploads_Model::count(); // phpcs:ignore -- 8.1 proof | |
| 352 | 352 | } else { |
| 353 | 353 | $no_csv_import = 0; |
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | // Count backup tables |
| 357 | - $backup_tables = $wpdb->get_results( | |
| 357 | + $backup_tables = $wpdb->get_results( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter -- plugin tables | |
| 358 | 358 | $wpdb->prepare( |
| 359 | 359 | $query, // phpcs:ignore WordPress.DB.PreparedSQL |
| 360 | 360 | array( |
| 361 | 361 | $wpdb->dbname, |
| @@ -421,9 +421,9 @@ | ||
| 421 | 421 | $wpnonce_download_backup = wp_create_nonce( 'wpda-export-' . WPDA::get_current_user_login() ); |
| 422 | 422 | ?> |
| 423 | 423 | <form id="wpda-download-actual-respository" |
| 424 | 424 | method="post" |
| 425 | - action="<?php echo admin_url( 'admin.php' ); // phpcs:ignore WordPress.Security.EscapeOutput ?>?action=wpda_export" | |
| 425 | + action="<?php echo esc_url( admin_url( 'admin.php' ) ); ?>?action=wpda_export" | |
| 426 | 426 | target="_blank" |
| 427 | 427 | style="display: none" |
| 428 | 428 | > |
| 429 | 429 | <input type="hidden" name="type" value="table"> |
| @@ -445,9 +445,9 @@ | ||
| 445 | 445 | <input type="submit"> |
| 446 | 446 | </form> |
| 447 | 447 | <form id="wpda-download-backup" |
| 448 | 448 | method="post" |
| 449 | - action="<?php echo admin_url( 'admin.php' ); // phpcs:ignore WordPress.Security.EscapeOutput ?>?action=wpda_export" | |
| 449 | + action="<?php echo esc_url( admin_url( 'admin.php' ) ); ?>?action=wpda_export" | |
| 450 | 450 | target="_blank" |
| 451 | 451 | style="display: none" |
| 452 | 452 | > |
| 453 | 453 | <input type="hidden" name="type" value="table"> |
| @@ -469,9 +469,9 @@ | ||
| 469 | 469 | <input type="submit"> |
| 470 | 470 | </form> |
| 471 | 471 | <form id="wpda-remove-backup" |
| 472 | 472 | method="post" |
| 473 | - action="<?php echo admin_url( 'admin.php' ); // phpcs:ignore WordPress.Security.EscapeOutput ?>?page=<?php echo esc_attr( $this->page ); ?>&tab=repository" | |
| 473 | + action="<?php esc_url( admin_url( 'admin.php' ) ); ?>?page=<?php echo esc_attr( $this->page ); ?>&tab=repository" | |
| 474 | 474 | style="display: none" |
| 475 | 475 | > |
| 476 | 476 | <input type="hidden" name="backup_date" id="remove_backup_date"> |
| 477 | 477 | <input type="hidden" name="remove_one_backup" value="true"> |
| @@ -479,9 +479,9 @@ | ||
| 479 | 479 | <input type="submit"> |
| 480 | 480 | </form> |
| 481 | 481 | <form id="wpda-create-backup" |
| 482 | 482 | method="post" |
| 483 | - action="<?php echo admin_url( 'admin.php' ); // phpcs:ignore WordPress.Security.EscapeOutput ?>?page=<?php echo esc_attr( $this->page ); ?>&tab=repository" | |
| 483 | + action="<?php esc_url( admin_url( 'admin.php' ) ); ?>?page=<?php echo esc_attr( $this->page ); ?>&tab=repository" | |
| 484 | 484 | style="display: none" |
| 485 | 485 | > |
| 486 | 486 | <input type="hidden" name="create_backup" value="true"> |
| 487 | 487 | <input type="hidden" name="_wpnonce" value="<?php echo esc_attr( $wpnonce_create_backup ); ?>"> |
| @@ -488,9 +488,9 @@ | ||
| 488 | 488 | <input type="submit"> |
| 489 | 489 | </form> |
| 490 | 490 | <form id="wpda-remove-all-backups" |
| 491 | 491 | method="post" |
| 492 | - action="<?php echo admin_url( 'admin.php' ); // phpcs:ignore WordPress.Security.EscapeOutput ?>?page=<?php echo esc_attr( $this->page ); ?>&tab=repository" | |
| 492 | + action="<?php esc_url( admin_url( 'admin.php' ) ); ?>?page=<?php echo esc_attr( $this->page ); ?>&tab=repository" | |
| 493 | 493 | style="display: none" |
| 494 | 494 | > |
| 495 | 495 | <input type="hidden" name="remove_backup" value="true"> |
| 496 | 496 | <input type="hidden" name="_wpnonce" value="<?php echo esc_attr( $wpnonce_remove_backup ); ?>"> |
| @@ -497,9 +497,9 @@ | ||
| 497 | 497 | <input type="submit"> |
| 498 | 498 | </form> |
| 499 | 499 | <form id="wpda-restore-respository" |
| 500 | 500 | method="post" |
| 501 | - action="<?php echo admin_url( 'admin.php' ); // phpcs:ignore WordPress.Security.EscapeOutput ?>?page=<?php echo esc_attr( $this->page ); ?>&tab=repository" | |
| 501 | + action="<?php esc_url( admin_url( 'admin.php' ) ); ?>?page=<?php echo esc_attr( $this->page ); ?>&tab=repository" | |
| 502 | 502 | style="display: none" |
| 503 | 503 | > |
| 504 | 504 | <input type="hidden" name="wpda_app" id="restore_app_table_name"> |
| 505 | 505 | <input type="hidden" name="wpda_app_container" id="restore_app_container_table_name"> |
| @@ -519,21 +519,21 @@ | ||
| 519 | 519 | <input type="hidden" name="_wpnonce" value="<?php echo esc_attr( $wpnonce_restore_backup ); ?>"> |
| 520 | 520 | <input type="submit"> |
| 521 | 521 | </form> |
| 522 | 522 | <form id="wpda_settings_repository" method="post" |
| 523 | - action="<?php echo admin_url( 'admin.php' ); // phpcs:ignore WordPress.Security.EscapeOutput ?>?page=<?php echo esc_attr( $this->page ); ?>&tab=repository"> | |
| 523 | + action="<?php esc_url( admin_url( 'admin.php' ) ); ?>?page=<?php echo esc_attr( $this->page ); ?>&tab=repository"> | |
| 524 | 524 | <table class="wpda-table-settings"> |
| 525 | 525 | |
| 526 | 526 | <tr> |
| 527 | 527 | <th> |
| 528 | - <?php echo __( 'On Plugin Update', 'wp-data-access' ); ?> | |
| 528 | + <?php esc_html_e( 'On Plugin Update', 'wp-data-access' ); ?> | |
| 529 | 529 | </th> |
| 530 | 530 | <td> |
| 531 | 531 | <label> |
| 532 | 532 | <input type="checkbox" name="keep_backup_tables" |
| 533 | 533 | <?php echo 'on' === $keep_backup_tables ? 'checked' : ''; ?>> |
| 534 | - <strong><?php echo __( 'Keep backup of repository tables', 'wp-data-access' ); ?></strong> | |
| 535 | - <?php echo __( '(creates backup tables on plugin updates)', 'wp-data-access' ); ?> | |
| 534 | + <strong><?php esc_html_e( 'Keep backup of repository tables', 'wp-data-access' ); ?></strong> | |
| 535 | + <?php esc_html_e( '(creates backup tables on plugin updates)', 'wp-data-access' ); ?> | |
| 536 | 536 | </label> |
| 537 | 537 | <br/> |
| 538 | 538 | <label style="display: inline-block; margin-top: 5px"> |
| 539 | 539 | <strong>Max backups saved:</strong> |
| @@ -543,9 +543,9 @@ | ||
| 543 | 543 | <a href="javascript:void(0)" |
| 544 | 544 | class="button" |
| 545 | 545 | onclick="jQuery('#wpda-download-actual-respository').submit()" |
| 546 | 546 | > |
| 547 | - <?php echo __( 'Download actual repository tables' ); ?> | |
| 547 | + <?php esc_html_e( 'Download actual repository tables', 'wp-data-access' ); ?> | |
| 548 | 548 | </a> |
| 549 | 549 | <div style="width: fit-content"> |
| 550 | 550 | <?php |
| 551 | 551 | if ( $no_backup_tables > 0 ) { |
| @@ -898,15 +898,15 @@ | ||
| 898 | 898 | <a href="javascript:void(0)" |
| 899 | 899 | class="button" |
| 900 | 900 | onclick="jQuery('.wpda-restore-repository-backup-selected').removeClass('wpda-restore-repository-backup-selected'); jQuery('#wpda-restore-repository-backup').hide();" |
| 901 | 901 | > |
| 902 | - <?php echo __( 'Cancel' ); ?> | |
| 902 | + <?php esc_html_e( 'Cancel', 'wp-data-access' ); ?> | |
| 903 | 903 | </a> |
| 904 | 904 | <a href="javascript:void(0)" |
| 905 | 905 | class="button" |
| 906 | 906 | onclick="restore_respository_tables()" |
| 907 | 907 | > |
| 908 | - <?php echo __( 'Restore' ); ?> | |
| 908 | + <?php esc_html_e( 'Restore', 'wp-data-access' ); ?> | |
| 909 | 909 | </a> |
| 910 | 910 | </div> |
| 911 | 911 | </fieldset> |
| 912 | 912 | </div> |
| @@ -916,17 +916,17 @@ | ||
| 916 | 916 | </div> |
| 917 | 917 | <div class="wpda-spacer"></div> |
| 918 | 918 | <a href="javascript:void(0)" |
| 919 | 919 | class="button" |
| 920 | - onclick=" if (confirm('<?php echo __( 'Backup repository tables?', 'wp-data-access' ); ?>')) { jQuery('#wpda-create-backup').submit(); }" | |
| 920 | + onclick=" if (confirm('<?php esc_html_e( 'Backup repository tables?', 'wp-data-access' ); ?>')) { jQuery('#wpda-create-backup').submit(); }" | |
| 921 | 921 | > |
| 922 | - <?php echo __( 'Create new repository backup' ); ?> | |
| 922 | + <?php esc_html_e( 'Create new repository backup', 'wp-data-access' ); ?> | |
| 923 | 923 | </a> |
| 924 | 924 | <a href="javascript:void(0)" |
| 925 | 925 | class="button <?php echo 0 === $no_backup_tables ? 'disabled' : ''; ?>" |
| 926 | - onclick="if (confirm('<?php echo __( 'Delete all backup tables?', 'wp-data-access' ) . '\n' . __( 'This action cannot be undone.', 'wp-data-access' ) . '\n' . __( '\\\'Cancel\\\' to stop, \\\'OK\\\' to delete.', 'wp-data-access' ); ?>')) { jQuery('#wpda-remove-all-backups').submit(); }" | |
| 926 | + onclick="if (confirm('<?php echo esc_attr__( 'Delete all backup tables?', 'wp-data-access' ) . '\n' . esc_attr__( 'This action cannot be undone.', 'wp-data-access' ) . '\n' . esc_attr__( '\\\'Cancel\\\' to stop, \\\'OK\\\' to delete.', 'wp-data-access' ); ?>')) { jQuery('#wpda-remove-all-backups').submit(); }" | |
| 927 | 927 | > |
| 928 | - <?php echo __( 'Delete all (' ) . esc_html( $no_backup_tables ) . __( ') repository backup tables' ); ?> | |
| 928 | + <?php echo esc_attr__( 'Delete all (', 'wp-data-access' ) . esc_attr( $no_backup_tables ) . esc_attr__( ') repository backup tables', 'wp-data-access' ); ?> | |
| 929 | 929 | </a> |
| 930 | 930 | </td> |
| 931 | 931 | </tr> |
| 932 | 932 | |
| @@ -931,9 +931,9 @@ | ||
| 931 | 931 | </tr> |
| 932 | 932 | |
| 933 | 933 | <tr> |
| 934 | 934 | <th> |
| 935 | - <?php echo __( 'Apps', 'wp-data-access' ); ?> | |
| 935 | + <?php esc_html_e( 'Apps', 'wp-data-access' ); ?> | |
| 936 | 936 | </th> |
| 937 | 937 | <td> |
| 938 | 938 | <span class="dashicons <?php echo $app_table_name_exists ? 'dashicons-yes' : 'dashicons-no'; ?>"></span> |
| 939 | 939 | <?php echo esc_attr( $table ); ?> |
| @@ -945,9 +945,9 @@ | ||
| 945 | 945 | <br/><br/> |
| 946 | 946 | <span class="dashicons dashicons-yes"></span> |
| 947 | 947 | <strong> |
| 948 | 948 | <?php echo esc_attr( $no_app_items ); ?> |
| 949 | - <?php echo __( 'apps defined in repository', 'wp-data-access' ); ?> | |
| 949 | + <?php esc_html_e( 'apps defined in repository', 'wp-data-access' ); ?> | |
| 950 | 950 | </strong> |
| 951 | 951 | <?php |
| 952 | 952 | } |
| 953 | 953 | ?> |
| @@ -955,9 +955,9 @@ | ||
| 955 | 955 | </tr> |
| 956 | 956 | |
| 957 | 957 | <tr> |
| 958 | 958 | <th> |
| 959 | - <?php echo __( 'App Containers', 'wp-data-access' ); ?> | |
| 959 | + <?php esc_html_e( 'App Containers', 'wp-data-access' ); ?> | |
| 960 | 960 | </th> |
| 961 | 961 | <td> |
| 962 | 962 | <span class="dashicons <?php echo $app_container_table_name_exists ? 'dashicons-yes' : 'dashicons-no'; ?>"></span> |
| 963 | 963 | <?php echo esc_attr( $table ); ?> |
| @@ -969,9 +969,9 @@ | ||
| 969 | 969 | <br/><br/> |
| 970 | 970 | <span class="dashicons dashicons-yes"></span> |
| 971 | 971 | <strong> |
| 972 | 972 | <?php echo esc_attr( $no_app_container_items ); ?> |
| 973 | - <?php echo __( 'apps containers defined in repository', 'wp-data-access' ); ?> | |
| 973 | + <?php esc_html_e( 'apps containers defined in repository', 'wp-data-access' ); ?> | |
| 974 | 974 | </strong> |
| 975 | 975 | <?php |
| 976 | 976 | } |
| 977 | 977 | ?> |
| @@ -979,9 +979,9 @@ | ||
| 979 | 979 | </tr> |
| 980 | 980 | |
| 981 | 981 | <tr> |
| 982 | 982 | <th> |
| 983 | - <?php echo __( 'App Apps', 'wp-data-access' ); ?> | |
| 983 | + <?php esc_html_e( 'App Apps', 'wp-data-access' ); ?> | |
| 984 | 984 | </th> |
| 985 | 985 | <td> |
| 986 | 986 | <span class="dashicons <?php echo $app_apps_table_name_exists ? 'dashicons-yes' : 'dashicons-no'; ?>"></span> |
| 987 | 987 | <?php echo esc_attr( $table ); ?> |
| @@ -993,9 +993,9 @@ | ||
| 993 | 993 | <br/><br/> |
| 994 | 994 | <span class="dashicons dashicons-yes"></span> |
| 995 | 995 | <strong> |
| 996 | 996 | <?php echo esc_attr( $no_app_apps_items ); ?> |
| 997 | - <?php echo __( 'app apps defined in repository', 'wp-data-access' ); ?> | |
| 997 | + <?php esc_html_e( 'app apps defined in repository', 'wp-data-access' ); ?> | |
| 998 | 998 | </strong> |
| 999 | 999 | <?php |
| 1000 | 1000 | } |
| 1001 | 1001 | ?> |
| @@ -1003,9 +1003,9 @@ | ||
| 1003 | 1003 | </tr> |
| 1004 | 1004 | |
| 1005 | 1005 | <tr> |
| 1006 | 1006 | <th> |
| 1007 | - <?php echo __( 'Table Settings', 'wp-data-access' ); ?> | |
| 1007 | + <?php esc_html_e( 'Table Settings', 'wp-data-access' ); ?> | |
| 1008 | 1008 | </th> |
| 1009 | 1009 | <td> |
| 1010 | 1010 | <span class="dashicons <?php echo $table_settings_table_exists ? 'dashicons-yes' : 'dashicons-no'; ?>"></span> |
| 1011 | 1011 | <?php echo esc_attr( $table ); ?> |
| @@ -1017,9 +1017,9 @@ | ||
| 1017 | 1017 | <br/><br/> |
| 1018 | 1018 | <span class="dashicons dashicons-yes"></span> |
| 1019 | 1019 | <strong> |
| 1020 | 1020 | <?php echo esc_attr( $no_table_settings ); ?> |
| 1021 | - <?php echo __( 'table settings defined in repository', 'wp-data-access' ); ?> | |
| 1021 | + <?php esc_html_e( 'table settings defined in repository', 'wp-data-access' ); ?> | |
| 1022 | 1022 | </strong> |
| 1023 | 1023 | <?php |
| 1024 | 1024 | } |
| 1025 | 1025 | ?> |
| @@ -1027,9 +1027,9 @@ | ||
| 1027 | 1027 | </tr> |
| 1028 | 1028 | |
| 1029 | 1029 | <tr> |
| 1030 | 1030 | <th> |
| 1031 | - <?php echo __( 'Manage Media', 'wp-data-access' ); ?> | |
| 1031 | + <?php esc_html_e( 'Manage Media', 'wp-data-access' ); ?> | |
| 1032 | 1032 | </th> |
| 1033 | 1033 | <td> |
| 1034 | 1034 | <span class="dashicons <?php echo $media_table_exists ? 'dashicons-yes' : 'dashicons-no'; ?>"></span> |
| 1035 | 1035 | <?php echo esc_attr( $table ); ?> |
| @@ -1041,9 +1041,9 @@ | ||
| 1041 | 1041 | <br/><br/> |
| 1042 | 1042 | <span class="dashicons dashicons-yes"></span> |
| 1043 | 1043 | <strong> |
| 1044 | 1044 | <?php echo esc_attr( $no_media ); ?> |
| 1045 | - <?php echo __( 'media columns defined in repository', 'wp-data-access' ); ?> | |
| 1045 | + <?php esc_html_e( 'media columns defined in repository', 'wp-data-access' ); ?> | |
| 1046 | 1046 | </strong> |
| 1047 | 1047 | <?php |
| 1048 | 1048 | } |
| 1049 | 1049 | ?> |
| @@ -1065,9 +1065,9 @@ | ||
| 1065 | 1065 | <br/><br/> |
| 1066 | 1066 | <span class="dashicons dashicons-yes"></span> |
| 1067 | 1067 | <strong> |
| 1068 | 1068 | <?php echo esc_attr( $no_table_designs ); ?> |
| 1069 | - <?php echo __( 'table designs in repository', 'wp-data-access' ); ?> | |
| 1069 | + <?php esc_html_e( 'table designs in repository', 'wp-data-access' ); ?> | |
| 1070 | 1070 | </strong> |
| 1071 | 1071 | <?php |
| 1072 | 1072 | } |
| 1073 | 1073 | ?> |
| @@ -1103,9 +1103,9 @@ | ||
| 1103 | 1103 | <br/> |
| 1104 | 1104 | <span class="dashicons dashicons-yes"></span> |
| 1105 | 1105 | <strong> |
| 1106 | 1106 | <?php echo esc_attr( $no_projects ); ?> |
| 1107 | - <?php echo __( 'data projects in repository', 'wp-data-access' ); ?> | |
| 1107 | + <?php esc_html_e( 'data projects in repository', 'wp-data-access' ); ?> | |
| 1108 | 1108 | </strong> |
| 1109 | 1109 | <?php |
| 1110 | 1110 | } |
| 1111 | 1111 | if ( $data_projects_page_name_exists ) { |
| @@ -1113,9 +1113,9 @@ | ||
| 1113 | 1113 | <br/> |
| 1114 | 1114 | <span class="dashicons dashicons-yes"></span> |
| 1115 | 1115 | <strong> |
| 1116 | 1116 | <?php echo esc_attr( $no_pages ); ?> |
| 1117 | - <?php echo __( 'project pages in repository', 'wp-data-access' ); ?> | |
| 1117 | + <?php esc_html_e( 'project pages in repository', 'wp-data-access' ); ?> | |
| 1118 | 1118 | </strong> |
| 1119 | 1119 | <?php |
| 1120 | 1120 | } |
| 1121 | 1121 | if ( $data_projects_table_name_exists ) { |
| @@ -1123,9 +1123,9 @@ | ||
| 1123 | 1123 | <br/> |
| 1124 | 1124 | <span class="dashicons dashicons-yes"></span> |
| 1125 | 1125 | <strong> |
| 1126 | 1126 | <?php echo esc_attr( $no_project_table_designs ); ?> |
| 1127 | - <?php echo __( 'project tables in repository', 'wp-data-access' ); ?> | |
| 1127 | + <?php esc_html_e( 'project tables in repository', 'wp-data-access' ); ?> | |
| 1128 | 1128 | </strong> |
| 1129 | 1129 | <?php |
| 1130 | 1130 | } |
| 1131 | 1131 | ?> |
| @@ -1147,9 +1147,9 @@ | ||
| 1147 | 1147 | <br/><br/> |
| 1148 | 1148 | <span class="dashicons dashicons-yes"></span> |
| 1149 | 1149 | <strong> |
| 1150 | 1150 | <?php echo esc_attr( $no_data_publication ); ?> |
| 1151 | - <?php echo __( 'data tables in repository', 'wp-data-access' ); ?> | |
| 1151 | + <?php esc_html_e( 'data tables in repository', 'wp-data-access' ); ?> | |
| 1152 | 1152 | </strong> |
| 1153 | 1153 | <?php |
| 1154 | 1154 | } |
| 1155 | 1155 | ?> |
| @@ -1171,9 +1171,9 @@ | ||
| 1171 | 1171 | <br/><br/> |
| 1172 | 1172 | <span class="dashicons dashicons-yes"></span> |
| 1173 | 1173 | <strong> |
| 1174 | 1174 | <?php echo esc_attr( $no_menu_items ); ?> |
| 1175 | - <?php echo __( 'menus in repository', 'wp-data-access' ); ?> | |
| 1175 | + <?php esc_html_e( 'menus in repository', 'wp-data-access' ); ?> | |
| 1176 | 1176 | </strong> |
| 1177 | 1177 | <?php |
| 1178 | 1178 | } |
| 1179 | 1179 | ?> |
| @@ -1181,9 +1181,9 @@ | ||
| 1181 | 1181 | </tr> |
| 1182 | 1182 | |
| 1183 | 1183 | <tr> |
| 1184 | 1184 | <th> |
| 1185 | - <?php echo __( 'CSV Uploads', 'wp-data-access' ); ?> | |
| 1185 | + <?php esc_html_e( 'CSV Uploads', 'wp-data-access' ); ?> | |
| 1186 | 1186 | </th> |
| 1187 | 1187 | <td> |
| 1188 | 1188 | <span class="dashicons <?php echo $csv_import_table_exists ? 'dashicons-yes' : 'dashicons-no'; ?>"></span> |
| 1189 | 1189 | <?php echo esc_attr( $table ); ?> |
| @@ -1195,9 +1195,9 @@ | ||
| 1195 | 1195 | <br/><br/> |
| 1196 | 1196 | <span class="dashicons dashicons-yes"></span> |
| 1197 | 1197 | <strong> |
| 1198 | 1198 | <?php echo esc_attr( $no_csv_import ); ?> |
| 1199 | - <?php echo __( 'menus in repository', 'wp-data-access' ); ?> | |
| 1199 | + <?php esc_html_e( 'menus in repository', 'wp-data-access' ); ?> | |
| 1200 | 1200 | </strong> |
| 1201 | 1201 | <?php |
| 1202 | 1202 | } |
| 1203 | 1203 | ?> |
| @@ -1219,9 +1219,9 @@ | ||
| 1219 | 1219 | <br/><br/> |
| 1220 | 1220 | <span class="dashicons dashicons-yes"></span> |
| 1221 | 1221 | <strong> |
| 1222 | 1222 | <?php echo esc_attr( $no_logs ); ?> |
| 1223 | - <?php echo __( 'logging rows in repository', 'wp-data-access' ); ?> | |
| 1223 | + <?php esc_html_e( 'logging rows in repository', 'wp-data-access' ); ?> | |
| 1224 | 1224 | </strong> |
| 1225 | 1225 | <?php |
| 1226 | 1226 | } |
| 1227 | 1227 | ?> |
| @@ -1232,27 +1232,27 @@ | ||
| 1232 | 1232 | <div class="wpda-table-settings-button"> |
| 1233 | 1233 | <input type="hidden" name="action" value="save"/> |
| 1234 | 1234 | <button type="submit" class="button button-primary"> |
| 1235 | 1235 | <i class="fas fa-check wpda_icon_on_button"></i> |
| 1236 | - <?php echo __( 'Save Manage Respository Settings', 'wp-data-access' ); ?> | |
| 1236 | + <?php esc_html_e( 'Save Manage Respository Settings', 'wp-data-access' ); ?> | |
| 1237 | 1237 | </button> |
| 1238 | 1238 | <a href="javascript:void(0)" |
| 1239 | - onclick="if (confirm('<?php echo __( 'Reset to defaults?', 'wp-data-access' ); ?>')) { | |
| 1239 | + onclick="if (confirm('<?php esc_html_e( 'Reset to defaults?', 'wp-data-access' ); ?>')) { | |
| 1240 | 1240 | jQuery('input[name=\'action\']').val('setdefaults'); |
| 1241 | 1241 | jQuery('#wpda_settings_repository').trigger('submit'); |
| 1242 | 1242 | }" |
| 1243 | 1243 | class="button button-secondary"> |
| 1244 | 1244 | <i class="fas fa-times-circle wpda_icon_on_button"></i> |
| 1245 | - <?php echo __( 'Reset Manage Repository Settings To Defaults', 'wp-data-access' ); ?> | |
| 1245 | + <?php esc_html_e( 'Reset Manage Repository Settings To Defaults', 'wp-data-access' ); ?> | |
| 1246 | 1246 | </a> |
| 1247 | 1247 | <?php |
| 1248 | 1248 | $wpnonce_recreate = wp_create_nonce( 'wpda-settings-recreate-repository-' . WPDA::get_current_user_login() ); |
| 1249 | 1249 | ?> |
| 1250 | - <a href="<?php echo admin_url( 'admin.php' ); // phpcs:ignore WordPress.Security.EscapeOutput ?>?page=<?php echo esc_attr( $this->page ); ?>&tab=repository&repos=true&_wpnonce=<?php echo esc_attr( $wpnonce_recreate ); ?>" | |
| 1250 | + <a href="<?php esc_url( admin_url( 'admin.php' ) ); ?>?page=<?php echo esc_attr( $this->page ); ?>&tab=repository&repos=true&_wpnonce=<?php echo esc_attr( $wpnonce_recreate ); ?>" | |
| 1251 | 1251 | class="button button-secondary"> |
| 1252 | 1252 | <i class="fas fa-redo wpda_icon_on_button"></i> |
| 1253 | - <?php echo __( 'Recreate', 'wp-data-access' ); ?> WP Data Access | |
| 1254 | - <?php echo __( 'Repository', 'wp-data-access' ); ?> | |
| 1253 | + <?php esc_html_e( 'Recreate', 'wp-data-access' ); ?> WP Data Access | |
| 1254 | + <?php esc_html_e( 'Repository', 'wp-data-access' ); ?> | |
| 1255 | 1255 | </a> |
| 1256 | 1256 | </div> |
| 1257 | 1257 | <?php wp_nonce_field( 'wpda-repository-settings-' . WPDA::get_current_user_login(), '_wpnonce', false ); ?> |
| 1258 | 1258 | </form> |
| @@ -1272,12 +1272,12 @@ | ||
| 1272 | 1272 | ! $data_projects_table_name_exists || |
| 1273 | 1273 | ! $data_publication_table_name_exists |
| 1274 | 1274 | ) { |
| 1275 | 1275 | ?> |
| 1276 | - <p><strong><?php echo __( 'Your repository has errors!', 'wp-data-access' ); ?></strong></p> | |
| 1276 | + <p><strong><?php esc_html_e( 'Your repository has errors!', 'wp-data-access' ); ?></strong></p> | |
| 1277 | 1277 | <p> |
| 1278 | - <?php echo __( 'Recreate the WP Data Access repository to solve this problem.', 'wp-data-access' ); ?> | |
| 1279 | - <?php echo __( 'Please leave your comments on the support forum if the problem remains.', 'wp-data-access' ); ?> | |
| 1278 | + <?php esc_html_e( 'Recreate the WP Data Access repository to solve this problem.', 'wp-data-access' ); ?> | |
| 1279 | + <?php esc_html_e( 'Please leave your comments on the support forum if the problem remains.', 'wp-data-access' ); ?> | |
| 1280 | 1280 | (<a href="https://wordpress.org/support/plugin/wp-data-access/" target="_blank">go to forum</a>) |
| 1281 | 1281 | </p> |
| 1282 | 1282 | <?php |
| 1283 | 1283 | |