Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 41 additions & 3 deletions admin/actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ) );
Expand Down Expand Up @@ -633,13 +633,51 @@ function ajax_cron_test() {

if ( is_wp_error( $response1 ) && is_wp_error( $response2 ) && is_wp_error( $response3 ) ) {

echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress has detected a problem.', 'backupwordpress' ) . '</strong> ' . 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' ), '<code>wp-cron.php</code>', '<code>' . $response1->get_error_message() . '</code>', '<a href="http://wordpress.org/extend/plugins/backupwordpress/faq/">FAQ</a>' ) . '</p></div>';
echo '<div id="hmbkp-warning" class="updated fade"><p>';

printf(
wp_kses(
/* translators: 1: wp-cron.php 2: Error messages 3: URL to plugin's FAQ page in wordpress.org plugin directory */
__( '<strong>BackUpWordPress has detected a problem.</strong> %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 <a href="%3$s">FAQ</a> for more details.', 'backupwordpress' ),
array(
'strong' => array(),
'code' => array(),
'a' => array(
'href' => array(),
),
)
),
'<code>wp-cron.php</code>',
'<code>' . esc_html( $response1->get_error_message() ) . '</code>',
'http://wordpress.org/extend/plugins/backupwordpress/faq/'
);

echo '</p></div>';

update_option( 'hmbkp_wp_cron_test_failed', true );

} elseif ( ! in_array( 200, array_map( 'wp_remote_retrieve_response_code', array( $response1, $response2, $response3 ) ) ) ) {

echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress has detected a problem.', 'backupwordpress' ) . '</strong> ' . 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' ), '<code>wp-cron.php</code>', '<code>' . esc_html( wp_remote_retrieve_response_code( $response1 ) ) . ' ' . esc_html( get_status_header_desc( wp_remote_retrieve_response_code( $response1 ) ) ) . '</code>', '<a href="http://wordpress.org/extend/plugins/backupwordpress/faq/">FAQ</a>' ) . '</p></div>';
echo '<div id="hmbkp-warning" class="updated fade"><p>';

printf(
wp_kses(
/* translators: 1: wp-cron.php 2: Error messages 3: URL to plugin's FAQ page in wordpress.org plugin directory */
__( '<strong>BackUpWordPress has detected a problem.</strong> %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 <a href="%3$s">FAQ</a> for more details.', 'backupwordpress' ),
array(
'strong' => array(),
'code' => array(),
'a' => array(
'href' => array(),
),
)
),
'<code>wp-cron.php</code>',
'<code>' . esc_html( wp_remote_retrieve_response_code( $response1 ) . ' ' . get_status_header_desc( wp_remote_retrieve_response_code( $response1 ) ) ) . '</code>',
'http://wordpress.org/extend/plugins/backupwordpress/faq/'
);

echo '</p></div>';

update_option( 'hmbkp_wp_cron_test_failed', true );

Expand Down
8 changes: 4 additions & 4 deletions admin/backups-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<tr>

<th scope="col"><?php backups_number( $schedule ); ?></th>
<th scope="col"><?php _e( 'Size', 'backupwordpress' ); ?></th>
<th scope="col"><?php _e( 'Type', 'backupwordpress' ); ?></th>
<th scope="col"><?php _e( 'Actions', 'backupwordpress' ); ?></th>
<th scope="col"><?php esc_html_e( 'Size', 'backupwordpress' ); ?></th>
<th scope="col"><?php esc_html_e( 'Type', 'backupwordpress' ); ?></th>
<th scope="col"><?php esc_html_e( 'Actions', 'backupwordpress' ); ?></th>

</tr>

Expand All @@ -38,7 +38,7 @@
else : ?>

<tr>
<td class="hmbkp-no-backups" colspan="4"><?php _e( 'This is where your backups will appear once you have some.', 'backupwordpress' ); ?></td>
<td class="hmbkp-no-backups" colspan="4"><?php esc_html_e( 'This is where your backups will appear once you have some.', 'backupwordpress' ); ?></td>
</tr>

<?php endif; ?>
Expand Down
2 changes: 1 addition & 1 deletion admin/backups.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<?php endforeach; ?>

<li><a href="<?php echo esc_url( add_query_arg( array( 'hmbkp_add_schedule' => '1', 'action' => 'hmbkp_edit_schedule', 'hmbkp_schedule_id' => time(), 'hmbkp_panel' => 'hmbkp_edit_schedule_settings' ), HMBKP_ADMIN_URL ) ); ?>" class="<?php if ( ! Schedules::get_instance()->get_schedule( $current_schedule->get_id() ) ) { ?> current<?php } ?>"> + <?php _e( 'add schedule', 'backupwordpress' ); ?></a></li>
<li><a href="<?php echo esc_url( add_query_arg( array( 'hmbkp_add_schedule' => '1', 'action' => 'hmbkp_edit_schedule', 'hmbkp_schedule_id' => time(), 'hmbkp_panel' => 'hmbkp_edit_schedule_settings' ), HMBKP_ADMIN_URL ) ); ?>" class="<?php if ( ! Schedules::get_instance()->get_schedule( $current_schedule->get_id() ) ) { ?> current<?php } ?>"> + <?php esc_html_e( 'add schedule', 'backupwordpress' ); ?></a></li>

</ul>
</div>
Expand Down
28 changes: 14 additions & 14 deletions admin/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
<td>

<?php if ( defined( 'HMBKP_PATH' ) ) { ?>
<p><?php printf( __( 'You\'ve set it to: %s', 'backupwordpress' ), '<code>' . esc_html( HMBKP_PATH ) . '</code>' ); ?></p>
<p><?php whitelist_html( printf( __( 'You\'ve set it to: %s', 'backupwordpress' ), '<code>' . esc_html( HMBKP_PATH ) . '</code>' ), 'code' ); ?></p>
<?php } ?>

<p><?php printf( __( 'The path to the folder you would like to store your backup files in, defaults to %s.', 'backupwordpress' ), '<code>' . esc_html( Path::get_path() ) . '</code>' ); ?> <?php _e( 'e.g.', 'backupwordpress' ); ?> <code>define( 'HMBKP_PATH', '/home/willmot/backups' );</code></p>
<p><?php whitelist_html( printf( __( 'The path to the folder you would like to store your backup files in, defaults to %s.', 'backupwordpress' ), '<code>' . esc_html( Path::get_path() ) . '</code>' ), 'code' ); ?> <?php esc_html_e( 'e.g.', 'backupwordpress' ); ?> <code>define( 'HMBKP_PATH', '/home/willmot/backups' );</code></p>

</td>

Expand All @@ -33,10 +33,10 @@
<td>

<?php if ( defined( 'HMBKP_MYSQLDUMP_PATH' ) ) { ?>
<p><?php printf( __( 'You\'ve set it to: %s', 'backupwordpress' ), '<code>' . esc_html( HMBKP_MYSQLDUMP_PATH ) . '</code>' ); ?></p>
<p><?php whitelist_html( printf( __( 'You\'ve set it to: %s', 'backupwordpress' ), '<code>' . esc_html( HMBKP_MYSQLDUMP_PATH ) . '</code>' ), 'code' ); ?></p>
<?php } ?>

<p><?php printf( __( 'The path to your %1$s executable. Will be used for the %2$s part of the back up if available.', 'backupwordpress' ), '<code>mysqldump</code>', '<code>' . __( 'database', 'backupwordpress' ) . '</code>' ); ?> <?php _e( 'e.g.', 'backupwordpress' ); ?> <code>define( 'HMBKP_MYSQLDUMP_PATH', '/opt/local/bin/mysqldump' );</code></p>
<p><?php whitelist_html( printf( __( 'The path to your %1$s executable. Will be used for the %2$s part of the back up if available.', 'backupwordpress' ), '<code>mysqldump</code>', '<code>' . __( 'database', 'backupwordpress' ) . '</code>' ), 'code' ); ?> <?php esc_html_e( 'e.g.', 'backupwordpress' ); ?> <code>define( 'HMBKP_MYSQLDUMP_PATH', '/opt/local/bin/mysqldump' );</code></p>

</td>

Expand All @@ -49,10 +49,10 @@
<td>

<?php if ( defined( 'HMBKP_ZIP_PATH' ) ) { ?>
<p><?php printf( __( 'You\'ve set it to: %s', 'backupwordpress' ), '<code>' . esc_html( HMBKP_ZIP_PATH ) . '</code>' ); ?></p>
<p><?php whitelist_html( printf( __( 'You\'ve set it to: %s', 'backupwordpress' ), '<code>' . esc_html( HMBKP_ZIP_PATH ) . '</code>' ), 'code' ); ?></p>
<?php } ?>

<p><?php printf( __( 'The path to your %1$s executable. Will be used to zip up your %2$s and %3$s if available.', 'backupwordpress' ), '<code>zip</code>', '<code>' . __( 'files', 'backupwordpress' ) . '</code>', '<code>' . __( 'database', 'backupwordpress' ) . '</code>' ); ?> <?php _e( 'e.g.', 'backupwordpress' ); ?> <code>define( 'HMBKP_ZIP_PATH', '/opt/local/bin/zip' );</code></p>
<p><?php whitelist_html( printf( __( 'The path to your %1$s executable. Will be used to zip up your %2$s and %3$s if available.', 'backupwordpress' ), '<code>zip</code>', '<code>' . __( 'files', 'backupwordpress' ) . '</code>', '<code>' . __( 'database', 'backupwordpress' ) . '</code>' ), 'code' ); ?> <?php esc_html_e( 'e.g.', 'backupwordpress' ); ?> <code>define( 'HMBKP_ZIP_PATH', '/opt/local/bin/zip' );</code></p>

</td>

Expand All @@ -65,10 +65,10 @@
<td>

<?php if ( defined( 'HMBKP_EXCLUDE' ) ) { ?>
<p><?php printf( __( 'You\'ve set it to: %s', 'backupwordpress' ), '<code>' . esc_html( HMBKP_EXCLUDE ) . '</code>' ); ?></p>
<p><?php whitelist_html( printf( __( 'You\'ve set it to: %s', 'backupwordpress' ), '<code>' . esc_html( HMBKP_EXCLUDE ) . '</code>' ), 'code' ); ?></p>
<?php } ?>

<p><?php _e( 'Comma separated list of files or directories to exclude, the backups directory is automatically excluded.', 'backupwordpress' ); ?> <?php _e( 'e.g.', 'backupwordpress' ); ?> <code>define( 'HMBKP_EXCLUDE', '/wp-content/uploads/, /stats/, .svn/, *.txt' );</code></p>
<p><?php esc_html_e( 'Comma separated list of files or directories to exclude, the backups directory is automatically excluded.', 'backupwordpress' ); ?> <?php esc_html_e( 'e.g.', 'backupwordpress' ); ?> <code>define( 'HMBKP_EXCLUDE', '/wp-content/uploads/, /stats/, .svn/, *.txt' );</code></p>

</td>

Expand All @@ -81,10 +81,10 @@
<td>

<?php if ( defined( 'HMBKP_CAPABILITY' ) ) { ?>
<p><?php printf( __( 'You\'ve set it to: %s', 'backupwordpress' ), '<code>' . esc_html( HMBKP_CAPABILITY ) . '</code>' ); ?></p>
<p><?php whitelist_html( printf( __( 'You\'ve set it to: %s', 'backupwordpress' ), '<code>' . esc_html( HMBKP_CAPABILITY ) . '</code>' ), 'code' ); ?></p>
<?php } ?>

<p><?php printf( __( 'The capability to use when calling %1$s. Defaults to %2$s.', 'backupwordpress' ), '<code>add_menu_page</code>', '<code>manage_options</code>' ); ?> <?php _e( 'e.g.', 'backupwordpress' ); ?> <code>define( 'HMBKP_CAPABILITY', 'edit_posts' );</code></p>
<p><?php whitelist_html( printf( __( 'The capability to use when calling %1$s. Defaults to %2$s.', 'backupwordpress' ), '<code>add_menu_page</code>', '<code>manage_options</code>' ), 'code' ); ?> <?php esc_html_e( 'e.g.', 'backupwordpress' ); ?> <code>define( 'HMBKP_CAPABILITY', 'edit_posts' );</code></p>

</td>

Expand All @@ -97,10 +97,10 @@
<td>

<?php if ( defined( 'HMBKP_ROOT' ) ) { ?>
<p><?php printf( __( 'You\'ve set it to: %s', 'backupwordpress' ), '<code>' . esc_html( HMBKP_ROOT ) . '</code>' ); ?></p>
<p><?php whitelist_html( printf( __( 'You\'ve set it to: %s', 'backupwordpress' ), '<code>' . esc_html( HMBKP_ROOT ) . '</code>' ), 'code' ); ?></p>
<?php } ?>

<p><?php printf( __( 'The root directory that is backed up. Defaults to %s.', 'backupwordpress' ), '<code>' . Path::get_home_path() . '</code>' ); ?> <?php _e( 'e.g.', 'backupwordpress' ); ?> <code>define( 'HMBKP_ROOT', ABSPATH . 'wp/' );</code></p>
<p><?php whitelist_html( printf( __( 'The root directory that is backed up. Defaults to %s.', 'backupwordpress' ), '<code>' . Path::get_home_path() . '</code>' ), 'code' ); ?> <?php esc_html_e( 'e.g.', 'backupwordpress' ); ?> <code>define( 'HMBKP_ROOT', ABSPATH . 'wp/' );</code></p>

</td>

Expand All @@ -113,10 +113,10 @@
<td>

<?php if ( defined( 'HMBKP_SCHEDULE_TIME' ) && HMBKP_SCHEDULE_TIME !== '11pm' ) { ?>
<p><?php printf( __( 'You\'ve set it to: %s', 'backupwordpress' ), '<code>' . esc_html( HMBKP_SCHEDULE_TIME ) . '</code>' ); ?></p>
<p><?php whitelist_html( printf( __( 'You\'ve set it to: %s', 'backupwordpress' ), '<code>' . esc_html( HMBKP_SCHEDULE_TIME ) . '</code>' ), 'code' ); ?></p>
<?php } ?>

<p><?php printf( __( 'The time that your schedules should run. Defaults to %s.', 'backupwordpress' ), '<code>23:00</code>' ); ?> <?php _e( 'e.g.', 'backupwordpress' ); ?> <code>define( 'HMBKP_SCHEDULE_TIME', '07:30' );</code></p>
<p><?php whitelist_html( printf( __( 'The time that your schedules should run. Defaults to %s.', 'backupwordpress' ), '<code>23:00</code>' ), 'code' ); ?> <?php esc_html_e( 'e.g.', 'backupwordpress' ); ?> <code>define( 'HMBKP_SCHEDULE_TIME', '07:30' );</code></p>

</td>

Expand Down
20 changes: 14 additions & 6 deletions admin/enable-support.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
<?php require_once HMBKP_PLUGIN_PATH . 'classes/class-requirements.php'; ?>

<h2><?php _e( 'Enable BackUpWordPress Support', 'backupwordpress' ); ?></h2>

<p class="howto"><?php printf( __( 'BackUpWordPress uses %s to provide support. In addition to allowing you to send and receive messages we also send the following server information along with your requests:', 'backupwordpress' ), '<a target="blank" href="https://www.intercom.io">Intercom</a>' ); ?></p>
<h2><?php esc_html_e( 'Enable BackUpWordPress Support', 'backupwordpress' ); ?></h2>

<p class="howto">
<?php whitelist_html(
printf(
/* translators: Link to Intercom site */
__( 'BackUpWordPress uses %s to provide support. In addition to allowing you to send and receive messages we also send the following server information along with your requests:', 'backupwordpress' ),
'<a target="blank" href="https://www.intercom.io">Intercom</a>'
), 'a'
); ?>
</p>

<div class="server-info">

Expand Down Expand Up @@ -55,7 +63,7 @@

</div>

<p class="howto"><?php _e( 'You can disable support in the future by deactivating BackUpWordPress.', 'backupwordpress' ); ?></p>
<p class="howto"><?php esc_html_e( 'You can disable support in the future by deactivating BackUpWordPress.', 'backupwordpress' ); ?></p>

<a href="#" class="button-secondary hmbkp-thickbox-close"><?php _e( 'No, thanks', 'backupwordpress' ); ?></a>
<a href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'hmbkp_request_enable_support' ), admin_url( 'admin-post.php' ) ), 'hmbkp_enable_support', 'hmbkp_enable_support_nonce' ) ); ?>" class="button-primary right"><?php _e( 'Yes, I want to enable support', 'backupwordpress' ); ?></a>
<a href="#" class="button-secondary hmbkp-thickbox-close"><?php esc_html_e( 'No, thanks', 'backupwordpress' ); ?></a>
<a href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'hmbkp_request_enable_support' ), admin_url( 'admin-post.php' ) ), 'hmbkp_enable_support', 'hmbkp_enable_support_nonce' ) ); ?>" class="button-primary right"><?php esc_html_e( 'Yes, I want to enable support', 'backupwordpress' ); ?></a>
11 changes: 4 additions & 7 deletions admin/extensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,11 @@ class="thickbox"
</div>

<div class="column-updated">
<?php printf(
wp_kses(
<?php whitelist_html(
printf(
__( '<strong>Last Updated:</strong> %s ago', 'backupwordpress' ),
array(
'strong' => array(),
)
),
esc_html( human_time_diff( strtotime( $extension->modified ) ) )
esc_html( human_time_diff( strtotime( $extension->modified ) ) )
), 'strong'
); ?>
</div>
</div>
Expand Down
Loading