| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | <?php |
| 2 | -if (!defined('WPO_VERSION')) die('No direct access allowed'); | |
| 2 | +if (!defined('ABSPATH')) die('No direct access allowed'); | |
| 3 | 3 | |
| 4 | 4 | if ($load_data) { |
| 5 | 5 | $optimizer = WP_Optimize()->get_optimizer(); |
| 6 | 6 | list ($db_size, $total_gain) = $optimizer->get_current_db_size(); |
| @@ -6,11 +6,11 @@ | ||
| 6 | 6 | list ($db_size, $total_gain) = $optimizer->get_current_db_size(); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | ?> |
| 10 | -<h3><?php _e('Total size of database:', 'wp-optimize'); ?> <span id="optimize_current_db_size"><?php | |
| 10 | +<h3><?php esc_html_e('Total size of database:', 'wp-optimize'); ?> <span id="optimize_current_db_size"><?php | |
| 11 | 11 | if ($load_data) { |
| 12 | - echo $db_size; | |
| 12 | + echo esc_html($db_size); | |
| 13 | 13 | } else { |
| 14 | 14 | echo '...'; |
| 15 | 15 | } |
| 16 | 16 | ?></span></h3> |
| @@ -18,13 +18,14 @@ | ||
| 18 | 18 | <?php |
| 19 | 19 | if ($optimize_db) { |
| 20 | 20 | ?> |
| 21 | 21 | |
| 22 | - <h3><?php _e('Optimization results:', 'wp-optimize'); ?></h3> | |
| 22 | + <h3><?php esc_html_e('Optimization results:', 'wp-optimize'); ?></h3> | |
| 23 | 23 | <p style="color: #0000ff;" id="optimization_table_total_gain"> |
| 24 | 24 | <?php |
| 25 | 25 | if ($total_gain > 0) { |
| 26 | - echo __('Total space saved:', 'wp-optimize').' <span>'.$wp_optimize->format_size($total_gain).'</span> '; | |
| 26 | + // translators: %s is the total space saved in KB/MB | |
| 27 | + printf(esc_html__('Total space saved: %s', 'wp-optimize'), '<span>'. esc_html($wp_optimize->format_size($total_gain)).'</span> '); | |
| 27 | 28 | $optimizer->update_total_cleaned(strval($total_gain)); |
| 28 | 29 | } |
| 29 | 30 | ?> |
| 30 | 31 | </p> |
| @@ -33,27 +34,32 @@ | ||
| 33 | 34 | |
| 34 | 35 | ?> |
| 35 | 36 | |
| 36 | 37 | <script type="text/html" id="tmpl-wpo-table-delete"> |
| 37 | - <h3><span class="dashicons dashicons-warning"></span> <?php _e('Are you sure?', 'wp-optimize'); ?></h3> | |
| 38 | + <h3><span class="dashicons dashicons-warning"></span> <?php esc_html_e('Are you sure?', 'wp-optimize'); ?></h3> | |
| 38 | 39 | <div class="notice notice-warning"> |
| 39 | - <p><?php _e('WARNING - some plugins might not be detected as installed or activated if they are in unknown folders (for example premium plugins).', 'wp-optimize').' '.__('Only delete a table if you are sure of what you are doing, and after taking a backup.', 'wp-optimize'); ?></p> | |
| 40 | - <p><?php _e('If none of the plugins listed were ever installed on this website, you should not delete this table as it is likely to be used by an unlisted plugin.', 'wp-optimize'); ?></p> | |
| 40 | + <p><?php echo esc_html__('WARNING - some plugins might not be detected as installed or activated if they are in unknown folders (for example premium plugins).', 'wp-optimize').' '.esc_html__('Only delete a table if you are sure of what you are doing, and after taking a backup.', 'wp-optimize'); ?></p> | |
| 41 | + <p><?php echo esc_html__('If none of the plugins listed were ever installed on this website, you should not delete this table as it is likely to be used by an unlisted plugin.', 'wp-optimize'); ?></p> | |
| 41 | 42 | </div> |
| 42 | - <h4><?php printf(__('You are about to remove the table %s.', 'wp-optimize'), '<span class="table-name">{{data.table_name}}</span>'); ?></h4> | |
| 43 | + <h4> | |
| 44 | + <?php | |
| 45 | + // translators: %s is a table name | |
| 46 | + printf(esc_html__('You are about to remove the table %s.', 'wp-optimize'), '<span class="table-name">{{data.table_name}}</span>'); | |
| 47 | + ?> | |
| 48 | + </h4> | |
| 43 | 49 | <div class="wpo-table-delete--plugins"> |
| 44 | 50 | {{{data.plugins_list}}} |
| 45 | 51 | </div> |
| 46 | 52 | <# if (data.no_backup) { #> |
| 47 | 53 | <p class="no-backup-detected"> |
| 48 | - <input type="checkbox" id="confirm_deletion_without_backup"> <strong><?php _e('No automatic backup was detected.', 'wp-optimize'); ?></strong> <?php _e('I confirm that I will be able to revert the changes if needed.', 'wp-optimize'); ?> | |
| 54 | + <label for="confirm_deletion_without_backup"><input type="checkbox" id="confirm_deletion_without_backup"> <strong><?php esc_html_e('No automatic backup was detected.', 'wp-optimize'); ?></strong> <?php esc_html_e('I confirm that I will be able to revert the changes if needed.', 'wp-optimize'); ?></label> | |
| 49 | 55 | </p> |
| 50 | 56 | <# } #> |
| 51 | 57 | <p> |
| 52 | - <input type="checkbox" id="confirm_table_deletion"> <?php _e('I confirm that I have understood the risks in doing that, and that I know what I am doing.', 'wp-optimize'); ?> | |
| 58 | + <label for="confirm_table_deletion"><input type="checkbox" id="confirm_table_deletion"> <?php esc_html_e('I confirm that I have understood the risks in doing that, and that I know what I am doing.', 'wp-optimize'); ?></label> | |
| 53 | 59 | </p> |
| 54 | 60 | <p> |
| 55 | - <input type="checkbox" id="ignores_table_delete_warning"> <?php _e('Do not show this warning again.', 'wp-optimize'); ?> | |
| 61 | + <label for="ignores_table_deletion_warning"><input type="checkbox" id="ignores_table_deletion_warning"> <?php esc_html_e('Do not show this warning again.', 'wp-optimize'); ?></label> | |
| 56 | 62 | </p> |
| 57 | - <button type="button" class="button button-primary delete-table" disabled><?php _e('Remove the table', 'wp-optimize'); ?></button> | |
| 58 | - <button type="button" class="button cancel wpo-modal--close"><?php _e('Cancel', 'wp-optimize'); ?></button> | |
| 63 | + <button type="button" class="button button-primary delete-table" disabled><?php esc_html_e('Remove the table', 'wp-optimize'); ?></button> | |
| 64 | + <button type="button" class="button cancel wpo-modal--close"><?php esc_html_e('Cancel', 'wp-optimize'); ?></button> | |
| 59 | 65 | </script> |