From 242ab74f317bd972c29733dc53afbdb88cfc18a4 Mon Sep 17 00:00:00 2001 From: Brandon Olivares Date: Thu, 22 Feb 2024 06:59:59 -0500 Subject: [PATCH] Release 4.0.3 --- backwpup.php | 4 +- changelog.txt | 5 + inc/class-destination-ftp.php | 8 +- inc/class-page-jobs.php | 443 ++++++++++++++++++---------- languages/backwpup.pot | 116 ++++---- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 10 +- vendor/composer/autoload_static.php | 12 +- vendor/composer/installed.php | 4 +- 9 files changed, 372 insertions(+), 232 deletions(-) diff --git a/backwpup.php b/backwpup.php index 40d5fb78..ca763137 100755 --- a/backwpup.php +++ b/backwpup.php @@ -1,11 +1,11 @@ job['jobid'], 'lastbackupdownloadurl', - 'ftp://' . $job_object->job['ftpuser'] . ':' . BackWPup_Encryption::decrypt( - $job_object->job['ftppass'] - ) . '@' . $job_object->job['ftphost'] . ':' . $job_object->job['ftphostport'] . $current_ftp_dir . $job_object->backup_file + network_admin_url( + 'admin.php?page=backwpupbackups&action=downloadftp&file=' . + $current_ftp_dir . $job_object->backup_file . '&local_file=' . + $job_object->backup_file . '&jobid=' . $job_object->job['jobid'] + ) ); } diff --git a/inc/class-page-jobs.php b/inc/class-page-jobs.php index 6d6541e7..505b2921 100644 --- a/inc/class-page-jobs.php +++ b/inc/class-page-jobs.php @@ -1,4 +1,8 @@ '; - if (current_user_can('backwpup_backups_download')) { - $download_url = BackWPup_Option::get($item, 'lastbackupdownloadurl'); - if (!empty($download_url)) { - $r .= '' . esc_html__('Download', 'backwpup') . ' | '; + + $download_url = BackWPup_Option::get($item, 'lastbackupdownloadurl'); + if (current_user_can('backwpup_backups_download') && !empty($download_url)) { + // If it's not a direct link, but will be run through the downloader, then process differently + if (strpos($download_url, 'backwpupbackups') === false) { + $r .= '' . esc_html__('Download', 'backwpup') . ' | '; + } else { + $r .= self::generate_download_link($download_url) . ' | '; } } + if (current_user_can('backwpup_logs') && BackWPup_Option::get($item, 'logfile')) { $logfile = basename((string) BackWPup_Option::get($item, 'logfile')); if (is_object($this->job_object) && $this->job_object->job['jobid'] == $item) { @@ -338,6 +347,37 @@ public function column_last($item) return $r; } + private static function generate_download_link($download_url) + { + $params = []; + parse_str(wp_parse_url($download_url, PHP_URL_QUERY), $params); + + $file = $params['file']; + $local_file = untrailingslashit(BackWPup::get_plugin_data('TEMP')) . '/' . basename($params['local_file'] ?? $file); + $jobid = $params['jobid']; + $destination = strtoupper(str_replace('download', '', $params['action'])); + + // Construct the link + return sprintf( + '%7$s', + intval($jobid), + esc_attr($destination), + esc_attr($file), + esc_attr($local_file), + wp_create_nonce('backwpup_action_nonce'), + wp_nonce_url($download_url, 'backwpup_action_nonce'), + __('Download', 'backwpup') + ); + } + public static function load() { //Create Table @@ -430,7 +470,7 @@ public static function load() $dest_class = BackWPup::get_destination($id); $job_settings = BackWPup_Option::get_job($jobid); if (!$dest_class->can_run($job_settings)) { - BackWPup_Admin::message(sprintf(__('The job "%s" destination "%s" is not configured properly', 'backwpup'), esc_attr(BackWPup_Option::get($jobid, 'name')), $id), true); + BackWPup_Admin::message(sprintf(__('The job "%1$s" destination "%2$s" is not configured properly', 'backwpup'), esc_attr(BackWPup_Option::get($jobid, 'name')), $id), true); } ++$destinations; } @@ -454,7 +494,7 @@ public static function load() $new_log_file = BackWPup_Option::get($jobid, 'logfile', null, false); //wait maximal 10 sec. if ($i >= 40) { - BackWPup_Admin::message(sprintf(__('Job "%s" has started, but not responded for 10 seconds. Please check information.', 'backwpup'), esc_attr(BackWPup_Option::get($jobid, 'name')), network_admin_url('admin.php') . '?page=backwpupsettings#backwpup-tab-information'), true); + BackWPup_Admin::message(sprintf(__('Job "%1$s" has started, but not responded for 10 seconds. Please check information.', 'backwpup'), esc_attr(BackWPup_Option::get($jobid, 'name')), network_admin_url('admin.php') . '?page=backwpupsettings#backwpup-tab-information'), true); break 2; } ++$i; @@ -488,92 +528,158 @@ public static function load() public static function admin_print_styles() { ?> - - + + .column-last, .column-next, .column-type, .column-dest { + width: 15%; + } + + #TB_ajaxContent { + background-color: black; + color: #c0c0c0; + } + + #showworking { + white-space:nowrap; + display: block; + width: 100%; + font-family:monospace; + font-size:12px; + line-height:15px; + } + #runningjob { + padding:10px; + position:relative; + margin: 15px 0 25px 0; + padding-bottom:25px; + } + h2#runnigtitle { + margin-bottom: 15px; + padding: 0; + } + #warningsid, #errorid { + margin-right: 10px; + } + + .infobuttons { + position: absolute; + right: 10px; + bottom: 0; + } + + .progressbar { + margin-top: 20px; + height: auto; + background: #f6f6f6 url('/assets/images/progressbarhg.jpg'); + } + + #lastmsg, #onstep, #lasterrormsg { + text-align: center; + margin-bottom: 20px; + } + #backwpup-page #lastmsg, + #backwpup-page #onstep, + #backwpup-page #lasterrormsg { + font-family: "Open Sans", sans-serif; + } + .bwpu-progress { + background-color: #1d94cf; + color: #fff; + padding: 5px 0; + text-align: center; + } + #progresssteps { + background-color: #007fb6; + } + + .row-actions .lastlog { + display: none; + } + + @media screen and (max-width: 782px) { + .column-type, .column-dest { + display: none; + } + .row-actions .lastlog { + display: inline-block; + } + .last-action-links { + display: none; + } + } + + -
-
-

job['name'])); ?>

- warnings; ?> - errors; ?> -
- -
-
- -
-
step_percent); ?>%
-
steps_data[$job_object->step_working]['NAME']); ?>
-
substep_percent); ?>%
-
lastmsg); ?>
- -
- -
- - +
+

job['name'])); ?>

+ warnings; ?> + errors; ?> +
+ +
+
+ +
+
step_percent); ?>%
+
steps_data[$job_object->step_working]['NAME']); ?>
+
substep_percent); ?>%
+
lastmsg); ?>
+ + + + + + display(); ?> -
-
- - + + + + + + logfile)) { ?> - information." +#: inc/class-page-jobs.php:497 +msgid "Job \"%1$s\" has started, but not responded for 10 seconds. Please check information." msgstr "" -#: inc/class-page-jobs.php:462 +#: inc/class-page-jobs.php:502 msgid "Job \"%s\" started." msgstr "" -#: inc/class-page-jobs.php:477, inc/class-wp-cli.php:60 +#: inc/class-page-jobs.php:517, inc/class-wp-cli.php:60 msgid "Job will be terminated." msgstr "" -#: inc/class-page-jobs.php:582 +#: inc/class-page-jobs.php:688 msgid "%s › Jobs" msgstr "" -#: inc/class-page-jobs.php:601 +#: inc/class-page-jobs.php:707 msgid "Job currently running: %s" msgstr "" -#: inc/class-page-jobs.php:602 +#: inc/class-page-jobs.php:708 msgid "Warnings:" msgstr "" -#: inc/class-page-jobs.php:603 +#: inc/class-page-jobs.php:709 msgid "Errors:" msgstr "" -#: inc/class-page-jobs.php:604 +#: inc/class-page-jobs.php:710 msgid "Log of running job" msgstr "" -#: inc/class-page-jobs.php:604 +#: inc/class-page-jobs.php:710 msgid "Display working log" msgstr "" -#: inc/class-page-jobs.php:606 +#: inc/class-page-jobs.php:712 msgid "Close working screen" msgstr "" -#: inc/class-page-jobs.php:606 +#: inc/class-page-jobs.php:712 msgid "Close" msgstr "" -#: inc/class-page-jobs.php:782 +#: inc/class-page-jobs.php:913 msgid "Job completed" msgstr "" -#: inc/class-page-jobs.php:786 +#: inc/class-page-jobs.php:917 msgid "Job has done with warnings in %s seconds. Please resolve them for correct execution." msgstr "" diff --git a/vendor/autoload.php b/vendor/autoload.php index fbe2600d..b825207d 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit8745a2a92f68f1c8f911a1638308726f::getLoader(); +return ComposerAutoloaderInitb81f714672cab81745951e3983f718b7::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 9ba10bce..da9f9308 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit8745a2a92f68f1c8f911a1638308726f +class ComposerAutoloaderInitb81f714672cab81745951e3983f718b7 { private static $loader; @@ -24,20 +24,20 @@ public static function getLoader() require __DIR__ . '/platform_check.php'; - spl_autoload_register(array('ComposerAutoloaderInit8745a2a92f68f1c8f911a1638308726f', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitb81f714672cab81745951e3983f718b7', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit8745a2a92f68f1c8f911a1638308726f', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitb81f714672cab81745951e3983f718b7', 'loadClassLoader')); $includePaths = require __DIR__ . '/include_paths.php'; $includePaths[] = get_include_path(); set_include_path(implode(PATH_SEPARATOR, $includePaths)); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit8745a2a92f68f1c8f911a1638308726f::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInitb81f714672cab81745951e3983f718b7::getInitializer($loader)); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInit8745a2a92f68f1c8f911a1638308726f::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInitb81f714672cab81745951e3983f718b7::$files; $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 0a1b69a2..d34e31bd 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit8745a2a92f68f1c8f911a1638308726f +class ComposerStaticInitb81f714672cab81745951e3983f718b7 { public static $files = array ( '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', @@ -3217,11 +3217,11 @@ class ComposerStaticInit8745a2a92f68f1c8f911a1638308726f public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit8745a2a92f68f1c8f911a1638308726f::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit8745a2a92f68f1c8f911a1638308726f::$prefixDirsPsr4; - $loader->prefixesPsr0 = ComposerStaticInit8745a2a92f68f1c8f911a1638308726f::$prefixesPsr0; - $loader->fallbackDirsPsr0 = ComposerStaticInit8745a2a92f68f1c8f911a1638308726f::$fallbackDirsPsr0; - $loader->classMap = ComposerStaticInit8745a2a92f68f1c8f911a1638308726f::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInitb81f714672cab81745951e3983f718b7::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitb81f714672cab81745951e3983f718b7::$prefixDirsPsr4; + $loader->prefixesPsr0 = ComposerStaticInitb81f714672cab81745951e3983f718b7::$prefixesPsr0; + $loader->fallbackDirsPsr0 = ComposerStaticInitb81f714672cab81745951e3983f718b7::$fallbackDirsPsr0; + $loader->classMap = ComposerStaticInitb81f714672cab81745951e3983f718b7::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index adcaad8b..ff58c342 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'inpsyde/backwpup-pro', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'f96c385c709931ba47075cfd8399cb7150f7fb6f', + 'reference' => '7f26d0781b98a4118ec32a27f37002bbbbaf689b', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -208,7 +208,7 @@ 'inpsyde/backwpup-pro' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'f96c385c709931ba47075cfd8399cb7150f7fb6f', + 'reference' => '7f26d0781b98a4118ec32a27f37002bbbbaf689b', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(),