PluginProbe
MainWP Dashboard: Self-hosted WordPress Management for Agencies / 6.2.2
MainWP Dashboard: Self-hosted WordPress Management for Agencies v6.2.2
6.2.3 6.2.2 6.2.1 6.2 6.1.8 6.1.7 6.1.6 6.1.5 6.1.4 6.1.3 6.1.2 6.1.1 6.1 6.0.12 6.0.11 4.6.0.1 5.0 5.0.1 5.0.2 5.0.3 5.0.3.1 5.0.3.2 5.1 5.1.1 5.2 All 156 releases
← All changes | assets/js/mainwp-backups.js +75 -77 5.1 → 6.2.2 View file →
@@ -55,9 +55,9 @@
55 55 loadFilesBeforeZip: loadFilesBeforeZip,
56 56 subfolder: jQuery('#backup_subfolder').val()
57 57 }, true);
58 58
59 - mainwpPopup('#managesite-backup-status-box').getContentEl().html(dateToHMS(new Date()) + ' ' + __('Creating the backup file on the child site, this might take a while depending on the size. Please be patient.') + ' <div id="managesite-createbackup-status-progress" class="ui green progress"><div class="bar"><div class="progress"></div></div></div>');
59 + mainwpPopup('#managesite-backup-status-box').getContentEl().html(dateToHMS(new Date()) + ' ' + MainWP.I18n.t('Creating the backup file on the child site, this might take a while depending on the size. Please be patient.') + ' <div id="managesite-createbackup-status-progress" class="ui green progress"><div class="bar"><div class="progress"></div></div></div>');
60 60 jQuery('#managesite-createbackup-status-progress').progress({ value: 0, total: size });
61 61
62 62 mainwpPopup('#managesite-backup-status-box').init({
63 63 callback: function () {
@@ -135,9 +135,9 @@
135 135
136 136 let progressBar = jQuery('#managesite-createbackup-status-progress');
137 137 progressBar.progress('set progress', parseFloat(progressBar.progress('get total')));
138 138
139 - appendToDiv(backsprocessContentEl, __('Backup file on child site created successfully!'));
139 + appendToDiv(backsprocessContentEl, MainWP.I18n.t('Backup file on child site created successfully!'));
140 140
141 141 backup_download_file(pSiteId, pType, response.result.url, response.result.local, response.result.regexfile, response.result.size, response.result.subfolder, pRemoteDestinations);
142 142 }
143 143 }
@@ -174,9 +174,9 @@
174 174 let progressBar = jQuery('#managesite-createbackup-status-progress');
175 175 progressBar.progress('set progress', parseFloat(progressBar.progress('get total')));
176 176
177 177 //download!!!
178 - appendToDiv(backsprocessContentEl, __('Backup file on child site created successfully!'));
178 + appendToDiv(backsprocessContentEl, MainWP.I18n.t('Backup file on child site created successfully!'));
179 179
180 180 backup_download_file(siteId, type, response.result.file, response.result.local, response.result.regexfile, response.result.size, response.result.subfolder, remoteDestinations);
181 181 } else if (response.status == 'stalled') {
182 182 backupContinueRetries++;
@@ -206,9 +206,9 @@
206 206
207 207 let progressBar = jQuery('#managesite-createbackup-status-progress');
208 208 progressBar.progress('set progress', parseFloat(progressBar.progress('get total')));
209 209
210 - appendToDiv(backsprocessContentEl, __('Backupfile on child site created successfully.'));
210 + appendToDiv(backsprocessContentEl, MainWP.I18n.t('Backupfile on child site created successfully.'));
211 211
212 212 backup_download_file(pSiteId, pType, response.result.url, response.result.local, response.result.regexfile, response.result.size, response.result.subfolder, pRemoteDestinations);
213 213 }
214 214 }
@@ -248,9 +248,9 @@
248 248 };
249 249
250 250 backup_download_file = function (pSiteId, type, url, file, regexfile, size, subfolder, remote_destinations) {
251 251 let backsprocessContentEl = mainwpPopup('#managesite-backup-status-box').getContentEl();
252 - appendToDiv(backsprocessContentEl, __('Downloading the file.') + ' <div id="managesite-backup-status-progress" class="ui green progress"><div class="bar"><div class="progress"></div></div></div>');
252 + appendToDiv(backsprocessContentEl, MainWP.I18n.t('Downloading the file.') + ' <div id="managesite-backup-status-progress" class="ui green progress"><div class="bar"><div class="progress"></div></div></div>');
253 253 jQuery('#managesite-backup-status-progress').progress({ value: 0, total: size });
254 254
255 255 let fnc = function (file) {
256 256 return function (pFunction) {
@@ -319,9 +319,9 @@
319 319 backupDownloadRunning = false;
320 320
321 321 if (response.error) {
322 322 appendToDiv(backsprocessContentEl, '<span class="mainwp-red">ERROR: ' + getErrorMessage(response.error) + '</span>');
323 - appendToDiv(backsprocessContentEl, '<span class="mainwp-red">' + __('Backup failed!') + '</span>');
323 + appendToDiv(backsprocessContentEl, '<span class="mainwp-red">' + MainWP.I18n.t('Backup failed!') + '</span>');
324 324
325 325 jQuery('#managesite-backup-status-close').prop('value', 'Close');
326 326 return;
327 327 }
@@ -326,9 +326,9 @@
326 326 return;
327 327 }
328 328
329 329 jQuery('#managesite-backup-status-progress').progress('set progress', pSize);
330 - appendToDiv(backsprocessContentEl, __('Download from child site completed.'));
330 + appendToDiv(backsprocessContentEl, MainWP.I18n.t('Download from child site completed.'));
331 331
332 332 let newData = mainwp_secure_data({
333 333 action: 'mainwp_backup_delete_file',
334 334 site_id: pSiteId,
@@ -356,9 +356,9 @@
356 356 if (pRemoteDestinations.length > 0) {
357 357 let remote_destination = pRemoteDestinations[0];
358 358 //upload..
359 359 let unique = Date.now();
360 - appendToDiv(backsprocessContentEl, __('Uploading to remote destination: %1 (%2)', remote_destination.title, remote_destination.type) + '<div id="managesite-upload-status-progress-' + unique + '" class="ui green progress"><div class="bar"><div class="progress"></div></div></div>');
360 + appendToDiv(backsprocessContentEl, MainWP.I18n.t('Uploading to remote destination: %1 (%2)', remote_destination.title, remote_destination.type) + '<div id="managesite-upload-status-progress-' + unique + '" class="ui green progress"><div class="bar"><div class="progress"></div></div></div>');
361 361
362 362 jQuery('#managesite-upload-status-progress-' + unique).progress({ value: 0, total: pSize });
363 363
364 364 let fnc = function (pUnique) {
@@ -382,9 +382,9 @@
382 382 }
383 383
384 384 if (backupUploadRunning[pUnique]) {
385 385 let progressBar = jQuery('#managesite-upload-status-progress-' + pUnique);
386 - if ((progressBar.length > 0) && (progressBar.progress('get value') < progressBar.progress('get total')) && (progressBar.progress('get value') < parseInt(response.result))) {
386 + if ((progressBar.length > 0) && (progressBar.progress('get value') < progressBar.progress('get total')) && (progressBar.progress('get value') < Number.parseInt(response.result))) {
387 387 progressBar.progress('set progress', response.result);
388 388 }
389 389
390 390 setTimeout(function () {
@@ -441,11 +441,11 @@
441 441
442 442 let obj = response.result;
443 443 if (obj.error) {
444 444 backupError = true;
445 - appendToDiv(backsprocessContentEl, '<span class="mainwp-red">' + __('Upload to %1 (%2) failed:', obj.title, obj.type) + ' ' + obj.error + '</span>');
445 + appendToDiv(backsprocessContentEl, '<span class="mainwp-red">' + MainWP.I18n.t('Upload to %1 (%2) failed:', obj.title, obj.type) + ' ' + obj.error + '</span>');
446 446 } else {
447 - appendToDiv(backsprocessContentEl, __('Upload to %1 (%2) successful!', obj.title, obj.type));
447 + appendToDiv(backsprocessContentEl, MainWP.I18n.t('Upload to %1 (%2) successful!', obj.title, obj.type));
448 448 }
449 449
450 450 backup_upload_file(pSiteId, pFile, pRegexFile, pSubfolder, pNewRemoteDestinations, pType, pSize);
451 451 }
@@ -458,9 +458,9 @@
458 458 }(pSiteId, pRemoteDestinations, pFile, pRegexFile, pSubfolder, pType, pSize, data, unique, remote_destination.id),
459 459 dataType: 'json'
460 460 });
461 461 } else {
462 - appendToDiv(backsprocessContentEl, __('Backup completed!'));
462 + appendToDiv(backsprocessContentEl, MainWP.I18n.t('Backup completed!'));
463 463 jQuery('#managesite-backup-status-close').prop('value', 'Close');
464 464 if (!backupError) {
465 465 setTimeout(function () {
466 466 mainwpPopup('#managesite-backup-status-box').close(true);
@@ -489,9 +489,9 @@
489 489
490 490 let progressBar = jQuery('#managesite-upload-status-progress-' + pUnique);
491 491 progressBar.progress('set progress', pSize);
492 492
493 - appendToDiv(backsprocessContentEl, __('Upload to %1 (%2) successful!', response.info.title, response.info.type));
493 + appendToDiv(backsprocessContentEl, MainWP.I18n.t('Upload to %1 (%2) successful!', response.info.title, response.info.type));
494 494
495 495 backup_upload_file(pSiteId, pFile, pRegexFile, pSubfolder, pNewRemoteDestinations, pType, pSize);
496 496 } else if (response.status == 'stalled') {
497 497 if (backupContinueRetriesUnique[pUnique] == undefined) {
@@ -502,9 +502,9 @@
502 502
503 503 if (backupContinueRetriesUnique[pUnique] > 10) {
504 504 if (responseError != undefined) {
505 505 backupError = true;
506 - appendToDiv(backsprocessContentEl, '<span class="mainwp-red">' + __('Upload to %1 (%2) failed:', response.info.title, response.info.type) + ' ' + responseError + '</span>');
506 + appendToDiv(backsprocessContentEl, '<span class="mainwp-red">' + MainWP.I18n.t('Upload to %1 (%2) failed:', response.info.title, response.info.type) + ' ' + responseError + '</span>');
507 507 } else {
508 508 appendToDiv(backsprocessContentEl, ' <span class="mainwp-red">ERROR: Upload timed out! <a href="http://docs.mainwp.com/backup-failed-php-ini-settings/">Please check this help document for more information and possible fixes</a></span>');
509 509 }
510 510
@@ -530,11 +530,11 @@
530 530
531 531 let obj = response.result;
532 532 if (obj.error) {
533 533 backupError = true;
534 - appendToDiv(backsprocessContentEl, '<span class="mainwp-red">' + __('Upload to %1 (%2) failed:', obj.title, obj.type) + ' ' + obj.error + '</span>');
534 + appendToDiv(backsprocessContentEl, '<span class="mainwp-red">' + MainWP.I18n.t('Upload to %1 (%2) failed:', obj.title, obj.type) + ' ' + obj.error + '</span>');
535 535 } else {
536 - appendToDiv(backsprocessContentEl, __('Upload to %1 (%2) successful!', obj.title, obj.type));
536 + appendToDiv(backsprocessContentEl, MainWP.I18n.t('Upload to %1 (%2) successful!', obj.title, obj.type));
537 537 }
538 538
539 539 backup_upload_file(pSiteId, pFile, pRegexFile, pSubfolder, pNewRemoteDestinations, pType, pSize);
540 540 }
@@ -596,9 +596,9 @@
596 596
597 597 });
598 598 managebackups_exclude_folder = function (pElement) {
599 599 let folder = pElement.parent().attr('rel') + "\n";
600 - if (jQuery('#excluded_folders_list').val().indexOf(folder) !== -1)
600 + if (jQuery('#excluded_folders_list').val().includes(folder))
601 601 return;
602 602
603 603 jQuery('#excluded_folders_list').val(jQuery('#excluded_folders_list').val() + folder);
604 604 };
@@ -611,12 +611,12 @@
611 611 managebackups_run_now = function (el) {
612 612 el = jQuery(el);
613 613 el.hide();
614 614 el.parent().find('.backup_run_loading').show();
615 - mainwpPopup('#managebackups-task-status-box').getContentEl().html(dateToHMS(new Date()) + ' ' + __('Starting the backup task...'));
616 - jQuery('#managebackups-task-status-close').prop('value', __('Cancel'));
615 + mainwpPopup('#managebackups-task-status-box').getContentEl().html(dateToHMS(new Date()) + ' ' + MainWP.I18n.t('Starting the backup task...'));
616 + jQuery('#managebackups-task-status-close').prop('value', MainWP.I18n.t('Cancel'));
617 617 mainwpPopup('#managebackups-task-status-box').init({
618 - title: __('Running task'), callback: function () {
618 + title: MainWP.I18n.t('Running task'), callback: function () {
619 619 location.reload();
620 620 }
621 621 });
622 622
@@ -644,11 +644,11 @@
644 644 };
645 645 managebackups_run_next = function () {
646 646 let backtaskContentEl = mainwpPopup('#managebackups-task-status-box').getContentEl();
647 647 if (manageBackupTaskSites.length == 0) {
648 - appendToDiv(backtaskContentEl, __('Backup task completed') + (manageBackupsTaskError ? ' <span class="mainwp-red">' + __('with errors') + '</span>' : '') + '.');
648 + appendToDiv(backtaskContentEl, MainWP.I18n.t('Backup task completed') + (manageBackupsTaskError ? ' <span class="mainwp-red">' + MainWP.I18n.t('with errors') + '</span>' : '') + '.');
649 649
650 - jQuery('#managebackups-task-status-close').prop('value', __('Close'));
650 + jQuery('#managebackups-task-status-close').prop('value', MainWP.I18n.t('Close'));
651 651 if (!manageBackupsError) {
652 652 setTimeout(function () {
653 653 mainwpPopup('#managebackups-task-status-box').close(true);
654 654 }, 3000);
@@ -659,9 +659,9 @@
659 659 let siteId = manageBackupTaskSites[0]['id'];
660 660 let siteName = manageBackupTaskSites[0]['name'];
661 661 let size = manageBackupTaskSites[0][manageBackupsTaskType + 'size'];
662 662 let fileNameUID = mainwp_uid();
663 - appendToDiv(backtaskContentEl, '[' + siteName + '] ' + __('Creating backup file.') + '<div id="managebackups-task-status-create-progress" siteId="' + siteId + '" class="ui green progress"><div class="bar"><div class="progress"></div></div></div>');
663 + appendToDiv(backtaskContentEl, '[' + siteName + '] ' + MainWP.I18n.t('Creating backup file.') + '<div id="managebackups-task-status-create-progress" siteId="' + siteId + '" class="ui green progress"><div class="bar"><div class="progress"></div></div></div>');
664 664
665 665 manageBackupTaskSites.shift();
666 666 let data = mainwp_secure_data({
667 667 action: 'mainwp_backuptask_run_site',
@@ -712,9 +712,9 @@
712 712 appendToDiv(backtaskContentEl, '[' + pSiteName + '] <span class="mainwp-red">Error: ' + getErrorMessage(response.error) + '</span>');
713 713 manageBackupsTaskError = true;
714 714 managebackups_run_next();
715 715 } else {
716 - appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + __('Backup file created successfully.'));
716 + appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + MainWP.I18n.t('Backup file created successfully.'));
717 717
718 718 managebackups_backup_download_file(pSiteId, pSiteName, response.result.type, response.result.url, response.result.local, response.result.regexfile, response.result.size, response.result.subfolder, pRemoteDestinations);
719 719 }
720 720 }
@@ -767,9 +767,9 @@
767 767 clearInterval(pInterVal);
768 768
769 769 if (response.error) {
770 770 appendToDiv(backtaskContentEl, '[' + pSiteName + '] <span class="mainwp-red">ERROR: ' + getErrorMessage(response.error) + '</span>');
771 - appendToDiv(backtaskContentEl, '[' + pSiteName + '] <span class="mainwp-red">' + __('Backup failed!') + '</span>');
771 + appendToDiv(backtaskContentEl, '[' + pSiteName + '] <span class="mainwp-red">' + MainWP.I18n.t('Backup failed!') + '</span>');
772 772
773 773 manageBackupsError = true;
774 774 managebackups_run_next();
775 775 return;
@@ -775,9 +775,9 @@
775 775 return;
776 776 }
777 777
778 778 jQuery('#managebackups-task-status-progress[siteId="' + pSiteId + '"]').progress('set progress', pSize);
779 - appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + __('Download from child site completed.'));
779 + appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + MainWP.I18n.t('Download from child site completed.'));
780 780
781 781
782 782 let newData = mainwp_secure_data({
783 783 action: 'mainwp_backup_delete_file',
@@ -796,9 +796,9 @@
796 796 if (pRemoteDestinations.length > 0) {
797 797 let remote_destination = pRemoteDestinations[0];
798 798 //upload..
799 799 let unique = Date.now();
800 - appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + __('Uploading to selected remote destination: %1 (%2)', remote_destination.title, remote_destination.type) + '<div id="managesite-upload-status-progress-' + unique + '" class="ui green progress"><div class="bar"><div class="progress"></div></div></div>');
800 + appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + MainWP.I18n.t('Uploading to selected remote destination: %1 (%2)', remote_destination.title, remote_destination.type) + '<div id="managesite-upload-status-progress-' + unique + '" class="ui green progress"><div class="bar"><div class="progress"></div></div></div>');
801 801
802 802 jQuery('#managesite-upload-status-progress-' + unique).progress({ value: 0, total: pSize });
803 803
804 804 let fnc = function (pUnique) {
@@ -822,9 +822,9 @@
822 822 }
823 823
824 824 if (backupUploadRunning[pUnique]) {
825 825 let progressBar = jQuery('#managesite-upload-status-progress-' + pUnique);
826 - if ((progressBar.length > 0) && (progressBar.progress('get value') < progressBar.progress('get total')) && (progressBar.progress('get value') < parseInt(response.result))) {
826 + if ((progressBar.length > 0) && (progressBar.progress('get value') < progressBar.progress('get total')) && (progressBar.progress('get value') < Number.parseInt(response.result))) {
827 827 progressBar.progress('set progress', response.result);
828 828 }
829 829
830 830 setTimeout(function () {
@@ -881,11 +881,11 @@
881 881
882 882 let obj = response.result;
883 883 if (obj.error) {
884 884 manageBackupsError = true;
885 - appendToDiv(backtaskContentEl, '<span class="mainwp-red">[' + pSiteName + '] ' + __('Upload to %1 (%2) failed:', obj.title, obj.type) + ' ' + obj.error + '</span>');
885 + appendToDiv(backtaskContentEl, '<span class="mainwp-red">[' + pSiteName + '] ' + MainWP.I18n.t('Upload to %1 (%2) failed:', obj.title, obj.type) + ' ' + obj.error + '</span>');
886 886 } else {
887 - appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + __('Upload to %1 (%2) successful', obj.title, obj.type));
887 + appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + MainWP.I18n.t('Upload to %1 (%2) successful', obj.title, obj.type));
888 888 }
889 889
890 890 managebackups_backup_upload_file(pSiteId, pSiteName, pFile, pRegexFile, pSubfolder, pNewRemoteDestinations, pType, pSize);
891 891 }
@@ -898,9 +898,9 @@
898 898 }(pRemoteDestinations, pFile, pRegexFile, pSubfolder, pType, pSiteName, pSiteId, pSize, data, unique, remote_destination.id),
899 899 dataType: 'json'
900 900 });
901 901 } else {
902 - appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + __('Backup completed.'));
902 + appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + MainWP.I18n.t('Backup completed.'));
903 903 managebackups_run_next();
904 904 }
905 905 };
906 906
@@ -923,9 +923,9 @@
923 923
924 924 let progressBar = jQuery('#managesite-upload-status-progress-' + pUnique);
925 925 progressBar.progress('set progress', pSize);
926 926
927 - appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + __('Upload to %1 (%2) successful', response.info.title, response.info.type));
927 + appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + MainWP.I18n.t('Upload to %1 (%2) successful', response.info.title, response.info.type));
928 928
929 929 managebackups_backup_upload_file(pSiteId, pSiteName, pFile, pRegexFile, pSubfolder, pNewRemoteDestinations, pType, pSize);
930 930 } else if (response.status == 'busy') {
931 931 //Try again in 10seconds
@@ -941,9 +941,9 @@
941 941
942 942 if (backupContinueRetriesUnique[pUnique] > 10) {
943 943 if (responseError != undefined) {
944 944 manageBackupsError = true;
945 - appendToDiv(backtaskContentEl, '<span class="mainwp-red">[' + pSiteName + '] ' + __('Upload to %1 (%2) failed:', response.info.title, response.info.type) + ' ' + responseError + '</span>');
945 + appendToDiv(backtaskContentEl, '<span class="mainwp-red">[' + pSiteName + '] ' + MainWP.I18n.t('Upload to %1 (%2) failed:', response.info.title, response.info.type) + ' ' + responseError + '</span>');
946 946 } else {
947 947 appendToDiv(backtaskContentEl, ' <span class="mainwp-red">[' + pSiteName + '] ERROR: Upload timed out - <a href="http://docs.mainwp.com/backup-failed-php-ini-settings/">Please check this help document for more information and possible fixes</a></span>');
948 948 }
949 949
@@ -969,11 +969,11 @@
969 969
970 970 let obj = response.result;
971 971 if (obj.error) {
972 972 manageBackupsError = true;
973 - appendToDiv(backtaskContentEl, '<span class="mainwp-red">[' + pSiteName + '] ' + __('Upload to %1 (%2) failed:', obj.title, obj.type) + ' ' + obj.error + '</span>');
973 + appendToDiv(backtaskContentEl, '<span class="mainwp-red">[' + pSiteName + '] ' + MainWP.I18n.t('Upload to %1 (%2) failed:', obj.title, obj.type) + ' ' + obj.error + '</span>');
974 974 } else {
975 - appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + __('Upload to %1 (%2) successful', obj.title, obj.type));
975 + appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + MainWP.I18n.t('Upload to %1 (%2) successful', obj.title, obj.type));
976 976 }
977 977
978 978 managebackups_backup_upload_file(pSiteId, pSiteName, pFile, pRegexFile, pSubfolder, pNewRemoteDestinations, pType, pSize);
979 979 }
@@ -1015,18 +1015,18 @@
1015 1015 managebackups_init();
1016 1016
1017 1017 let errors = [];
1018 1018 if (jQuery('#mainwp_managebackups_add_name').val() == '') {
1019 - errors.push(__('Please enter a valid name for your backup task'));
1019 + errors.push(MainWP.I18n.t('Please enter a valid name for your backup task'));
1020 1020 }
1021 1021 let selected_groups = [];
1022 1022 let selected_sites = [];
1023 - if (jQuery('#select_by').val() == 'site') {
1023 + if (jQuery('input[name="select_by"]').val() == 'site') {
1024 1024 jQuery("input[name='selected_sites[]']:checked").each(function () {
1025 1025 selected_sites.push(jQuery(this).val());
1026 1026 });
1027 1027 if (selected_sites.length == 0) {
1028 - errors.push(__('Please select websites or groups to add a backup task.'));
1028 + errors.push(MainWP.I18n.t('Please select websites or groups to add a backup task.'));
1029 1029 }
1030 1030 } else {
1031 1031 jQuery("input[name='selected_groups[]']:checked").each(function () {
1032 1032 selected_groups.push(jQuery(this).val());
@@ -1031,9 +1031,9 @@
1031 1031 jQuery("input[name='selected_groups[]']:checked").each(function () {
1032 1032 selected_groups.push(jQuery(this).val());
1033 1033 });
1034 1034 if (selected_groups.length == 0) {
1035 - errors.push(__('Please select websites or groups to add a backup task.'));
1035 + errors.push(MainWP.I18n.t('Please select websites or groups to add a backup task.'));
1036 1036 }
1037 1037 }
1038 1038
1039 1039 if (errors.length > 0) {
@@ -1038,9 +1038,9 @@
1038 1038
1039 1039 if (errors.length > 0) {
1040 1040 feedback('mainwp-message-zone', errors.join('<br />'), 'red');
1041 1041 } else {
1042 - feedback('mainwp-message-zone', __('Adding the task...'), 'green');
1042 + feedback('mainwp-message-zone', MainWP.I18n.t('Adding the task...'), 'green');
1043 1043
1044 1044 jQuery('#mainwp_managebackups_update').attr('disabled', 'true'); //disable button to add..
1045 1045
1046 1046 //let loadFilesBeforeZip = jQuery( '[name="mainwp_options_loadFilesBeforeZip"]:checked' ).val();
@@ -1084,18 +1084,18 @@
1084 1084 managebackups_init();
1085 1085
1086 1086 let errors = [];
1087 1087 if (jQuery('#mainwp_managebackups_add_name').val() == '') {
1088 - errors.push(__('Please enter a valid name for your backup task'));
1088 + errors.push(MainWP.I18n.t('Please enter a valid name for your backup task'));
1089 1089 }
1090 1090 let selected_sites = [];
1091 1091 let selected_groups = [];
1092 - if (jQuery('#select_by').val() == 'site') {
1092 + if (jQuery('input[name="select_by"]').val() == 'site') {
1093 1093 jQuery("input[name='selected_sites[]']:checked").each(function () {
1094 1094 selected_sites.push(jQuery(this).val());
1095 1095 });
1096 1096 if (selected_sites.length == 0) {
1097 - errors.push(__('Please select websites or groups.'));
1097 + errors.push(MainWP.I18n.t('Please select websites or groups.'));
1098 1098 }
1099 1099 } else {
1100 1100 jQuery("input[name='selected_groups[]']:checked").each(function () {
1101 1101 selected_groups.push(jQuery(this).val());
@@ -1100,18 +1100,17 @@
1100 1100 jQuery("input[name='selected_groups[]']:checked").each(function () {
1101 1101 selected_groups.push(jQuery(this).val());
1102 1102 });
1103 1103 if (selected_groups.length == 0) {
1104 - errors.push(__('Please select websites or groups.'));
1104 + errors.push(MainWP.I18n.t('Please select websites or groups.'));
1105 1105 }
1106 1106 }
1107 1107
1108 - console.log(errors);
1109 1108
1110 1109 if (errors.length > 0) {
1111 1110 feedback('mainwp-message-zone', errors.join('<br />'), 'red');
1112 1111 } else {
1113 - feedback('mainwp-message-zone', __('Adding the task...'), 'green');
1112 + feedback('mainwp-message-zone', MainWP.I18n.t('Adding the task...'), 'green');
1114 1113
1115 1114 jQuery('#mainwp_managebackups_add').attr('disabled', 'true'); //disable button to add..
1116 1115
1117 1116 jQuery('#mainwp_managesites_add').attr('disabled', 'true'); //Disable add button
@@ -1154,11 +1153,11 @@
1154 1153 managebackups_remove = function (element) {
1155 1154 let id = jQuery(element).attr('task_id');
1156 1155 managebackups_init();
1157 1156
1158 - let msg = __('Are you sure you want to delete this backup task?');
1157 + let msg = MainWP.I18n.t('Are you sure you want to delete this backup task?');
1159 1158 mainwp_confirm(msg, function () {
1160 - jQuery('#task-status-' + id).html(__('Removing the task...'));
1159 + jQuery('#task-status-' + id).html(MainWP.I18n.t('Removing the task...'));
1161 1160 let data = mainwp_secure_data({
1162 1161 action: 'mainwp_removebackup',
1163 1162 id: id
1164 1163 });
@@ -1169,11 +1168,11 @@
1169 1168 let error = '';
1170 1169 if (response.error != undefined) {
1171 1170 error = response.error;
1172 1171 } else if (response.result == 'SUCCESS') {
1173 - result = __('The task has been removed.');
1172 + result = MainWP.I18n.t('The task has been removed.');
1174 1173 } else {
1175 - error = __('An undefined error occured.');
1174 + error = MainWP.I18n.t('An undefined error occurred.');
1176 1175 }
1177 1176
1178 1177 if (error != '') {
1179 1178 setHtml('#mainwp_managebackups', error);
@@ -1193,9 +1192,9 @@
1193 1192 managebackups_resume = function (element) {
1194 1193 let id = jQuery(element).attr('task_id');
1195 1194 managebackups_init();
1196 1195
1197 - jQuery('#task-status-' + id).html(__('Resuming the task...'));
1196 + jQuery('#task-status-' + id).html(MainWP.I18n.t('Resuming the task...'));
1198 1197 let data = mainwp_secure_data({
1199 1198 action: 'mainwp_resumebackup',
1200 1199 id: id
1201 1200 });
@@ -1206,11 +1205,11 @@
1206 1205 let error = '';
1207 1206 if (response.error != undefined) {
1208 1207 error = response.error;
1209 1208 } else if (response.result == 'SUCCESS') {
1210 - result = __('The task has been resumed.');
1209 + result = MainWP.I18n.t('The task has been resumed.');
1211 1210 } else {
1212 - error = __('An undefined error occured.');
1211 + error = MainWP.I18n.t('An undefined error occurred.');
1213 1212 }
1214 1213
1215 1214 if (error != '') {
1216 1215 setHtml('#mainwp_managebackups', error);
@@ -1220,9 +1219,9 @@
1220 1219 }
1221 1220 jQuery('#task-status-' + id).html('');
1222 1221
1223 1222 if (error == '') {
1224 - jQuery(pElement).after('<a href="#" task_id="' + pId + '" onClick="return managebackups_pause(this)">' + __('Pause') + '</a>');
1223 + jQuery(pElement).after('<a href="#" task_id="' + pId + '" onClick="return managebackups_pause(this)">' + MainWP.I18n.t('Pause') + '</a>');
1225 1224 jQuery(pElement).remove();
1226 1225 }
1227 1226 }
1228 1227 }(element, id), 'json');
@@ -1232,9 +1231,9 @@
1232 1231 managebackups_pause = function (element) {
1233 1232 let id = jQuery(element).attr('task_id');
1234 1233 managebackups_init();
1235 1234
1236 - jQuery('#task-status-' + id).html(__('Pausing the task...'));
1235 + jQuery('#task-status-' + id).html(MainWP.I18n.t('Pausing the task...'));
1237 1236 let data = mainwp_secure_data({
1238 1237 action: 'mainwp_pausebackup',
1239 1238 id: id
1240 1239 });
@@ -1245,11 +1244,11 @@
1245 1244 let error = '';
1246 1245 if (response.error != undefined) {
1247 1246 error = response.error;
1248 1247 } else if (response.result == 'SUCCESS') {
1249 - result = __('The task has been paused.');
1248 + result = MainWP.I18n.t('The task has been paused.');
1250 1249 } else {
1251 - error = __('An undefined error occured.');
1250 + error = MainWP.I18n.t('An undefined error occurred.');
1252 1251 }
1253 1252
1254 1253 if (error != '') {
1255 1254 setHtml('#mainwp_managebackups', error);
@@ -1258,9 +1257,9 @@
1258 1257 setHtml('#mainwp_managebackups_add_message', result);
1259 1258 }
1260 1259 jQuery('#task-status-' + id).html('');
1261 1260 if (error == '') {
1262 - jQuery(pElement).after('<a href="#" task_id="' + pId + '" onClick="return managebackups_resume(this)">' + __('Resume') + '</a>');
1261 + jQuery(pElement).after('<a href="#" task_id="' + pId + '" onClick="return managebackups_resume(this)">' + MainWP.I18n.t('Resume') + '</a>');
1263 1262 jQuery(pElement).remove();
1264 1263 }
1265 1264 }
1266 1265 }(element, id), 'json');
@@ -1271,9 +1270,8 @@
1271 1270
1272 1271 jQuery(document).on('click', '#updatesoverview-backup-ignore', function () {
1273 1272 if (updatesoverviewContinueAfterBackup != undefined) {
1274 1273 mainwpPopup('#updatesoverview-backup-box').close();
1275 - console.log(updatesoverviewContinueAfterBackup);
1276 1274 updatesoverviewContinueAfterBackup();
1277 1275 updatesoverviewContinueAfterBackup = undefined;
1278 1276 }
1279 1277 });
@@ -1279,9 +1277,9 @@
1279 1277 });
1280 1278
1281 1279 let updatesoverviewShowBusyFunction;
1282 1280 let updatesoverviewShowBusyTimeout;
1283 -mainwp_updatesoverview_checkBackups = function (sitesToUpdate, siteNamesx) {
1281 +mainwp_updatesoverview_checkBackups = function (sitesToUpdate, siteNames) {
1284 1282 if (mainwpParams['disable_checkBackupBeforeUpgrade']) {
1285 1283 if (updatesoverviewContinueAfterBackup != undefined) {
1286 1284 updatesoverviewContinueAfterBackup();
1287 1285 }
@@ -1289,15 +1287,15 @@
1289 1287 }
1290 1288
1291 1289 updatesoverviewShowBusyFunction = function () {
1292 1290
1293 - let output = __('Checking if a backup is required for the selected updates...');
1291 + let output = MainWP.I18n.t('Checking if a backup is required for the selected updates...');
1294 1292 mainwpPopup('#updatesoverview-backup-box').getContentEl().html(output);
1295 1293 jQuery('#updatesoverview-backup-all').hide();
1296 1294 jQuery('#updatesoverview-backup-ignore').hide();
1297 1295
1298 1296 mainwpPopup('#updatesoverview-backup-box').init({
1299 - title: __("Checking backup settings..."), callback: function () {
1297 + title: MainWP.I18n.t("Checking backup settings..."), callback: function () {
1300 1298 window.location.href = location.href
1301 1299 }
1302 1300 });
1303 1301 };
@@ -1343,12 +1341,12 @@
1343 1341 jQuery('#updatesoverview-backup-ignore').show();
1344 1342 } else {
1345 1343 let backupLink = mainwp_get_primaryBackup_link(backupPrimary);
1346 1344 jQuery('#updatesoverview-backup-now').attr('href', backupLink).show();
1347 - jQuery('#updatesoverview-backup-ignore').val(__('Proceed with Updates')).show();
1345 + jQuery('#updatesoverview-backup-ignore').val(MainWP.I18n.t('Proceed with Updates')).show();
1348 1346 }
1349 1347
1350 - let output = '<span class="mainwp-red">' + __('A full backup has not been taken in the last days for the following sites:') + '</span><br /><br />';
1348 + let output = '<span class="mainwp-red">' + MainWP.I18n.t('A full backup has not been taken in the last days for the following sites:') + '</span><br /><br />';
1351 1349
1352 1350 if (backupPrimary == '') { // default backup feature
1353 1351 for (let id of siteFeedback) {
1354 1352 output += '<span class="updatesoverview-backup-site" siteid="' + id + '">' + decodeURIComponent(pSiteNames[id]) + '</span><br />';
@@ -1361,9 +1359,9 @@
1361 1359
1362 1360 mainwpPopup('#updatesoverview-backup-box').getContentEl().html(output);
1363 1361
1364 1362 mainwpPopup('#updatesoverview-backup-box').init({
1365 - title: __("Full backup required!"), callback: function () {
1363 + title: MainWP.I18n.t("Full backup required!"), callback: function () {
1366 1364 if (updatesoverviewContinueAfterBackup != undefined) {
1367 1365 updatesoverviewContinueAfterBackup = undefined;
1368 1366 }
1369 1367 window.location.href = location.href
@@ -1402,11 +1400,11 @@
1402 1400 });
1403 1401 jQuery(document).on('click', '#updatesoverview-backup-all', function () {
1404 1402
1405 1403 // change action buttons
1406 - mainwpPopup('#updatesoverview-backup-box').setActionButtons('<input id="updatesoverview-backupnow-close" type="button" name="Ignore" value="' + __('Cancel') + '" class="button"/>');
1404 + mainwpPopup('#updatesoverview-backup-box').setActionButtons('<input id="updatesoverview-backupnow-close" type="button" name="Ignore" value="' + MainWP.I18n.t('Cancel') + '" class="button"/>');
1407 1405 mainwpPopup('#updatesoverview-backup-box').init({
1408 - title: __("Full backup"), callback: function () {
1406 + title: MainWP.I18n.t("Full backup"), callback: function () {
1409 1407 updatesoverviewContinueAfterBackup = undefined;
1410 1408 window.location.href = location.href
1411 1409 }
1412 1410 });
@@ -1426,10 +1424,10 @@
1426 1424 let updatesoverviewBackupError;
1427 1425 let updatesoverviewBackupDownloadRunning;
1428 1426
1429 1427 updatesoverview_backup_run = function () {
1430 - mainwpPopup('#updatesoverview-backup-box').getContentEl().html(dateToHMS(new Date()) + ' ' + __('Starting required backup(s)...'));
1431 - jQuery('#updatesoverview-backupnow-close').prop('value', __('Cancel'));
1428 + mainwpPopup('#updatesoverview-backup-box').getContentEl().html(dateToHMS(new Date()) + ' ' + MainWP.I18n.t('Starting required backup(s)...'));
1429 + jQuery('#updatesoverview-backupnow-close').prop('value', MainWP.I18n.t('Cancel'));
1432 1430 jQuery('#updatesoverview-backupnow-close').prop('cancel', '1');
1433 1431 updatesoverview_backup_run_next();
1434 1432 };
1435 1433
@@ -1435,21 +1433,21 @@
1435 1433
1436 1434 updatesoverview_backup_run_next = function () {
1437 1435 let backupContentEl = mainwpPopup('#updatesoverview-backup-box').getContentEl();
1438 1436 if (updatesoverviewBackupSites.length == 0) {
1439 - appendToDiv(backupContentEl, __('Required backup(s) completed') + (updatesoverviewBackupError ? ' <span class="mainwp-red">' + __('with errors') + '</span>' : '') + '.');
1437 + appendToDiv(backupContentEl, MainWP.I18n.t('Required backup(s) completed') + (updatesoverviewBackupError ? ' <span class="mainwp-red">' + MainWP.I18n.t('with errors') + '</span>' : '') + '.');
1440 1438
1441 1439 jQuery('#updatesoverview-backupnow-close').prop('cancel', '0');
1442 1440 if (updatesoverviewBackupError) {
1443 - jQuery('#updatesoverview-backupnow-close').prop('value', __('Continue update anyway'));
1441 + jQuery('#updatesoverview-backupnow-close').prop('value', MainWP.I18n.t('Continue update anyway'));
1444 1442 } else {
1445 - jQuery('#updatesoverview-backupnow-close').prop('value', __('Continue update'));
1443 + jQuery('#updatesoverview-backupnow-close').prop('value', MainWP.I18n.t('Continue update'));
1446 1444 }
1447 1445 return;
1448 1446 }
1449 1447
1450 1448 let siteName = updatesoverviewBackupSites[0]['name'];
1451 - appendToDiv(backupContentEl, '[' + siteName + '] ' + __('Creating backup file...'));
1449 + appendToDiv(backupContentEl, '[' + siteName + '] ' + MainWP.I18n.t('Creating backup file...'));
1452 1450
1453 1451 let siteId = updatesoverviewBackupSites[0]['id'];
1454 1452 updatesoverviewBackupSites.shift();
1455 1453 let data = mainwp_secure_data({
@@ -1463,9 +1461,9 @@
1463 1461 appendToDiv(backupContentEl, '[' + pSiteName + '] <span class="mainwp-red">ERROR: ' + getErrorMessage(response.error) + '</span>');
1464 1462 updatesoverviewBackupError = true;
1465 1463 updatesoverview_backup_run_next();
1466 1464 } else {
1467 - appendToDiv(backupContentEl, '[' + pSiteName + '] ' + __('Backup file created successfully!'));
1465 + appendToDiv(backupContentEl, '[' + pSiteName + '] ' + MainWP.I18n.t('Backup file created successfully!'));
1468 1466
1469 1467 updatesoverview_backupnow_download_file(pSiteId, pSiteName, response.result.type, response.result.url, response.result.local, response.result.regexfile, response.result.size, response.result.subfolder);
1470 1468 }
1471 1469
@@ -1510,9 +1508,9 @@
1510 1508 clearInterval(pInterVal);
1511 1509
1512 1510 if (response.error) {
1513 1511 appendToDiv(backupContentEl, '[' + pSiteName + '] <span class="mainwp-red">ERROR: ' + getErrorMessage(response.error) + '</span>');
1514 - appendToDiv(backupContentEl, '[' + pSiteName + '] <span class="mainwp-red">' + __('Backup failed!') + '</span>');
1512 + appendToDiv(backupContentEl, '[' + pSiteName + '] <span class="mainwp-red">' + MainWP.I18n.t('Backup failed!') + '</span>');
1515 1513
1516 1514 updatesoverviewBackupError = true;
1517 1515 updatesoverview_backup_run_next();
1518 1516 return;
@@ -1518,10 +1516,10 @@
1518 1516 return;
1519 1517 }
1520 1518
1521 1519 jQuery('#updatesoverview-backupnow-status-progress[siteId="' + pSiteId + '"]').progress('set progress', pSize);
1522 - appendToDiv(backupContentEl, '[' + pSiteName + '] ' + __('Download from the child site completed.'));
1523 - appendToDiv(backupContentEl, '[' + pSiteName + '] ' + __('Backup completed.'));
1520 + appendToDiv(backupContentEl, '[' + pSiteName + '] ' + MainWP.I18n.t('Download from the child site completed.'));
1521 + appendToDiv(backupContentEl, '[' + pSiteName + '] ' + MainWP.I18n.t('Backup completed.'));
1524 1522
1525 1523 let newData = mainwp_secure_data({
1526 1524 action: 'mainwp_backup_delete_file',
1527 1525 site_id: pSiteId,