WP-DB-Backup - Version 2.1.0

Version Description

Download this release

Release Info

Developer filosofo
Plugin Icon 128x128 WP-DB-Backup
Version 2.1.0
Comparing to
See all releases

Code changes from version 2.0.6 to 2.1.0

Files changed (3) hide show
  1. readme.txt +3 -3
  2. wp-db-backup.php +237 -202
  3. wp-db-backup.po +150 -96
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: filosofo, skippy, Firas, LaughingLizard, MtDewVirus, Podz, Ringmaster
3
  Donate link: http://www.ilfilosofo.com/blog/wp-db-backup/
4
  Tags: mysql, database, backup, cron
5
- Requires at least: 2.0
6
- Tested up to: 2.2
7
- Stable tag: 2.0.6
8
 
9
  On-demand backup of your WordPress database.
10
 
2
  Contributors: filosofo, skippy, Firas, LaughingLizard, MtDewVirus, Podz, Ringmaster
3
  Donate link: http://www.ilfilosofo.com/blog/wp-db-backup/
4
  Tags: mysql, database, backup, cron
5
+ Requires at least: 2.0.3
6
+ Tested up to: 2.3
7
+ Stable tag: 2.1.0
8
 
9
  On-demand backup of your WordPress database.
10
 
wp-db-backup.php CHANGED
@@ -2,10 +2,10 @@
2
  /*
3
  Plugin Name: WordPress Database Backup
4
  Plugin URI: http://www.ilfilosofo.com/blog/wp-db-backup
5
- Description: On-demand backup of your WordPress database. Navigate to <a href="edit.php?page=wp-db-backup.php">Manage &rarr; Backup</a> to get started.
6
  Author: Austin Matzko
7
  Author URI: http://www.ilfilosofo.com/blog/
8
- Version: 2.0.6
9
 
10
  Development continued from that done by Skippy (http://www.skippy.net/)
11
 
@@ -47,16 +47,19 @@ define('ROWS_PER_SEGMENT', 100);
47
  * and increase MOD_EVASIVE_DELAY
48
  * if the backup stops prematurely.
49
  */
50
- define('MOD_EVASIVE_OVERRIDE', false);
51
  define('MOD_EVASIVE_DELAY', '500');
52
 
53
  class wpdbBackup {
54
 
55
  var $backup_complete = false;
56
  var $backup_file = '';
 
57
  var $backup_dir = WP_BACKUP_DIR;
58
- var $backup_errors = array();
59
  var $basename;
 
 
60
  var $useMailer = false;
61
 
62
  function gzip() {
@@ -65,16 +68,18 @@ class wpdbBackup {
65
 
66
  function module_check() {
67
  $mod_evasive = false;
68
- if ( true == MOD_EVASIVE_OVERRIDE ) return true;
 
69
  if ( function_exists('apache_get_modules') )
70
  foreach( (array) apache_get_modules() as $mod )
71
- if ( false !== strpos($mod,'mod_evasive') || false !== strpos($mod,'mod_dosevasive') ) $mod_evasive = true;
72
- return $mod_evasive;
 
73
  }
74
 
75
  function wpdbBackup() {
76
  global $table_prefix, $wpdb;
77
- load_plugin_textdomain('wp-db-backup');
78
  add_action('phpmailer_init', array(&$this, 'setup_phpmailer'));
79
  add_action('wp_db_backup_cron', array(&$this, 'cron_backup'));
80
  add_action('wp_cron_daily', array(&$this, 'wp_cron_daily'));
@@ -82,29 +87,41 @@ class wpdbBackup {
82
  add_filter('wp_db_b_schedule_choices', array(&$this, 'schedule_choices'));
83
 
84
  $table_prefix = ( isset( $table_prefix ) ) ? $table_prefix : $wpdb->prefix;
 
 
 
 
85
  if ( isset( $wpdb->link2cat ) )
86
  $this->core_table_names = explode(',',"$wpdb->categories,$wpdb->comments,$wpdb->link2cat,$wpdb->links,$wpdb->options,$wpdb->post2cat,$wpdb->postmeta,$wpdb->posts,$wpdb->users,$wpdb->usermeta");
87
  else
88
  $this->core_table_names = explode(',',"$wpdb->categories,$wpdb->comments,$wpdb->linkcategories,$wpdb->links,$wpdb->options,$wpdb->post2cat,$wpdb->postmeta,$wpdb->posts,$wpdb->users,$wpdb->usermeta");
89
 
90
- $this->backup_dir = trailingslashit($this->backup_dir);
91
- $this->basename = preg_replace('/^.*wp-content[\\\\\/]plugins[\\\\\/]/', '', __FILE__);
92
 
 
 
 
 
 
 
93
  if (isset($_POST['do_backup'])) {
94
- if ( !$this->user_can_backup() ) die(__('You are not allowed to perform backups.','wp-db-backup'));
 
 
95
  switch($_POST['do_backup']) {
96
  case 'backup':
97
- $this->perform_backup();
98
  break;
99
  case 'fragments':
100
  add_action('admin_menu', array(&$this, 'fragment_menu'));
101
  break;
102
  }
103
  } elseif (isset($_GET['fragment'] )) {
104
- if ( !$this->user_can_backup() ) die(__('You are not allowed to perform backups.','wp-db-backup'));
105
  add_action('init', array(&$this, 'init'));
106
  } elseif (isset($_GET['backup'] )) {
107
- if ( !$this->user_can_backup() ) die(__('You are not allowed to perform backups.','wp-db-backup'));
108
  add_action('init', array(&$this, 'init'));
109
  } else {
110
  add_action('admin_menu', array(&$this, 'admin_menu'));
@@ -112,8 +129,7 @@ class wpdbBackup {
112
  }
113
 
114
  function init() {
115
- if ( !$this->user_can_backup() ) die(__('You are not allowed to perform backups.','wp-db-backup'));
116
-
117
  if (isset($_GET['backup'])) {
118
  $via = isset($_GET['via']) ? $_GET['via'] : 'http';
119
 
@@ -124,15 +140,11 @@ class wpdbBackup {
124
  case 'smtp':
125
  case 'email':
126
  $this->deliver_backup ($this->backup_file, 'smtp', $_GET['recipient']);
 
127
  echo '
128
  <!-- ' . $via . ' -->
129
  <script type="text/javascript"><!--\\
130
  ';
131
- if($this->backup_errors) {
132
- foreach($this->backup_errors as $error) {
133
- echo "window.parent.addError('$error');\n";
134
- }
135
- }
136
  echo '
137
  alert("' . __('Backup Complete!','wp-db-backup') . '");
138
  </script>
@@ -140,6 +152,7 @@ class wpdbBackup {
140
  break;
141
  default:
142
  $this->deliver_backup ($this->backup_file, $via);
 
143
  }
144
  die();
145
  }
@@ -151,14 +164,14 @@ class wpdbBackup {
151
 
152
  die();
153
  }
154
-
 
 
 
 
155
  function build_backup_script() {
156
  global $table_prefix, $wpdb;
157
 
158
- $datum = date("Ymd_B");
159
- $backup_filename = DB_NAME . "_$table_prefix$datum.sql";
160
- if ($this->gzip()) $backup_filename .= '.gz';
161
-
162
  echo "<div class='wrap'>";
163
  //echo "<pre>" . print_r($_POST, 1) . "</pre>";
164
  echo '<h2>' . __('Backup','wp-db-backup') . '</h2>
@@ -193,8 +206,8 @@ class wpdbBackup {
193
  }
194
 
195
  function backup(table, segment) {
196
- var fram = document.getElementById("backuploader");
197
- fram.src = "' . $_SERVER['REQUEST_URI'] . '&fragment=" + table + ":" + segment + ":' . $backup_filename . '";
198
  }
199
 
200
  var curStep = 0;
@@ -209,8 +222,7 @@ class wpdbBackup {
209
  setMeter(100);
210
  ';
211
 
212
- $this_basename = preg_replace('/^.*wp-content[\\\\\/]plugins[\\\\\/]/', '', __FILE__);
213
- $download_uri = get_option('siteurl') . "/wp-admin/edit.php?page={$this_basename}&backup={$backup_filename}";
214
  switch($_POST['deliver']) {
215
  case 'http':
216
  echo '
@@ -292,82 +304,64 @@ class wpdbBackup {
292
  }
293
  }
294
 
295
- echo '<script type="text/javascript"><!--//
296
- var msg = "' . $msg . '";
297
- window.parent.setProgress(msg);
298
- ';
299
-
300
  if (is_writable(ABSPATH . $this->backup_dir)) {
301
  $this->fp = $this->open(ABSPATH . $this->backup_dir . $filename, 'a');
302
  if(!$this->fp) {
303
- $this->backup_error(__('Could not open the backup file for writing!','wp-db-backup'));
304
- $this->fatal_error = __('The backup file could not be saved. Please check the permissions for writing to your backup directory and try again.','wp-db-backup');
305
  }
306
  else {
307
  if($table == '') {
308
  //Begin new backup of MySql
309
- $this->stow("# WordPress MySQL database backup\n");
310
  $this->stow("#\n");
311
- $this->stow("# Generated: " . date("l j. F Y H:i T") . "\n");
312
- $this->stow("# Hostname: " . DB_HOST . "\n");
313
- $this->stow("# Database: " . $this->backquote(DB_NAME) . "\n");
314
  $this->stow("# --------------------------------------------------------\n");
315
  } else {
316
  if($segment == 0) {
317
  // Increase script execution time-limit to 15 min for every table.
318
  if ( !ini_get('safe_mode')) @set_time_limit(15*60);
319
- //ini_set('memory_limit', '16M');
320
  // Create the SQL statements
321
  $this->stow("# --------------------------------------------------------\n");
322
- $this->stow("# Table: " . $this->backquote($table) . "\n");
323
  $this->stow("# --------------------------------------------------------\n");
324
  }
325
  $this->backup_table($table, $segment);
326
  }
327
  }
328
  } else {
329
- $this->backup_error(__('The backup directory is not writeable!','wp-db-backup'));
330
- $this->fatal_error = __('The backup directory is not writeable! Please check the permissions for writing to your backup directory and try again.','wp-db-backup');
331
  }
332
 
333
  if($this->fp) $this->close($this->fp);
334
 
335
- if($this->backup_errors) {
336
- foreach($this->backup_errors as $error) {
337
- echo "window.parent.addError('$error');\n";
338
- }
339
- }
340
- if($this->fatal_error) {
341
- echo '
342
- alert("' . addslashes($this->fatal_error) . '");
343
- //--></script>
344
- ';
345
- }
346
- else {
347
- echo '
348
- window.parent.nextStep();
349
- //--></script>
350
- ';
351
- }
352
-
353
  die();
354
  }
355
 
356
  function perform_backup() {
357
  // are we backing up any other tables?
358
  $also_backup = array();
359
- if (isset($_POST['other_tables'])) {
360
  $also_backup = $_POST['other_tables'];
361
- }
362
-
363
  $core_tables = $_POST['core_tables'];
364
  $this->backup_file = $this->db_backup($core_tables, $also_backup);
365
  if (FALSE !== $this->backup_file) {
366
  if ('smtp' == $_POST['deliver']) {
367
- $this->deliver_backup ($this->backup_file, $_POST['deliver'], $_POST['backup_recipient']);
 
368
  } elseif ('http' == $_POST['deliver']) {
369
- $this_basename = preg_replace('/^.*wp-content[\\\\\/]plugins[\\\\\/]/', '', __FILE__);
370
- header('Refresh: 3; ' . get_option('siteurl') . "/wp-admin/edit.php?page={$this_basename}&backup={$this->backup_file}");
371
  }
372
  // we do this to say we're done.
373
  $this->backup_complete = true;
@@ -375,11 +369,11 @@ class wpdbBackup {
375
  }
376
 
377
  function admin_menu() {
378
- add_management_page(__('Backup','wp-db-backup'), __('Backup','wp-db-backup'), 'import', basename(__FILE__), array(&$this, 'backup_menu'));
379
  }
380
 
381
  function fragment_menu() {
382
- add_management_page(__('Backup','wp-db-backup'), __('Backup','wp-db-backup'), 'import', basename(__FILE__), array(&$this, 'build_backup_script'));
383
  }
384
 
385
  /**
@@ -422,31 +416,69 @@ class wpdbBackup {
422
  }
423
 
424
  function close($fp) {
425
- if ($this->gzip())
426
- gzclose($fp);
427
- else
428
- fclose($fp);
429
  }
430
 
 
 
 
 
 
431
  function stow($query_line) {
432
  if ($this->gzip()) {
433
- if(@gzwrite($this->fp, $query_line) === FALSE) {
434
- $this->backup_error(__('There was an error writing a line to the backup script:','wp-db-backup'));
435
- $this->backup_error('&nbsp;&nbsp;' . $query_line);
436
- }
437
  } else {
438
- if(@fwrite($this->fp, $query_line) === FALSE) {
439
- $this->backup_error(__('There was an error writing a line to the backup script:','wp-db-backup'));
440
- $this->backup_error('&nbsp;&nbsp;' . $query_line);
441
- }
442
  }
443
  }
444
 
445
- function backup_error($err) {
446
- if(count($this->backup_errors) < 20)
447
- $this->backup_errors[] = $err;
448
- elseif(count($this->backup_errors) == 20)
449
- $this->backup_errors[] = __('Subsequent errors have been omitted from this log.','wp-db-backup');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
450
  }
451
 
452
  /**
@@ -454,15 +486,18 @@ class wpdbBackup {
454
  * Alain Wolf, Zurich - Switzerland
455
  * Website: http://restkultur.ch/personal/wolf/scripts/db_backup/
456
 
457
- * Modified by Scott Merril (http://www.skippy.net/)
458
  * to use the WordPress $wpdb object
 
 
 
459
  */
460
  function backup_table($table, $segment = 'none') {
461
  global $wpdb;
462
 
463
  $table_structure = $wpdb->get_results("DESCRIBE $table");
464
  if (! $table_structure) {
465
- $this->backup_error(__('Error getting table details','wp-db-backup') . ": $table");
466
  return FALSE;
467
  }
468
 
@@ -470,7 +505,7 @@ class wpdbBackup {
470
  // Add SQL statement to drop existing table
471
  $this->stow("\n\n");
472
  $this->stow("#\n");
473
- $this->stow("# Delete any existing table " . $this->backquote($table) . "\n");
474
  $this->stow("#\n");
475
  $this->stow("\n");
476
  $this->stow("DROP TABLE IF EXISTS " . $this->backquote($table) . ";\n");
@@ -479,26 +514,28 @@ class wpdbBackup {
479
  // Comment in SQL-file
480
  $this->stow("\n\n");
481
  $this->stow("#\n");
482
- $this->stow("# Table structure of table " . $this->backquote($table) . "\n");
483
  $this->stow("#\n");
484
  $this->stow("\n");
485
 
486
  $create_table = $wpdb->get_results("SHOW CREATE TABLE $table", ARRAY_N);
487
  if (FALSE === $create_table) {
488
- $this->backup_error(sprintf(__("Error with SHOW CREATE TABLE for %s.",'wp-db-backup'), $table));
489
- $this->stow("#\n# Error with SHOW CREATE TABLE for $table!\n#\n");
 
490
  }
491
  $this->stow($create_table[0][1] . ' ;');
492
 
493
  if (FALSE === $table_structure) {
494
- $this->backup_error(sprintf(__("Error getting table structure of %s",'wp-db-backup'), $table));
495
- $this->stow("#\n# Error getting table structure of $table!\n#\n");
 
496
  }
497
 
498
  // Comment in SQL-file
499
  $this->stow("\n\n");
500
  $this->stow("#\n");
501
- $this->stow('# Data contents of table ' . $this->backquote($table) . "\n");
502
  $this->stow("#\n");
503
  }
504
 
@@ -532,8 +569,9 @@ class wpdbBackup {
532
 
533
  /*
534
  if (FALSE === $table_data) {
535
- $wp_backup_error .= "Error getting table contents from $table\r\n";
536
- fwrite($fp, "#\n# Error getting table contents fom $table!\n#\n");
 
537
  }
538
  */
539
 
@@ -562,52 +600,32 @@ class wpdbBackup {
562
  // Create footer/closing comment in SQL-file
563
  $this->stow("\n");
564
  $this->stow("#\n");
565
- $this->stow("# End of data contents of table " . $this->backquote($table) . "\n");
566
  $this->stow("# --------------------------------------------------------\n");
567
  $this->stow("\n");
568
  }
569
  } // end backup_table()
570
 
571
- function return_bytes($val) {
572
- $val = trim($val);
573
- $last = strtolower($val{strlen($val)-1});
574
- switch($last) {
575
- // The 'G' modifier is available since PHP 5.1.0
576
- case 'g':
577
- $val *= 1024;
578
- case 'm':
579
- $val *= 1024;
580
- case 'k':
581
- $val *= 1024;
582
- }
583
- return $val;
584
- }
585
-
586
  function db_backup($core_tables, $other_tables) {
587
  global $table_prefix, $wpdb;
588
 
589
- $datum = date("Ymd_B");
590
- $wp_backup_filename = DB_NAME . "_$table_prefix$datum.sql";
591
- if ($this->gzip())
592
- $wp_backup_filename .= '.gz';
593
-
594
  if (is_writable(ABSPATH . $this->backup_dir)) {
595
- $this->fp = $this->open(ABSPATH . $this->backup_dir . $wp_backup_filename);
596
  if(!$this->fp) {
597
- $this->backup_error(__('Could not open the backup file for writing!','wp-db-backup'));
598
  return false;
599
  }
600
  } else {
601
- $this->backup_error(__('The backup directory is not writeable!','wp-db-backup'));
602
  return false;
603
  }
604
 
605
  //Begin new backup of MySql
606
- $this->stow("# WordPress MySQL database backup\n");
607
  $this->stow("#\n");
608
- $this->stow("# Generated: " . date("l j. F Y H:i T") . "\n");
609
- $this->stow("# Hostname: " . DB_HOST . "\n");
610
- $this->stow("# Database: " . $this->backquote(DB_NAME) . "\n");
611
  $this->stow("# --------------------------------------------------------\n");
612
 
613
  if ( (is_array($other_tables)) && (count($other_tables) > 0) )
@@ -620,17 +638,17 @@ class wpdbBackup {
620
  if ( !ini_get('safe_mode')) @set_time_limit(15*60);
621
  // Create the SQL statements
622
  $this->stow("# --------------------------------------------------------\n");
623
- $this->stow("# Table: " . $this->backquote($table) . "\n");
624
  $this->stow("# --------------------------------------------------------\n");
625
  $this->backup_table($table);
626
  }
627
 
628
  $this->close($this->fp);
629
 
630
- if (count($this->backup_errors)) {
631
  return false;
632
  } else {
633
- return $wp_backup_filename;
634
  }
635
 
636
  } //wp_db_backup
@@ -647,18 +665,14 @@ class wpdbBackup {
647
  return true;
648
  }
649
 
650
- function deliver_backup ($filename = '', $delivery = 'http', $recipient = '') {
651
  if ('' == $filename) { return FALSE; }
652
 
653
  $this->diskfile = ABSPATH . $this->backup_dir . $filename;
654
  $this->filename = $filename;
655
  if ('http' == $delivery) {
656
- if (! file_exists($this->diskfile)) {
657
- $msg = sprintf(__('File not found:%s','wp-db-backup'), "<br /><strong>$filename</strong><br />");
658
- $this_basename = preg_replace('/^.*wp-content[\\\\\/]plugins[\\\\\/]/', '', __FILE__);
659
- $msg .= '<br /><a href="' . get_option('siteurl') . "/wp-admin/edit.php?page={$this_basename}" . '">' . __('Return to Backup','wp-db-backup');
660
- die($msg);
661
- }
662
  header('Content-Description: File Transfer');
663
  header('Content-Type: application/octet-stream');
664
  header('Content-Length: ' . filesize($this->diskfile));
@@ -701,10 +715,10 @@ class wpdbBackup {
701
 
702
  if (function_exists('wp_mail')) {
703
  $this->useMailer = true;
704
- wp_mail ($recipient, get_bloginfo('name') . ' ' . __('Database Backup','wp-db-backup'), $message, $headers);
705
  $this->useMailer = false;
706
  } else {
707
- mail ($recipient, get_bloginfo('name') . ' ' . __('Database Backup','wp-db-backup'), $message, $headers);
708
  }
709
 
710
  unlink($this->diskfile);
@@ -739,18 +753,20 @@ class wpdbBackup {
739
  }
740
  $feedback .= '</p></div>';
741
  }
742
-
743
- if (count($this->backup_errors)) {
744
- $feedback .= '<div class="updated error">' . __('The following errors were reported:','wp-db-backup') . "<pre>";
745
- foreach($this->backup_errors as $error) {
746
- $feedback .= "{$error}\n"; //Errors are already localized
747
- }
748
- $feedback .= "</pre></div>";
 
749
  }
750
-
751
  // did we just save options for wp-cron?
752
  if ( (function_exists('wp_schedule_event') || function_exists('wp_cron_init'))
753
  && isset($_POST['wp_cron_backup_options']) ) :
 
754
  if ( function_exists('wp_schedule_event') ) {
755
  wp_clear_scheduled_hook( 'wp_db_backup_cron' ); // unschedule previous
756
  $scheds = (array) wp_get_schedules();
@@ -786,6 +802,9 @@ class wpdbBackup {
786
  if ('' != $feedback)
787
  echo $feedback;
788
 
 
 
 
789
  // Give the new dirs the same perms as wp-content.
790
  $stat = stat( ABSPATH . 'wp-content' );
791
  $dir_perms = $stat['mode'] & 0000777; // Get the permission bits.
@@ -805,10 +824,10 @@ class wpdbBackup {
805
 
806
  if ( !file_exists( ABSPATH . $this->backup_dir . 'index.php') )
807
  @ touch( ABSPATH . $this->backup_dir . "index.php");
808
-
809
  ?><div class='wrap'>
810
  <h2><?php _e('Backup','wp-db-backup') ?></h2>
811
  <form method="post" action="">
 
812
  <fieldset class="options"><legend><?php _e('Tables','wp-db-backup') ?></legend>
813
  <table align="center" cellspacing="5" cellpadding="5"><tr><td width="50%" align="left" class="alternate" valign="top">
814
  <?php _e('These core WordPress tables will always be backed up:','wp-db-backup') ?><br /><ul><?php
@@ -822,38 +841,19 @@ class wpdbBackup {
822
  echo "<label style=\"display:block;\"><input type='checkbox' name='other_tables[]' value='{$table}' /> {$table}</label>";
823
  }
824
  }
825
- ?></td></tr></table></fieldset>
826
- <fieldset class="options"><legend><?php _e('Backup Options','wp-db-backup') ?></legend>
827
- <?php _e('What to do with the backup file:','wp-db-backup') ?><br />
828
- <label for="do_save" style="display:block;"><input type="radio" id="do_save" name="deliver" value="none" style="border:none;" />
829
- <?php echo __('Save to server','wp-db-backup') . " ({$this->backup_dir})</label>";
830
- ?><label for="do_download" style="display:block;"><input type="radio" checked="checked" id="do_download" name="deliver" value="http" style="border:none;" />
831
- <?php _e('Download to your computer','wp-db-backup') ?></label>
832
- <label for="do_email"><input type="radio" name="deliver" id="do_email" value="smtp" style="border:none;" />
833
- <?php _e('Email backup to:','wp-db-backup') ?></label><input type="text" name="backup_recipient" size="20" value="<?php echo get_option('admin_email') ?>" />
834
-
835
- <?php
836
- // Check DB dize.
837
- $table_status = $wpdb->get_results("SHOW TABLE STATUS FROM " . $this->backquote(DB_NAME));
838
- $core_size = $db_size = 0;
839
- foreach($table_status as $table) {
840
- $table_size = $table->Data_length - $table->Data_free;
841
- if(in_array($table->Name, $wp_backup_default_tables)) {
842
- $core_size += $table_size;
843
- }
844
- $db_size += $table_size;
845
- }
846
- $mem_limit = ini_get('memory_limit');
847
- $mem_limit = $this->return_bytes($mem_limit);
848
- $mem_limit = ($mem_limit == 0) ? 8*1024*1024 : $mem_limit - 2000000;
849
-
850
- if (! $WHOOPS) {
851
- echo '<input type="hidden" name="do_backup" id="do_backup" value="backup" />';
852
- echo '<p class="submit"><input type="submit" name="submit" onclick="document.getElementById(\'do_backup\').value=\'fragments\';" value="' . __('Backup','wp-db-backup') . '!" /></p>';
853
- } else {
854
- echo '<p class="alternate">' . __('WARNING: Your backup directory is <strong>NOT</strong> writable!','wp-db-backup') . '</p>';
855
- }
856
- echo '</fieldset>';
857
  echo '</form>';
858
 
859
  // this stuff only displays if some sort of wp-cron is available
@@ -872,6 +872,7 @@ class wpdbBackup {
872
  echo __('Next WP-Cron Daily Execution','wp-db-backup') . ': ' . gmdate($datetime, (get_option('wp_cron_daily_lastrun') + (get_option('gmt_offset') * 3600) + 86400)) . '</p>';
873
  endif;
874
  ?><form method="post" action="">
 
875
  <table width="100%" cellpadding="5" cellspacing="5">
876
  <tr><td align="center"><?php
877
  echo __('Schedule: ','wp-db-backup');
@@ -893,7 +894,8 @@ class wpdbBackup {
893
  if (! is_email($cron_recipient)) {
894
  $cron_recipient = get_option('admin_email');
895
  }
896
- echo __('Email backup to:','wp-db-backup') . ' <input type="text" name="cron_backup_recipient" size="20" value="' . $cron_recipient . '" />';
 
897
  echo '</td></tr>';
898
  $cron_tables = get_option('wp_cron_backup_tables');
899
  if (! is_array($cron_tables)) {
@@ -910,7 +912,7 @@ class wpdbBackup {
910
  }
911
  echo '</td></tr>';
912
  }
913
- echo '<tr><td colspan="2" align="center"><input type="hidden" name="wp_cron_backup_options" value="SET" /><input type="submit" name="submit" value="' . __('Submit','wp-db-backup') . '" /></td></tr></table></form>';
914
  echo '</fieldset>';
915
  endif; // end of wp_cron (legacy) section
916
 
@@ -951,27 +953,22 @@ class wpdbBackup {
951
 
952
  function wp_cron_daily() { // for legacy cron plugin
953
  $schedule = intval(get_option('wp_cron_backup_schedule'));
954
- if (0 == $schedule) {
955
- // Scheduled backup is disabled
956
  return;
957
- }
958
- else { $this->cron_backup(); }
959
- } // wp_cron_daily
960
 
961
  function cron_backup() {
962
  global $table_prefix, $wpdb;
963
-
964
  $all_tables = $wpdb->get_results("SHOW TABLES", ARRAY_N);
965
  $all_tables = array_map(create_function('$a', 'return $a[0];'), $all_tables);
966
  $core_tables = array_intersect($all_tables, $this->core_table_names);
967
  $other_tables = get_option('wp_cron_backup_tables');
968
-
969
  $recipient = get_option('wp_cron_backup_recipient');
970
-
971
  $backup_file = $this->db_backup($core_tables, $other_tables);
972
- if (FALSE !== $backup_file) {
973
- $this->deliver_backup ($backup_file, 'smtp', $recipient);
974
- }
975
  return;
976
  }
977
 
@@ -980,19 +977,57 @@ class wpdbBackup {
980
  return $sched;
981
  }
982
 
983
- function user_can_backup() {
984
- return current_user_can('import');
 
 
 
 
 
 
 
 
 
 
985
  }
986
 
987
- function validate_file($file) {
988
- if (false !== strpos($file, '..'))
989
- die(__("Cheatin' uh ?",'wp-db-backup'));
 
 
 
 
 
 
 
 
 
 
990
 
991
- if (false !== strpos($file, './'))
992
- die(__("Cheatin' uh ?",'wp-db-backup'));
 
 
 
 
 
 
 
 
 
 
 
993
 
994
- if (':' == substr($file, 1, 1))
995
- die(__("Cheatin' uh ?",'wp-db-backup'));
 
 
 
 
 
 
 
996
  }
997
 
998
  }
2
  /*
3
  Plugin Name: WordPress Database Backup
4
  Plugin URI: http://www.ilfilosofo.com/blog/wp-db-backup
5
+ Description: On-demand backup of your WordPress database. Navigate to <a href="edit.php?page=wp-db-backup">Manage &rarr; Backup</a> to get started.
6
  Author: Austin Matzko
7
  Author URI: http://www.ilfilosofo.com/blog/
8
+ Version: 2.1.0
9
 
10
  Development continued from that done by Skippy (http://www.skippy.net/)
11
 
47
  * and increase MOD_EVASIVE_DELAY
48
  * if the backup stops prematurely.
49
  */
50
+ // define('MOD_EVASIVE_OVERRIDE', false);
51
  define('MOD_EVASIVE_DELAY', '500');
52
 
53
  class wpdbBackup {
54
 
55
  var $backup_complete = false;
56
  var $backup_file = '';
57
+ var $backup_filename;
58
  var $backup_dir = WP_BACKUP_DIR;
59
+ var $errors = array();
60
  var $basename;
61
+ var $page_url;
62
+ var $referer_check_key;
63
  var $useMailer = false;
64
 
65
  function gzip() {
68
 
69
  function module_check() {
70
  $mod_evasive = false;
71
+ if ( true === MOD_EVASIVE_OVERRIDE ) return true;
72
+ if ( false === MOD_EVASIVE_OVERRIDE ) return false;
73
  if ( function_exists('apache_get_modules') )
74
  foreach( (array) apache_get_modules() as $mod )
75
+ if ( false !== strpos($mod,'mod_evasive') || false !== strpos($mod,'mod_dosevasive') )
76
+ return true;
77
+ return false;
78
  }
79
 
80
  function wpdbBackup() {
81
  global $table_prefix, $wpdb;
82
+ add_action('init', array(&$this, 'init_textdomain'));
83
  add_action('phpmailer_init', array(&$this, 'setup_phpmailer'));
84
  add_action('wp_db_backup_cron', array(&$this, 'cron_backup'));
85
  add_action('wp_cron_daily', array(&$this, 'wp_cron_daily'));
87
  add_filter('wp_db_b_schedule_choices', array(&$this, 'schedule_choices'));
88
 
89
  $table_prefix = ( isset( $table_prefix ) ) ? $table_prefix : $wpdb->prefix;
90
+ $datum = date("Ymd_B");
91
+ $this->backup_filename = DB_NAME . "_$table_prefix$datum.sql";
92
+ if ($this->gzip()) $this->backup_filename .= '.gz';
93
+
94
  if ( isset( $wpdb->link2cat ) )
95
  $this->core_table_names = explode(',',"$wpdb->categories,$wpdb->comments,$wpdb->link2cat,$wpdb->links,$wpdb->options,$wpdb->post2cat,$wpdb->postmeta,$wpdb->posts,$wpdb->users,$wpdb->usermeta");
96
  else
97
  $this->core_table_names = explode(',',"$wpdb->categories,$wpdb->comments,$wpdb->linkcategories,$wpdb->links,$wpdb->options,$wpdb->post2cat,$wpdb->postmeta,$wpdb->posts,$wpdb->users,$wpdb->usermeta");
98
 
99
+ $this->backup_dir = trailingslashit(apply_filters('wp_db_b_backup_dir',$this->backup_dir));
100
+ $this->basename = 'wp-db-backup';
101
 
102
+ $this->referer_check_key = $this->basename . '-download_' . DB_NAME;
103
+ $query_args = array( 'page' => $this->basename );
104
+ if ( function_exists('wp_create_nonce') )
105
+ $query_args = array_merge( $query_args, array('_wpnonce' => wp_create_nonce($this->referer_check_key)) );
106
+ $this->page_url = add_query_arg( $query_args, get_option('siteurl') . '/wp-admin/edit.php');
107
+
108
  if (isset($_POST['do_backup'])) {
109
+ $this->wp_secure('fatal');
110
+ check_admin_referer($this->referer_check_key);
111
+ $this->can_user_backup('main');
112
  switch($_POST['do_backup']) {
113
  case 'backup':
114
+ add_action('init', array(&$this, 'perform_backup'));
115
  break;
116
  case 'fragments':
117
  add_action('admin_menu', array(&$this, 'fragment_menu'));
118
  break;
119
  }
120
  } elseif (isset($_GET['fragment'] )) {
121
+ $this->can_user_backup('frame');
122
  add_action('init', array(&$this, 'init'));
123
  } elseif (isset($_GET['backup'] )) {
124
+ $this->can_user_backup();
125
  add_action('init', array(&$this, 'init'));
126
  } else {
127
  add_action('admin_menu', array(&$this, 'admin_menu'));
129
  }
130
 
131
  function init() {
132
+ $this->can_user_backup();
 
133
  if (isset($_GET['backup'])) {
134
  $via = isset($_GET['via']) ? $_GET['via'] : 'http';
135
 
140
  case 'smtp':
141
  case 'email':
142
  $this->deliver_backup ($this->backup_file, 'smtp', $_GET['recipient']);
143
+ $this->error_display( 'frame' );
144
  echo '
145
  <!-- ' . $via . ' -->
146
  <script type="text/javascript"><!--\\
147
  ';
 
 
 
 
 
148
  echo '
149
  alert("' . __('Backup Complete!','wp-db-backup') . '");
150
  </script>
152
  break;
153
  default:
154
  $this->deliver_backup ($this->backup_file, $via);
155
+ $this->error_display( 'frame' );
156
  }
157
  die();
158
  }
164
 
165
  die();
166
  }
167
+
168
+ function init_textdomain() {
169
+ load_plugin_textdomain('wp-db-backup');
170
+ }
171
+
172
  function build_backup_script() {
173
  global $table_prefix, $wpdb;
174
 
 
 
 
 
175
  echo "<div class='wrap'>";
176
  //echo "<pre>" . print_r($_POST, 1) . "</pre>";
177
  echo '<h2>' . __('Backup','wp-db-backup') . '</h2>
206
  }
207
 
208
  function backup(table, segment) {
209
+ var fram = document.getElementById("backuploader");
210
+ fram.src = "' . $this->page_url . '&fragment=" + table + ":" + segment + ":' . $this->backup_filename . '";
211
  }
212
 
213
  var curStep = 0;
222
  setMeter(100);
223
  ';
224
 
225
+ $download_uri = add_query_arg('backup', $this->backup_filename, $this->page_url);
 
226
  switch($_POST['deliver']) {
227
  case 'http':
228
  echo '
304
  }
305
  }
306
 
 
 
 
 
 
307
  if (is_writable(ABSPATH . $this->backup_dir)) {
308
  $this->fp = $this->open(ABSPATH . $this->backup_dir . $filename, 'a');
309
  if(!$this->fp) {
310
+ $this->error(__('Could not open the backup file for writing!','wp-db-backup'));
311
+ $this->error(array('loc' => 'frame', 'kind' => 'fatal', 'msg' => __('The backup file could not be saved. Please check the permissions for writing to your backup directory and try again.','wp-db-backup')));
312
  }
313
  else {
314
  if($table == '') {
315
  //Begin new backup of MySql
316
+ $this->stow("# " . __('WordPress MySQL database backup','wp-db-backup') . "\n");
317
  $this->stow("#\n");
318
+ $this->stow("# " . sprintf(__('Generated: %s','wp-db-backup'),date("l j. F Y H:i T")) . "\n");
319
+ $this->stow("# " . sprintf(__('Hostname: %s','wp-db-backup'),DB_HOST) . "\n");
320
+ $this->stow("# " . sprintf(__('Database: %s','wp-db-backup'),$this->backquote(DB_NAME)) . "\n");
321
  $this->stow("# --------------------------------------------------------\n");
322
  } else {
323
  if($segment == 0) {
324
  // Increase script execution time-limit to 15 min for every table.
325
  if ( !ini_get('safe_mode')) @set_time_limit(15*60);
 
326
  // Create the SQL statements
327
  $this->stow("# --------------------------------------------------------\n");
328
+ $this->stow("# " . sprintf(__('Table: %s','wp-db-backup'),$this->backquote($table)) . "\n");
329
  $this->stow("# --------------------------------------------------------\n");
330
  }
331
  $this->backup_table($table, $segment);
332
  }
333
  }
334
  } else {
335
+ $this->error(array('kind' => 'fatal', 'loc' => 'frame', 'msg' => __('The backup directory is not writeable! Please check the permissions for writing to your backup directory and try again.','wp-db-backup')));
 
336
  }
337
 
338
  if($this->fp) $this->close($this->fp);
339
 
340
+ $this->error_display('frame');
341
+
342
+ echo '<script type="text/javascript"><!--//
343
+ var msg = "' . $msg . '";
344
+ window.parent.setProgress(msg);
345
+ window.parent.nextStep();
346
+ //--></script>
347
+ ';
 
 
 
 
 
 
 
 
 
 
348
  die();
349
  }
350
 
351
  function perform_backup() {
352
  // are we backing up any other tables?
353
  $also_backup = array();
354
+ if (isset($_POST['other_tables']))
355
  $also_backup = $_POST['other_tables'];
 
 
356
  $core_tables = $_POST['core_tables'];
357
  $this->backup_file = $this->db_backup($core_tables, $also_backup);
358
  if (FALSE !== $this->backup_file) {
359
  if ('smtp' == $_POST['deliver']) {
360
+ $this->deliver_backup($this->backup_file, $_POST['deliver'], $_POST['backup_recipient']);
361
+ wp_redirect($this->page_url);
362
  } elseif ('http' == $_POST['deliver']) {
363
+ $download_uri = add_query_arg('backup',$this->backup_file,$this->page_url);
364
+ wp_redirect($download_uri);
365
  }
366
  // we do this to say we're done.
367
  $this->backup_complete = true;
369
  }
370
 
371
  function admin_menu() {
372
+ add_management_page(__('Backup','wp-db-backup'), __('Backup','wp-db-backup'), 'import', $this->basename, array(&$this, 'backup_menu'));
373
  }
374
 
375
  function fragment_menu() {
376
+ add_management_page(__('Backup','wp-db-backup'), __('Backup','wp-db-backup'), 'import', $this->basename, array(&$this, 'build_backup_script'));
377
  }
378
 
379
  /**
416
  }
417
 
418
  function close($fp) {
419
+ if ($this->gzip()) gzclose($fp);
420
+ else fclose($fp);
 
 
421
  }
422
 
423
+ /**
424
+ * Write to the backup file
425
+ * @param string $query_line the line to write
426
+ * @return null
427
+ */
428
  function stow($query_line) {
429
  if ($this->gzip()) {
430
+ if(FALSE === @gzwrite($this->fp, $query_line))
431
+ $this->error(__('There was an error writing a line to the backup script:','wp-db-backup') . '&nbsp;&nbsp;' . $query_line);
 
 
432
  } else {
433
+ if(FALSE === @fwrite($this->fp, $query_line))
434
+ $this->error(__('There was an error writing a line to the backup script:','wp-db-backup') . '&nbsp;&nbsp;' . $query_line);
 
 
435
  }
436
  }
437
 
438
+ /**
439
+ * Logs any error messages
440
+ * @param array $args
441
+ * @return bool
442
+ */
443
+ function error($args = array()) {
444
+ if ( is_string( $args ) )
445
+ $args = array('msg' => $args);
446
+ $args = array_merge( array('loc' => 'main', 'kind' => 'warn', 'msg' => ''), $args);
447
+ $this->errors[$args['kind']][] = $args['msg'];
448
+ if ( 'fatal' == $args['kind'] || 'frame' == $args['loc'])
449
+ $this->error_display($args['loc']);
450
+ return true;
451
+ }
452
+
453
+ /**
454
+ * Displays error messages
455
+ * @param array $errs
456
+ * @param string $loc
457
+ * @return string
458
+ */
459
+ function error_display($loc = 'main', $echo = true) {
460
+ $errs = $this->errors;
461
+ unset( $this->errors );
462
+ if ( ! count($errs) ) return;
463
+ $msg = '';
464
+ $err_list = array_slice(array_merge( (array) $errs['fatal'], (array) $errs['warn']), 0, 10);
465
+ if ( 10 == count( $err_list ) )
466
+ $err_list[9] = __('Subsequent errors have been omitted from this log.','wp-db-backup');
467
+ $wrap = ( 'frame' == $loc ) ? "<script type=\"text/javascript\">\n var msgList = '';\n %1\$s \n alert(msgList); \n </script>" : '%1\$s';
468
+ $line = ( 'frame' == $loc ) ?
469
+ "try{ window.parent.addError('%1\$s'); } catch(e) { msgList += ' %1\$s';}\n" :
470
+ "%1\$s<br />\n";
471
+ foreach( (array) $err_list as $err )
472
+ $msg .= sprintf($line,$err);
473
+ $msg = sprintf($wrap,$msg);
474
+ if ( count($errs['fatal'] ) ) {
475
+ if ( function_exists('wp_die') && 'frame' != $loc ) wp_die($msg);
476
+ else die($msg);
477
+ }
478
+ else {
479
+ if ( $echo ) echo $msg;
480
+ else return $msg;
481
+ }
482
  }
483
 
484
  /**
486
  * Alain Wolf, Zurich - Switzerland
487
  * Website: http://restkultur.ch/personal/wolf/scripts/db_backup/
488
 
489
+ * Modified by Scott Merrill (http://www.skippy.net/)
490
  * to use the WordPress $wpdb object
491
+ * @param string $table
492
+ * @param string $segment
493
+ * @return void
494
  */
495
  function backup_table($table, $segment = 'none') {
496
  global $wpdb;
497
 
498
  $table_structure = $wpdb->get_results("DESCRIBE $table");
499
  if (! $table_structure) {
500
+ $this->error(__('Error getting table details','wp-db-backup') . ": $table");
501
  return FALSE;
502
  }
503
 
505
  // Add SQL statement to drop existing table
506
  $this->stow("\n\n");
507
  $this->stow("#\n");
508
+ $this->stow("# " . sprintf(__('Delete any existing table %s','wp-db-backup'),$this->backquote($table)) . "\n");
509
  $this->stow("#\n");
510
  $this->stow("\n");
511
  $this->stow("DROP TABLE IF EXISTS " . $this->backquote($table) . ";\n");
514
  // Comment in SQL-file
515
  $this->stow("\n\n");
516
  $this->stow("#\n");
517
+ $this->stow("# " . sprintf(__('Table structure of table %s','wp-db-backup'),$this->backquote($table)) . "\n");
518
  $this->stow("#\n");
519
  $this->stow("\n");
520
 
521
  $create_table = $wpdb->get_results("SHOW CREATE TABLE $table", ARRAY_N);
522
  if (FALSE === $create_table) {
523
+ $err_msg = sprintf(__('Error with SHOW CREATE TABLE for %s.','wp-db-backup'), $table);
524
+ $this->error($err_msg);
525
+ $this->stow("#\n# $err_msg\n#\n");
526
  }
527
  $this->stow($create_table[0][1] . ' ;');
528
 
529
  if (FALSE === $table_structure) {
530
+ $err_msg = sprintf(__('Error getting table structure of %s','wp-db-backup'), $table);
531
+ $this->error($err_msg);
532
+ $this->stow("#\n# $err_msg\n#\n");
533
  }
534
 
535
  // Comment in SQL-file
536
  $this->stow("\n\n");
537
  $this->stow("#\n");
538
+ $this->stow('# ' . sprintf(__('Data contents of table %s','wp-db-backup'),$this->backquote($table)) . "\n");
539
  $this->stow("#\n");
540
  }
541
 
569
 
570
  /*
571
  if (FALSE === $table_data) {
572
+ $err_msg = sprintf(__('Error getting table contents from %s','wp-db-backup'),$table);
573
+ $this->error($err_msg);
574
+ fwrite($fp, "#\n# $err_msg\n#\n");
575
  }
576
  */
577
 
600
  // Create footer/closing comment in SQL-file
601
  $this->stow("\n");
602
  $this->stow("#\n");
603
+ $this->stow("# " . sprintf(__('End of data contents of table %s','wp-db-backup'),$this->backquote($table)) . "\n");
604
  $this->stow("# --------------------------------------------------------\n");
605
  $this->stow("\n");
606
  }
607
  } // end backup_table()
608
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
609
  function db_backup($core_tables, $other_tables) {
610
  global $table_prefix, $wpdb;
611
 
 
 
 
 
 
612
  if (is_writable(ABSPATH . $this->backup_dir)) {
613
+ $this->fp = $this->open(ABSPATH . $this->backup_dir . $this->backup_filename);
614
  if(!$this->fp) {
615
+ $this->error(__('Could not open the backup file for writing!','wp-db-backup'));
616
  return false;
617
  }
618
  } else {
619
+ $this->error(__('The backup directory is not writeable!','wp-db-backup'));
620
  return false;
621
  }
622
 
623
  //Begin new backup of MySql
624
+ $this->stow("# " . __('WordPress MySQL database backup','wp-db-backup') . "\n");
625
  $this->stow("#\n");
626
+ $this->stow("# " . sprintf(__('Generated: %s','wp-db-backup'),date("l j. F Y H:i T")) . "\n");
627
+ $this->stow("# " . sprintf(__('Hostname: %s','wp-db-backup'),DB_HOST) . "\n");
628
+ $this->stow("# " . sprintf(__('Database: %s','wp-db-backup'),$this->backquote(DB_NAME)) . "\n");
629
  $this->stow("# --------------------------------------------------------\n");
630
 
631
  if ( (is_array($other_tables)) && (count($other_tables) > 0) )
638
  if ( !ini_get('safe_mode')) @set_time_limit(15*60);
639
  // Create the SQL statements
640
  $this->stow("# --------------------------------------------------------\n");
641
+ $this->stow("# " . sprintf(__('Table: %s','wp-db-backup'),$this->backquote($table)) . "\n");
642
  $this->stow("# --------------------------------------------------------\n");
643
  $this->backup_table($table);
644
  }
645
 
646
  $this->close($this->fp);
647
 
648
+ if (count($this->errors)) {
649
  return false;
650
  } else {
651
+ return $this->backup_filename;
652
  }
653
 
654
  } //wp_db_backup
665
  return true;
666
  }
667
 
668
+ function deliver_backup($filename = '', $delivery = 'http', $recipient = '') {
669
  if ('' == $filename) { return FALSE; }
670
 
671
  $this->diskfile = ABSPATH . $this->backup_dir . $filename;
672
  $this->filename = $filename;
673
  if ('http' == $delivery) {
674
+ if (! file_exists($this->diskfile))
675
+ $this->error(array('kind' => 'fatal', 'msg' => sprintf(__('File not found:%s','wp-db-backup'), "&nbsp;<strong>$filename</strong><br />") . '<br /><a href="' . $this->page_url . '">' . __('Return to Backup','wp-db-backup') . '</a>'));
 
 
 
 
676
  header('Content-Description: File Transfer');
677
  header('Content-Type: application/octet-stream');
678
  header('Content-Length: ' . filesize($this->diskfile));
715
 
716
  if (function_exists('wp_mail')) {
717
  $this->useMailer = true;
718
+ wp_mail($recipient, get_bloginfo('name') . ' ' . __('Database Backup','wp-db-backup'), $message, $headers);
719
  $this->useMailer = false;
720
  } else {
721
+ mail($recipient, get_bloginfo('name') . ' ' . __('Database Backup','wp-db-backup'), $message, $headers);
722
  }
723
 
724
  unlink($this->diskfile);
753
  }
754
  $feedback .= '</p></div>';
755
  }
756
+
757
+ // security check
758
+ $this->wp_secure();
759
+
760
+ if (count($this->errors)) {
761
+ $feedback .= '<div class="updated error"><p><strong>' . __('The following errors were reported:','wp-db-backup') . '</strong></p>';
762
+ $feedback .= '<p>' . $this->error_display( 'main', false ) . '</p>';
763
+ $feedback .= "</p></div>";
764
  }
765
+
766
  // did we just save options for wp-cron?
767
  if ( (function_exists('wp_schedule_event') || function_exists('wp_cron_init'))
768
  && isset($_POST['wp_cron_backup_options']) ) :
769
+ do_action('wp_db_b_update_cron_options');
770
  if ( function_exists('wp_schedule_event') ) {
771
  wp_clear_scheduled_hook( 'wp_db_backup_cron' ); // unschedule previous
772
  $scheds = (array) wp_get_schedules();
802
  if ('' != $feedback)
803
  echo $feedback;
804
 
805
+ if ( ! $this->wp_secure() )
806
+ return;
807
+
808
  // Give the new dirs the same perms as wp-content.
809
  $stat = stat( ABSPATH . 'wp-content' );
810
  $dir_perms = $stat['mode'] & 0000777; // Get the permission bits.
824
 
825
  if ( !file_exists( ABSPATH . $this->backup_dir . 'index.php') )
826
  @ touch( ABSPATH . $this->backup_dir . "index.php");
 
827
  ?><div class='wrap'>
828
  <h2><?php _e('Backup','wp-db-backup') ?></h2>
829
  <form method="post" action="">
830
+ <?php if ( function_exists('wp_nonce_field') ) wp_nonce_field($this->referer_check_key); ?>
831
  <fieldset class="options"><legend><?php _e('Tables','wp-db-backup') ?></legend>
832
  <table align="center" cellspacing="5" cellpadding="5"><tr><td width="50%" align="left" class="alternate" valign="top">
833
  <?php _e('These core WordPress tables will always be backed up:','wp-db-backup') ?><br /><ul><?php
841
  echo "<label style=\"display:block;\"><input type='checkbox' name='other_tables[]' value='{$table}' /> {$table}</label>";
842
  }
843
  }
844
+ ?></td></tr></table></fieldset><?php
845
+ $backup_opts = '<fieldset class="options"><legend>' . __('Backup Options','wp-db-backup') . "</legend>\n";
846
+ $backup_opts .= __('What to do with the backup file:','wp-db-backup') . '<br /> <label for="do_save" style="display:block;"><input type="radio" id="do_save" name="deliver" value="none" style="border:none;" />' . "\n";
847
+ $backup_opts .= __('Save to server','wp-db-backup') . " ({$this->backup_dir})</label>\n";
848
+ $backup_opts .= '<label for="do_download" style="display:block;"><input type="radio" checked="checked" id="do_download" name="deliver" value="http" style="border:none;" />' . "\n";
849
+ $backup_opts .= __('Download to your computer','wp-db-backup') . "</label>\n" . '<label for="do_email"><input type="radio" name="deliver" id="do_email" value="smtp" style="border:none;" />' . "\n";
850
+ $backup_opts .= __('Email backup to:','wp-db-backup') . '</label><input type="text" name="backup_recipient" size="20" value="' . get_option('admin_email') . '" />';
851
+ if ( ! $WHOOPS )
852
+ $backup_opts .= '<input type="hidden" name="do_backup" id="do_backup" value="backup" /> <p class="submit"><input type="submit" name="submit" onclick="document.getElementById(\'do_backup\').value=\'fragments\';" value="' . __('Backup','wp-db-backup') . '!" /></p>';
853
+ else
854
+ $backup_opts .= '<p class="alternate">' . __('WARNING: Your backup directory is <strong>NOT</strong> writable!','wp-db-backup') . '</p>';
855
+ $backup_opts .= '</fieldset>';
856
+ echo apply_filters('wp_db_b_backup_opts', $backup_opts);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
857
  echo '</form>';
858
 
859
  // this stuff only displays if some sort of wp-cron is available
872
  echo __('Next WP-Cron Daily Execution','wp-db-backup') . ': ' . gmdate($datetime, (get_option('wp_cron_daily_lastrun') + (get_option('gmt_offset') * 3600) + 86400)) . '</p>';
873
  endif;
874
  ?><form method="post" action="">
875
+ <?php if ( function_exists('wp_nonce_field') ) wp_nonce_field($this->referer_check_key); ?>
876
  <table width="100%" cellpadding="5" cellspacing="5">
877
  <tr><td align="center"><?php
878
  echo __('Schedule: ','wp-db-backup');
894
  if (! is_email($cron_recipient)) {
895
  $cron_recipient = get_option('admin_email');
896
  }
897
+ $cron_recipient_input = '<label for="cron_backup_recipient">' . __('Email backup to:','wp-db-backup') . ' <input type="text" name="cron_backup_recipient" id="cron_backup_recipient" size="20" value="' . $cron_recipient . '" /></label>';
898
+ echo apply_filters('wp_db_b_cron_recipient_input', $cron_recipient_input);
899
  echo '</td></tr>';
900
  $cron_tables = get_option('wp_cron_backup_tables');
901
  if (! is_array($cron_tables)) {
912
  }
913
  echo '</td></tr>';
914
  }
915
+ echo '<tr><td colspan="2" align="center"><input type="hidden" name="wp_cron_backup_options" value="SET" /><p class="submit"><input type="submit" name="submit" value="' . __('Submit','wp-db-backup') . '" /></p></td></tr></table></form>';
916
  echo '</fieldset>';
917
  endif; // end of wp_cron (legacy) section
918
 
953
 
954
  function wp_cron_daily() { // for legacy cron plugin
955
  $schedule = intval(get_option('wp_cron_backup_schedule'));
956
+ // If scheduled backup is disabled
957
+ if (0 == $schedule)
958
  return;
959
+ else $this->cron_backup();
960
+ }
 
961
 
962
  function cron_backup() {
963
  global $table_prefix, $wpdb;
 
964
  $all_tables = $wpdb->get_results("SHOW TABLES", ARRAY_N);
965
  $all_tables = array_map(create_function('$a', 'return $a[0];'), $all_tables);
966
  $core_tables = array_intersect($all_tables, $this->core_table_names);
967
  $other_tables = get_option('wp_cron_backup_tables');
 
968
  $recipient = get_option('wp_cron_backup_recipient');
 
969
  $backup_file = $this->db_backup($core_tables, $other_tables);
970
+ if (FALSE !== $backup_file)
971
+ $this->deliver_backup($backup_file, 'smtp', $recipient);
 
972
  return;
973
  }
974
 
977
  return $sched;
978
  }
979
 
980
+ /**
981
+ * Checks that WordPress has sufficient security measures
982
+ * @param string $kind
983
+ * @return bool
984
+ */
985
+ function wp_secure($kind = 'warn', $loc = 'main') {
986
+ global $wp_version;
987
+ if ( function_exists('wp_verify_nonce') ) return true;
988
+ else {
989
+ $this->error(array('kind' => $kind, 'loc' => $loc, 'msg' => sprintf(__('Your WordPress version, %1s, lacks important security features without which it is unsafe to use the WP-DB-Backup plugin. Hence, this plugin is automatically disabled. Please consider <a href="%2s">upgrading WordPress</a> to a more recent version.','wp-db-backup'),$wp_version,'http://wordpress.org/download/')));
990
+ return false;
991
+ }
992
  }
993
 
994
+ /**
995
+ * Checks that the user has sufficient permission to backup
996
+ * @param string $loc
997
+ * @return bool
998
+ */
999
+ function can_user_backup($loc = 'main') {
1000
+ $can = false;
1001
+ if ( ( $this->wp_secure('fatal', $loc) ) && current_user_can('import') )
1002
+ $can = $this->verify_nonce($_REQUEST['_wpnonce'], $this->referer_check_key, $loc);
1003
+ if ( false == $can )
1004
+ $this->error(array('loc' => $loc, 'kind' => 'fatal', 'msg' => __('You are not allowed to perform backups.','wp-db-backup')));
1005
+ return $can;
1006
+ }
1007
 
1008
+ /**
1009
+ * Verify that the nonce is legitimate
1010
+ * @param string $rec the nonce received
1011
+ * @param string $nonce what the nonce should be
1012
+ * @param string $loc the location of the check
1013
+ * @return bool
1014
+ */
1015
+ function verify_nonce($rec = '', $nonce = 'X', $loc = 'main') {
1016
+ if ( wp_verify_nonce($rec, $nonce) )
1017
+ return true;
1018
+ else
1019
+ $this->error(array('loc' => $loc, 'kind' => 'fatal', 'msg' => sprintf(__('There appears to be an unauthorized attempt from this site to access your database located at %1s. The attempt has been halted.','wp-db-backup'),get_option('home'))));
1020
+ }
1021
 
1022
+ /**
1023
+ * Check whether a file to be downloaded is
1024
+ * surreptitiously trying to download a non-backup file
1025
+ * @param string $file
1026
+ * @return null
1027
+ */
1028
+ function validate_file($file) {
1029
+ if ( (false !== strpos($file, '..')) || (false !== strpos($file, './')) || (':' == substr($file, 1, 1)) )
1030
+ $this->error(array('kind' => 'fatal', 'loc' => 'frame', 'msg' => __("Cheatin' uh ?",'wp-db-backup')));
1031
  }
1032
 
1033
  }
wp-db-backup.po CHANGED
@@ -1,140 +1,172 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: wp-db-backup 2.0.1\n"
4
- "POT-Creation-Date: \n"
5
- "PO-Revision-Date: 2007-02-09 08:09-0500\n"
6
- "Last-Translator: Austin Matzko <if.website@gmail.com>\n"
7
- "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
- "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "X-Poedit-KeywordsList: __;_e\n"
12
- "X-Poedit-Basepath: .\n"
13
- "X-Poedit-SearchPath-0: trunk\n"
14
-
15
- #: wp-db-backup.php:55
16
- #: wp-db-backup.php:65
17
- #: wp-db-backup.php:68
18
- #: wp-db-backup.php:76
19
- msgid "You are not allowed to perform backups."
20
- msgstr ""
21
 
22
- #: wp-db-backup.php:98
23
  msgid "Backup Complete!"
24
  msgstr ""
25
 
26
- #: wp-db-backup.php:125
27
- #: wp-db-backup.php:334
28
- #: wp-db-backup.php:338
29
- #: wp-db-backup.php:767
30
- #: wp-db-backup.php:809
31
  msgid "Backup"
32
  msgstr ""
33
 
34
- #: wp-db-backup.php:126
35
  msgid "Progress"
36
  msgstr ""
37
 
38
- #: wp-db-backup.php:128
39
  msgid "DO NOT DO THE FOLLOWING AS IT WILL CAUSE YOUR BACKUP TO FAIL:"
40
  msgstr ""
41
 
42
- #: wp-db-backup.php:131
43
  msgid "Close this browser"
44
  msgstr ""
45
 
46
- #: wp-db-backup.php:132
47
  msgid "Reload this page"
48
  msgstr ""
49
 
50
- #: wp-db-backup.php:133
51
  msgid "Click the Stop or Back buttons in your browser"
52
  msgstr ""
53
 
54
- #: wp-db-backup.php:135
55
  msgid "Progress:"
56
  msgstr ""
57
 
58
- #: wp-db-backup.php:178
59
  #, php-format
60
- msgid "Backup complete, preparing <a href=\\\"%s\\\">backup</a> for download..."
 
61
  msgstr ""
62
 
63
- #: wp-db-backup.php:184
64
  #, php-format
65
  msgid "Backup complete, sending <a href=\\\"%s\\\">backup</a> via email..."
66
  msgstr ""
67
 
68
- #: wp-db-backup.php:190
69
  #, php-format
70
  msgid "Backup complete, download <a href=\\\"%s\\\">here</a>."
71
  msgstr ""
72
 
73
- #: wp-db-backup.php:242
74
  msgid "Creating backup file..."
75
  msgstr ""
76
 
77
- #: wp-db-backup.php:245
78
  #, php-format
79
  msgid "Finished backing up table \\\"%s\\\"."
80
  msgstr ""
81
 
82
- #: wp-db-backup.php:247
83
  #, php-format
84
  msgid "Backing up table \\\"%s\\\"..."
85
  msgstr ""
86
 
87
- #: wp-db-backup.php:259
88
- #: wp-db-backup.php:567
89
  msgid "Could not open the backup file for writing!"
90
  msgstr ""
91
 
92
- #: wp-db-backup.php:260
93
- msgid "The backup file could not be saved. Please check the permissions for writing to your backup directory and try again."
 
 
94
  msgstr ""
95
 
96
- #: wp-db-backup.php:285
97
- #: wp-db-backup.php:571
98
- msgid "The backup directory is not writeable!"
99
  msgstr ""
100
 
101
- #: wp-db-backup.php:286
102
- msgid "The backup directory is not writeable! Please check the permissions for writing to your backup directory and try again."
 
 
 
 
 
 
103
  msgstr ""
104
 
105
- #: wp-db-backup.php:398
106
- #: wp-db-backup.php:403
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  msgid "There was an error writing a line to the backup script:"
108
  msgstr ""
109
 
110
- #: wp-db-backup.php:413
111
  msgid "Subsequent errors have been omitted from this log."
112
  msgstr ""
113
 
114
- #: wp-db-backup.php:431
115
  msgid "Error getting table details"
116
  msgstr ""
117
 
118
- #: wp-db-backup.php:454
 
 
 
 
 
 
 
 
 
 
119
  #, php-format
120
  msgid "Error with SHOW CREATE TABLE for %s."
121
  msgstr ""
122
 
123
- #: wp-db-backup.php:460
124
  #, php-format
125
  msgid "Error getting table structure of %s"
126
  msgstr ""
127
 
128
- #: wp-db-backup.php:614
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  #, php-format
130
  msgid "File not found:%s"
131
  msgstr ""
132
 
133
- #: wp-db-backup.php:616
134
  msgid "Return to Backup"
135
  msgstr ""
136
 
137
- #: wp-db-backup.php:641
138
  #, php-format
139
  msgid ""
140
  "Attached to this email is\n"
@@ -142,139 +174,161 @@ msgid ""
142
  " Size:%2s kilobytes\n"
143
  msgstr ""
144
 
145
- #: wp-db-backup.php:660
146
- #: wp-db-backup.php:662
147
  msgid "Database Backup"
148
  msgstr ""
149
 
150
- #: wp-db-backup.php:677
151
  msgid "Backup Successful"
152
  msgstr ""
153
 
154
- #: wp-db-backup.php:681
155
  #, php-format
156
- msgid "Your backup file: <a href=\"%1s\">%2s</a> should begin downloading shortly."
 
157
  msgstr ""
158
 
159
- #: wp-db-backup.php:689
160
  #, php-format
161
  msgid "Your backup has been emailed to %s"
162
  msgstr ""
163
 
164
- #: wp-db-backup.php:692
165
- msgid "Your backup file has been saved on the server. If you would like to download it now, right click and select \"Save As\""
 
 
166
  msgstr ""
167
 
168
- #: wp-db-backup.php:693
169
  #, php-format
170
  msgid "%s bytes"
171
  msgstr ""
172
 
173
- #: wp-db-backup.php:699
174
  msgid "The following errors were reported:"
175
  msgstr ""
176
 
177
- #: wp-db-backup.php:727
178
  msgid "Scheduled Backup Options Saved!"
179
  msgstr ""
180
 
181
- #: wp-db-backup.php:753
182
- msgid "WARNING: Your wp-content directory is <strong>NOT</strong> writable! We can not create the backup directory."
 
 
183
  msgstr ""
184
 
185
- #: wp-db-backup.php:759
186
- msgid "WARNING: Your backup directory is <strong>NOT</strong> writable! We can not create the backup directory."
 
 
187
  msgstr ""
188
 
189
- #: wp-db-backup.php:769
190
  msgid "Tables"
191
  msgstr ""
192
 
193
- #: wp-db-backup.php:771
194
  msgid "These core WordPress tables will always be backed up:"
195
  msgstr ""
196
 
197
- #: wp-db-backup.php:777
198
  msgid "You may choose to include any of the following tables:"
199
  msgstr ""
200
 
201
- #: wp-db-backup.php:783
202
  msgid "Backup Options"
203
  msgstr ""
204
 
205
- #: wp-db-backup.php:784
206
  msgid "What to do with the backup file:"
207
  msgstr ""
208
 
209
- #: wp-db-backup.php:786
210
  msgid "Save to server"
211
  msgstr ""
212
 
213
- #: wp-db-backup.php:788
214
  msgid "Download to your computer"
215
  msgstr ""
216
 
217
- #: wp-db-backup.php:790
218
- #: wp-db-backup.php:853
219
  msgid "Email backup to:"
220
  msgstr ""
221
 
222
- #: wp-db-backup.php:811
223
  msgid "WARNING: Your backup directory is <strong>NOT</strong> writable!"
224
  msgstr ""
225
 
226
- #: wp-db-backup.php:820
227
  msgid "Scheduled Backup"
228
  msgstr ""
229
 
230
- #: wp-db-backup.php:824
231
  msgid "Next Backup"
232
  msgstr ""
233
 
234
- #: wp-db-backup.php:828
235
  msgid "Last WP-Cron Daily Execution"
236
  msgstr ""
237
 
238
- #: wp-db-backup.php:829
239
  msgid "Next WP-Cron Daily Execution"
240
  msgstr ""
241
 
242
- #: wp-db-backup.php:834
243
  msgid "Schedule: "
244
  msgstr ""
245
 
246
- #: wp-db-backup.php:837
247
  msgid "None"
248
  msgstr ""
249
 
250
- #: wp-db-backup.php:837
251
  msgid "Daily"
252
  msgstr ""
253
 
254
- #: wp-db-backup.php:860
255
  msgid "Tables to include:"
256
  msgstr ""
257
 
258
- #: wp-db-backup.php:870
259
  msgid "Submit"
260
  msgstr ""
261
 
262
- #: wp-db-backup.php:893
263
  msgid "Never"
264
  msgstr ""
265
 
266
- #: wp-db-backup.php:898
267
  #, php-format
268
  msgid "%s seconds"
269
  msgstr ""
270
 
271
- #: wp-db-backup.php:936
272
  msgid "Once Weekly"
273
  msgstr ""
274
 
275
- #: wp-db-backup.php:946
276
- #: wp-db-backup.php:949
277
- #: wp-db-backup.php:952
278
- msgid "Cheatin' uh ?"
 
 
 
 
 
 
 
279
  msgstr ""
280
 
 
 
 
 
 
 
 
 
 
 
1
+ "Project-Id-Version: wp-db-backup.php 2.1.0\n"
2
+ "Report-Msgid-Bugs-To: \n"
3
+ "POT-Creation-Date: 2007-05-08 23:52-0400\n"
4
+ "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
5
+ "Last-Translator: Austin Matzko if.website at gmail.com\n"
6
+ "Language-Team: EN\n"
 
7
  "MIME-Version: 1.0\n"
8
+ "Content-Type: text/plain; charset=CHARSET\n"
9
  "Content-Transfer-Encoding: 8bit\n"
 
 
 
 
 
 
 
 
 
 
10
 
11
+ #: wp-db-backup.php:149
12
  msgid "Backup Complete!"
13
  msgstr ""
14
 
15
+ #: wp-db-backup.php:177 wp-db-backup.php:372 wp-db-backup.php:376
16
+ #: wp-db-backup.php:828 wp-db-backup.php:852
 
 
 
17
  msgid "Backup"
18
  msgstr ""
19
 
20
+ #: wp-db-backup.php:178
21
  msgid "Progress"
22
  msgstr ""
23
 
24
+ #: wp-db-backup.php:180
25
  msgid "DO NOT DO THE FOLLOWING AS IT WILL CAUSE YOUR BACKUP TO FAIL:"
26
  msgstr ""
27
 
28
+ #: wp-db-backup.php:183
29
  msgid "Close this browser"
30
  msgstr ""
31
 
32
+ #: wp-db-backup.php:184
33
  msgid "Reload this page"
34
  msgstr ""
35
 
36
+ #: wp-db-backup.php:185
37
  msgid "Click the Stop or Back buttons in your browser"
38
  msgstr ""
39
 
40
+ #: wp-db-backup.php:187
41
  msgid "Progress:"
42
  msgstr ""
43
 
44
+ #: wp-db-backup.php:229
45
  #, php-format
46
+ msgid ""
47
+ "Backup complete, preparing <a href=\\\"%s\\\">backup</a> for download..."
48
  msgstr ""
49
 
50
+ #: wp-db-backup.php:235
51
  #, php-format
52
  msgid "Backup complete, sending <a href=\\\"%s\\\">backup</a> via email..."
53
  msgstr ""
54
 
55
+ #: wp-db-backup.php:241
56
  #, php-format
57
  msgid "Backup complete, download <a href=\\\"%s\\\">here</a>."
58
  msgstr ""
59
 
60
+ #: wp-db-backup.php:298
61
  msgid "Creating backup file..."
62
  msgstr ""
63
 
64
+ #: wp-db-backup.php:301
65
  #, php-format
66
  msgid "Finished backing up table \\\"%s\\\"."
67
  msgstr ""
68
 
69
+ #: wp-db-backup.php:303
70
  #, php-format
71
  msgid "Backing up table \\\"%s\\\"..."
72
  msgstr ""
73
 
74
+ #: wp-db-backup.php:310 wp-db-backup.php:615
 
75
  msgid "Could not open the backup file for writing!"
76
  msgstr ""
77
 
78
+ #: wp-db-backup.php:311
79
+ msgid ""
80
+ "The backup file could not be saved. Please check the permissions for "
81
+ "writing to your backup directory and try again."
82
  msgstr ""
83
 
84
+ #: wp-db-backup.php:316 wp-db-backup.php:624
85
+ msgid "WordPress MySQL database backup"
 
86
  msgstr ""
87
 
88
+ #: wp-db-backup.php:318 wp-db-backup.php:626
89
+ #, php-format
90
+ msgid "Generated: %s"
91
+ msgstr ""
92
+
93
+ #: wp-db-backup.php:319 wp-db-backup.php:627
94
+ #, php-format
95
+ msgid "Hostname: %s"
96
  msgstr ""
97
 
98
+ #: wp-db-backup.php:320 wp-db-backup.php:628
99
+ #, php-format
100
+ msgid "Database: %s"
101
+ msgstr ""
102
+
103
+ #: wp-db-backup.php:328 wp-db-backup.php:641
104
+ #, php-format
105
+ msgid "Table: %s"
106
+ msgstr ""
107
+
108
+ #: wp-db-backup.php:335
109
+ msgid ""
110
+ "The backup directory is not writeable! Please check the permissions for "
111
+ "writing to your backup directory and try again."
112
+ msgstr ""
113
+
114
+ #: wp-db-backup.php:431 wp-db-backup.php:434
115
  msgid "There was an error writing a line to the backup script:"
116
  msgstr ""
117
 
118
+ #: wp-db-backup.php:466
119
  msgid "Subsequent errors have been omitted from this log."
120
  msgstr ""
121
 
122
+ #: wp-db-backup.php:500
123
  msgid "Error getting table details"
124
  msgstr ""
125
 
126
+ #: wp-db-backup.php:508
127
+ #, php-format
128
+ msgid "Delete any existing table %s"
129
+ msgstr ""
130
+
131
+ #: wp-db-backup.php:517
132
+ #, php-format
133
+ msgid "Table structure of table %s"
134
+ msgstr ""
135
+
136
+ #: wp-db-backup.php:523
137
  #, php-format
138
  msgid "Error with SHOW CREATE TABLE for %s."
139
  msgstr ""
140
 
141
+ #: wp-db-backup.php:530
142
  #, php-format
143
  msgid "Error getting table structure of %s"
144
  msgstr ""
145
 
146
+ #: wp-db-backup.php:538
147
+ #, php-format
148
+ msgid "Data contents of table %s"
149
+ msgstr ""
150
+
151
+ #: wp-db-backup.php:603
152
+ #, php-format
153
+ msgid "End of data contents of table %s"
154
+ msgstr ""
155
+
156
+ #: wp-db-backup.php:619
157
+ msgid "The backup directory is not writeable!"
158
+ msgstr ""
159
+
160
+ #: wp-db-backup.php:675
161
  #, php-format
162
  msgid "File not found:%s"
163
  msgstr ""
164
 
165
+ #: wp-db-backup.php:675
166
  msgid "Return to Backup"
167
  msgstr ""
168
 
169
+ #: wp-db-backup.php:698
170
  #, php-format
171
  msgid ""
172
  "Attached to this email is\n"
174
  " Size:%2s kilobytes\n"
175
  msgstr ""
176
 
177
+ #: wp-db-backup.php:718 wp-db-backup.php:721
 
178
  msgid "Database Backup"
179
  msgstr ""
180
 
181
+ #: wp-db-backup.php:736
182
  msgid "Backup Successful"
183
  msgstr ""
184
 
185
+ #: wp-db-backup.php:740
186
  #, php-format
187
+ msgid ""
188
+ "Your backup file: <a href=\"%1s\">%2s</a> should begin downloading shortly."
189
  msgstr ""
190
 
191
+ #: wp-db-backup.php:748
192
  #, php-format
193
  msgid "Your backup has been emailed to %s"
194
  msgstr ""
195
 
196
+ #: wp-db-backup.php:751
197
+ msgid ""
198
+ "Your backup file has been saved on the server. If you would like to download "
199
+ "it now, right click and select \"Save As\""
200
  msgstr ""
201
 
202
+ #: wp-db-backup.php:752
203
  #, php-format
204
  msgid "%s bytes"
205
  msgstr ""
206
 
207
+ #: wp-db-backup.php:761
208
  msgid "The following errors were reported:"
209
  msgstr ""
210
 
211
+ #: wp-db-backup.php:788
212
  msgid "Scheduled Backup Options Saved!"
213
  msgstr ""
214
 
215
+ #: wp-db-backup.php:816
216
+ msgid ""
217
+ "WARNING: Your wp-content directory is <strong>NOT</strong> writable! We can "
218
+ "not create the backup directory."
219
  msgstr ""
220
 
221
+ #: wp-db-backup.php:822
222
+ msgid ""
223
+ "WARNING: Your backup directory is <strong>NOT</strong> writable! We can not "
224
+ "create the backup directory."
225
  msgstr ""
226
 
227
+ #: wp-db-backup.php:831
228
  msgid "Tables"
229
  msgstr ""
230
 
231
+ #: wp-db-backup.php:833
232
  msgid "These core WordPress tables will always be backed up:"
233
  msgstr ""
234
 
235
+ #: wp-db-backup.php:839
236
  msgid "You may choose to include any of the following tables:"
237
  msgstr ""
238
 
239
+ #: wp-db-backup.php:845
240
  msgid "Backup Options"
241
  msgstr ""
242
 
243
+ #: wp-db-backup.php:846
244
  msgid "What to do with the backup file:"
245
  msgstr ""
246
 
247
+ #: wp-db-backup.php:847
248
  msgid "Save to server"
249
  msgstr ""
250
 
251
+ #: wp-db-backup.php:849
252
  msgid "Download to your computer"
253
  msgstr ""
254
 
255
+ #: wp-db-backup.php:850 wp-db-backup.php:897
 
256
  msgid "Email backup to:"
257
  msgstr ""
258
 
259
+ #: wp-db-backup.php:854
260
  msgid "WARNING: Your backup directory is <strong>NOT</strong> writable!"
261
  msgstr ""
262
 
263
+ #: wp-db-backup.php:863
264
  msgid "Scheduled Backup"
265
  msgstr ""
266
 
267
+ #: wp-db-backup.php:867
268
  msgid "Next Backup"
269
  msgstr ""
270
 
271
+ #: wp-db-backup.php:871
272
  msgid "Last WP-Cron Daily Execution"
273
  msgstr ""
274
 
275
+ #: wp-db-backup.php:872
276
  msgid "Next WP-Cron Daily Execution"
277
  msgstr ""
278
 
279
+ #: wp-db-backup.php:878
280
  msgid "Schedule: "
281
  msgstr ""
282
 
283
+ #: wp-db-backup.php:881
284
  msgid "None"
285
  msgstr ""
286
 
287
+ #: wp-db-backup.php:881
288
  msgid "Daily"
289
  msgstr ""
290
 
291
+ #: wp-db-backup.php:905
292
  msgid "Tables to include:"
293
  msgstr ""
294
 
295
+ #: wp-db-backup.php:915
296
  msgid "Submit"
297
  msgstr ""
298
 
299
+ #: wp-db-backup.php:938
300
  msgid "Never"
301
  msgstr ""
302
 
303
+ #: wp-db-backup.php:943
304
  #, php-format
305
  msgid "%s seconds"
306
  msgstr ""
307
 
308
+ #: wp-db-backup.php:976
309
  msgid "Once Weekly"
310
  msgstr ""
311
 
312
+ #: wp-db-backup.php:989
313
+ #, php-format
314
+ msgid ""
315
+ "Your WordPress version, %1s, lacks important security features without which "
316
+ "it is unsafe to use the WP-DB-Backup plugin. Hence, this plugin is "
317
+ "automatically disabled. Please consider <a href=\"%2s\">upgrading "
318
+ "WordPress</a> to a more recent version."
319
+ msgstr ""
320
+
321
+ #: wp-db-backup.php:1004
322
+ msgid "You are not allowed to perform backups."
323
  msgstr ""
324
 
325
+ #: wp-db-backup.php:1019
326
+ #, php-format
327
+ msgid ""
328
+ "There appears to be an unauthorized attempt from this site to access your "
329
+ "database located at %1s. The attempt has been halted."
330
+ msgstr ""
331
+
332
+ #: wp-db-backup.php:1030
333
+ msgid "Cheatin' uh ?"
334
+ msgstr ""