Skip to content

Commit da7c28a

Browse files
committed
Release 5.0.7
1 parent 35aad6f commit da7c28a

38 files changed

+1028
-602
lines changed

assets/css/backwpup-admin.css

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -999,10 +999,6 @@ select {
999999
display: table;
10001000
}
10011001

1002-
.grid {
1003-
display: grid;
1004-
}
1005-
10061002
.hidden {
10071003
display: none;
10081004
}
@@ -1182,10 +1178,6 @@ select {
11821178
user-select: all;
11831179
}
11841180

1185-
.grid-cols-4 {
1186-
grid-template-columns: repeat(4, minmax(0, 1fr));
1187-
}
1188-
11891181
.flex-col {
11901182
flex-direction: column;
11911183
}
@@ -1222,10 +1214,6 @@ select {
12221214
gap: 2.5rem;
12231215
}
12241216

1225-
.gap-16 {
1226-
gap: 4rem;
1227-
}
1228-
12291217
.gap-2 {
12301218
gap: 0.5rem;
12311219
}

assets/js/backwpup-admin.js

Lines changed: 62 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -479,37 +479,55 @@ jQuery(document).ready(function ($) {
479479

480480
// Frequency fields
481481
function showFrequencyFilesFields(frequency) {
482+
let frequencies = ["daily", "weekly", "monthly"];
483+
484+
if (frequency === "hourly") {
485+
$(".js-backwpup-frequency-file-hide-if-hourly, .js-backwpup-frequency-file-show-if-weekly, .js-backwpup-frequency-file-show-if-monthly").hide();
486+
}
487+
482488
if (frequency === "weekly") {
483-
$(".js-backwpup-frequency-file-show-if-weekly").show();
484-
$(".js-backwpup-frequency-file-show-if-monthly").hide();
489+
$(".js-backwpup-frequency-file-show-if-hourly, .js-backwpup-frequency-file-show-if-monthly").hide();
485490
}
486491

487492
if (frequency === "monthly") {
488-
$(".js-backwpup-frequency-file-show-if-weekly").hide();
489-
$(".js-backwpup-frequency-file-show-if-monthly").show();
493+
$(".js-backwpup-frequency-file-show-if-hourly, js-backwpup-frequency-file-show-if-weekly").hide();
490494
}
491495

492496
if (frequency === "daily") {
493-
$(".js-backwpup-frequency-file-show-if-weekly").hide();
494-
$(".js-backwpup-frequency-file-show-if-monthly").hide();
497+
$(".js-backwpup-frequency-file-show-if-hourly, .js-backwpup-frequency-file-show-if-weekly, .js-backwpup-frequency-file-show-if-monthly").hide();
495498
}
499+
500+
if ( frequencies.includes(frequency) ) {
501+
$(".js-backwpup-frequency-file-hide-if-hourly").show();
502+
}
503+
504+
$(".js-backwpup-frequency-file-show-if-" + frequency).show();
496505
}
497506

498507
function showFrequencyTablesFields(frequency) {
508+
let frequencies = ["daily", "weekly", "monthly"];
509+
510+
if (frequency === "hourly") {
511+
$(".js-backwpup-frequency-table-show-if-weekly, .js-backwpup-frequency-table-show-if-monthly, .js-backwpup-frequency-table-hide-if-hourly").hide();
512+
}
513+
499514
if (frequency === "weekly") {
500-
$(".js-backwpup-frequency-table-show-if-weekly").show();
501-
$(".js-backwpup-frequency-table-show-if-monthly").hide();
515+
$(".js-backwpup-frequency-table-show-if-hourly, .js-backwpup-frequency-table-show-if-monthly").hide();
502516
}
503517

504518
if (frequency === "monthly") {
505-
$(".js-backwpup-frequency-table-show-if-weekly").hide();
506-
$(".js-backwpup-frequency-table-show-if-monthly").show();
519+
$(".js-backwpup-frequency-table-show-if-hourly, .js-backwpup-frequency-table-show-if-weekly").hide();
507520
}
508521

509522
if (frequency === "daily") {
510-
$(".js-backwpup-frequency-table-show-if-weekly").hide();
511-
$(".js-backwpup-frequency-table-show-if-monthly").hide();
523+
$(".js-backwpup-frequency-table-show-if-hourly, .js-backwpup-frequency-table-show-if-weekly, .js-backwpup-frequency-table-show-if-monthly").hide();
524+
}
525+
526+
if ( frequencies.includes(frequency) ) {
527+
$(".js-backwpup-frequency-table-hide-if-hourly").show();
512528
}
529+
530+
$(".js-backwpup-frequency-table-show-if-" + frequency).show();
513531
}
514532

515533
showFrequencyFilesFields($(".js-backwpup-frequency-files").val());
@@ -1356,12 +1374,14 @@ jQuery(document).ready(function ($) {
13561374
const container = $(this).closest("article");
13571375
const frequency = container.find("select[name='frequency']").val();
13581376
const startTime = container.find("input[name='start_time']").val();
1377+
const hourlyStartTime = container.find("select[name='hourly_start_time']").val();
13591378
const day_of_week = container.find("select[name='day_of_week']").val();
13601379
const day_of_month = container.find("select[name='day_of_month']").val();
13611380

13621381
const data = {
13631382
frequency: frequency,
13641383
start_time: startTime,
1384+
hourly_start_time: hourlyStartTime,
13651385
day_of_week: day_of_week,
13661386
day_of_month: day_of_month,
13671387
};
@@ -1389,12 +1409,14 @@ jQuery(document).ready(function ($) {
13891409
const container = $(this).closest("article");
13901410
const frequency = container.find("select[name='frequency']").val();
13911411
const startTime = container.find("input[name='start_time']").val();
1412+
const hourlyStartTime = container.find("select[name='hourly_start_time']").val();
13921413
const day_of_week = container.find("select[name='day_of_week']").val();
13931414
const day_of_month = container.find("select[name='day_of_month']").val();
13941415

13951416
const data = {
13961417
frequency: frequency,
13971418
start_time: startTime,
1419+
hourly_start_time: hourlyStartTime,
13981420
day_of_week: day_of_week,
13991421
day_of_month: day_of_month,
14001422
};
@@ -1550,15 +1572,17 @@ jQuery(document).ready(function ($) {
15501572
}
15511573

15521574
// Function to start the backup process using requestWPApi
1553-
function startBackupProcess() {
1575+
function startBackupProcess( data = {} ) {
15541576
if ( ! isGenerateJsIncluded() ) {
1555-
requestWPApi(backwpupApi.startbackup, {}, function(response) {
1577+
requestWPApi(backwpupApi.startbackup, data, function(response) {
15561578
if (response.status === 200) {
15571579
setTimeout(function() {
15581580
if ('#dbbackup' !== window.location.hash ) {
15591581
window.location.reload();
15601582
}
1561-
}, 500);
1583+
}, 500);
1584+
} else if ( 301 === response.status ) {
1585+
window.location = response.url;
15621586
}
15631587
}, 'POST');
15641588
} else {
@@ -1571,7 +1595,9 @@ jQuery(document).ready(function ($) {
15711595

15721596
// Call the functions when the "First Backup" page is loaded
15731597
if (window.location.search.includes('backwpupfirstbackup')) {
1574-
startBackupProcess();
1598+
startBackupProcess( {
1599+
first_backup: 1
1600+
} );
15751601
}
15761602

15771603
// Replace the 'Buy Pro' menu item with the correct link.
@@ -1589,6 +1615,26 @@ jQuery(document).ready(function ($) {
15891615
DocsMenuItem.attr('href', 'https://backwpup.com/docs/');
15901616
DocsMenuItem.attr('target', '_blank');
15911617
}
1618+
1619+
// Handle bwpup-ajax-close
1620+
$('.bwpup-ajax-close').click( function(e) {
1621+
e.preventDefault();
1622+
let current_close = $(this);
1623+
let url = current_close.attr( 'href' );
1624+
if ( ! url ) {
1625+
return;
1626+
}
1627+
let hide_id = current_close.data('bwpu-hide');
1628+
$('#'+hide_id).fadeTo('slow', '0.2');
1629+
1630+
$.ajax({
1631+
url,
1632+
success: function(response) {
1633+
$('#'+hide_id).hide();
1634+
},
1635+
});
1636+
} );
1637+
15921638
});
15931639

15941640
// Add a custom 'hide' event when the .hide() function is called

assets/js/backwpup-admin.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/backwpup-generate.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jQuery(document).ready(function ($) {
4040
$("#abortbutton").remove();
4141
$('.backupgeneration-progress-box .progress-bar').hide();
4242
$("#backwpup-adminbar-running").remove();
43-
$("#backupgeneration-progress-box-title").html(rundata.on_step +" : "+rundata.last_msg);
43+
$("#backupgeneration-progress-box-title").html(rundata.last_msg);
4444
$('.backupgeneration-progress-box-step').remove();
4545
if ('' !== $('#next_job_id').val()) {
4646
$.ajax({
@@ -75,16 +75,6 @@ jQuery(document).ready(function ($) {
7575
if (window.location.search.includes('backwpupfirstbackup')) {
7676
$('#info_container_2').hide();
7777
$('#first-congratulations').show();
78-
var countdown = 5
79-
var interval = setInterval(function() {
80-
countdown--;
81-
$('#redirect-time').text(countdown);
82-
if (countdown <= 0) {
83-
clearInterval(interval);
84-
// Redirect to the main dashboard
85-
window.location.href = backwpup.adminUrl;
86-
}
87-
}, 1000);
8878
}
8979
} else {
9080
if (rundata.restart_url !== '') {
@@ -111,7 +101,12 @@ jQuery(document).ready(function ($) {
111101
};
112102
backwpup_show_progress();
113103
$('#showworkingclose').on('click', function() {
114-
$("#runningjob").hide('slow');
104+
let redirect_url = $(this).data('bwpup_redirect_url');
105+
if ( redirect_url ) {
106+
window.location.href = redirect_url;
107+
} else {
108+
$("#runningjob").hide('slow');
109+
}
115110
return false;
116111
});
117112

assets/js/backwpup-generate.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backwpup.php

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Description: WordPress Backup Plugin
66
* Author: BackWPup – WordPress Backup & Restore Plugin
77
* Author URI: https://backwpup.com
8-
* Version: 5.0.6
8+
* Version: 5.0.7
99
* Requires at least: 4.9
1010
* Requires PHP: 7.4
1111
* Text Domain: backwpup
@@ -55,10 +55,7 @@ private function __construct()
5555
return;
5656
}
5757

58-
require_once __DIR__ . '/inc/functions.php';
59-
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
60-
require_once __DIR__ . '/vendor/autoload.php';
61-
}
58+
require_once __DIR__ . '/inc/functions.php';
6259

6360
$file = untrailingslashit( self::get_plugin_data( 'plugindir' ) )
6461
. '/src/Infrastructure/Restore/commons.php';
@@ -171,7 +168,7 @@ private function __construct()
171168
*
172169
* @param bool $is_in_admin_bar Whether the admin link will be shown in the admin bar or not.
173170
*/
174-
$is_in_admin_bar = (bool) apply_filters( 'backwpup_is_in_admin_bar', (bool) get_site_option( 'backwpup_cfg_showadminbar' ) );
171+
$is_in_admin_bar = wpm_apply_filters_typed( 'boolean', 'backwpup_is_in_admin_bar', (bool) get_site_option( 'backwpup_cfg_showadminbar' ) );
175172

176173
if ( true === $is_in_admin_bar ) {
177174
$admin_bar = new BackWPup_Adminbar( $admin );
@@ -274,10 +271,11 @@ public static function get_plugin_data($name = null)
274271
$upload_dir['basedir']
275272
) . '/backwpup/' . self::$plugin_data['hash'] . '/temp/';
276273
}
277-
self::$plugin_data['running_file'] = self::$plugin_data['temp'] . 'backwpup-working.php';
278-
self::$plugin_data['url'] = plugins_url('', __FILE__);
279-
self::$plugin_data['cacert'] = apply_filters(
280-
'backwpup_cacert_bundle',
274+
self::$plugin_data['running_file'] = self::$plugin_data['temp'] . 'backwpup-working.php';
275+
self::$plugin_data['url'] = plugins_url( '', __FILE__ );
276+
self::$plugin_data['cacert'] = wpm_apply_filters_typed(
277+
'string',
278+
'backwpup_cacert_bundle',
281279
ABSPATH . WPINC . '/certificates/ca-bundle.crt'
282280
);
283281
//get unmodified WP Versions
@@ -494,9 +492,10 @@ public static function get_registered_destinations()
494492
],
495493
];
496494

497-
//Hook for adding Destinations like above
498-
self::$registered_destinations = apply_filters(
499-
'backwpup_register_destination',
495+
// Hook for adding Destinations like above.
496+
self::$registered_destinations = wpm_apply_filters_typed(
497+
'array',
498+
'backwpup_register_destination',
500499
self::$registered_destinations
501500
);
502501

@@ -572,7 +571,7 @@ public static function get_job_types()
572571
self::$job_types['WPPLUGIN'] = new BackWPup_JobType_WPPlugin();
573572
self::$job_types['DBCHECK'] = new BackWPup_JobType_DBCheck();
574573

575-
self::$job_types = apply_filters('backwpup_job_types', self::$job_types);
574+
self::$job_types = wpm_apply_filters_typed( 'array', 'backwpup_job_types', self::$job_types );
576575

577576
//remove types can't load
578577
foreach (self::$job_types as $key => $job_type) {
@@ -595,7 +594,7 @@ public static function get_wizards()
595594
return self::$wizards;
596595
}
597596

598-
self::$wizards = apply_filters('backwpup_pro_wizards', self::$wizards);
597+
self::$wizards = wpm_apply_filters_typed( 'array', 'backwpup_pro_wizards', self::$wizards );
599598

600599
//remove wizards can't load
601600
foreach (self::$wizards as $key => $wizard) {
@@ -608,6 +607,11 @@ public static function get_wizards()
608607
}
609608
}
610609

610+
// Include the Composer autoload file.
611+
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
612+
require_once __DIR__ . '/vendor/autoload.php';
613+
}
614+
611615
require_once __DIR__ . '/inc/class-system-requirements.php';
612616

613617
require_once __DIR__ . '/inc/class-system-tests.php';

changelog.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
== Changelog ==
2+
= 5.0.7 =
3+
Release date: March 13, 2025
4+
5+
* Added: Hourly frequency for backups
6+
* Added: WPM Apply filters library for better code maintainability
7+
* Fixed: PHP Warning & auto reset advanced settings issue
8+
* Fixed: Closing banner cancels the onboarding issue
9+
* Fixed: Correct the title of Next Schedule Backup
10+
* Changed: Onboarding backup success page notice & redirection
11+
* Changed: "Restore Full Backup" string to "Restore Backup"
12+
213
= 5.0.6 =
314
Release date: March 10, 2025
415

components/first-congrats.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,4 @@ class="p-8 text-center bg-white rounded-lg"
2121

2222
<h2 class="mt-4 mb-2 text-primary-darker text-xl font-semibold"><?php esc_html_e("Congratulations! 🙌", 'backwpup'); ?></h2>
2323
<p class="text-xl"><?php esc_html_e("You’ve set up your first backup.", 'backwpup'); ?></p>
24-
<p class="mt-6 flex items-center justify-center gap-6">
25-
<?= __('You will be redirected to the main dashboard in ') ?><span id="redirect-time">5</span><?= __(' seconds', 'backwpup') ?>
26-
</p>
2724
</div>

components/form/select.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<option value="" <?php if ($value === "") : ?>selected<?php endif; ?>></option>
4646
<?php endif; ?>
4747
<?php foreach ($options as $key => $option) : ?>
48-
<option value="<?php echo $key; ?>" <?php echo $key === $value ? "selected" : ""; ?>><?php echo $option; ?></option>
48+
<option value="<?php echo $key; ?>" <?php selected( $key, $value ); ?>><?php echo $option; ?></option>
4949
<?php endforeach; ?>
5050
</select>
5151
<div class="absolute right-4 top-0 bottom-0 flex items-center pointer-events-none rotate-180">

components/onboarding/step2.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"value" => "monthly",
3939
"trigger" => "onboarding-files-frequency",
4040
"options" => [
41+
'hourly' => __( 'Hourly', 'backwpup' ),
4142
"daily" => __("Daily", 'backwpup'),
4243
"weekly" => __("Weekly", 'backwpup'),
4344
"monthly" => __("Monthly", 'backwpup'),
@@ -76,6 +77,7 @@
7677
"class" => "onboarding-database-frequency",
7778
"trigger" => "onboarding-database-frequency",
7879
"options" => [
80+
'hourly' => __( 'Hourly', 'backwpup' ),
7981
"daily" => __("Daily", 'backwpup'),
8082
"weekly" => __("Weekly", 'backwpup'),
8183
"monthly" => __("Monthly", 'backwpup'),

0 commit comments

Comments
 (0)