diff --git a/admin/constants.php b/admin/constants.php index 330e47ef..914b0420 100644 --- a/admin/constants.php +++ b/admin/constants.php @@ -6,7 +6,19 @@
-

define', '' . __( 'Constants', 'backupwordpress' ) . '', 'wp-config.php', '' . __( 'The Codex can help', 'backupwordpress' ) . '', '' . __( 'Constants', 'backupwordpress' ) . '' ); ?>

+

The Codex can help. Defined constants will be highlighted.', 'backupwordpress' ), + array( + 'a' => array( + 'href' => array(), + ), + ) + ), + 'wp-config.php', + 'https://codex.wordpress.org/Editing_wp-config.php' + ); ?>

@@ -17,10 +29,19 @@ @@ -33,10 +54,19 @@ @@ -49,10 +79,19 @@ @@ -65,10 +104,18 @@ @@ -81,10 +128,19 @@ @@ -97,10 +153,19 @@ @@ -113,17 +178,26 @@ $service ) : - echo wp_kses_post( call_user_func( array( $service, 'constant' ) ) ); + call_user_func( array( $service, 'constant' ) ); endforeach; ?>
-

' . 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' );" + ); ?>

-

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

+

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

-

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

+

mysqldump', + "define( 'HMBKP_MYSQLDUMP_PATH', '/opt/local/bin/mysqldump' );" + ); ?>

-

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

+

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

-

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

+

zip', + "define( 'HMBKP_ZIP_PATH', '/opt/local/bin/zip' );" + ); ?>

-

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

+

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

-

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

+

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

-

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

+

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

-

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

+

manage_options', + "define( 'HMBKP_CAPABILITY', 'edit_posts' );" + ); ?>

-

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

+

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

-

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

+

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

-

' . 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..765c2fa5 100644 --- a/admin/faq.php +++ b/admin/faq.php @@ -7,13 +7,19 @@ '

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

' . + '

' . sprintf( + __( 'BackUpWordPress Pro supports Dropbox, Google Drive, Amazon S3, Rackspace, Azure, DreamObjects and FTP/SFTP. Check it out at bwp.hmn.md', 'backupwordpress' ), + 'https://bwp.hmn.md/?utm_source=wordpress-org&utm_medium=plugin-page&utm_campaign=freeplugin' + ) . '

' . '

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

' . + '

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

' . - '

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

' . + '

' . sprintf( + __( 'See this guide for more details - How to restore from backup.', 'backupwordpress' ), + 'https://bwp.hmn.md/support-center/restore-backup/' + ) . '

' . '

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

' . @@ -21,7 +27,7 @@ '

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

' . + '

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

' . '

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

' . @@ -43,7 +49,11 @@ '
  • ' . __( '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' ) . '
  • ' . + '
  • ' . sprintf( + __( 'Try adding %1$s to your %2$s file. Do automatic backups work?', 'backupwordpress' ), + "define( 'ALTERNATE_WP_CRON', true );", + 'wp-config.php' + ) . '
  • ' . '
  • ' . __( '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' ) . '
  • ' . diff --git a/admin/page.php b/admin/page.php index d7a5c835..8dbf30ea 100755 --- a/admin/page.php +++ b/admin/page.php @@ -10,16 +10,16 @@ BackUpWordPress - Extensions + - - + -   + +   diff --git a/admin/schedule-form-excludes.php b/admin/schedule-form-excludes.php index 23a9d89e..bc24c6cb 100644 --- a/admin/schedule-form-excludes.php +++ b/admin/schedule-form-excludes.php @@ -56,7 +56,7 @@ - + wp-config.php' ); ?> @@ -181,12 +181,12 @@ @@ -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 ) ); diff --git a/admin/schedule-form.php b/admin/schedule-form.php index 4a79ca98..f6989729 100644 --- a/admin/schedule-form.php +++ b/admin/schedule-form.php @@ -2,6 +2,8 @@ namespace HM\BackUpWordPress; +global $wp_locale; + ?>

    @@ -74,7 +76,7 @@ @@ -103,13 +105,13 @@ -

    ' . size_format( get_max_attachment_size() ) . '' ); ?>

    +

    < ' . esc_html( size_format( get_max_attachment_size() ) ) . '' ); ?>

    @@ -61,10 +61,19 @@ public static function constant() { -

    ' . HMBKP_ATTACHMENT_MAX_FILESIZE . '' ); ?>

    +

    ' . esc_html( HMBKP_ATTACHMENT_MAX_FILESIZE ) . '' + ); ?>

    -

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

    +

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

    @@ -83,7 +92,11 @@ public function display() { $email = '' . implode( ', ', array_map( 'esc_html', $emails ) ) . ''; - return sprintf( __( 'Send an email notification to %s', 'backupwordpress' ), $email ); + return sprintf( + /* translators: List of email addresses */ + esc_html__( 'Send an email notification to %s', 'backupwordpress' ), + $email + ); } @@ -119,7 +132,7 @@ public function update( &$new_data, $old_data ) { $email = trim( $email ); if ( ! is_email( $email ) ) { - $errors['email'] = sprintf( __( '%s isn\'t a valid email', 'backupwordpress' ), $email ); + $errors['email'] = sprintf( esc_html__( '%s isn\'t a valid email', 'backupwordpress' ), $email ); } } } @@ -174,33 +187,69 @@ public function action( $action, Backup $backup ) { $error_message = ' - ' . $error_message; } - $subject = sprintf( __( 'Backup of %s Failed', 'backupwordpress' ), $domain ); - - $message = sprintf( __( 'BackUpWordPress was unable to backup your site %1$s.', 'backupwordpress' ) . "\n\n" . __( 'Here are the errors that we\'ve encountered:', 'backupwordpress' ) . "\n\n" . '%2$s' . "\n\n" . __( 'If the errors above look like Martian, forward this email to %3$s and we\'ll take a look', 'backupwordpress' ) . "\n\n" . __( "Kind Regards,\nThe Apologetic BackUpWordPress Backup Emailing Robot", 'backupwordpress' ), home_url(), $error_message, 'backupwordpress@hmn.md' ); + $subject = wp_strip_all_tags( sprintf( + /* translators: Domain URL */ + __( 'Backup of %s failed', 'backupwordpress' ), + $domain + ) ); + + $message = sprintf( + /* translators: 1: Site URL 2: List of errors */ + esc_html__( + 'BackUpWordPress was unable to backup your site %1$s.' . "\n\n" . + 'Here are the errors that we\'ve encountered: %2$s' . "\n\n" . + 'If the errors above look like Martian, forward this email to %3$s and we\'ll take a look.' . "\n\n", 'backupwordpress' + ), + esc_url( home_url() ), + $error_message, + 'backupwordpress@hmn.md' + ); wp_mail( $this->get_email_address_array(), $subject, $message, $headers ); return; - } - $subject = sprintf( __( 'Backup of %s', 'backupwordpress' ), $domain ); + $subject = wp_strip_all_tags( sprintf( + /* translators: Domain URL */ + __( 'Backup of %s', 'backupwordpress' ), + $domain + ) ); // If it's larger than the max attachment size limit assume it's not going to be able to send the backup if ( @filesize( $file ) < get_max_attachment_size() ) { - $message = sprintf( __( 'BackUpWordPress has completed a backup of your site %1$s.', 'backupwordpress' ) . "\n\n" . __( 'The backup file should be attached to this email.', 'backupwordpress' ) . "\n\n" . __( 'You can download the backup file by clicking the link below:', 'backupwordpress' ) . "\n\n" . '%2$s' . "\n\n" . __( "Kind Regards,\nThe Happy BackUpWordPress Backup Emailing Robot", 'backupwordpress' ), home_url(), $download ); + $message = sprintf( + /* translators: 1: Site URL 2: WordPress admin URL to BackupWordPress page */ + esc_html__( + 'BackUpWordPress has completed a backup of your site %1$s' . "\n\n" . + 'The backup file should be attached to this email.' . "\n\n" . + 'You can download the backup file by clicking the link below:' . "\n\n" . '%2$s' . "\n\n" . + 'Kind Regards,\nThe Happy BackUpWordPress Backup Emailing Robot', 'backupwordpress' + ), + esc_url( home_url() ), + esc_url( $download ) + ); $sent = wp_mail( $this->get_email_address_array(), $subject, $message, $headers, $file ); - } // If we didn't send the email above then send just the notification if ( ! $sent ) { - $message = sprintf( __( 'BackUpWordPress has completed a backup of your site %1$s.', 'backupwordpress' ) . "\n\n" . __( 'Unfortunately, the backup file was too large to attach to this email.', 'backupwordpress' ) . "\n\n" . __( 'You can download the backup file by clicking the link below:', 'backupwordpress' ) . "\n\n" . '%2$s' . "\n\n" . __( "Kind Regards,\nThe Happy BackUpWordPress Backup Emailing Robot", 'backupwordpress' ), home_url(), $download ); - wp_mail( $this->get_email_address_array(), $subject, $message, $headers ); + $message = sprintf( + /* translators: 1: Site URL 2: WordPress admin URL to BackupWordPress page */ + esc_html__( + 'BackUpWordPress has completed a backup of your site %1$s' . "\n\n" . + 'Unfortunately, the backup file was too large to attach to this email.' . "\n\n" . + 'You can download the backup file by clicking the link below:' . "\n\n" . '%2$s' . "\n\n" . + 'Kind Regards,\nThe Happy BackUpWordPress Backup Emailing Robot', 'backupwordpress' + ), + esc_url( home_url() ), + esc_url( $download ) + ); + wp_mail( $this->get_email_address_array(), $subject, $message, $headers ); } } }