Skip to content

Commit 5bccf41

Browse files
committed
Release 5.6.1
1 parent e1c3772 commit 5bccf41

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+847
-612
lines changed

assets/css/backwpup-admin.css

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
}
108108

109109
/*
110-
! tailwindcss v3.4.18 | MIT License | https://tailwindcss.com
110+
! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com
111111
*/
112112

113113
/*
@@ -1051,6 +1051,10 @@ select {
10511051
display: table;
10521052
}
10531053

1054+
.contents {
1055+
display: contents;
1056+
}
1057+
10541058
.hidden {
10551059
display: none;
10561060
}
@@ -1117,14 +1121,6 @@ select {
11171121
width: 0px;
11181122
}
11191123

1120-
.w-1\/2 {
1121-
width: 50%;
1122-
}
1123-
1124-
.w-1\/6 {
1125-
width: 16.666667%;
1126-
}
1127-
11281124
.w-10 {
11291125
width: 2.5rem;
11301126
}
@@ -1169,6 +1165,10 @@ select {
11691165
width: 100%;
11701166
}
11711167

1168+
.min-w-20 {
1169+
min-width: 5rem;
1170+
}
1171+
11721172
.min-w-\[130px\] {
11731173
min-width: 130px;
11741174
}
@@ -1478,6 +1478,11 @@ select {
14781478
background-color: rgb(255 243 219 / var(--tw-bg-opacity, 1));
14791479
}
14801480

1481+
.bg-black {
1482+
--tw-bg-opacity: 1;
1483+
background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));
1484+
}
1485+
14811486
.bg-danger-light {
14821487
--tw-bg-opacity: 1;
14831488
background-color: rgb(255 219 221 / var(--tw-bg-opacity, 1));
@@ -1565,10 +1570,6 @@ select {
15651570
padding: 2rem;
15661571
}
15671572

1568-
.p-\[2px\] {
1569-
padding: 2px;
1570-
}
1571-
15721573
.px-10 {
15731574
padding-left: 2.5rem;
15741575
padding-right: 2.5rem;
@@ -1614,6 +1615,11 @@ select {
16141615
padding-bottom: 2.5rem;
16151616
}
16161617

1618+
.py-2 {
1619+
padding-top: 0.5rem;
1620+
padding-bottom: 0.5rem;
1621+
}
1622+
16171623
.py-4 {
16181624
padding-top: 1rem;
16191625
padding-bottom: 1rem;

assets/js/backwpup-admin.js

Lines changed: 71 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jQuery(document).ready(function ($) {
4040
url: route,
4141
beforeSend: function(xhr) {
4242
xhr.setRequestHeader('X-WP-Nonce', backwpupApi.nonce);
43+
xhr.setRequestHeader('Cache-Control', 'no-cache');
4344
},
4445
method: method,
4546
data: data,
@@ -112,16 +113,15 @@ jQuery(document).ready(function ($) {
112113
},
113114
},
114115
function(response) {
115-
const toast = jQuery('<div class="transform translate-y-2 transition-all duration-300"></div>').html(response);
116-
$('#bwp-settings-toast').html('');
117-
$('#bwp-settings-toast').append(toast);
116+
const toast = jQuery('<div class="transform translate-y-2 transition-all mb-2"></div>').html(response);
117+
$('#bwp-settings-toast').append(toast);
118118
// Animate in
119119
setTimeout(() => {
120120
toast.addClass('opacity-100 translate-y-0');
121121
}, 10);
122122

123123
// Auto-remove after duration
124-
if (duration !== -1 || type !== 'success') {
124+
if (duration !== -1) {
125125
setTimeout(() => {
126126
toast.removeClass('opacity-100 translate-y-0').addClass('opacity-0 translate-y-2');
127127
setTimeout(() => {
@@ -137,6 +137,25 @@ jQuery(document).ready(function ($) {
137137
);
138138
}
139139

140+
function getBackWPupMessages() {
141+
requestWPApi(backwpupApi.messages, null, function(response) {
142+
143+
if (response['error'] && response['error'].length) {
144+
response['error'].forEach(function(error) {
145+
backwpupDisplaySettingsToast('danger', error, -1 );
146+
});
147+
}
148+
149+
if (response['updated'] && response['updated'].length) {
150+
response['updated'].forEach(function(updated) {
151+
backwpupDisplaySettingsToast('success', updated );
152+
});
153+
}
154+
});
155+
}
156+
157+
getBackWPupMessages();
158+
140159
// Function to be sure the value on this class is an integer.
141160
$(".js-backwpup-intonly").on('keydown', function(event) {
142161
return ['Backspace','Delete','ArrowLeft','ArrowRight'].includes(event.code) ? true : !isNaN(Number(event.key)) && event.code!=='Space';
@@ -1384,6 +1403,7 @@ jQuery(document).ready(function ($) {
13841403
refresh_storage_destinations(job_id, 'GDRIVE', response.connected);
13851404
backwpupDisplaySettingsToast('success', response.message);
13861405
closeSidebar();
1406+
getBackWPupMessages();
13871407
},
13881408
"POST",
13891409
function (request, error) {
@@ -1935,6 +1955,7 @@ jQuery(document).ready(function ($) {
19351955

19361956
backwpupDisplaySettingsToast( 'success', response.message );
19371957
closeSidebar();
1958+
getBackWPupMessages();
19381959
}
19391960
},
19401961
"POST",
@@ -2003,6 +2024,7 @@ jQuery(document).ready(function ($) {
20032024
if (response.status === 200) {
20042025
if ( ! $("#backwpup-onboarding-panes").length ) {
20052026
backwpupDisplaySettingsToast('success', response.message);
2027+
getBackWPupMessages();
20062028
}
20072029
closeSidebar();
20082030
}
@@ -2065,6 +2087,7 @@ jQuery(document).ready(function ($) {
20652087
closeSidebar();
20662088
if ( ! $("#backwpup-onboarding-panes").length ) {
20672089
backwpupDisplaySettingsToast('success', response.message);
2090+
getBackWPupMessages();
20682091
}
20692092
}
20702093
}, 'POST');
@@ -2090,16 +2113,23 @@ jQuery(document).ready(function ($) {
20902113
data,
20912114
function(response) {
20922115
if (response.status === 200) {
2093-
setTimeout(function() {
2094-
window.location.reload();
2095-
}, 500);
2096-
} else if ( 301 === response.status ) {
2116+
window.location.reload();
2117+
} else if (response.status === 201) {
2118+
backwpupDisplaySettingsToast('success', response.message);
2119+
setTimeout(function() {
2120+
window.location.reload();
2121+
}, 750);
2122+
}else if ( 301 === response.status ) {
20972123
window.location = response.url;
2098-
}
2124+
} else if ( 500 === response.status ) {
2125+
backwpupDisplaySettingsToast('danger', response.message, -1);
2126+
$document.trigger('backup-complete');
2127+
}
20992128
},
2100-
'POST',
2101-
function(request, error) {
2102-
$document.trigger('backup-ended');
2129+
'POST',
2130+
function(request, error) {
2131+
backwpupDisplaySettingsToast('danger', 'Get an undefined error on trying to start backup! You can find more information in the browser console.', -1);
2132+
$document.trigger('backup-complete');
21032133
}
21042134
);
21052135
}
@@ -2173,14 +2203,16 @@ jQuery(document).ready(function ($) {
21732203
} );
21742204

21752205
// hide toast on click.
2176-
$(document).on('click', '#bwp-settings-toast #dismiss-icon', function() {
2177-
const toastElements = $('#bwp-settings-toast').children();
2206+
$(document).on('click', '#bwp-settings-toast .dismiss-icon', function(event) {
2207+
const toast = event.target.closest(".flex.items-center.gap-2.p-4.rounded");
21782208

2179-
toastElements.removeClass('opacity-100 translate-y-0')
2180-
.addClass('opacity-0 translate-y-2');
2209+
toast.classList.remove("oopacity-100");
2210+
toast.classList.remove("translate-y-0");
2211+
toast.classList.add("opacity-0");
2212+
toast.classList.add("translate-y-2");
21812213

21822214
setTimeout(() => {
2183-
toastElements.remove();
2215+
toast.parentElement.remove();
21842216
}, 300);
21852217
});
21862218

@@ -2379,7 +2411,8 @@ jQuery(document).ready(function ($) {
23792411
onboardingPane.find("select[name='job_"+data.job_id+"_frequency']").val(sidebarFrequency.val());
23802412
} else {
23812413
backwpupDisplaySettingsToast('success', response.message);
2382-
}
2414+
getBackWPupMessages();
2415+
}
23832416

23842417
// Close the settings sidebar
23852418
closeSidebar();
@@ -2411,6 +2444,7 @@ jQuery(document).ready(function ($) {
24112444
function (response) {
24122445
if (response.status === 200) {
24132446
backwpupDisplaySettingsToast('success', response.message);
2447+
getBackWPupMessages();
24142448
// Close the settings sidebar
24152449
closeSidebar();
24162450
}
@@ -2446,16 +2480,8 @@ jQuery(document).ready(function ($) {
24462480
*
24472481
*/
24482482
document.addEventListener("DOMContentLoaded", function() {
2449-
//Copy button
2450-
const copyButtons = document.querySelectorAll('.js-backwpup-copy-clipboard svg');
2451-
2452-
copyButtons.forEach(function(btn) {
2453-
btn.addEventListener('click', function() {
2454-
});
2455-
})
2456-
24572483
document.addEventListener("click", function (event) {
2458-
const copy_button = event.target.closest('.js-backwpup-copy-clipboard svg');
2484+
const copy_button = event.target.closest('.js-backwpup-copy-clipboard ');
24592485

24602486
if( copy_button ) {
24612487
const parentDiv = copy_button.closest('.js-frequency-link-url');
@@ -2464,17 +2490,25 @@ document.addEventListener("DOMContentLoaded", function() {
24642490

24652491
navigator.clipboard.writeText(textToCopy).then(function() {
24662492

2467-
const paths = copy_button.querySelectorAll('path');
2468-
const originalFill = copy_button.querySelector('path').getAttribute('fill');
2469-
paths.forEach(path => {
2470-
path.setAttribute('fill', '#10b981');
2471-
});
2493+
const originalText = copy_button.textContent;
2494+
copy_button.textContent = 'Copied!';
2495+
copy_button.style.backgroundColor = '#10b981';
2496+
copy_button.setAttribute('aria-label', 'Backup link copied to clipboard');
2497+
2498+
const liveRegion = parentDiv.querySelector('[role="status"]');
2499+
if(liveRegion) {
2500+
liveRegion.textContent = 'Backup link copied to clipboard';
2501+
}
24722502

2473-
setTimeout(function() {
2474-
paths.forEach(path => {
2475-
path.setAttribute('fill', originalFill);
2476-
});
2477-
}, 500);
2503+
setTimeout(() => {
2504+
copy_button.textContent = originalText;
2505+
copy_button.style.backgroundColor = '';
2506+
copy_button.setAttribute('aria-label', 'Copy backup link to clipboard');
2507+
2508+
if(liveRegion) {
2509+
liveRegion.textContent = '';
2510+
}
2511+
}, 2000);
24782512

24792513
}).catch(function(err) {
24802514
console.error('Failed to copy:', err);

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-job.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,19 @@ document.addEventListener("DOMContentLoaded", function() {
1111
element.style.pointerEvents = 'auto';
1212
}
1313

14-
document.addEventListener("click", function (event) {
14+
document.addEventListener('change', function(e) {
15+
if (e.target && e.target.id === 's3region') {
16+
const customService = document.querySelector('.js-s3-custom-service');
17+
18+
if (e.target.value === 'custom') {
19+
customService.classList.remove('hidden');
20+
} else {
21+
customService.classList.add('hidden');
22+
}
23+
}
24+
})
25+
26+
document.addEventListener("click", function (event) {
1527
const buttonAddNew = event.target.closest('#js_backwpup_add_new_backup');
1628
if (!buttonAddNew) {
1729
return;

assets/js/backwpup-job.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/page_edit_jobtype_dbdump.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jQuery(document).ready(function ($) {
5656
dbpassword: $("#dbdumpdbpassword").val(),
5757
wpdbsettings: $("#dbdumpwpdbsettings:checked").val(),
5858
jobid: $("#jobid").val(),
59-
_ajax_nonce: $("#backwpupajaxnonce").val(),
59+
_ajax_nonce: $('input[name="backwpupajaxnonce"]').val(),
6060
};
6161
$.post(ajaxurl, data, function (response) {
6262
$("#dbtables").replaceWith(response);
@@ -80,7 +80,7 @@ jQuery(document).ready(function ($) {
8080
dbuser: $("#dbdumpdbuser").val(),
8181
dbpassword: $("#dbdumpdbpassword").val(),
8282
wpdbsettings: $("#dbdumpwpdbsettings:checked").val(),
83-
_ajax_nonce: $("#backwpupajaxnonce").val(),
83+
_ajax_nonce: $('input[name="backwpupajaxnonce"]').val(),
8484
};
8585
$.post(ajaxurl, data, function (response) {
8686
$("#dbdumpdbname").replaceWith(response);
@@ -100,7 +100,7 @@ jQuery(document).ready(function ($) {
100100
dbpassword: $("#dbdumpdbpassword").val(),
101101
wpdbsettings: $("#dbdumpwpdbsettings:checked").val(),
102102
jobid: $("#jobid").val(),
103-
_ajax_nonce: $("#backwpupajaxnonce").val(),
103+
_ajax_nonce: $('input[name="backwpupajaxnonce"]').val(),
104104
};
105105

106106
$.post(ajaxurl, data, function (response) {

0 commit comments

Comments
 (0)