From 600f7297c65191748894073d59d6b976dd431f1c Mon Sep 17 00:00:00 2001 From: dashaluna Date: Fri, 5 Aug 2016 12:31:26 +0100 Subject: [PATCH 1/6] Added escaping and translator notes to the strings in /admin folder --- admin/actions.php | 40 ++++++++++++++- admin/backups-table.php | 8 +-- admin/backups.php | 2 +- admin/enable-support.php | 15 ++++-- admin/menu.php | 2 +- admin/schedule-sentence.php | 97 ++++++++++++++++++++++++++++++------- admin/upsell.php | 14 ++++-- 7 files changed, 144 insertions(+), 34 deletions(-) diff --git a/admin/actions.php b/admin/actions.php index 4da7eb3a..a3975a07 100755 --- a/admin/actions.php +++ b/admin/actions.php @@ -635,13 +635,49 @@ function ajax_cron_test() { if ( is_wp_error( $response1 ) && is_wp_error( $response2 ) && is_wp_error( $response3 ) ) { - echo '

' . __( 'BackUpWordPress has detected a problem.', 'backupwordpress' ) . ' ' . sprintf( __( '%1$s is returning a %2$s response which could mean cron jobs aren\'t getting fired properly. BackUpWordPress relies on wp-cron to run scheduled backups. See the %3$s for more details.', 'backupwordpress' ), 'wp-cron.php', '' . $response1->get_error_message() . '', 'FAQ' ) . '

'; + echo '

'; + + printf( + wp_kses( + /* translators: 1: wp-cron.php 2: Error messages 3: URL to plugin's FAQ page in wordpress.org plugin directory */ + __( 'BackUpWordPress has detected a problem. %1$s is returning a %2$s response which could mean cron jobs aren\'t getting fired properly. BackUpWordPress relies on wp-cron to run scheduled backups. See the FAQ for more details.', 'backupwordpress' ), + array( + 'strong', + 'a' => array( + 'href' => array(), + ), + ) + ), + 'wp-cron.php', + '' . esc_html( $response1->get_error_message() ) . '', + 'http://wordpress.org/extend/plugins/backupwordpress/faq/' + ); + + echo '

'; update_option( 'hmbkp_wp_cron_test_failed', true ); } elseif ( ! in_array( 200, array_map( 'wp_remote_retrieve_response_code', array( $response1, $response2, $response3 ) ) ) ) { - echo '

' . __( 'BackUpWordPress has detected a problem.', 'backupwordpress' ) . ' ' . sprintf( __( '%1$s is returning a %2$s response which could mean cron jobs aren\'t getting fired properly. BackUpWordPress relies on wp-cron to run scheduled backups, and more generally relies on HTTP loopback connections not being blocked for manual backups. See the %3$s for more details.', 'backupwordpress' ), 'wp-cron.php', '' . esc_html( wp_remote_retrieve_response_code( $response1 ) ) . ' ' . esc_html( get_status_header_desc( wp_remote_retrieve_response_code( $response1 ) ) ) . '', 'FAQ' ) . '

'; + echo '

'; + + printf( + wp_kses( + /* translators: 1: wp-cron.php 2: Error messages 3: URL to plugin's FAQ page in wordpress.org plugin directory */ + __( 'BackUpWordPress has detected a problem. %1$s is returning a %2$s response which could mean cron jobs aren\'t getting fired properly. BackUpWordPress relies on wp-cron to run scheduled backups, and more generally relies on HTTP loopback connections not being blocked for manual backups. See the FAQ for more details.', 'backupwordpress' ), + array( + 'strong', + 'a' => array( + 'href' => array(), + ), + ) + ), + 'wp-cron.php', + '' . esc_html( wp_remote_retrieve_response_code( $response1 ) . ' ' . get_status_header_desc( wp_remote_retrieve_response_code( $response1 ) ) ) . '', + 'http://wordpress.org/extend/plugins/backupwordpress/faq/' + ); + + echo '

'; update_option( 'hmbkp_wp_cron_test_failed', true ); diff --git a/admin/backups-table.php b/admin/backups-table.php index 9b6c243b..1b36cd0c 100644 --- a/admin/backups-table.php +++ b/admin/backups-table.php @@ -11,9 +11,9 @@ - - - + + + @@ -38,7 +38,7 @@ else : ?> - + diff --git a/admin/backups.php b/admin/backups.php index 0a92aaee..a858ba82 100644 --- a/admin/backups.php +++ b/admin/backups.php @@ -23,7 +23,7 @@ -
  • +
  • +
  • +
  • diff --git a/admin/enable-support.php b/admin/enable-support.php index f72e0ebb..84f51ce8 100644 --- a/admin/enable-support.php +++ b/admin/enable-support.php @@ -1,8 +1,13 @@ -

    +

    -

    Intercom' ); ?>

    +

    Intercom' + ); ?> +

    @@ -55,7 +60,7 @@
    -

    +

    - - + + diff --git a/admin/menu.php b/admin/menu.php index ee8259ac..38f71093 100644 --- a/admin/menu.php +++ b/admin/menu.php @@ -52,7 +52,7 @@ function extensions() { function plugin_action_link( $links, $file ) { if ( false !== strpos( $file, HMBKP_PLUGIN_SLUG ) ) { - array_push( $links, '' . __( 'Backups', 'backupwordpress' ) . '' ); + array_push( $links, '' . esc_html__( 'Backups', 'backupwordpress' ) . '' ); } return $links; diff --git a/admin/schedule-sentence.php b/admin/schedule-sentence.php index 6a263d83..7c731d0c 100644 --- a/admin/schedule-sentence.php +++ b/admin/schedule-sentence.php @@ -11,7 +11,13 @@ $day = date_i18n( 'l', $schedule->get_next_occurrence( false ) ); // Next Backup -$next_backup = 'title="' . esc_attr( sprintf( __( 'The next backup will be on %1$s at %2$s %3$s', 'backupwordpress' ), date_i18n( get_option( 'date_format' ), $schedule->get_next_occurrence( false ) ), date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ), date_i18n( 'T', $schedule->get_next_occurrence( false ) ) ) ) . '"'; +$next_backup = 'title="' . esc_attr( sprintf( + /* translators: 1: Date 2: Time 3: Timezone abbreviation. Eg., EST, MDT */ + __( 'The next backup will be on %1$s at %2$s %3$s', 'backupwordpress' ), + date_i18n( get_option( 'date_format' ), $schedule->get_next_occurrence( false ) ), + date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ), + date_i18n( 'T', $schedule->get_next_occurrence( false ) ) + ) ) . '"'; // Backup status $status = new Backup_Status( $schedule->get_id() ); @@ -21,13 +27,23 @@ case 'hourly' : - $reoccurrence = date_i18n( 'i', $schedule->get_next_occurrence( false ) ) === '00' ? '' . __( 'hourly on the hour', 'backupwordpress' ) . '' : sprintf( __( 'hourly at %s minutes past the hour', 'backupwordpress' ), '' . intval( date_i18n( 'i', $schedule->get_next_occurrence( false ) ) ) ) . ''; + $reoccurrence = date_i18n( 'i', $schedule->get_next_occurrence( false ) ) === '00' + ? '' . esc_html__( 'hourly on the hour', 'backupwordpress' ) . '' + : sprintf( + /* translators: Number of minutes */ + esc_html__( 'hourly at %s minutes past the hour', 'backupwordpress' ), + '' . esc_html( intval( date_i18n( 'i', $schedule->get_next_occurrence( false ) ) ) ) . '' + ); break; case 'daily' : - $reoccurrence = sprintf( __( 'daily at %s', 'backupwordpress' ), '' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '' ); + $reoccurrence = sprintf( + /* translators: Time */ + esc_html__( 'daily at %s', 'backupwordpress' ), + '' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '' + ); break; @@ -38,42 +54,62 @@ sort( $times ); - $reoccurrence = sprintf( __( 'every 12 hours at %1$s & %2$s', 'backupwordpress' ), '' . esc_html( reset( $times ) ) . '', '' . esc_html( end( $times ) ) ) . ''; + $reoccurrence = sprintf( + /* translators: 1: First time the back up runs 2: Second time backup runs */ + esc_html__( 'every 12 hours at %1$s & %2$s', 'backupwordpress' ), + '' . esc_html( reset( $times ) ) . '', + '' . esc_html( end( $times ) ) . '' + ); break; case 'weekly' : - $reoccurrence = sprintf( __( 'weekly on %1$s at %2$s', 'backupwordpress' ), '' .esc_html( $day ) . '', '' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '' ); + $reoccurrence = sprintf( + /* translators: 1: Full name of the week day, eg. Monday 2: Time */ + esc_html__( 'weekly on %1$s at %2$s', 'backupwordpress' ), + '' . esc_html( $day ) . '', + '' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '' + ); break; case 'fortnightly' : - $reoccurrence = sprintf( __( 'every two weeks on %1$s at %2$s', 'backupwordpress' ), '' . $day . '', '' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '' ); + $reoccurrence = sprintf( + /* translators: 1: Full name of the week day, eg. Monday 2: Time */ + esc_html__( 'every two weeks on %1$s at %2$s', 'backupwordpress' ), + '' . esc_html( $day ) . '', + '' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '' + ); break; case 'monthly' : - $reoccurrence = sprintf( __( 'on the %1$s of each month at %2$s', 'backupwordpress' ), '' . esc_html( date_i18n( 'jS', $schedule->get_next_occurrence( false ) ) ) . '', '' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '' ); + $reoccurrence = sprintf( + /* translators: 1: Ordinal number of a day of a month, eg. 1st, 10th 2: Time */ + esc_html__( 'on the %1$s of each month at %2$s', 'backupwordpress' ), + '' . esc_html( date_i18n( 'jS', $schedule->get_next_occurrence( false ) ) ) . '', + '' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '' + ); break; case 'manually' : - $reoccurrence = __( 'manually', 'backupwordpress' ); + $reoccurrence = esc_html__( 'manually', 'backupwordpress' ); break; default : - $reoccurrence = __( 'manually', 'backupwordpress' ); + $reoccurrence = esc_html__( 'manually', 'backupwordpress' ); $schedule->set_reoccurrence( 'manually' ); endswitch; -$server = '' . __( 'this server', 'backupwordpress' ) . ''; +$server = '' . esc_html__( 'this server', 'backupwordpress' ) . ''; $server = '' . esc_attr( str_replace( Path::get_home_path(), '', Path::get_path() ) ) . ''; // Backup to keep @@ -81,19 +117,24 @@ case 1 : - $backup_to_keep = sprintf( __( 'store the most recent backup in %s', 'backupwordpress' ), $server ); + $backup_to_keep = sprintf( esc_html__( 'store the most recent backup in %s', 'backupwordpress' ), $server ); break; case 0 : - $backup_to_keep = sprintf( __( 'don\'t store any backups in on this server', 'backupwordpress' ), Path::get_path() ); + $backup_to_keep = sprintf( esc_html__( 'don\'t store any backups in on this server', 'backupwordpress' ), Path::get_path() ); break; default : - $backup_to_keep = sprintf( __( 'store the last %1$s backups in %2$s', 'backupwordpress' ), esc_html( $schedule->get_max_backups() ), $server ); + $backup_to_keep = sprintf( + /* translators: 1: The number of backups to store 2: Path on a server */ + esc_html__( 'store the last %1$s backups in %2$s', 'backupwordpress' ), + esc_html( $schedule->get_max_backups() ), + $server + ); endswitch; @@ -118,14 +159,25 @@
    - ' . esc_html( $type ) . '', $filesize, $reoccurrence, $backup_to_keep ); + ' . esc_html( $type ) . '', + $filesize, + $reoccurrence, + $backup_to_keep + ); if ( $email_msg ) { $sentence .= ' ' . $email_msg; } if ( $services ) { - $sentence .= ' ' . sprintf( __( 'Send a copy of each backup to %s.', 'backupwordpress' ), implode( ', ', $services ) ); + $sentence .= ' ' . sprintf( + /* translators: List of available services for storing backups */ + esc_html__( 'Send a copy of each backup to %s.', 'backupwordpress' ), + implode( ', ', $services ) + ); } echo $sentence; ?> @@ -157,9 +209,20 @@ function get_site_size_text( Scheduled_Backup $schedule ) { $site_size = new Site_Size( $schedule->get_type(), $schedule->get_excludes() ); if ( ( 'database' === $schedule->get_type() ) || $site_size->is_site_size_cached() ) { - return sprintf( '(%s)', esc_attr( $site_size->get_formatted_site_size() ) ); + + return sprintf( + '(%2$s)', + esc_attr__( 'Backups will be compressed and should be smaller than this.', 'backupwordpress' ), + esc_html( $site_size->get_formatted_site_size() ) + ); + } else { - return sprintf( '(' . __( 'calculating the size of your site…', 'backupwordpress' ) . ')' ); + + return sprintf( + '(%2$s)', + esc_attr__( 'this shouldn\'t take long…', 'backupwordpress' ), + esc_html__( 'calculating the size of your site…', 'backupwordpress' ) + ); } } diff --git a/admin/upsell.php b/admin/upsell.php index e2286dca..2d5b84c0 100644 --- a/admin/upsell.php +++ b/admin/upsell.php @@ -4,11 +4,17 @@

    ', - '' + wp_kses( + /* translators: Link to plugin's extensions page in WordPress admin */ + __( 'Store your backups securely in the Cloud with our extensions', 'backupwordpress' ), + array( + 'a' => array( + 'href' => array(), + ), + ) + ), + esc_url( get_settings_url( HMBKP_PLUGIN_SLUG . '_extensions' ) ) ); ?> From 24f2842f3514c5fbc957d2062c57588b4b74866a Mon Sep 17 00:00:00 2001 From: mikeselander Date: Tue, 10 Jan 2017 18:03:17 +0100 Subject: [PATCH 2/6] Added escaping around sprintf statements instead of inside of them --- admin/actions.php | 10 +- admin/schedule-sentence.php | 190 ++++++++++++++++++++++++++---------- 2 files changed, 143 insertions(+), 57 deletions(-) diff --git a/admin/actions.php b/admin/actions.php index 6cfc23a4..778760aa 100755 --- a/admin/actions.php +++ b/admin/actions.php @@ -640,8 +640,9 @@ function ajax_cron_test() { /* translators: 1: wp-cron.php 2: Error messages 3: URL to plugin's FAQ page in wordpress.org plugin directory */ __( 'BackUpWordPress has detected a problem. %1$s is returning a %2$s response which could mean cron jobs aren\'t getting fired properly. BackUpWordPress relies on wp-cron to run scheduled backups. See the FAQ for more details.', 'backupwordpress' ), array( - 'strong', - 'a' => array( + 'strong' => array(), + 'code' => array(), + 'a' => array( 'href' => array(), ), ) @@ -664,8 +665,9 @@ function ajax_cron_test() { /* translators: 1: wp-cron.php 2: Error messages 3: URL to plugin's FAQ page in wordpress.org plugin directory */ __( 'BackUpWordPress has detected a problem. %1$s is returning a %2$s response which could mean cron jobs aren\'t getting fired properly. BackUpWordPress relies on wp-cron to run scheduled backups, and more generally relies on HTTP loopback connections not being blocked for manual backups. See the FAQ for more details.', 'backupwordpress' ), array( - 'strong', - 'a' => array( + 'strong' => array(), + 'code' => array(), + 'a' => array( 'href' => array(), ), ) diff --git a/admin/schedule-sentence.php b/admin/schedule-sentence.php index 2374a9f0..b9238eab 100644 --- a/admin/schedule-sentence.php +++ b/admin/schedule-sentence.php @@ -29,20 +29,34 @@ $reoccurrence = date_i18n( 'i', $schedule->get_next_occurrence( false ) ) === '00' ? '' . esc_html__( 'hourly on the hour', 'backupwordpress' ) . '' - : sprintf( - /* translators: Number of minutes */ - esc_html__( 'hourly at %s minutes past the hour', 'backupwordpress' ), - '' . esc_html( intval( date_i18n( 'i', $schedule->get_next_occurrence( false ) ) ) ) . '' + : wp_kses( + sprintf( + /* translators: Number of minutes */ + __( 'hourly at %s minutes past the hour', 'backupwordpress' ), + '' . esc_html( intval( date_i18n( 'i', $schedule->get_next_occurrence( false ) ) ) ) . '' + ), + array( + 'span' => array( + 'title' => array(), + ) + ) ); break; case 'daily' : - $reoccurrence = sprintf( - /* translators: Time */ - esc_html__( 'daily at %s', 'backupwordpress' ), - '' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '' + $reoccurrence = wp_kses( + sprintf( + /* translators: Time */ + __( 'daily at %s', 'backupwordpress' ), + '' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '' + ), + array( + 'span' => array( + 'title' => array(), + ) + ) ); break; @@ -54,44 +68,72 @@ sort( $times ); - $reoccurrence = sprintf( - /* translators: 1: First time the back up runs 2: Second time backup runs */ - esc_html__( 'every 12 hours at %1$s & %2$s', 'backupwordpress' ), - '' . esc_html( reset( $times ) ) . '', - '' . esc_html( end( $times ) ) . '' + $reoccurrence = wp_kses( + sprintf( + /* translators: 1: First time the back up runs 2: Second time backup runs */ + __( 'every 12 hours at %1$s & %2$s', 'backupwordpress' ), + '' . esc_html( reset( $times ) ) . '', + '' . esc_html( end( $times ) ) . '' + ), + array( + 'span' => array( + 'title' => array(), + ) + ) ); break; case 'weekly' : - $reoccurrence = sprintf( - /* translators: 1: Full name of the week day, eg. Monday 2: Time */ - esc_html__( 'weekly on %1$s at %2$s', 'backupwordpress' ), - '' . esc_html( $day ) . '', - '' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '' + $reoccurrence = wp_kses( + sprintf( + /* translators: 1: Full name of the week day, eg. Monday 2: Time */ + __( 'weekly on %1$s at %2$s', 'backupwordpress' ), + '' . esc_html( $day ) . '', + '' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '' + ), + array( + 'span' => array( + 'title' => array(), + ) + ) ); break; case 'fortnightly' : - $reoccurrence = sprintf( - /* translators: 1: Full name of the week day, eg. Monday 2: Time */ - esc_html__( 'every two weeks on %1$s at %2$s', 'backupwordpress' ), - '' . esc_html( $day ) . '', - '' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '' + $reoccurrence = wp_kses( + sprintf( + /* translators: 1: Full name of the week day, eg. Monday 2: Time */ + __( 'every two weeks on %1$s at %2$s', 'backupwordpress' ), + '' . esc_html( $day ) . '', + '' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '' + ), + array( + 'span' => array( + 'title' => array(), + ) + ) ); break; case 'monthly' : - $reoccurrence = sprintf( - /* translators: 1: Ordinal number of a day of a month, eg. 1st, 10th 2: Time */ - esc_html__( 'on the %1$s of each month at %2$s', 'backupwordpress' ), - '' . esc_html( date_i18n( 'jS', $schedule->get_next_occurrence( false ) ) ) . '', - '' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '' + $reoccurrence = wp_kses( + sprintf( + /* translators: 1: Ordinal number of a day of a month, eg. 1st, 10th 2: Time */ + __( 'on the %1$s of each month at %2$s', 'backupwordpress' ), + '' . esc_html( date_i18n( 'jS', $schedule->get_next_occurrence( false ) ) ) . '', + '' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '' + ), + array( + 'span' => array( + 'title' => array(), + ) + ) ); break; @@ -116,23 +158,40 @@ case 1 : - $backup_to_keep = sprintf( esc_html__( 'store the most recent backup in %s', 'backupwordpress' ), $server ); + $backup_to_keep = wp_kses( + sprintf( + __( 'store the most recent backup in %s', 'backupwordpress' ), + $server + ), + array( + 'code' => array( + 'title' => array(), + ) + ) + ); break; case 0 : - $backup_to_keep = sprintf( esc_html__( 'don\'t store any backups in on this server', 'backupwordpress' ), Path::get_path() ); + $backup_to_keep = esc_html__( 'don\'t store any backups in on this server', 'backupwordpress' ); break; default : - $backup_to_keep = sprintf( - /* translators: 1: The number of backups to store 2: Path on a server */ - esc_html__( 'store the last %1$s backups in %2$s', 'backupwordpress' ), - esc_html( $schedule->get_max_backups() ), - $server + $backup_to_keep = wp_kses( + sprintf( + /* translators: 1: The number of backups to store 2: Path on a server */ + __( 'store the last %1$s backups in %2$s', 'backupwordpress' ), + esc_html( $schedule->get_max_backups() ), + $server + ), + array( + 'code' => array( + 'title' => array(), + ) + ) ); endswitch; @@ -158,13 +217,23 @@

    - ' . esc_html( $type ) . '', - $filesize, - $reoccurrence, - $backup_to_keep + ' . esc_html( $type ) . '', + $filesize, + $reoccurrence, + $backup_to_keep + ), + array( + 'span' => array( + 'title' => array(), + ), + 'code' => array( + 'title' => array(), + ), + ) ); if ( $email_msg ) { @@ -172,11 +241,11 @@ } if ( ! empty( $services ) ) { - $sentence .= ' ' . sprintf( + $sentence .= ' ' . esc_html( sprintf( /* translators: List of available services for storing backups */ - esc_html__( 'Send a copy of each backup to %s.', 'backupwordpress' ), + __( 'Send a copy of each backup to %s.', 'backupwordpress' ), implode( ', ', $services ) - ); + ) ); } echo $sentence; ?> @@ -209,18 +278,33 @@ function get_site_size_text( Scheduled_Backup $schedule ) { if ( ( 'database' === $schedule->get_type() ) || $site_size->is_site_size_cached() ) { - return sprintf( - '(%2$s)', - esc_attr__( 'Backups will be compressed and should be smaller than this.', 'backupwordpress' ), - esc_html( $site_size->get_formatted_site_size() ) + return wp_kses( + sprintf( + '(%2$s)', + __( 'Backups will be compressed and should be smaller than this.', 'backupwordpress' ), + esc_html( $site_size->get_formatted_site_size() ) + ), + array( + 'code' => array( + 'title' => array(), + ) + ) ); } else { - return sprintf( - '(%2$s)', - esc_attr__( 'this shouldn\'t take long…', 'backupwordpress' ), - esc_html__( 'calculating the size of your site…', 'backupwordpress' ) + return wp_kses( + sprintf( + '(%2$s)', + esc_attr__( 'this shouldn\'t take long…', 'backupwordpress' ), + __( 'calculating the size of your site…', 'backupwordpress' ) + ), + array( + 'code' => array( + 'class' => array(), + 'title' => array(), + ) + ) ); } } From 56308cb3299c733af3a5ef5498a2ba96214d29ec Mon Sep 17 00:00:00 2001 From: mikeselander Date: Tue, 10 Jan 2017 18:15:18 +0100 Subject: [PATCH 3/6] Added esc_* to all _e function calls --- admin/constants.php | 14 +++++++------- admin/page.php | 4 ++-- admin/schedule-form.php | 26 +++++++++++++------------- admin/schedule-settings.php | 8 ++++---- classes/class-email-service.php | 4 ++-- functions/interface.php | 8 ++++---- 6 files changed, 32 insertions(+), 32 deletions(-) diff --git a/admin/constants.php b/admin/constants.php index 330e47ef..14abe573 100644 --- a/admin/constants.php +++ b/admin/constants.php @@ -20,7 +20,7 @@

    ' . esc_html( HMBKP_PATH ) . '' ); ?>

    -

    ' . esc_html( Path::get_path() ) . '' ); ?> define( 'HMBKP_PATH', '/home/willmot/backups' );

    +

    ' . esc_html( Path::get_path() ) . '' ); ?> define( 'HMBKP_PATH', '/home/willmot/backups' );

    @@ -36,7 +36,7 @@

    ' . esc_html( HMBKP_MYSQLDUMP_PATH ) . '' ); ?>

    -

    mysqldump', '' . __( 'database', 'backupwordpress' ) . '' ); ?> define( 'HMBKP_MYSQLDUMP_PATH', '/opt/local/bin/mysqldump' );

    +

    mysqldump', '' . __( 'database', 'backupwordpress' ) . '' ); ?> define( 'HMBKP_MYSQLDUMP_PATH', '/opt/local/bin/mysqldump' );

    @@ -52,7 +52,7 @@

    ' . esc_html( HMBKP_ZIP_PATH ) . '' ); ?>

    -

    zip', '' . __( 'files', 'backupwordpress' ) . '', '' . __( 'database', 'backupwordpress' ) . '' ); ?> define( 'HMBKP_ZIP_PATH', '/opt/local/bin/zip' );

    +

    zip', '' . __( 'files', 'backupwordpress' ) . '', '' . __( 'database', 'backupwordpress' ) . '' ); ?> define( 'HMBKP_ZIP_PATH', '/opt/local/bin/zip' );

    @@ -68,7 +68,7 @@

    ' . esc_html( HMBKP_EXCLUDE ) . '' ); ?>

    -

    define( 'HMBKP_EXCLUDE', '/wp-content/uploads/, /stats/, .svn/, *.txt' );

    +

    define( 'HMBKP_EXCLUDE', '/wp-content/uploads/, /stats/, .svn/, *.txt' );

    @@ -84,7 +84,7 @@

    ' . esc_html( HMBKP_CAPABILITY ) . '' ); ?>

    -

    add_menu_page', 'manage_options' ); ?> define( 'HMBKP_CAPABILITY', 'edit_posts' );

    +

    add_menu_page', 'manage_options' ); ?> define( 'HMBKP_CAPABILITY', 'edit_posts' );

    @@ -100,7 +100,7 @@

    ' . esc_html( HMBKP_ROOT ) . '' ); ?>

    -

    ' . Path::get_home_path() . '' ); ?> define( 'HMBKP_ROOT', ABSPATH . 'wp/' );

    +

    ' . Path::get_home_path() . '' ); ?> define( 'HMBKP_ROOT', ABSPATH . 'wp/' );

    @@ -116,7 +116,7 @@

    ' . esc_html( HMBKP_SCHEDULE_TIME ) . '' ); ?>

    -

    23:00' ); ?> define( 'HMBKP_SCHEDULE_TIME', '07:30' );

    +

    23:00' ); ?> define( 'HMBKP_SCHEDULE_TIME', '07:30' );

    diff --git a/admin/page.php b/admin/page.php index 2262cb13..254f2913 100755 --- a/admin/page.php +++ b/admin/page.php @@ -14,12 +14,12 @@ - + -   +   diff --git a/admin/schedule-form.php b/admin/schedule-form.php index 4a79ca98..231b6b8b 100644 --- a/admin/schedule-form.php +++ b/admin/schedule-form.php @@ -39,18 +39,18 @@ - + @@ -61,14 +61,14 @@ - + - + +

    - +

    @@ -168,7 +168,7 @@ - + diff --git a/admin/schedule-settings.php b/admin/schedule-settings.php index 523bd256..a606ea1f 100644 --- a/admin/schedule-settings.php +++ b/admin/schedule-settings.php @@ -8,17 +8,17 @@ - | + | - | + | get_type() ) : ?> - | + | - +
    diff --git a/classes/class-email-service.php b/classes/class-email-service.php index 51987c9d..a223b40d 100644 --- a/classes/class-email-service.php +++ b/classes/class-email-service.php @@ -27,7 +27,7 @@ public function field() { - + @@ -64,7 +64,7 @@ public static function constant() {

    ' . HMBKP_ATTACHMENT_MAX_FILESIZE . '' ); ?>

    -

    10MB' ); ?> define( 'HMBKP_ATTACHMENT_MAX_FILESIZE', '25MB' );

    +

    10MB' ); ?> define( 'HMBKP_ATTACHMENT_MAX_FILESIZE', '25MB' );

    diff --git a/functions/interface.php b/functions/interface.php index 57b512bf..c5929873 100644 --- a/functions/interface.php +++ b/functions/interface.php @@ -30,10 +30,10 @@ function get_backup_row( $file, Scheduled_Backup $schedule ) { - | + | - + @@ -72,7 +72,7 @@ function admin_notices() {

    - +

      @@ -265,7 +265,7 @@ function schedule_status( Scheduled_Backup $schedule, $echo = true ) { get_status() ) { ?> title="get_start_time() ) ); ?>"> get_status() ? wp_kses_data( $status->get_status() ) : __( 'Starting backup...', 'backupwordpress' ); ?> - + Date: Wed, 11 Jan 2017 11:10:37 +0100 Subject: [PATCH 4/6] Went through the __ translations --- admin/actions.php | 2 +- admin/constants.php | 26 +++++++-------- admin/faq.php | 65 ++++++++++++++++++------------------- admin/page.php | 2 +- admin/schedule-form.php | 4 +-- admin/schedule-sentence.php | 2 +- classes/class-setup.php | 2 +- functions/core.php | 2 +- 8 files changed, 51 insertions(+), 54 deletions(-) diff --git a/admin/actions.php b/admin/actions.php index 778760aa..6ff1aa54 100755 --- a/admin/actions.php +++ b/admin/actions.php @@ -185,7 +185,7 @@ function edit_schedule_services_submit() { check_admin_referer( 'hmbkp-edit-schedule-services', 'hmbkp-edit-schedule-services-nonce' ); if ( empty( $_POST['hmbkp_schedule_id'] ) ) { - wp_die( __( 'The schedule ID was not provided. Aborting.', 'backupwordpress' ) ); + wp_die( esc_html__( 'The schedule ID was not provided. Aborting.', 'backupwordpress' ) ); } $schedule = new Scheduled_Backup( sanitize_text_field( $_POST['hmbkp_schedule_id'] ) ); diff --git a/admin/constants.php b/admin/constants.php index 14abe573..b1b6858b 100644 --- a/admin/constants.php +++ b/admin/constants.php @@ -17,10 +17,10 @@ -

      ' . esc_html( HMBKP_PATH ) . '' ); ?>

      +

      ' . esc_html( HMBKP_PATH ) . '' ) ); ?>

      -

      ' . esc_html( Path::get_path() ) . '' ); ?> define( 'HMBKP_PATH', '/home/willmot/backups' );

      +

      ' . esc_html( Path::get_path() ) . '' ) ); ?> define( 'HMBKP_PATH', '/home/willmot/backups' );

      @@ -33,10 +33,10 @@ -

      ' . esc_html( HMBKP_MYSQLDUMP_PATH ) . '' ); ?>

      +

      ' . esc_html( HMBKP_MYSQLDUMP_PATH ) . '' ) ); ?>

      -

      mysqldump', '' . __( 'database', 'backupwordpress' ) . '' ); ?> define( 'HMBKP_MYSQLDUMP_PATH', '/opt/local/bin/mysqldump' );

      +

      mysqldump', '' . __( 'database', 'backupwordpress' ) . '' ) ); ?> define( 'HMBKP_MYSQLDUMP_PATH', '/opt/local/bin/mysqldump' );

      @@ -49,10 +49,10 @@ -

      ' . esc_html( HMBKP_ZIP_PATH ) . '' ); ?>

      +

      ' . esc_html( HMBKP_ZIP_PATH ) . '' ) ); ?>

      -

      zip', '' . __( 'files', 'backupwordpress' ) . '', '' . __( 'database', 'backupwordpress' ) . '' ); ?> define( 'HMBKP_ZIP_PATH', '/opt/local/bin/zip' );

      +

      zip', '' . __( 'files', 'backupwordpress' ) . '', '' . __( 'database', 'backupwordpress' ) . '' ) ); ?> define( 'HMBKP_ZIP_PATH', '/opt/local/bin/zip' );

      @@ -65,7 +65,7 @@ -

      ' . esc_html( HMBKP_EXCLUDE ) . '' ); ?>

      +

      ' . esc_html( HMBKP_EXCLUDE ) . '' ) ); ?>

      define( 'HMBKP_EXCLUDE', '/wp-content/uploads/, /stats/, .svn/, *.txt' );

      @@ -81,10 +81,10 @@ -

      ' . esc_html( HMBKP_CAPABILITY ) . '' ); ?>

      +

      ' . esc_html( HMBKP_CAPABILITY ) . '' ) ); ?>

      -

      add_menu_page', 'manage_options' ); ?> define( 'HMBKP_CAPABILITY', 'edit_posts' );

      +

      add_menu_page', 'manage_options' ) ); ?> define( 'HMBKP_CAPABILITY', 'edit_posts' );

      @@ -97,10 +97,10 @@ -

      ' . esc_html( HMBKP_ROOT ) . '' ); ?>

      +

      ' . esc_html( HMBKP_ROOT ) . '' ) ); ?>

      -

      ' . Path::get_home_path() . '' ); ?> define( 'HMBKP_ROOT', ABSPATH . 'wp/' );

      +

      ' . Path::get_home_path() . '' ) ); ?> define( 'HMBKP_ROOT', ABSPATH . 'wp/' );

      @@ -113,10 +113,10 @@ -

      ' . esc_html( HMBKP_SCHEDULE_TIME ) . '' ); ?>

      +

      ' . esc_html( HMBKP_SCHEDULE_TIME ) . '' ) ); ?>

      -

      23:00' ); ?> define( 'HMBKP_SCHEDULE_TIME', '07:30' );

      +

      23:00' ) ); ?> define( 'HMBKP_SCHEDULE_TIME', '07:30' );

      diff --git a/admin/faq.php b/admin/faq.php index 187b729f..f8c584e0 100644 --- a/admin/faq.php +++ b/admin/faq.php @@ -1,58 +1,55 @@ -' . __( 'Where does BackUpWordPress store the backup files?', 'backupwordpress' ) . '

      ' . +

      - '

      ' . __( 'Backups are stored on your server in /wp-content/backups, you can change the directory.', 'backupwordpress' ). '

      ' . +

      /wp-content/backups, you can change the directory.', 'backupwordpress' ) ); ?>

      - '

      ' . __( 'Important: By default BackUpWordPress backs up everything in your site root as well as your database, this includes any non WordPress folders that happen to be in your site root. This does mean that your backup directory can get quite large.', 'backupwordpress' ) . '

      ' . +

      - '

      ' . __( 'What if I want to back up my site to another destination?', 'backupwordpress' ) . '

      ' . +

      - '

      ' . __( 'BackUpWordPress Pro supports Dropbox, Google Drive, Amazon S3, Rackspace, Azure, DreamObjects and FTP/SFTP. Check it out here: https://bwp.hmn.md', 'backupwordpress' ) . '

      ' . +

      https://bwp.hmn.md', 'backupwordpress' ) ); ?>

      - '

      ' . __( 'How do I restore my site from a backup?', 'backupwordpress' ) . '

      ' . +

      - '

      ' . __( 'You need to download the latest backup file either by clicking download on the backups page or via FTP. Unzip the files and upload all the files to your server overwriting your site. You can then import the database using your hosts database management tool (likely phpMyAdmin).', 'backupwordpress' ) . '

      ' . +

      FTP. Unzip the files and upload all the files to your server overwriting your site. You can then import the database using your hosts database management tool (likely phpMyAdmin).', 'backupwordpress' ) ); ?>

      - '

      ' . __( 'See this guide for more details - How to restore from backup.', 'backupwordpress' ) . '

      ' . +

      How to restore from backup.', 'backupwordpress' ) ); ?>

      - '

      ' . __( 'Does BackUpWordPress back up the backups directory?', 'backupwordpress' ) . '

      ' . +

      - '

      ' . __( 'No.', 'backupwordpress' ) . '

      ' . +

      - '

      ' . __( 'I\'m not receiving my backups by email', 'backupwordpress' ) . '

      ' . +

      - '

      ' . __( 'Most servers have a filesize limit on email attachments, it\'s generally about 10mb. If your backup file is over that limit, it won\'t be sent attached to the email. Instead, you should receive an email with a link to download the backup. If you aren\'t even receiving that, then you likely have a mail issue on your server that you\'ll need to contact your host about.', 'backupwordpress' ) . '

      ' . +

      - '

      ' . __( 'How many backups are stored by default?', 'backupwordpress' ) . '

      ' . +

      - '

      ' . __( 'BackUpWordPress stores the last 10 backups by default.', 'backupwordpress' ) . '

      ' . +

      - '

      ' . __( 'How long should a backup take?', 'backupwordpress' ) . '

      ' . +

      - '

      ' . __( 'Unless your site is very large (many gigabytes) it should only take a few minutes to perform a backup. If your back up has been running for longer than an hour, it\'s safe to assume that something has gone wrong. Try de-activating and re-activating the plugin. If it keeps happening, contact support.', 'backupwordpress' ) . '

      ' . +

      - '

      ' . __( 'What do I do if I get the wp-cron error message?', 'backupwordpress' ) . '

      ' . +

      - '

      ' . __( 'The issue is that your wp-cron.php is not returning a 200 response when hit with a HTTP request originating from your own server, it could be several things. In most cases, it\'s an issue with the server / site.', 'backupwordpress' ) . '

      ' . +

      wp-cron.php is not returning a 200 response when hit with a HTTP request originating from your own server, it could be several things. In most cases, it\'s an issue with the server / site.', 'backupwordpress' ) ); ?>

      - '

      ' . __( 'There are some things you can test to confirm this is the issue.', 'backupwordpress' ) . '

      ' . +

      - '
      • ' . __( 'Are scheduled posts working? (They use wp-cron as well.)', 'backupwordpress' ) . '
      • ' . +
          +
        • +
        • +
        • +
        • define( \'ALTERNATE_WP_CRON\', true ); to your wp-config.php. Do automatic backups work?', 'backupwordpress' ) ); ?>
        • +
        • +
        - '
      • ' . __( 'Are you hosted on Heart Internet? (wp-cron may not be supported by Heart Internet, see below for work-around.)', 'backupwordpress' ) . '
      • ' . +

        - '
      • ' . __( 'If you click manual backup, does it work?', 'backupwordpress' ) . '
      • ' . +

        - '
      • ' . __( 'Try adding define( \'ALTERNATE_WP_CRON\', true ); to your wp-config.php. Do automatic backups work?', 'backupwordpress' ) . '
      • ' . +

        /usr/bin/php5 /home/sites/yourdomain.com/public_html/wp-cron.php (note the space between php5 and the location of the file). The file wp-cron.php chmod must be set to 711.', 'backupwordpress' ) ); ?>

        - '
      • ' . __( 'Is your site private (i.e. is it behind some kind of authentication, maintenance plugin, .htaccess)? If so, wp-cron won\'t work until you remove it. If you are and you temporarily remove the authentication, do backups start working?', 'backupwordpress' ) . '
      ' . +

      - '

      ' . __( 'Report the results to our support team for further help. To do this, either enable support from your Admin Dashboard (recommended), or email backupwordpress@hmn.md', 'backupwordpress' ) . '

      ' . - - '

      ' . __( 'How to get BackUpWordPress working in Heart Internet', 'backupwordpress' ) . '

      ' . - - '

      ' . __( 'The script to be entered into the Heart Internet cPanel is: /usr/bin/php5 /home/sites/yourdomain.com/public_html/wp-cron.php (note the space between php5 and the location of the file). The file wp-cron.php chmod must be set to 711.', 'backupwordpress' ) . '

      ' . - - '

      ' . __( 'My backups seem to be failing?', 'backupwordpress' ) . '

      ' . - - '

      ' . __( 'If your backups are failing, it\'s commonly caused by a lack of available resources on your server. To establish this is the case, exclude the complete (or parts of the) uploads folder and run a backup. If that succeeds, you know it\'s probably a server issue. If it does not succeed, report the results to our support team for further help. You can contact support by enabling support from your Admin Dashboard (recommended), or emailing backupwordpress@hmn.md', 'backupwordpress' ) . '

      '; +

      diff --git a/admin/page.php b/admin/page.php index 254f2913..3cf64539 100755 --- a/admin/page.php +++ b/admin/page.php @@ -27,7 +27,7 @@ -

      ', '' ); ?>

      +

      ', '' ) ); ?>

      diff --git a/admin/schedule-form.php b/admin/schedule-form.php index 231b6b8b..88c53c67 100644 --- a/admin/schedule-form.php +++ b/admin/schedule-form.php @@ -177,14 +177,14 @@

      - + get_type(), $schedule->get_excludes() ); if ( $site_size->is_site_size_cached() ) : - printf( __( 'This schedule will store a maximum of %s of backups.', 'backupwordpress' ), '' . esc_html( size_format( $site_size->get_site_size() * $schedule->get_max_backups() ) ) . '' ); + echo wp_kses_post( sprintf( __( 'This schedule will store a maximum of %s of backups.', 'backupwordpress' ), '' . esc_html( size_format( $site_size->get_site_size() * $schedule->get_max_backups() ) ) . '' ) ); endif; ?>

      diff --git a/admin/schedule-sentence.php b/admin/schedule-sentence.php index b9238eab..34984d33 100644 --- a/admin/schedule-sentence.php +++ b/admin/schedule-sentence.php @@ -151,7 +151,7 @@ endswitch; -$server = '' . esc_attr( str_replace( Path::get_home_path(), '', Path::get_path() ) ) . ''; +$server = '' . str_replace( Path::get_home_path(), '', Path::get_path() ) ) . ''; // Backup to keep switch ( $schedule->get_max_backups() ) : diff --git a/classes/class-setup.php b/classes/class-setup.php index a77c99eb..162da305 100644 --- a/classes/class-setup.php +++ b/classes/class-setup.php @@ -28,7 +28,7 @@ public static function activate() { if ( ! self::meets_requirements() ) { - wp_die( self::get_notice_message(), __( 'BackUpWordPress', 'backupwordpress' ), array( 'back_link' => true ) ); + wp_die( self::get_notice_message(), esc_html__( 'BackUpWordPress', 'backupwordpress' ), array( 'back_link' => true ) ); } diff --git a/functions/core.php b/functions/core.php index 8201614f..45bea264 100755 --- a/functions/core.php +++ b/functions/core.php @@ -328,7 +328,7 @@ function setup_default_schedules() { $schedules->refresh_schedules(); add_action( 'admin_notices', function() { - echo '

      ' . __( 'BackUpWordPress has set up your default schedules.', 'backupwordpress' ) . ' ' . __( 'By default BackUpWordPress performs a daily backup of your database and a weekly backup of your database & files. You can modify these schedules.', 'backupwordpress' ) . '

      '; + echo '

      ' . esc_html__( 'BackUpWordPress has set up your default schedules.', 'backupwordpress' ) . ' ' . esc_html__( 'By default BackUpWordPress performs a daily backup of your database and a weekly backup of your database & files. You can modify these schedules.', 'backupwordpress' ) . '

      '; } ); } From 7079772c7a6f2485850a2e96eedeadb28d0056e6 Mon Sep 17 00:00:00 2001 From: mikeselander Date: Wed, 11 Jan 2017 11:31:05 +0100 Subject: [PATCH 5/6] Eliminated redundant escaping and moved most instances of wp_kses_post to whitelist_html for greater specificty and easier use --- admin/constants.php | 26 +++--- admin/extensions.php | 11 +-- admin/faq.php | 16 ++-- admin/page.php | 2 +- admin/schedule-form.php | 2 +- admin/schedule-sentence.php | 167 ++++++++++-------------------------- admin/upsell.php | 15 ++-- 7 files changed, 79 insertions(+), 160 deletions(-) diff --git a/admin/constants.php b/admin/constants.php index b1b6858b..a51c49fa 100644 --- a/admin/constants.php +++ b/admin/constants.php @@ -17,10 +17,10 @@ -

      ' . esc_html( HMBKP_PATH ) . '' ) ); ?>

      +

      ' . esc_html( HMBKP_PATH ) . '' ), 'code' ); ?>

      -

      ' . esc_html( Path::get_path() ) . '' ) ); ?> define( 'HMBKP_PATH', '/home/willmot/backups' );

      +

      ' . esc_html( Path::get_path() ) . '' ), 'code' ); ?> define( 'HMBKP_PATH', '/home/willmot/backups' );

      @@ -33,10 +33,10 @@ -

      ' . esc_html( HMBKP_MYSQLDUMP_PATH ) . '' ) ); ?>

      +

      ' . esc_html( HMBKP_MYSQLDUMP_PATH ) . '' ), 'code' ); ?>

      -

      mysqldump', '' . __( 'database', 'backupwordpress' ) . '' ) ); ?> define( 'HMBKP_MYSQLDUMP_PATH', '/opt/local/bin/mysqldump' );

      +

      mysqldump', '' . __( 'database', 'backupwordpress' ) . '' ), 'code' ); ?> define( 'HMBKP_MYSQLDUMP_PATH', '/opt/local/bin/mysqldump' );

      @@ -49,10 +49,10 @@ -

      ' . esc_html( HMBKP_ZIP_PATH ) . '' ) ); ?>

      +

      ' . esc_html( HMBKP_ZIP_PATH ) . '' ), 'code' ); ?>

      -

      zip', '' . __( 'files', 'backupwordpress' ) . '', '' . __( 'database', 'backupwordpress' ) . '' ) ); ?> define( 'HMBKP_ZIP_PATH', '/opt/local/bin/zip' );

      +

      zip', '' . __( 'files', 'backupwordpress' ) . '', '' . __( 'database', 'backupwordpress' ) . '' ), 'code' ); ?> define( 'HMBKP_ZIP_PATH', '/opt/local/bin/zip' );

      @@ -65,7 +65,7 @@ -

      ' . esc_html( HMBKP_EXCLUDE ) . '' ) ); ?>

      +

      ' . esc_html( HMBKP_EXCLUDE ) . '' ), 'code' ); ?>

      define( 'HMBKP_EXCLUDE', '/wp-content/uploads/, /stats/, .svn/, *.txt' );

      @@ -81,10 +81,10 @@ -

      ' . esc_html( HMBKP_CAPABILITY ) . '' ) ); ?>

      +

      ' . esc_html( HMBKP_CAPABILITY ) . '' ), 'code' ); ?>

      -

      add_menu_page', 'manage_options' ) ); ?> define( 'HMBKP_CAPABILITY', 'edit_posts' );

      +

      add_menu_page', 'manage_options' ), 'code' ); ?> define( 'HMBKP_CAPABILITY', 'edit_posts' );

      @@ -97,10 +97,10 @@ -

      ' . esc_html( HMBKP_ROOT ) . '' ) ); ?>

      +

      ' . esc_html( HMBKP_ROOT ) . '' ), 'code' ); ?>

      -

      ' . Path::get_home_path() . '' ) ); ?> define( 'HMBKP_ROOT', ABSPATH . 'wp/' );

      +

      ' . Path::get_home_path() . '' ), 'code' ); ?> define( 'HMBKP_ROOT', ABSPATH . 'wp/' );

      @@ -113,10 +113,10 @@ -

      ' . esc_html( HMBKP_SCHEDULE_TIME ) . '' ) ); ?>

      +

      ' . esc_html( HMBKP_SCHEDULE_TIME ) . '' ), 'code' ); ?>

      -

      23:00' ) ); ?> define( 'HMBKP_SCHEDULE_TIME', '07:30' );

      +

      23:00' ), 'code' ); ?> define( 'HMBKP_SCHEDULE_TIME', '07:30' );

      diff --git a/admin/extensions.php b/admin/extensions.php index 22b13e69..ee71db3b 100644 --- a/admin/extensions.php +++ b/admin/extensions.php @@ -182,14 +182,11 @@ class="thickbox"
    - Last Updated: %s ago', 'backupwordpress' ), - array( - 'strong' => array(), - ) - ), - esc_html( human_time_diff( strtotime( $extension->modified ) ) ) + esc_html( human_time_diff( strtotime( $extension->modified ) ) ) + ), 'strong' ); ?>
    diff --git a/admin/faq.php b/admin/faq.php index f8c584e0..bb774eb2 100644 --- a/admin/faq.php +++ b/admin/faq.php @@ -1,18 +1,18 @@

    -

    /wp-content/backups, you can change the directory.', 'backupwordpress' ) ); ?>

    +

    /wp-content/backups, you can change the directory.', 'backupwordpress' ), 'code' ); ?>

    -

    https://bwp.hmn.md', 'backupwordpress' ) ); ?>

    +

    https://bwp.hmn.md', 'backupwordpress' ), 'a' ); ?>

    -

    FTP. Unzip the files and upload all the files to your server overwriting your site. You can then import the database using your hosts database management tool (likely phpMyAdmin).', 'backupwordpress' ) ); ?>

    +

    FTP. Unzip the files and upload all the files to your server overwriting your site. You can then import the database using your hosts database management tool (likely phpMyAdmin).', 'backupwordpress' ), 'code' ); ?>

    -

    How to restore from backup.', 'backupwordpress' ) ); ?>

    +

    How to restore from backup.', 'backupwordpress' ), 'a' ); ?>

    @@ -32,7 +32,7 @@

    -

    wp-cron.php is not returning a 200 response when hit with a HTTP request originating from your own server, it could be several things. In most cases, it\'s an issue with the server / site.', 'backupwordpress' ) ); ?>

    +

    wp-cron.php is not returning a 200 response when hit with a HTTP request originating from your own server, it could be several things. In most cases, it\'s an issue with the server / site.', 'backupwordpress' ), 'code' ); ?>

    @@ -40,15 +40,15 @@
  • -
  • define( \'ALTERNATE_WP_CRON\', true ); to your wp-config.php. Do automatic backups work?', 'backupwordpress' ) ); ?>
  • +
  • define( \'ALTERNATE_WP_CRON\', true ); to your wp-config.php. Do automatic backups work?', 'backupwordpress' ), 'a' ); ?>
  • -

    +

    -

    /usr/bin/php5 /home/sites/yourdomain.com/public_html/wp-cron.php (note the space between php5 and the location of the file). The file wp-cron.php chmod must be set to 711.', 'backupwordpress' ) ); ?>

    +

    /usr/bin/php5 /home/sites/yourdomain.com/public_html/wp-cron.php (note the space between php5 and the location of the file). The file wp-cron.php chmod must be set to 711.', 'backupwordpress' ), 'code' ); ?>

    diff --git a/admin/page.php b/admin/page.php index 3cf64539..804487b8 100755 --- a/admin/page.php +++ b/admin/page.php @@ -27,7 +27,7 @@ -

    ', '' ) ); ?>

    +

    ', '' ), 'a' ); ?>

    diff --git a/admin/schedule-form.php b/admin/schedule-form.php index 88c53c67..0f12aba9 100644 --- a/admin/schedule-form.php +++ b/admin/schedule-form.php @@ -184,7 +184,7 @@ $site_size = new Site_Size( $schedule->get_type(), $schedule->get_excludes() ); if ( $site_size->is_site_size_cached() ) : - echo wp_kses_post( sprintf( __( 'This schedule will store a maximum of %s of backups.', 'backupwordpress' ), '' . esc_html( size_format( $site_size->get_site_size() * $schedule->get_max_backups() ) ) . '' ) ); + echo whitelist_html( sprintf( __( 'This schedule will store a maximum of %s of backups.', 'backupwordpress' ), '' . esc_html( size_format( $site_size->get_site_size() * $schedule->get_max_backups() ) ) . '' ), 'code' ); endif; ?>

    diff --git a/admin/schedule-sentence.php b/admin/schedule-sentence.php index 34984d33..7b1b66ad 100644 --- a/admin/schedule-sentence.php +++ b/admin/schedule-sentence.php @@ -29,34 +29,20 @@ $reoccurrence = date_i18n( 'i', $schedule->get_next_occurrence( false ) ) === '00' ? '' . esc_html__( 'hourly on the hour', 'backupwordpress' ) . '' - : wp_kses( - sprintf( - /* translators: Number of minutes */ - __( 'hourly at %s minutes past the hour', 'backupwordpress' ), - '' . esc_html( intval( date_i18n( 'i', $schedule->get_next_occurrence( false ) ) ) ) . '' - ), - array( - 'span' => array( - 'title' => array(), - ) - ) + : sprintf( + /* translators: Number of minutes */ + __( 'hourly at %s minutes past the hour', 'backupwordpress' ), + '' . esc_html( intval( date_i18n( 'i', $schedule->get_next_occurrence( false ) ) ) ) . '' ); break; case 'daily' : - $reoccurrence = wp_kses( - sprintf( - /* translators: Time */ - __( 'daily at %s', 'backupwordpress' ), - '' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '' - ), - array( - 'span' => array( - 'title' => array(), - ) - ) + $reoccurrence = sprintf( + /* translators: Time */ + __( 'daily at %s', 'backupwordpress' ), + '' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '' ); break; @@ -68,130 +54,88 @@ sort( $times ); - $reoccurrence = wp_kses( - sprintf( - /* translators: 1: First time the back up runs 2: Second time backup runs */ - __( 'every 12 hours at %1$s & %2$s', 'backupwordpress' ), - '' . esc_html( reset( $times ) ) . '', - '' . esc_html( end( $times ) ) . '' - ), - array( - 'span' => array( - 'title' => array(), - ) - ) + $reoccurrence = sprintf( + /* translators: 1: First time the back up runs 2: Second time backup runs */ + __( 'every 12 hours at %1$s & %2$s', 'backupwordpress' ), + '' . esc_html( reset( $times ) ) . '', + '' . esc_html( end( $times ) ) . '' ); break; case 'weekly' : - $reoccurrence = wp_kses( - sprintf( - /* translators: 1: Full name of the week day, eg. Monday 2: Time */ - __( 'weekly on %1$s at %2$s', 'backupwordpress' ), - '' . esc_html( $day ) . '', - '' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '' - ), - array( - 'span' => array( - 'title' => array(), - ) - ) + $reoccurrence = sprintf( + /* translators: 1: Full name of the week day, eg. Monday 2: Time */ + __( 'weekly on %1$s at %2$s', 'backupwordpress' ), + '' . esc_html( $day ) . '', + '' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '' ); break; case 'fortnightly' : - $reoccurrence = wp_kses( - sprintf( - /* translators: 1: Full name of the week day, eg. Monday 2: Time */ - __( 'every two weeks on %1$s at %2$s', 'backupwordpress' ), - '' . esc_html( $day ) . '', - '' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '' - ), - array( - 'span' => array( - 'title' => array(), - ) - ) + $reoccurrence = sprintf( + /* translators: 1: Full name of the week day, eg. Monday 2: Time */ + __( 'every two weeks on %1$s at %2$s', 'backupwordpress' ), + '' . esc_html( $day ) . '', + '' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '' ); break; case 'monthly' : - $reoccurrence = wp_kses( - sprintf( - /* translators: 1: Ordinal number of a day of a month, eg. 1st, 10th 2: Time */ - __( 'on the %1$s of each month at %2$s', 'backupwordpress' ), - '' . esc_html( date_i18n( 'jS', $schedule->get_next_occurrence( false ) ) ) . '', - '' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '' - ), - array( - 'span' => array( - 'title' => array(), - ) - ) + $reoccurrence = sprintf( + /* translators: 1: Ordinal number of a day of a month, eg. 1st, 10th 2: Time */ + __( 'on the %1$s of each month at %2$s', 'backupwordpress' ), + '' . esc_html( date_i18n( 'jS', $schedule->get_next_occurrence( false ) ) ) . '', + '' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '' ); break; case 'manually' : - $reoccurrence = esc_html__( 'manually', 'backupwordpress' ); + $reoccurrence = __( 'manually', 'backupwordpress' ); break; default : - $reoccurrence = esc_html__( 'manually', 'backupwordpress' ); + $reoccurrence = __( 'manually', 'backupwordpress' ); $schedule->set_reoccurrence( 'manually' ); endswitch; -$server = '' . str_replace( Path::get_home_path(), '', Path::get_path() ) ) . ''; +$server = '' . str_replace( Path::get_home_path(), '', Path::get_path() ) . ''; // Backup to keep switch ( $schedule->get_max_backups() ) : case 1 : - $backup_to_keep = wp_kses( - sprintf( - __( 'store the most recent backup in %s', 'backupwordpress' ), - $server - ), - array( - 'code' => array( - 'title' => array(), - ) - ) + $backup_to_keep = sprintf( + __( 'store the most recent backup in %s', 'backupwordpress' ), + $server ); break; case 0 : - $backup_to_keep = esc_html__( 'don\'t store any backups in on this server', 'backupwordpress' ); + $backup_to_keep = __( 'don\'t store any backups in on this server', 'backupwordpress' ); break; default : - $backup_to_keep = wp_kses( - sprintf( - /* translators: 1: The number of backups to store 2: Path on a server */ - __( 'store the last %1$s backups in %2$s', 'backupwordpress' ), - esc_html( $schedule->get_max_backups() ), - $server - ), - array( - 'code' => array( - 'title' => array(), - ) - ) + $backup_to_keep = sprintf( + /* translators: 1: The number of backups to store 2: Path on a server */ + __( 'store the last %1$s backups in %2$s', 'backupwordpress' ), + $schedule->get_max_backups(), + $server ); endswitch; @@ -217,7 +161,7 @@
    - array( - 'title' => array(), - ), - 'code' => array( - 'title' => array(), - ), - ) + ), array( 'code', 'span', 'a' ) ); if ( $email_msg ) { @@ -278,33 +214,22 @@ function get_site_size_text( Scheduled_Backup $schedule ) { if ( ( 'database' === $schedule->get_type() ) || $site_size->is_site_size_cached() ) { - return wp_kses( + return whitelist_html( sprintf( '(%2$s)', __( 'Backups will be compressed and should be smaller than this.', 'backupwordpress' ), esc_html( $site_size->get_formatted_site_size() ) - ), - array( - 'code' => array( - 'title' => array(), - ) - ) + ), 'code' ); } else { - return wp_kses( + return whitelist_html( sprintf( '(%2$s)', esc_attr__( 'this shouldn\'t take long…', 'backupwordpress' ), __( 'calculating the size of your site…', 'backupwordpress' ) - ), - array( - 'code' => array( - 'class' => array(), - 'title' => array(), - ) - ) + ), 'code' ); } } diff --git a/admin/upsell.php b/admin/upsell.php index 2d5b84c0..8f3b3f49 100644 --- a/admin/upsell.php +++ b/admin/upsell.php @@ -4,17 +4,14 @@

    our extensions', 'backupwordpress' ), - array( - 'a' => array( - 'href' => array(), - ), - ) - ), - esc_url( get_settings_url( HMBKP_PLUGIN_SLUG . '_extensions' ) ) + esc_url( get_settings_url( HMBKP_PLUGIN_SLUG . '_extensions' ) ) + ), 'a' +) + ); ?> From 420f729eac173f8e0f1c3249ba52ba8abe3f77c9 Mon Sep 17 00:00:00 2001 From: mikeselander Date: Wed, 11 Jan 2017 11:53:29 +0100 Subject: [PATCH 6/6] Fixed PHP error --- admin/enable-support.php | 11 +++++++---- admin/upsell.php | 2 -- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/admin/enable-support.php b/admin/enable-support.php index 84f51ce8..7e10ffb1 100644 --- a/admin/enable-support.php +++ b/admin/enable-support.php @@ -2,10 +2,13 @@

    -

    Intercom' +

    + Intercom' + ), 'a' ); ?>

    diff --git a/admin/upsell.php b/admin/upsell.php index 8f3b3f49..8e923af4 100644 --- a/admin/upsell.php +++ b/admin/upsell.php @@ -10,8 +10,6 @@ __( 'Store your backups securely in the Cloud with our extensions', 'backupwordpress' ), esc_url( get_settings_url( HMBKP_PLUGIN_SLUG . '_extensions' ) ) ), 'a' -) - ); ?>