edit_auth( $jobid ); } } } /** * Save form data. * * @param string $tab Active tab slug. * @param int $jobid Job ID. * * @return string|void */ public static function save_post_form( $tab, int $jobid ) { if ( ! current_user_can( 'backwpup_jobs_edit' ) ) { return __( 'Sorry, you don\'t have permissions to do that.', 'backwpup' ); } check_admin_referer( 'backwpupeditjob_page' ); $post_data = wp_unslash( $_POST ); $job_types = BackWPup::get_job_types(); switch ( $tab ) { case 'job': BackWPup_Option::update( $jobid, 'jobid', $jobid ); // Set type of backup. $backuptype_input = isset( $post_data['backuptype'] ) ? sanitize_text_field( $post_data['backuptype'] ) : ''; $backuptype = ( class_exists( \BackWPup_Pro::class, false ) && 'sync' === $backuptype_input ) ? 'sync' : 'archive'; BackWPup_Option::update( $jobid, 'backuptype', $backuptype ); $type_post = isset( $post_data['type'] ) ? (array) $post_data['type'] : []; $type_post = array_map( 'sanitize_text_field', $type_post ); // Check existing type. foreach ( $type_post as $key => $value ) { if ( ! isset( $job_types[ $value ] ) ) { unset( $type_post[ $key ] ); } } sort( $type_post ); BackWPup_Option::update( $jobid, 'type', $type_post ); // Test if job type makes backup. $makes_file = false; /** * Job type instance. * * @var BackWPup_JobTypes $job_type */ foreach ( $job_types as $type_id => $job_type ) { if ( in_array( $type_id, $type_post, true ) ) { if ( $job_type->creates_file() ) { $makes_file = true; break; } } } if ( $makes_file ) { $destinations_post = isset( $post_data['destinations'] ) ? (array) $post_data['destinations'] : []; } else { $destinations_post = []; } $destinations_post = array_map( 'sanitize_text_field', $destinations_post ); $destinations = BackWPup::get_registered_destinations(); foreach ( $destinations_post as $key => $dest_id ) { // Remove all destinations that do not exist. if ( ! isset( $destinations[ $dest_id ] ) ) { unset( $destinations_post[ $key ] ); continue; } // If sync remove all non-sync destinations. if ( 'sync' === $backuptype ) { if ( ! $destinations[ $dest_id ]['can_sync'] ) { unset( $destinations_post[ $key ] ); } } } sort( $destinations_post ); BackWPup_Option::update( $jobid, 'destinations', $destinations_post ); $name = isset( $post_data['name'] ) ? sanitize_text_field( $post_data['name'] ) : ''; $name = trim( (string) $name ); if ( '' === $name || __( 'New Job', 'backwpup' ) === $name ) { $name = sprintf( /* translators: %d: job ID. */ __( 'Job with ID %d', 'backwpup' ), $jobid ); } BackWPup_Option::update( $jobid, 'name', $name ); $mailaddresslog_input = isset( $post_data['mailaddresslog'] ) ? sanitize_text_field( $post_data['mailaddresslog'] ) : ''; $emails = explode( ',', $mailaddresslog_input ); foreach ( $emails as $key => $email ) { $emails[ $key ] = sanitize_email( trim( $email ) ); if ( ! is_email( $emails[ $key ] ) ) { unset( $emails[ $key ] ); } } $mailaddresslog = implode( ', ', $emails ); BackWPup_Option::update( $jobid, 'mailaddresslog', $mailaddresslog ); $mailaddresssenderlog = isset( $post_data['mailaddresssenderlog'] ) ? sanitize_text_field( $post_data['mailaddresssenderlog'] ) : ''; $mailaddresssenderlog = trim( $mailaddresssenderlog ); BackWPup_Option::update( $jobid, 'mailaddresssenderlog', $mailaddresssenderlog ); BackWPup_Option::update( $jobid, 'mailerroronly', ! empty( $post_data['mailerroronly'] ) ); $archiveformat_input = isset( $post_data['archiveformat'] ) ? sanitize_text_field( $post_data['archiveformat'] ) : ''; $archiveformat = in_array( $archiveformat_input, BackWPup_Option::get_allowed_archive_formats(), true ) ? $archiveformat_input : '.tar'; BackWPup_Option::update( $jobid, 'archiveformat', $archiveformat ); $archivename_input = isset( $post_data['archivename'] ) ? sanitize_text_field( $post_data['archivename'] ) : ''; $archivename = BackWPup_Job::sanitize_file_name( BackWPup_Option::normalize_archive_name( $archivename_input, $jobid, false ) ); BackWPup_Option::update( $jobid, 'archivename', $archivename ); break; case 'cron': $activetype_input = isset( $post_data['activetype'] ) ? sanitize_text_field( $post_data['activetype'] ) : ''; $activetype = in_array( $activetype_input, [ '', 'wpcron', 'link', ], true ) ? $activetype_input : ''; BackWPup_Option::update( $jobid, 'activetype', $activetype ); $cronselect_input = isset( $post_data['cronselect'] ) ? sanitize_text_field( $post_data['cronselect'] ) : ''; $cronselect = ( 'advanced' === $cronselect_input ) ? 'advanced' : 'basic'; BackWPup_Option::update( $jobid, 'cronselect', $cronselect ); $cronminutes = isset( $post_data['cronminutes'] ) ? (array) $post_data['cronminutes'] : []; $cronminutes = array_map( 'sanitize_text_field', $cronminutes ); $cronhours = isset( $post_data['cronhours'] ) ? (array) $post_data['cronhours'] : []; $cronhours = array_map( 'sanitize_text_field', $cronhours ); $cronmday = isset( $post_data['cronmday'] ) ? (array) $post_data['cronmday'] : []; $cronmday = array_map( 'sanitize_text_field', $cronmday ); $cronmon = isset( $post_data['cronmon'] ) ? (array) $post_data['cronmon'] : []; $cronmon = array_map( 'sanitize_text_field', $cronmon ); $cronwday = isset( $post_data['cronwday'] ) ? (array) $post_data['cronwday'] : []; $cronwday = array_map( 'sanitize_text_field', $cronwday ); // Save advanced. if ( 'advanced' === $cronselect ) { $cronminutes_first = $cronminutes[0] ?? ''; if ( '' === $cronminutes_first || '*' === $cronminutes_first ) { $cronminutes_step = $cronminutes[1] ?? ''; $cronminutes = '' !== $cronminutes_step ? [ '*/' . $cronminutes_step ] : [ '*' ]; } $cronhours_first = $cronhours[0] ?? ''; if ( '' === $cronhours_first || '*' === $cronhours_first ) { $cronhours_step = $cronhours[1] ?? ''; $cronhours = '' !== $cronhours_step ? [ '*/' . $cronhours_step ] : [ '*' ]; } $cronmday_first = $cronmday[0] ?? ''; if ( '' === $cronmday_first || '*' === $cronmday_first ) { $cronmday_step = $cronmday[1] ?? ''; $cronmday = '' !== $cronmday_step ? [ '*/' . $cronmday_step ] : [ '*' ]; } $cronmon_first = $cronmon[0] ?? ''; if ( '' === $cronmon_first || '*' === $cronmon_first ) { $cronmon_step = $cronmon[1] ?? ''; $cronmon = '' !== $cronmon_step ? [ '*/' . $cronmon_step ] : [ '*' ]; } $cronwday_first = $cronwday[0] ?? ''; if ( '' === $cronwday_first || '*' === $cronwday_first ) { $cronwday_step = $cronwday[1] ?? ''; $cronwday = '' !== $cronwday_step ? [ '*/' . $cronwday_step ] : [ '*' ]; } $cron = implode( ',', $cronminutes ) . ' ' . implode( ',', $cronhours ) . ' ' . implode( ',', $cronmday ) . ' ' . implode( ',', $cronmon ) . ' ' . implode( ',', $cronwday ); BackWPup_Option::update( $jobid, 'cron', $cron ); } else { // Save basic. $cronbtype = isset( $post_data['cronbtype'] ) ? sanitize_text_field( $post_data['cronbtype'] ) : ''; if ( 'mon' === $cronbtype ) { $mon_minutes = isset( $post_data['moncronminutes'] ) ? absint( $post_data['moncronminutes'] ) : 0; $mon_hours = isset( $post_data['moncronhours'] ) ? absint( $post_data['moncronhours'] ) : 0; $mon_mday = isset( $post_data['moncronmday'] ) ? absint( $post_data['moncronmday'] ) : 0; BackWPup_Option::update( $jobid, 'cron', $mon_minutes . ' ' . $mon_hours . ' ' . $mon_mday . ' * *' ); } if ( 'week' === $cronbtype ) { $week_minutes = isset( $post_data['weekcronminutes'] ) ? absint( $post_data['weekcronminutes'] ) : 0; $week_hours = isset( $post_data['weekcronhours'] ) ? absint( $post_data['weekcronhours'] ) : 0; $week_wday = isset( $post_data['weekcronwday'] ) ? absint( $post_data['weekcronwday'] ) : 0; BackWPup_Option::update( $jobid, 'cron', $week_minutes . ' ' . $week_hours . ' * * ' . $week_wday ); } if ( 'day' === $cronbtype ) { $day_minutes = isset( $post_data['daycronminutes'] ) ? absint( $post_data['daycronminutes'] ) : 0; $day_hours = isset( $post_data['daycronhours'] ) ? absint( $post_data['daycronhours'] ) : 0; BackWPup_Option::update( $jobid, 'cron', $day_minutes . ' ' . $day_hours . ' * * *' ); } if ( 'hour' === $cronbtype ) { $hour_minutes = isset( $post_data['hourcronminutes'] ) ? absint( $post_data['hourcronminutes'] ) : 0; BackWPup_Option::update( $jobid, 'cron', $hour_minutes . ' * * * *' ); } } // Reschedule. $activetype = BackWPup_Option::get( $jobid, 'activetype' ); wp_clear_scheduled_hook( 'backwpup_cron', [ 'arg' => $jobid ] ); if ( 'wpcron' === $activetype ) { $cron_next = BackWPup_Cron::cron_next( BackWPup_Option::get( $jobid, 'cron' ) ); wp_schedule_single_event( $cron_next, 'backwpup_cron', [ 'arg' => $jobid ] ); } break; default: if ( strstr( (string) $tab, 'dest-' ) ) { $dest_class = BackWPup::get_destination( str_replace( 'dest-', '', (string) $tab ) ); $dest_class->edit_form_post_save( $jobid ); } if ( strstr( (string) $tab, 'jobtype-' ) ) { $id = strtoupper( str_replace( 'jobtype-', '', (string) $tab ) ); $job_types[ $id ]->edit_form_post_save( $jobid, $post_data ); } } // Saved message. $messages = BackWPup_Admin::get_messages(); if ( empty( $messages['error'] ) ) { $url = BackWPup_Job::get_jobrun_url( 'runnowlink', $jobid ); BackWPup_Admin::message( sprintf( /* translators: %s: job name. */ __( 'Changes for job %s saved.', 'backwpup' ), BackWPup_Option::get( $jobid, 'name' ) ) . ' ' . __( 'Jobs overview', 'backwpup' ) . ' | ' . __( 'Run now', 'backwpup' ) . '' ); } } /** * Output css. */ public static function admin_print_styles() { ?> admin_print_styles(); } elseif ( 'jobtype-' === substr( $tab, 0, 8 ) ) { $job_type = BackWPup::get_job_types(); $id = strtoupper( str_replace( 'jobtype-', '', $tab ) ); $job_type[ $id ]->admin_print_styles(); } } /** * Output js. */ public static function admin_print_scripts() { wp_enqueue_script( 'backwpupgeneral' ); $nonce = filter_input( INPUT_GET, '_wpnonce', FILTER_SANITIZE_FULL_SPECIAL_CHARS ); if ( ! empty( $nonce ) ) { check_admin_referer( 'edit-job' ); } $tab = filter_input( INPUT_GET, 'tab', FILTER_SANITIZE_FULL_SPECIAL_CHARS ); $tab = $tab ? sanitize_text_field( $tab ) : 'job'; // Add JS for the first tabs. if ( 'job' === $tab ) { if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { wp_enqueue_script( 'backwpuptabjob', BackWPup::get_plugin_data( 'URL' ) . '/assets/js/page_edit_tab_job.js', [ 'jquery' ], time(), true ); } else { wp_enqueue_script( 'backwpuptabjob', BackWPup::get_plugin_data( 'URL' ) . '/assets/js/page_edit_tab_job.min.js', [ 'jquery' ], BackWPup::get_plugin_data( 'Version' ), true ); } } elseif ( 'cron' === $tab ) { if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { wp_enqueue_script( 'backwpuptabcron', BackWPup::get_plugin_data( 'URL' ) . '/assets/js/page_edit_tab_cron.js', [ 'jquery' ], time(), true ); } else { wp_enqueue_script( 'backwpuptabcron', BackWPup::get_plugin_data( 'URL' ) . '/assets/js/page_edit_tab_cron.min.js', [ 'jquery' ], BackWPup::get_plugin_data( 'Version' ), true ); } } elseif ( false !== strpos( $tab, 'dest-' ) ) { $dest_object = BackWPup::get_destination( str_replace( 'dest-', '', $tab ) ); $dest_object->admin_print_scripts(); } elseif ( false !== strpos( $tab, 'jobtype-' ) ) { $job_type = BackWPup::get_job_types(); $id = strtoupper( str_replace( 'jobtype-', '', $tab ) ); $job_type[ $id ]->admin_print_scripts(); } } /** * Generates and displays the BackWPup job editing page. * * This method is responsible for rendering the UI and forms for the BackWPup job configuration * page within the WordPress admin dashboard. It checks for an existing job ID or creates a new one, * initializes options and job types, and dynamically generates navigation tabs based on job types. * The page includes forms and input fields for job details such as name, backup tasks, archive name, * and various job-specific settings. * * @return void */ public static function page() { $jobid_param = absint( filter_input( INPUT_GET, 'jobid', FILTER_SANITIZE_NUMBER_INT ) ); if ( $jobid_param > 0 ) { $jobid = in_array( $jobid_param, BackWPup_Option::get_job_ids(), true ) ? $jobid_param : 0; } else { // Generate job ID if it does not exist. $jobid = BackWPup_Option::next_job_id(); } if ( ! $jobid ) { return; } $tab = filter_input( INPUT_GET, 'tab', FILTER_SANITIZE_FULL_SPECIAL_CHARS ); $tab = $tab ? sanitize_title_with_dashes( $tab ) : 'job'; if ( 'dest-' !== substr( $tab, 0, 5 ) && 'jobtype-' !== substr( $tab, 0, 8 ) && ! in_array( $tab, [ 'job', 'cron' ], true ) ) { $tab = 'job'; } $_GET['tab'] = $tab; $destinations = BackWPup::get_registered_destinations(); $job_types = BackWPup::get_job_types(); // Is encryption disabled? $disable_encryption = true; if ( ( 'symmetric' === get_site_option( 'backwpup_cfg_encryption' ) && get_site_option( 'backwpup_cfg_encryptionkey' ) ) || ( 'asymmetric' === get_site_option( 'backwpup_cfg_encryption' ) && get_site_option( 'backwpup_cfg_publickey' ) ) ) { $disable_encryption = false; } $archive_format_option = BackWPup_Option::get( $jobid, 'archiveformat' ); $allowed_formats = BackWPup_Option::get_allowed_archive_formats(); if ( ! in_array( $archive_format_option, $allowed_formats, true ) ) { BackWPup_Admin::message( BackWPup_Admin::unavailable_archive_format_notice( BackWPup_Option::get( $jobid, 'name' ), $archive_format_option ), true ); $archive_format_option = '.tar'; } ?>
' . sprintf( esc_html__( '%1$s › Job: %2$s', 'backwpup' ), esc_attr( BackWPup::get_plugin_data( 'name' ) ), '' . esc_html( BackWPup_Option::get( $jobid, 'name' ) ) . '' ) . ''; // Default tabs. $tabs = [ 'job' => [ 'name' => esc_html__( 'General', 'backwpup' ), 'display' => true, ], 'cron' => [ 'name' => __( 'Schedule', 'backwpup' ), 'display' => true, ], ]; // Add job types to tabs. $job_job_types = BackWPup_Option::get( $jobid, 'type' ); foreach ( $job_types as $typeid => $typeclass ) { $tabid = 'jobtype-' . strtolower( $typeid ); $tabs[ $tabid ]['name'] = $typeclass->info['name']; $tabs[ $tabid ]['display'] = true; if ( ! in_array( $typeid, $job_job_types, true ) ) { $tabs[ $tabid ]['display'] = false; } } // Display tabs. echo ''; // phpcs:disable // Display messages. BackWPup_Admin::display_messages(); echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; wp_nonce_field( 'backwpupeditjob_page' ); wp_nonce_field( 'backwpup_ajax_nonce', 'backwpupajaxnonce', false ); switch ( $tab ) { case 'job': ?>

$typeclass) { $addclass = ''; if ($typeclass->creates_file()) { $addclass .= ' filetype'; } echo '

'; if ( ! empty( $typeclass->info['help'] ) ) { echo '
' . esc_attr( $typeclass->info['help'] ) . ''; } echo '

'; } ?>

' . esc_html__('Preview: ', 'backwpup') . '' . esc_attr($archivename) . '' . esc_attr($archive_format_option) . '

'; echo '

'; echo '' . esc_attr__('Replacement patterns:', 'backwpup') . '
'; echo esc_attr__('%d = Two digit day of the month, with leading zeros', 'backwpup') . '
'; echo esc_attr__('%j = Day of the month, without leading zeros', 'backwpup') . '
'; echo esc_attr__('%m = Two-digit representation of the month, with leading zeros', 'backwpup') . '
'; echo esc_attr__('%n = Representation of the month (without leading zeros)', 'backwpup') . '
'; echo esc_attr__('%Y = Four digit representation of the year', 'backwpup') . '
'; echo esc_attr__('%y = Two digit representation of the year', 'backwpup') . '
'; echo esc_attr__('%a = Lowercase ante meridiem (am) and post meridiem (pm)', 'backwpup') . '
'; echo esc_attr__('%A = Uppercase ante meridiem (AM) and post meridiem (PM)', 'backwpup') . '
'; echo esc_attr__('%B = Swatch Internet Time', 'backwpup') . '
'; echo esc_attr__('%g = Hour in 12-hour format, without leading zeros', 'backwpup') . '
'; echo esc_attr__('%G = Hour in 24-hour format, without leading zeros', 'backwpup') . '
'; echo esc_attr__('%h = Two-digit hour in 12-hour format, with leading zeros', 'backwpup') . '
'; echo esc_attr__('%H = Two-digit hour in 24-hour format, with leading zeros', 'backwpup') . '
'; echo esc_attr__('%i = Two digit representation of the minute', 'backwpup') . '
'; echo esc_attr__('%s = Two digit representation of the second', 'backwpup') . '
'; echo '

'; ?>
[ 'label' => __( 'Zip', 'backwpup' ), 'id' => 'idarchiveformat-zip', 'available' => class_exists( \ZipArchive::class ), 'disabled_description' => __( 'ZipArchive PHP class is missing, so BackWPUp will use PclZip instead.', 'backwpup' ), ], '.tar' => [ 'label' => __( 'Tar', 'backwpup' ), 'id' => 'idarchiveformat-tar', 'available' => true, 'disabled_description' => '', ], '.tar.gz' => [ 'label' => __( 'Tar GZip', 'backwpup' ), 'id' => 'idarchiveformat-targz', 'available' => function_exists( 'gzopen' ), 'disabled_description' => sprintf( __( 'Disabled due to missing %s PHP function.', 'backwpup' ), 'gzopen()' ), ], ]; foreach ( BackWPup_Option::get_allowed_archive_formats() as $format ) { if ( ! isset( $format_config[ $format ] ) ) { continue; } $config = $format_config[ $format ]; $disabled = $config['available'] ? '' : ' disabled="disabled"'; echo '

'; if ( ! $config['available'] && ! empty( $config['disabled_description'] ) ) { echo '
' . esc_html( $config['disabled_description'] ) . ''; } echo '

'; } ?>

$dest) { $syncclass = ''; if (!$dest['can_sync']) { $syncclass = 'nosync'; } echo '

'; } ?>



WP-CLI to run jobs from commandline.', 'backwpup'); ?>

BackWPup_Option::get($jobid, 'cron'), 'crontype' => BackWPup_Option::get($jobid, 'cronselect')]); ?> > >


'; if ( false !== strpos( $tab, 'jobtype-' ) ) { $id = strtoupper( str_replace( 'jobtype-', '', $tab ) ); $job_types[ $id ]->edit_tab( $jobid ); } echo '
'; } echo '

'; submit_button(__('Save changes', 'backwpup'), 'primary', 'save', false, ['tabindex' => '2', 'accesskey' => 'p']); echo '

'; ?> edit_inline_js(); } if ( false !== strpos( $tab, 'jobtype-' ) ) { $id = strtoupper( str_replace( 'jobtype-', '', $tab ) ); $job_types[ $id ]->edit_inline_js(); } // phpcs:enable } /** * Output cron schedule text. * * @param array|string $args Cron data when called from the page render. * * @return void */ public static function ajax_cron_text( $args = '' ) { if ( is_array( $args ) ) { $cronstamp = isset( $args['cronstamp'] ) ? (string) $args['cronstamp'] : ''; $crontype = isset( $args['crontype'] ) ? (string) $args['crontype'] : ''; $ajax = false; } else { if ( ! current_user_can( 'backwpup_jobs_edit' ) ) { wp_die( -1 ); } check_ajax_referer( 'backwpup_ajax_nonce' ); $post_data = wp_unslash( $_POST ); $cronminutes = isset( $post_data['cronminutes'] ) ? (array) $post_data['cronminutes'] : []; $cronminutes = array_map( 'sanitize_text_field', $cronminutes ); $cronhours = isset( $post_data['cronhours'] ) ? (array) $post_data['cronhours'] : []; $cronhours = array_map( 'sanitize_text_field', $cronhours ); $cronmday = isset( $post_data['cronmday'] ) ? (array) $post_data['cronmday'] : []; $cronmday = array_map( 'sanitize_text_field', $cronmday ); $cronmon = isset( $post_data['cronmon'] ) ? (array) $post_data['cronmon'] : []; $cronmon = array_map( 'sanitize_text_field', $cronmon ); $cronwday = isset( $post_data['cronwday'] ) ? (array) $post_data['cronwday'] : []; $cronwday = array_map( 'sanitize_text_field', $cronwday ); $cronminutes_first = $cronminutes[0] ?? ''; if ( '' === $cronminutes_first || '*' === $cronminutes_first ) { $cronminutes_step = $cronminutes[1] ?? ''; $cronminutes = '' !== $cronminutes_step ? [ '*/' . $cronminutes_step ] : [ '*' ]; } $cronhours_first = $cronhours[0] ?? ''; if ( '' === $cronhours_first || '*' === $cronhours_first ) { $cronhours_step = $cronhours[1] ?? ''; $cronhours = '' !== $cronhours_step ? [ '*/' . $cronhours_step ] : [ '*' ]; } $cronmday_first = $cronmday[0] ?? ''; if ( '' === $cronmday_first || '*' === $cronmday_first ) { $cronmday_step = $cronmday[1] ?? ''; $cronmday = '' !== $cronmday_step ? [ '*/' . $cronmday_step ] : [ '*' ]; } $cronmon_first = $cronmon[0] ?? ''; if ( '' === $cronmon_first || '*' === $cronmon_first ) { $cronmon_step = $cronmon[1] ?? ''; $cronmon = '' !== $cronmon_step ? [ '*/' . $cronmon_step ] : [ '*' ]; } $cronwday_first = $cronwday[0] ?? ''; if ( '' === $cronwday_first || '*' === $cronwday_first ) { $cronwday_step = $cronwday[1] ?? ''; $cronwday = '' !== $cronwday_step ? [ '*/' . $cronwday_step ] : [ '*' ]; } $crontype = isset( $post_data['crontype'] ) ? sanitize_text_field( $post_data['crontype'] ) : ''; $cronstamp = implode( ',', $cronminutes ) . ' ' . implode( ',', $cronhours ) . ' ' . implode( ',', $cronmday ) . ' ' . implode( ',', $cronmon ) . ' ' . implode( ',', $cronwday ); $ajax = true; } echo '

'; if ( 'advanced' === $crontype ) { echo wp_kses( str_replace( '\"', '"', __( 'Working as Cron schedule:', 'backwpup' ) ), [ 'a' => [ 'href' => [], ], ] ); echo ' ' . esc_html( $cronstamp ) . '
'; } $cronstr = []; [$cronstr['minutes'], $cronstr['hours'], $cronstr['mday'], $cronstr['mon'], $cronstr['wday']] = explode( ' ', $cronstamp, 5 ); if ( false !== strpos( $cronstr['minutes'], '*/' ) || '*' === $cronstr['minutes'] ) { $repeatmins = str_replace( '*/', '', $cronstr['minutes'] ); if ( '*' === $repeatmins || empty( $repeatmins ) ) { $repeatmins = 5; } // translators: %d: number of minutes. echo '' . sprintf( esc_html__( 'ATTENTION: Job runs every %d minutes!', 'backwpup' ), absint( $repeatmins ) ) . '
'; } $cron_next = BackWPup_Cron::cron_next( $cronstamp ) + ( get_option( 'gmt_offset' ) * 3600 ); if ( PHP_INT_MAX === $cron_next ) { echo '' . esc_html__( 'ATTENTION: Can\'t calculate cron!', 'backwpup' ) . '
'; } else { esc_html_e( 'Next runtime:', 'backwpup' ); echo ' ' . esc_html( wp_date( 'D, j M Y, H:i', $cron_next ) ) . ''; } echo '

'; if ( $ajax ) { exit(); } } }