PageRenderTime 64ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-content/plugins/backupbuddy/controllers/pages/_backup-perform.php

https://bitbucket.org/betaimages/chakalos
PHP | 589 lines | 433 code | 114 blank | 42 comment | 87 complexity | c8c83290bd0c0a1ec2074b5956be66a5 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. <?php
  2. //pb_backupbuddy::$filesystem->recursive_copy(
  3. //pb_backupbuddy::load_script( 'admin.js' );
  4. // Thickbox used for remote send button for user after backup.
  5. wp_enqueue_script( 'thickbox' );
  6. wp_print_scripts( 'thickbox' );
  7. wp_print_styles( 'thickbox' );
  8. require_once( pb_backupbuddy::plugin_path() . '/classes/backup.php' );
  9. pb_backupbuddy::$classes['backup'] = new pb_backupbuddy_backup();
  10. // Set serial ahead of time so can be used by AJAX before backup procedure actually begins.
  11. $serial_override = pb_backupbuddy::random_string( 10 );
  12. pb_backupbuddy::$ui->title( 'Create Backup' );
  13. ?>
  14. <script type="text/javascript">
  15. jQuery(document).ready(function() {
  16. // Wait 0 seconds before first poll.
  17. setTimeout( 'backupbuddy_poll()' , 0 ); // was: 1000
  18. setInterval( 'blink_ledz()' , 400 );
  19. jQuery( '.pb_backupbuddy_hoveraction_send' ).click( function(e) {
  20. tb_show( 'BackupBuddy', '<?php echo pb_backupbuddy::ajax_url( 'destination_picker' ); ?>&callback_data=' + jQuery(this).attr('rel') + '&sending=1&TB_iframe=1&width=640&height=455', null );
  21. return false;
  22. });
  23. });
  24. function pb_backupbuddy_selectdestination( destination_id, destination_title, callback_data ) {
  25. if ( callback_data != '' ) {
  26. jQuery.post( '<?php echo pb_backupbuddy::ajax_url( 'remote_send' ); ?>', { destination_id: destination_id, destination_title: destination_title, file: callback_data, trigger: 'manual' },
  27. function(data) {
  28. data = jQuery.trim( data );
  29. if ( data.charAt(0) != '1' ) {
  30. alert( '<?php _e('Error starting remote send', 'it-l10n-backupbuddy' ); ?>:' + "\n\n" + data );
  31. } else {
  32. alert( "<?php _e('Your file has been scheduled to be sent now. It should arrive shortly.', 'it-l10n-backupbuddy' ); ?> <?php _e( 'You will be notified by email if any problems are encountered.', 'it-l10n-backupbuddy' ); ?>" + "\n\n" + data.slice(1) );
  33. }
  34. }
  35. );
  36. /* Try to ping server to nudge cron along since sometimes it doesnt trigger as expected. */
  37. jQuery.post( '<?php echo admin_url('admin-ajax.php'); ?>',
  38. function(data) {
  39. }
  40. );
  41. } else {
  42. //window.location.href = '<?php echo pb_backupbuddy::page_url(); ?>&custom=remoteclient&destination_id=' + destination_id;
  43. window.location.href = '<?php
  44. if ( is_network_admin() ) {
  45. echo network_admin_url( 'admin.php' );
  46. } else {
  47. echo admin_url( 'admin.php' );
  48. }
  49. ?>?page=pb_backupbuddy_backup&custom=remoteclient&destination_id=' + destination_id;
  50. }
  51. }
  52. var stale_archive_time_trigger = 25; // If this time ellapses without archive size increasing warn user that something may have gone wrong.
  53. var stale_archive_time_trigger_increment = 1; // Number of times the popup has been shown.
  54. var backupbuddy_errors_encountered = 0; // number of errors sent via log.
  55. keep_polling = 1;
  56. pb_blink_status = 1;
  57. var last_archive_change = 0; // Time where archive size last changed.
  58. var last_archive_size = ''; // Last archive size string.
  59. function blink_ledz( this_status ) {
  60. if ( pb_blink_status == 1 ) {
  61. jQuery( '.pb_backupbuddy_blinkz' ).addClass( 'pb_backupbuddy_empty' );
  62. jQuery( '.pb_backupbuddy_blinkz' ).removeClass( 'pb_backupbuddy_glow' );
  63. pb_blink_status = 0;
  64. } else {
  65. jQuery( '.pb_backupbuddy_blinkz' ).addClass( 'pb_backupbuddy_glow' );
  66. jQuery( '.pb_backupbuddy_blinkz' ).removeClass( 'pb_backupbuddy_empty' );
  67. pb_blink_status = 1;
  68. }
  69. }
  70. function unix_timestamp() {
  71. return Math.round( ( new Date() ).getTime() / 1000 );
  72. }
  73. function backupbuddy_poll_altcron() {
  74. if ( keep_polling != 1 ) {
  75. return;
  76. }
  77. jQuery.get(
  78. '<?php echo admin_url('admin.php').'?page=pluginbuddy_backupbuddy&pb_backupbuddy_alt_cron=true'; ?>',
  79. function(data) {
  80. }
  81. );
  82. }
  83. function backupbuddy_poll() {
  84. if ( keep_polling != 1 ) {
  85. return;
  86. }
  87. //alert( 'string: ' + ( last_archive_size ) + '; timediff: ' + ( unix_timestamp() - last_archive_change ) );
  88. // Check to make sure archive size is increasing. Warn if it seems to hang.
  89. if ( ( last_archive_change != 0 ) && ( ( ( unix_timestamp() - last_archive_change ) > stale_archive_time_trigger ) ) ) {
  90. if ( stale_archive_time_trigger == 25 ) {
  91. alert( "Warning: The backup archive file size has not increased in " + stale_archive_time_trigger + " seconds. The backup may have failed.\nSubsequent notifications will be displayed in the status window." );
  92. jQuery( '#backupbuddy_messages' ).append( "\n* Warning: The backup archive file size has not increased in " + stale_archive_time_trigger + " seconds. The backup may have failed." );
  93. } else {
  94. jQuery( '#backupbuddy_messages' ).append( "\n* Warning: The backup archive file size has not increased in " + round( stale_archive_time_trigger / 60 ) + " minutes. The backup may have failed." );
  95. }
  96. textareaelem = document.getElementById( 'backupbuddy_messages' );
  97. textareaelem.scrollTop = textareaelem.scrollHeight;
  98. messages_output = '';
  99. stale_archive_time_trigger = 60 * 5 * stale_archive_time_trigger_increment;
  100. stale_archive_time_trigger_increment++;
  101. }
  102. jQuery('#pb_backupbuddy_loading').show();
  103. jQuery.ajax({
  104. url: '<?php echo pb_backupbuddy::ajax_url( 'backup_status' ); ?>',
  105. type: 'post',
  106. data: { serial: '<?php echo $serial_override; //pb_backupbuddy::$classes['backup']->_backup['serial']; ?>', action: 'pb_backupbuddy_backup_status' },
  107. context: document.body,
  108. success: function( data ) {
  109. jQuery('#pb_backupbuddy_loading').hide();
  110. data = data.split( "\n" );
  111. for( var i = 0; i < data.length; i++ ) {
  112. messages_output = '';
  113. // 0 1 2 3 4
  114. // TIME|~|TIME_IN|~|PEAK_MEMORY|~|TYPE|~|MESSAGE
  115. if ( data[i].substring( 0, 1 ) == '!' ) { // Expected command since it begins with `!`.
  116. data[i] = data[i].substring(1); // Strip exclamation point.
  117. //alert( data[i] );
  118. line = data[i].split( "|~|" );
  119. //Convert timestamp to readable format. Server timestamp based on GMT so undo localization with offset.
  120. var date = new Date();
  121. var date = new Date( ( line[0] * 1000 ) + date.getTimezoneOffset() * 60000 );
  122. var seconds = date.getSeconds();
  123. if ( seconds < 10 ) {
  124. seconds = '0' + seconds;
  125. }
  126. date = date.getHours() + ':' + date.getMinutes() + ':' + seconds;
  127. // Process commands.
  128. if ( line[3] == 'message' ) {
  129. messages_output = date + "\t" + line[1] + "sec\t" + line[2] + "MB\t" + line[4];
  130. // ERROR.
  131. } else if ( line[3] == 'error' ) { // Process errors.
  132. // Get start of any error numbers.
  133. error_number_begin = line[4].toLowerCase().indexOf( 'error #' );
  134. // If start of error number found, find end.
  135. if ( error_number_begin >= 0 ) {
  136. error_number_begin += 7; // Shift over index to after 'error #'.
  137. error_number_end = line[4].toLowerCase().indexOf( ':', error_number_begin );
  138. if ( error_number_end < 0 ) { // End still not found.
  139. error_number_end = line[4].toLowerCase().indexOf( '.', error_number_begin );
  140. }
  141. if ( error_number_end < 0 ) { // End still not found.
  142. error_number_end = line[4].toLowerCase().indexOf( ' ', error_number_begin );
  143. }
  144. error_number = line[4].slice( error_number_begin, error_number_end );
  145. }
  146. // Wrap error lines for highlighted styling for easy visibility.
  147. //var messages_output = '';
  148. if ( error_number_begin >= 0 ) { // Error number found so link this line.
  149. //messages_output += '<a class="messages_error_link" href="http://ithemes.com/codex/page/BackupBuddy:_Error_Codes#' + error_number + '" target="_new" Title="Click to look up error & troubleshooting information for this error code.">';
  150. line[4] += ' Error information & troubleshooting: http://ithemes.com/codex/page/BackupBuddy:_Error_Codes#' + error_number + ' ';
  151. }
  152. /*
  153. messages_output += '<span class="messages_error">';
  154. if ( error_number_begin >= 0 ) { // Error number found so link this line.
  155. messages_output += '<span style="display: inline-block; float: right; margin-left: 10px; margin-right: -100px;">(Click for details)</span>';
  156. }
  157. */
  158. messages_output += date + "\t" + line[1] + "sec\t" + line[2] + "MB\t" + "ERROR: " + line[4];
  159. messages_output += '</span>';
  160. if ( error_number_begin >= 0 ) { // Error number found so link this line.
  161. messages_output += '</a>';
  162. }
  163. // Count errors we encounter & clearly show user that errors were encountered.
  164. backupbuddy_errors_encountered++;
  165. jQuery( '#backupbuddy_errors_notice_count' ).text( backupbuddy_errors_encountered );
  166. // DISABLED FOR NOW: jQuery( '#backupbuddy_errors_notice' ).slideDown();
  167. // PING.
  168. } else if ( line[3] == 'ping' ) { // Ping.
  169. messages_output = date + '&#x0009;0sec&#x0009;&#x0009;0mb&#x0009;Ping. Waiting for server . . .';
  170. // ACTION.
  171. } else if ( line[3] == 'action' ) { // Process action commands.
  172. action_line = line[4].split( "^" );
  173. if ( action_line[0] == 'archive_size' ) { // Process action sub-commands.
  174. if ( last_archive_size != action_line[1] ) { // Track time archive size last changed.
  175. last_archive_size = action_line[1];
  176. last_archive_change = unix_timestamp();
  177. }
  178. jQuery( '.backupbuddy_archive_size' ).html( action_line[1] );
  179. } else if ( action_line[0] == 'finish_settings' ) {
  180. jQuery( '#pb_backupbuddy_slot1_led' ).removeClass( 'pb_backupbuddy_blinkz' ); // disable blinking
  181. jQuery( '#pb_backupbuddy_slot1_led' ).removeClass( 'pb_backupbuddy_empty' ); // Remove empty LED hole.
  182. jQuery( '#pb_backupbuddy_slot1_led' ).addClass( 'pb_backupbuddy_glow' ); // Solid LED.
  183. } else if ( action_line[0] == 'start_database' ) {
  184. jQuery( '#pb_backupbuddy_slot2_led' ).addClass( 'pb_backupbuddy_activate' ); // Light BG
  185. jQuery( '#pb_backupbuddy_slot2_step' ).addClass( 'pb_backupbuddy_activate' ); // Light BG
  186. //jQuery( '#pb_backupbuddy_slot2_led' ).addClass( 'pb_backupbuddy_glow' ); // enable blinking
  187. jQuery( '#pb_backupbuddy_slot2_led' ).addClass( 'pb_backupbuddy_blinkz' ); // enable blinking
  188. } else if ( action_line[0] == 'finish_database' ) {
  189. jQuery( '#pb_backupbuddy_slot2_led' ).removeClass( 'pb_backupbuddy_blinkz' ); // Remote blinkage.
  190. jQuery( '#pb_backupbuddy_slot2_led' ).removeClass( 'pb_backupbuddy_empty' ); // Remove empty LED hole.
  191. jQuery( '#pb_backupbuddy_slot2_led' ).addClass( 'pb_backupbuddy_glow' ); // Solid LED.
  192. } else if ( action_line[0] == 'start_files' ) {
  193. jQuery( '#pb_backupbuddy_slot3_led' ).addClass( 'pb_backupbuddy_blinkz' ); // Remote blinkage.
  194. jQuery( '#pb_backupbuddy_slot3_led' ).addClass( 'pb_backupbuddy_activate' ); // Light BG
  195. jQuery( '#pb_backupbuddy_slot3_step' ).addClass( 'pb_backupbuddy_activate' ); // Light BG
  196. jQuery( '#pb_backupbuddy_slot3' ).addClass( 'light' ); // lighten the bg
  197. jQuery( '#pb_backupbuddy_slot3_header' ).addClass( 'light' ); // use text made for lighter bg
  198. } else if ( action_line[0] == 'finish_backup' ) {
  199. jQuery( '#pb_backupbuddy_slot3_led' ).removeClass( 'pb_backupbuddy_blinkz' ); // Remote blinkage.
  200. jQuery( '#pb_backupbuddy_slot3_led' ).removeClass( 'pb_backupbuddy_empty' ); // Remove empty LED hole.
  201. jQuery( '#pb_backupbuddy_slot3_led' ).addClass( 'pb_backupbuddy_glow' ); // Solid LED.
  202. jQuery( '#pb_backupbuddy_slot4_led' ).removeClass( 'pb_backupbuddy_empty' ); // Remove empty LED hole.
  203. jQuery( '#pb_backupbuddy_slot4_led' ).addClass( 'pb_backupbuddy_win' ); // set checkmark
  204. keep_polling = 0; // Stop polling server for status updates.
  205. } else if ( action_line[0] == 'archive_url' ) {
  206. <?php if ( defined( 'PB_DEMO_MODE' ) ) { ?>
  207. jQuery( '#pb_backupbuddy_archive_download' ).slideDown();
  208. <?php } else { ?>
  209. jQuery( '#pb_backupbuddy_archive_url' ).attr( 'href', '<?php echo pb_backupbuddy::ajax_url( 'download_archive' ) . '&backupbuddy_backup='; ?>' + action_line[1] );
  210. jQuery( '#pb_backupbuddy_archive_send' ).attr( 'rel', action_line[1] );
  211. jQuery( '#pb_backupbuddy_archive_download' ).slideDown();
  212. <?php } ?>
  213. } else if ( action_line[0] == 'halt_script' ) {
  214. jQuery( '.pb_backupbuddy_blinkz' ).css( 'background-position', 'top' ); // turn off led
  215. jQuery( '#pb_backupbuddy_slot1_led' ).removeClass( 'pb_backupbuddy_blinkz' ); // disable blinking
  216. jQuery( '#pb_backupbuddy_slot2_led' ).removeClass( 'pb_backupbuddy_blinkz' ); // disable blinking
  217. jQuery( '#pb_backupbuddy_slot3_led' ).removeClass( 'pb_backupbuddy_blinkz' ); // disable blinking
  218. jQuery( '#pb_backupbuddy_slot4_led' ).removeClass( 'pb_backupbuddy_empty' ); // Remove empty LED hole.
  219. jQuery( '#pb_backupbuddy_slot4_led' ).addClass( 'pb_backupbuddy_codered' ); // set checkmark
  220. keep_polling = 0; // Stop polling server for status updates.
  221. messages_output = '*** A fatal error has been encountered. The backup has halted.';
  222. alert( '<?php _e('A fatal error has been encountered. The backup has halted.', 'it-l10n-backupbuddy' );?>' );
  223. } else {
  224. messages_output = '<?php _e('Unknown action', 'it-l10n-backupbuddy' );?>: ' + action_line[0] + "\n";
  225. }
  226. } else { // Unknown command so send to details.
  227. messages_output = date + "\t" + line[1] + "sec\t" + line[2] + "MB\t" + line[4];
  228. }
  229. // Mirror mesages to details if no details have been set so far.
  230. if ( messages_output == '' ) {
  231. messages_output = messages_output;
  232. }
  233. } else { // Unrecognized command since it does not begin with `!`. Possible PHP error.
  234. messages_output = data[i];
  235. }
  236. if ( keep_polling == 0 ) {
  237. //messages_output += "\n&middot;&middot;&middot; Finished backup procedure.\n";
  238. }
  239. // Display details.
  240. if ( messages_output != '' ) {
  241. jQuery( '#backupbuddy_messages' ).append( "\r\n" + messages_output );
  242. textareaelem = document.getElementById( 'backupbuddy_messages' );
  243. textareaelem.scrollTop = textareaelem.scrollHeight;
  244. messages_output = '';
  245. }
  246. }
  247. // Set the next server poll if applicable to happen in 2 seconds.
  248. setTimeout( 'backupbuddy_poll()' , 2000 );
  249. <?php // Handles alternate WP cron forcing.
  250. if ( defined('ALTERNATE_WP_CRON') && ALTERNATE_WP_CRON ) {
  251. echo ' setTimeout( \'backupbuddy_poll_altcron()\' , 2000 );';
  252. }
  253. ?>
  254. },
  255. complete: function( jqXHR, status ) {
  256. if ( ( status != 'success' ) && ( status != 'notmodified' ) ) {
  257. jQuery('#pb_backupbuddy_loading').hide();
  258. }
  259. }
  260. });
  261. }
  262. </script>
  263. <style type="text/css">
  264. #backupbuddy_messages {
  265. border: 1px solid #CFCFCF;
  266. -moz-border-radius:25px; /* Firefox 3.6 and earlier */
  267. height: 150px;
  268. overflow: scroll;
  269. padding-left: 6px;
  270. padding-right: 6px;
  271. padding-top: 6px;
  272. white-space: pre;
  273. width: 793px;
  274. }
  275. .messages_error {
  276. background: #FFB5B5;
  277. padding: 2px;
  278. display: inline-block;
  279. min-width: 100%;
  280. margin-left: -2px;
  281. -moz-border-radius: 5px;
  282. border-radius: 5px;
  283. }
  284. .messages_error_link:hover {
  285. color: #082633;
  286. }
  287. .messages_error_link,.messages_error_link:active {
  288. color: #13455B;
  289. }
  290. #backupbuddy_errors_notice {
  291. background: #FF8989;
  292. -moz-border-radius: 5px;
  293. border-radius: 4px;
  294. text-align: center;
  295. font-size: 1.45em;
  296. padding: 10px;
  297. margin-top: 7px;
  298. //display: inline-block;
  299. width: 788px;
  300. display: none;
  301. }
  302. #backupbuddy_errors_notice_subtext {
  303. font-size: .75em;
  304. padding-top: 3px;
  305. }
  306. .pb_backupbuddy_status {
  307. background: #636363 url('<?php echo pb_backupbuddy::plugin_url(); ?>/images/status/bg_dark.png') top repeat-x;
  308. border: 1px solid #636363;
  309. min-width: 20px;
  310. height: 29px;
  311. float: left;
  312. padding-bottom: 8px;
  313. text-align: right;
  314. -moz-border-radius: 8px 0 0 8px;
  315. border-radius: 8px 0 0 8px;
  316. margin-top: 20px;
  317. z-index: 0;
  318. position: relative;
  319. }
  320. .pb_backupbuddy_progress {
  321. background: #ECECEC;
  322. margin: 0;
  323. display: inline-block;
  324. border-radius: 5px;
  325. padding: 0;
  326. border-radius: 5px;
  327. border: 1px solid #d6d6d6;
  328. border-top: 1px solid #ebebeb;
  329. box-shadow: 0px 3px 0px 0px #aaaaaa;
  330. box-shadow: 0px 2px 0px 0px #CFCFCF;
  331. font-family: 'Helvetica Neue', 'Helvetica', Arial, sans-serif;
  332. font-size: 1.3em;
  333. }
  334. .pb_backupbuddy_step {
  335. /* background: url('blue.png') 0 5px no-repeat; */
  336. padding: 12px 30px 12px 45px;
  337. width: 120px;
  338. color: #464646;
  339. display: block;
  340. float: left;
  341. }
  342. .pb_backupbuddy_step.pb_backupbuddy_settings {
  343. background: url('<?php echo pb_backupbuddy::plugin_url();; ?>/images/status/settings.png') 6px 4px no-repeat;
  344. }
  345. .pb_backupbuddy_step.pb_backupbuddy_database {
  346. background: url('<?php echo pb_backupbuddy::plugin_url();; ?>/images/status/database.png') 6px 4px no-repeat;
  347. }
  348. .pb_backupbuddy_step.pb_backupbuddy_files {
  349. background: url('<?php echo pb_backupbuddy::plugin_url();; ?>/images/status/files.png') 6px 4px no-repeat;
  350. }
  351. .pb_backupbuddy_glow {
  352. background: url('<?php echo pb_backupbuddy::plugin_url();; ?>/images/status/blue.png') -4px 1px no-repeat;
  353. width: 35px;
  354. height: 40px;
  355. float: left;
  356. border-right: 1px solid #d6d6d6;
  357. }
  358. .pb_backupbuddy_step.pb_backupbuddy_end {
  359. width: 20px;
  360. height: 18px;
  361. padding: 11px;
  362. border: none;
  363. border-radius: 0 4px 4px 0;
  364. }
  365. .pb_backupbuddy_empty {
  366. background: url('<?php echo pb_backupbuddy::plugin_url();; ?>/images/status/empty.png') -4px 1px no-repeat;
  367. width: 35px;
  368. height: 40px;
  369. float: left;
  370. border-right: 1px solid #d6d6d6;
  371. }
  372. .pb_backupbuddy_end.pb_backupbuddy_empty {
  373. background: url('<?php echo pb_backupbuddy::plugin_url();; ?>/images/status/empty.png') 1px 1px no-repeat;
  374. }
  375. .pb_backupbuddy_step.pb_backupbuddy_end.pb_backupbuddy_win {
  376. background: #ffffff url('<?php echo pb_backupbuddy::plugin_url();; ?>/images/status/green.png') 1px 1px no-repeat;
  377. }
  378. .pb_backupbuddy_step.pb_backupbuddy_end.pb_backupbuddy_fail {
  379. background: #ffffff url('<?php echo pb_backupbuddy::plugin_url();; ?>/images/status/yellow.png') 1px 1px no-repeat;
  380. }
  381. .pb_backupbuddy_step.pb_backupbuddy_end.pb_backupbuddy_codered {
  382. background: #ffffff url('<?php echo pb_backupbuddy::plugin_url();; ?>/images/status/red.png') 1px 1px no-repeat;
  383. }
  384. .pb_backupbuddy_activate {
  385. background-color: #fff !important;
  386. }
  387. .pb_backupbuddy_afterbackupoptionswp {
  388. margin: 10px 0;
  389. }
  390. .pb_backupbuddy_afterbackupoptions a {
  391. font-size: 16px;
  392. color: #21759B;
  393. margin-right: 20px;
  394. font-family: 'Helvetica Neue', 'Helvetica', Arial, sans-serif;
  395. text-decoration: none;
  396. }
  397. .pb_backupbuddy_afterbackupoptionswp a {
  398. background: #f5f5f5;
  399. text-shadow: rgba(255, 255, 255, 1) 0 1px 0;
  400. border: 1px solid #BBB;
  401. border-radius: 11px;
  402. color: #464646;
  403. text-decoration: none;
  404. font-family: 'Helvetica Neue', 'Helvetica', Arial, sans-serif;
  405. font-size: 12px;
  406. line-height: 13px;
  407. padding: 3px 8px;
  408. cursor: pointer;
  409. }
  410. #backupbuddy_messages::-webkit-scrollbar {
  411. -webkit-appearance: none;
  412. width: 11px;
  413. height: 11px;
  414. }
  415. #backupbuddy_messages::-webkit-scrollbar-thumb {
  416. border-radius: 8px;
  417. border: 2px solid white; /* should match background, can't be transparent */
  418. background-color: rgba(0, 0, 0, .5);
  419. }
  420. </style>
  421. <br />
  422. <div>
  423. <div style="margin-left: 20px;" class="pb_progress">
  424. <div class="pb_backupbuddy_progress">
  425. <span class="pb_backupbuddy_step pb_backupbuddy_settings pb_backupbuddy_activate" id="pb_backupbuddy_slot1_step"><?php _e('Settings Export', 'it-l10n-backupbuddy' );?></span>
  426. <span class="pb_backupbuddy_empty pb_backupbuddy_blinkz pb_backupbuddy_activate" id="pb_backupbuddy_slot1_led"></span>
  427. <span class="pb_backupbuddy_step pb_backupbuddy_database" id="pb_backupbuddy_slot2_step"><?php _e('Database Export', 'it-l10n-backupbuddy' );?></span>
  428. <span class="pb_backupbuddy_empty" id="pb_backupbuddy_slot2_led"></span>
  429. <span class="pb_backupbuddy_step pb_backupbuddy_files" id="pb_backupbuddy_slot3_step"><?php _e('Files Export', 'it-l10n-backupbuddy' );?></span>
  430. <span class="pb_backupbuddy_empty" id="pb_backupbuddy_slot3_led"></span>
  431. <span class="pb_backupbuddy_step pb_backupbuddy_end pb_backupbuddy_empty" id="pb_backupbuddy_slot4_led"></span>
  432. </div>
  433. </div>
  434. <div style="clear: both;"></div>
  435. <br />
  436. <div id="pb_backupbuddy_archive_download" style="display: none; width: 793px; text-align: center;">
  437. <a id="pb_backupbuddy_archive_url" href="#" class="button-primary"><?php _e('Download backup', 'it-l10n-backupbuddy' ); ?> (<span class="backupbuddy_archive_size">0 MB</span>)</a>
  438. &nbsp;&nbsp;&nbsp;
  439. <a id="pb_backupbuddy_archive_send" href="#" class="button-primary pb_backupbuddy_hoveraction_send thickbox"><?php _e('Send backup to destination', 'it-l10n-backupbuddy' ); ?></a>
  440. &nbsp;&nbsp;&nbsp;
  441. <a href="<?php echo pb_backupbuddy::page_url(); ?>" class="button secondary-button">&larr; <?php _e( 'back to backups', 'it-l10n-backupbuddy' );?></a>
  442. </div>
  443. <br />
  444. <table width="793"><tr>
  445. <td><span style="font-size: 1.17em; font-weight: bold;"><?php _e('Status', 'it-l10n-backupbuddy' );?></span></td>
  446. <td width="16"><span id="pb_backupbuddy_loading" style="display: none; margin-left: 10px;"><img src="<?php echo pb_backupbuddy::plugin_url();; ?>/images/loading.gif" <?php echo 'alt="', __('Loading...', 'it-l10n-backupbuddy' ),'" title="',__('Loading...', 'it-l10n-backupbuddy' ),'"';?> width="16" height="16" style="vertical-align: -3px;" /></span></td>
  447. <td width="100%" align="right"><?php _e('Archive size', 'it-l10n-backupbuddy' );?>: <span class="backupbuddy_archive_size">0 MB</span> <?php pb_backupbuddy::tip( __('This is the current size of the backup archive as it is being generated. This size will grow until the backup is complete.','it-l10n-backupbuddy' ) ); ?></td>
  448. </tr></table>
  449. <!-- &middot;&middot;&middot; Starting backup procedure... &middot;&middot;&middot; -->
  450. <textarea wrap="off" id="backupbuddy_messages" style="width: 793px; white-space: nowrap;">Time Elapsed Memory Message</textarea>
  451. <div id="backupbuddy_errors_notice"><span id="backupbuddy_errors_notice_count"></span> or more errors have been highlighted in the log above.<br><span id="backupbuddy_errors_notice_subtext"><b>Not all errors are fatal.</b> Look up errors & troubleshooting in the <a href="http://ithemes.com/codex/page/BackupBuddy#Troubleshooting"><b>Knowledge Base</b></a>.</span></div>
  452. <br><br>
  453. <!-- <a href="#" class="button-secondary pb_backupbuddy_sendlog" rel="backupbuddy_messages">Send Log to Support</a><br><br> -->
  454. <br><br>
  455. <div class="description" style="width: 793px; text-align: center;">
  456. <?php
  457. if ( pb_backupbuddy::$options['backup_mode'] == '1' ) { // Classic mode (all in one page load).
  458. _e('Running in CLASSIC mode. Leaving this page before the backup completes will lead to a failed backup.', 'it-l10n-backupbuddy' );
  459. } else {
  460. _e('You may leave this page and the backup will continue, though possibly with delays between steps.', 'it-l10n-backupbuddy' );
  461. }
  462. ?>
  463. </div>
  464. </div>
  465. <br /><br />
  466. <?php
  467. flush(); // Output HTML in case there is processing delay... Especially needed in classic mode since full backup must happen in page load.
  468. $export_plugins = array(); // Default of no exported plugins. Used by MS export.
  469. if ( pb_backupbuddy::_GET( 'backupbuddy_backup' ) == 'export' ) {
  470. $export_plugins = pb_backupbuddy::_POST( 'items' );
  471. }
  472. if ( pb_backupbuddy::$classes['backup']->start_backup_process( pb_backupbuddy::_GET( 'backupbuddy_backup' ), 'manual', array(), array(), '', $serial_override, $export_plugins ) !== true ) {
  473. echo __('Fatal Error #4344443: Backup failure', 'it-l10n-backupbuddy' );
  474. }
  475. ?>