get_type() ) );
// Backup Time
$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 ) ) ) ) . '"';
// Backup status
$status = new Backup_Status( $schedule->get_id() );
// Backup Re-occurrence
switch ( $schedule->get_reoccurrence() ) :
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 ) ) ) ) . '';
break;
case 'daily' :
$reoccurrence = sprintf( __( 'daily at %s', 'backupwordpress' ), '' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '' );
break;
case 'twicedaily' :
$times[] = date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) );
$times[] = date_i18n( get_option( 'time_format' ), strtotime( '+ 12 hours', $schedule->get_next_occurrence( false ) ) );
sort( $times );
$reoccurrence = sprintf( __( '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 ) ) ) . '' );
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 ) ) ) . '' );
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 ) ) ) . '' );
break;
case 'manually' :
$reoccurrence = __( 'manually', 'backupwordpress' );
break;
default :
$reoccurrence = __( 'manually', 'backupwordpress' );
$schedule->set_reoccurrence( 'manually' );
endswitch;
$server = '' . esc_attr( str_replace( Path::get_home_path(), '', Path::get_path() ) ) . '';
// Backup to keep
switch ( $schedule->get_max_backups() ) :
case 1 :
$backup_to_keep = sprintf( __( '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() );
break;
default :
$backup_to_keep = sprintf( __( 'store the last %1$s backups in %2$s', 'backupwordpress' ), esc_html( $schedule->get_max_backups() ), $server );
endswitch;
$email_msg = '';
$services = array();
foreach ( Services::get_services( $schedule ) as $file => $service ) {
if ( is_wp_error( $service ) ) {
$email_msg = $service->get_error_message();
} elseif ( 'Email' === $service->name ) {
$email_msg = wp_kses_post( $service->display() );
} elseif ( $service->is_service_active() && $service->display() ) {
$services[] = esc_html( $service->display() );
}
}
if ( ! empty( $services ) && count( $services ) > 1 ) {
$services[ count( $services ) -2 ] .= ' & ' . $services[ count( $services ) -1 ];
array_pop( $services );
} ?>
%s)',
esc_html( $site_size->get_formatted_site_size() )
);
}
return '';
}