Skip to content
Closed
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
106 changes: 90 additions & 16 deletions admin/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,19 @@

<div id="hmbkp-constants">

<p><?php printf( __( 'You can %1$s any of the following %2$s in your %3$s to control advanced settings. %4$s. Defined %5$s will be highlighted.', 'backupwordpress' ), '<code>define</code>', '<code>' . __( 'Constants', 'backupwordpress' ) . '</code>', '<code>wp-config.php</code>', '<a href="http://codex.wordpress.org/Editing_wp-config.php">' . __( 'The Codex can help', 'backupwordpress' ) . '</a>', '<code>' . __( 'Constants', 'backupwordpress' ) . '</code>' ); ?></p>
<p><?php printf(
wp_kses(
/* translators: 1: wp-config.php file 2: Link to Codex page with info on how edit wp-config.php file */
__( 'You can define any of the following constants in your %1$s file to control advanced settings. <a href="%2$s">The Codex can help</a>. Defined constants will be highlighted.', 'backupwordpress' ),
array(
'a' => array(
'href' => array(),
),
)
),
'<code>wp-config.php</code>',
'https://codex.wordpress.org/Editing_wp-config.php'
); ?></p>

<table class="widefat">

Expand All @@ -17,10 +29,19 @@
<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 printf(
/* translators: Constant value specified in wp-config.php */
esc_html__( 'You\'ve set it to: %s', 'backupwordpress' ),
'<code>' . esc_html( HMBKP_PATH ) . '</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 printf(
/* translators: 1: Default path for backups 2: Code example of how to specify the constant in wp-config.php */
esc_html__( 'The path to the folder in which you would like to store your backup files. Defaults to %1$s. e.g. %2$s', 'backupwordpress' ),
'<code>' . esc_html( Path::get_path() ) . '</code>',
"<code>define( 'HMBKP_PATH', '/home/willmot/backups' );</code>"
); ?></p>

</td>

Expand All @@ -33,10 +54,19 @@
<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 printf(
/* translators: Constant value specified in wp-config.php */
esc_html__( 'You\'ve set it to: %s', 'backupwordpress' ),
'<code>' . esc_html( HMBKP_MYSQLDUMP_PATH ) . '</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 printf(
/* translators: 1: mysqldump 2: Code example of how to specify the constant in wp-config.php */
esc_html__( 'The path to your %1$s executable. Used for the database backup if available. e.g. %2$s', 'backupwordpress' ),
'<code>mysqldump</code>',
"<code>define( 'HMBKP_MYSQLDUMP_PATH', '/opt/local/bin/mysqldump' );</code>"
); ?></p>

</td>

Expand All @@ -49,10 +79,19 @@
<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 printf(
/* translators: Constant value specified in wp-config.php */
esc_html__( 'You\'ve set it to: %s', 'backupwordpress' ),
'<code>' . esc_html( HMBKP_ZIP_PATH ) . '</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 printf(
/* translators: 1: zip 2: Code example of how to specify the constant in wp-config.php */
esc_html__( 'The path to your %1$s executable. Used to compress your files and database if available. e.g. %2$s', 'backupwordpress' ),
'<code>zip</code>',
"<code>define( 'HMBKP_ZIP_PATH', '/opt/local/bin/zip' );</code>"
); ?></p>

</td>

Expand All @@ -65,10 +104,18 @@
<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 printf(
/* translators: Constant value specified in wp-config.php */
esc_html__( 'You\'ve set it to: %s', 'backupwordpress' ),
'<code>' . esc_html( HMBKP_EXCLUDE ) . '</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 printf(
/* translators: 1: Code example of how to specify the constant in wp-config.php */
esc_html__( 'Comma separated list of files or directories to exclude from backup. The backups directory is automatically excluded. e.g. %s', 'backupwordpress' ),
"<code>define( 'HMBKP_EXCLUDE', '/wp-content/uploads/, /stats/, .svn/, *.txt' );</code>"
); ?></p>

</td>

Expand All @@ -81,10 +128,19 @@
<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 printf(
/* translators: Constant value specified in wp-config.php */
esc_html__( 'You\'ve set it to: %s', 'backupwordpress' ),
'<code>' . esc_html( HMBKP_CAPABILITY ) . '</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 printf(
/* translators: 1: Default capability value 2: Code example of how to specify the constant in wp-config.php */
esc_html__( 'The capability required to view BackUpWordPress admin menus. Defaults to %1$s. e.g. %2$s', 'backupwordpress' ),
'<code>manage_options</code>',
"<code>define( 'HMBKP_CAPABILITY', 'edit_posts' );</code>"
); ?></p>

</td>

Expand All @@ -97,10 +153,19 @@
<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 printf(
/* translators: Constant value specified in wp-config.php */
esc_html__( 'You\'ve set it to: %s', 'backupwordpress' ),
'<code>' . esc_html( HMBKP_ROOT ) . '</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 printf(
/* translators: 1: Default root directory value 2: Code example of how to specify the constant in wp-config.php */
esc_html__( 'The root directory that is backed up. Defaults to %1$s. e.g. %2$s', 'backupwordpress' ),
'<code>' . esc_html( Path::get_home_path() ) . '</code>',
"<code>define( 'HMBKP_ROOT', ABSPATH . 'wp/' );</code>"
); ?></p>

</td>

Expand All @@ -113,17 +178,26 @@
<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 printf(
/* translators: Constant value specified in wp-config.php */
esc_html__( 'You\'ve set it to: %s', 'backupwordpress' ),
'<code>' . esc_html( HMBKP_SCHEDULE_TIME ) . '</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 printf(
/* translators: 1: Default schedule time value 2: Code example of how to specify the constant in wp-config.php */
esc_html__( 'The time that your schedules should run. Defaults to %1$s. e.g. %2$s', 'backupwordpress' ),
'<code>23:00</code>',
"<code>define( 'HMBKP_SCHEDULE_TIME', '07:30' );</code>"
); ?></p>

</td>

</tr>

<?php foreach ( Services::get_services() as $file => $service ) :
echo wp_kses_post( call_user_func( array( $service, 'constant' ) ) );
call_user_func( array( $service, 'constant' ) );
endforeach; ?>

</table>
Expand Down
20 changes: 15 additions & 5 deletions admin/faq.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,27 @@

'<p><strong>' . __( 'What if I want to back up my site to another destination?', 'backupwordpress' ) . '</strong></p>' .

'<p>' . __( 'BackUpWordPress Pro supports Dropbox, Google Drive, Amazon S3, Rackspace, Azure, DreamObjects and FTP/SFTP. Check it out here: <a href="http://bwp.hmn.md/?utm_source=wordpress-org&utm_medium=plugin-page&utm_campaign=freeplugin" title="BackUpWordPress Homepage" target="_blank">https://bwp.hmn.md</a>', 'backupwordpress' ) . '</p>' .
'<p>' . sprintf(
__( 'BackUpWordPress Pro supports Dropbox, Google Drive, Amazon S3, Rackspace, Azure, DreamObjects and FTP/SFTP. <a href="%s" target="_blank">Check it out at bwp.hmn.md</a>', 'backupwordpress' ),
'https://bwp.hmn.md/?utm_source=wordpress-org&utm_medium=plugin-page&utm_campaign=freeplugin'
) . '</p>' .
Copy link
Contributor

@dashaluna dashaluna Aug 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pdewouters I think you've mentioned that these files have to have a specific format otherwise they won't be processed. Will it cope if we use sprintf() and esc_html__() ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep


'<p><strong>' . __( 'How do I restore my site from a backup?', 'backupwordpress' ) . '</strong></p>' .

'<p>' . __( 'You need to download the latest backup file either by clicking download on the backups page or via <code>FTP</code>. <code>Unzip</code> 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 <code>phpMyAdmin</code>).', 'backupwordpress' ) . '</p>' .
'<p>' . __( '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' ) . '</p>' .

'<p>' . __( 'See this guide for more details - <a href="https://bwp.hmn.md/support-center/restore-backup/" title="Go to support center" target="_blank">How to restore from backup</a>.', 'backupwordpress' ) . '</p>' .
'<p>' . sprintf(
__( 'See this guide for more details - <a href="%s" target="_blank">How to restore from backup</a>.', 'backupwordpress' ),
'https://bwp.hmn.md/support-center/restore-backup/'
) . '</p>' .

'<p><strong>' . __( 'Does BackUpWordPress back up the backups directory?', 'backupwordpress' ) . '</strong></p>' .

'<p>' . __( 'No.', 'backupwordpress' ) . '</p>' .

'<p><strong>' . __( 'I\'m not receiving my backups by email', 'backupwordpress' ) . '</strong></p>' .

'<p>' . __( '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' ) . '</p>' .
'<p>' . __( 'Most servers have a file size 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' ) . '</p>' .

'<p><strong>' . __( 'How many backups are stored by default?', 'backupwordpress' ) . '</strong></p>' .

Expand All @@ -43,7 +49,11 @@

'<li>' . __( 'If you click manual backup, does it work?', 'backupwordpress' ) . '</li>' .

'<li>' . __( 'Try adding <code>define( \'ALTERNATE_WP_CRON\', true );</code> to your <code>wp-config.php</code>. Do automatic backups work?', 'backupwordpress' ) . '</li>' .
'<li>' . sprintf(
__( 'Try adding %1$s to your %2$s file. Do automatic backups work?', 'backupwordpress' ),
"<code>define( 'ALTERNATE_WP_CRON', true );</code>",
'<code>wp-config.php</code>'
) . '</li>' .

'<li>' . __( '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' ) . '</li></ul>' .

Expand Down
8 changes: 4 additions & 4 deletions admin/page.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@

BackUpWordPress

<a class="page-title-action" href="https://bwp.hmn.md/" target="_blank">Extensions</a>
<a class="page-title-action" href="https://bwp.hmn.md/" target="_blank"><?php esc_html_e( 'Extensions', 'backupwordpress' ); ?></a>

<?php if ( get_option( 'hmbkp_enable_support' ) ) : ?>

<a id="intercom" class="page-title-action" href="mailto:[email protected]"><?php _e( 'Support', 'backupwordpress' ); ?></a>

<a id="intercom" class="page-title-action" href="mailto:[email protected]"><?php esc_html_e( 'Support', 'backupwordpress' ); ?></a>
<?php else :

add_thickbox(); ?>
<a id="intercom-info" class="thickbox page-title-action" href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'load_enable_support', 'width' => '600', 'height' => '420' ), self_admin_url( 'admin-ajax.php' ) ), 'hmbkp_nonce' ) ); ?>"><span class="dashicons dashicons-admin-users"></span>&nbsp;<?php _e( 'Enable Support', 'backupwordpress' ); ?></a>

<a id="intercom-info" class="thickbox page-title-action" href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'load_enable_support', 'width' => '600', 'height' => '420' ), self_admin_url( 'admin-ajax.php' ) ), 'hmbkp_nonce' ) ); ?>"><span class="dashicons dashicons-admin-users"></span>&nbsp;<?php esc_html_e( 'Enable Support', 'backupwordpress' ); ?></a>

<?php endif; ?>

Expand Down
20 changes: 10 additions & 10 deletions admin/schedule-form-excludes.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

<?php elseif ( defined( 'HMBKP_EXCLUDE' ) && false !== strpos( HMBKP_EXCLUDE, $exclude ) ) : ?>

<?php printf( esc_html__( 'Defined in %s', 'backupwordpress' ), 'wp-config.php' ); ?>
<?php printf( esc_html__( 'Defined in %s', 'backupwordpress' ), '<code>wp-config.php</code>' ); ?>

<?php else : ?>

Expand Down Expand Up @@ -181,12 +181,12 @@

<code>
<?php
/* translators: 1: Excluded size 2: Overall site size */
printf(
esc_html__( '%1$s of %2$s', 'backupwordpress' ),
echo esc_html( sprintf(
/* translators: 1: Excluded size 2: Overall site size */
__( '%1$s of %2$s', 'backupwordpress' ),
$excluded_size,
size_format( $size )
);
) );
?>

<a class="dashicons dashicons-update" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'hmbkp_recalculate_directory_filesize', urlencode( Path::get_root() ) ), 'hmbkp-recalculate_directory_filesize' ) ); ?>">
Expand Down Expand Up @@ -311,12 +311,12 @@
$size = size_format( $size );
}

/* translators: 1: Excluded size 2: Overall directory/file size */
printf(
esc_html__( '%1$s of %2$s', 'backupwordpress' ),
echo esc_html( sprintf(
/* translators: 1: Excluded size 2: Overall site size */
__( '%1$s of %2$s', 'backupwordpress' ),
$excluded_size,
$size
);
size_format( $size )
) );

elseif ( ! $is_unreadable ) :
echo esc_html( size_format( $size ) );
Expand Down
18 changes: 10 additions & 8 deletions admin/schedule-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace HM\BackUpWordPress;

global $wp_locale;

?>

<h3><?php esc_html_e( 'Settings', 'backupwordpress' ); ?></h3>
Expand Down Expand Up @@ -74,7 +76,7 @@

<option <?php selected( $schedule->get_reoccurrence(), $cron_schedule ); ?> value="<?php echo esc_attr( $cron_schedule ); ?>">

<?php esc_html_e( $cron_details['display'], 'backupwordpress' ); ?>
<?php echo esc_html( $cron_details['display'] ); ?>

</option>

Expand Down Expand Up @@ -103,13 +105,13 @@
<select id="hmbkp_schedule_start_day_of_week" name="hmbkp_schedule_recurrence[hmbkp_schedule_start_day_of_week]">

<?php $weekdays = array(
'monday' => __( 'Monday', 'backupwordpress' ),
'tuesday' => __( 'Tuesday', 'backupwordpress' ),
'wednesday' => __( 'Wednesday', 'backupwordpress' ),
'thursday' => __( 'Thursday', 'backupwordpress' ),
'friday' => __( 'Friday', 'backupwordpress' ),
'saturday' => __( 'Saturday', 'backupwordpress' ),
'sunday' => __( 'Sunday', 'backupwordpress' ),
'monday' => $wp_locale->weekday[1],
'tuesday' => $wp_locale->weekday[2],
'wednesday' => $wp_locale->weekday[3],
'thursday' => $wp_locale->weekday[4],
'friday' => $wp_locale->weekday[5],
'saturday' => $wp_locale->weekday[6],
'sunday' => $wp_locale->weekday[0],
);

foreach ( $weekdays as $key => $day ) : ?>
Expand Down
Loading