Changeset 1194527
- Timestamp:
- 07/08/2015 02:58:20 AM (9 years ago)
- Location:
- wp-db-backup
- Files:
-
- 38 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-db-backup/trunk/README.markdown
r780080 r1194527 6 6 Tags: mysql, database, backup, cron 7 7 Requires at least: 2.0.3 8 Tested up to: 3.6.19 Stable tag: 2. 2.48 Tested up to: 9 Stable tag: 2. 10 10 11 11 On-demand backup of your WordPress database. … … 21 21 NO WARRANTY. 22 22 23 Copyright (c) 2013 Austin Matzko 23 Copyright (c) 2015 Austin Matzko 24 25 [Source Code on GitHub](https://github.com/matzko/wp-db-backup) 24 26 25 27 Installation … … 42 44 43 45 Briefly, use phpMyAdmin, which is included with most hosting control panels. More details and links to further explanations are [here](http://codex.wordpress.org/Restoring_Your_Database_From_Backup). 44 45 Why can't I schedule automatic backups to be saved to my server?46 ----------------------------------------------------------------47 48 Although WP-DB-Backup provides the option of saving the backup file to the server, I strongly discourage anyone from leaving backed-up database files on the server. If the server is not perfectly configured, then someone could gain access to your data, and I do not want to make it easy for that to happen.49 46 50 47 My backup stops or hangs without completing. … … 93 90 94 91 1. Select how you'd like the backup to be delivered: 95 * Save to server : this will create a file in /wp-content/backup-*/ for you to retreive later96 92 * Download to your computer : this will send the backup file to your browser to be downloaded 97 93 * Email : this will email the backup file to the address you specify … … 107 103 See the PHP date() function for details. 108 104 109 When having the database backup emailed or sent to your browser for immediate download, the backup file will be _deleted_ from the server when the transfer is finished. Only if you select delivery method "Save to server" will the backup file remain on your server. 110 111 *** SECURITY WARNING *** 112 Your database backup contains sensitive information, 113 and should not be left on the server for any extended 114 period of time. The "Save to server" delivery method is provided 115 as a convenience only. I will not accept any responsibility 116 if other people obtain your backup file. 117 *** SECURITY WARNING *** 105 When having the database backup emailed or sent to your browser for immediate download, the backup file will be _deleted_ from the server when the transfer is finished. 118 106 119 107 Changelog 120 108 --------- 109 110 111 112 113 114 115 116 117 121 118 122 119 2.2.3 -
wp-db-backup/trunk/readme.txt
r780081 r1194527 4 4 Tags: mysql, database, backup, cron 5 5 Requires at least: 2.0.3 6 Tested up to: 3.6.17 Stable tag: 2. 2.46 Tested up to: 7 Stable tag: 2. 8 8 9 9 On-demand backup of your WordPress database. … … 18 18 NO WARRANTY. 19 19 20 Copyright (c) 2013 Austin Matzko 20 Copyright (c) 2015 Austin Matzko 21 22 [Source Code on GitHub](https://github.com/matzko/wp-db-backup) 21 23 22 24 == Installation == … … 35 37 36 38 Briefly, use phpMyAdmin, which is included with most hosting control panels. More details and links to further explanations are [here](http://codex.wordpress.org/Restoring_Your_Database_From_Backup). 37 38 = Why can't I schedule automatic backups to be saved to my server? =39 40 Although WP-DB-Backup provides the option of saving the backup file to the server, I strongly discourage anyone from leaving backed-up database files on the server. If the server is not perfectly configured, then someone could gain access to your data, and I do not want to make it easy for that to happen.41 39 42 40 = My backup stops or hangs without completing. = … … 80 78 81 79 1. Select how you'd like the backup to be delivered: 82 * Save to server : this will create a file in /wp-content/backup-*/ for you to retreive later83 80 * Download to your computer : this will send the backup file to your browser to be downloaded 84 81 * Email : this will email the backup file to the address you specify … … 94 91 See the PHP date() function for details. 95 92 96 When having the database backup emailed or sent to your browser for immediate download, the backup file will be _deleted_ from the server when the transfer is finished. Only if you select delivery method "Save to server" will the backup file remain on your server. 97 98 *** SECURITY WARNING *** 99 Your database backup contains sensitive information, 100 and should not be left on the server for any extended 101 period of time. The "Save to server" delivery method is provided 102 as a convenience only. I will not accept any responsibility 103 if other people obtain your backup file. 104 *** SECURITY WARNING *** 93 When having the database backup emailed or sent to your browser for immediate download, the backup file will be _deleted_ from the server when the transfer is finished. 105 94 106 95 == Changelog == 96 97 98 99 100 101 102 107 103 108 104 = 2.2.3 = … … 159 155 == Past Contributors == 160 156 skippy, Firas, LaughingLizard, MtDewVirus, Podz, Ringmaster 161 -
wp-db-backup/trunk/wp-db-backup.php
r780080 r1194527 2 2 /* 3 3 Plugin Name: WordPress Database Backup 4 Plugin URI: http ://austinmatzko.com/wordpress-plugins/wp-db-backup/4 Plugin URI: http 5 5 Description: On-demand backup of your WordPress database. Navigate to <a href="edit.php?page=wp-db-backup">Tools → Backup</a> to get started. 6 6 Author: Austin Matzko 7 7 Author URI: http://austinmatzko.com/ 8 Version: 2. 2.49 10 Copyright 201 3Austin Matzko (email : austin at pressedcode.com)8 Version: 2. 9 10 Copyright 201 Austin Matzko (email : austin at pressedcode.com) 11 11 12 12 This program is free software; you can redistribute it and/or modify … … 25 25 */ 26 26 27 /**28 * Change WP_BACKUP_DIR if you want to29 * use a different backup location30 */31 32 27 if ( ! defined('ABSPATH') ) { 33 28 die('Please do not load this file directly.'); … … 35 30 36 31 $rand = substr( md5( md5( DB_PASSWORD ) ), -5 ); 37 global $wpdbb_content_dir, $wpdbb_content_url , $wpdbb_plugin_dir;32 global $wpdbb_content_dir, $wpdbb_content_url; 38 33 $wpdbb_content_dir = ( defined('WP_CONTENT_DIR') ) ? WP_CONTENT_DIR : ABSPATH . 'wp-content'; 39 34 $wpdbb_content_url = ( defined('WP_CONTENT_URL') ) ? WP_CONTENT_URL : get_option('siteurl') . '/wp-content'; 40 $wpdbb_plugin_dir = ( defined('WP_PLUGIN_DIR') ) ? WP_PLUGIN_DIR : $wpdbb_content_dir . '/plugins';41 42 if ( ! defined('WP_BACKUP_DIR') ) {43 define('WP_BACKUP_DIR', $wpdbb_content_dir . '/backup-' . $rand . '/');44 }45 46 if ( ! defined('WP_BACKUP_URL') ) {47 define('WP_BACKUP_URL', $wpdbb_content_url . '/backup-' . $rand . '/');48 }49 35 50 36 if ( ! defined('ROWS_PER_SEGMENT') ) { … … 90 76 add_action('init', array(&$this, 'init_textdomain')); 91 77 add_action('init', array(&$this, 'set_page_url')); 92 add_action(' load-update-core.php', array(&$this, 'update_notice_action'));78 add_action('', array(&$this, 'update_notice_action')); 93 79 add_action('wp_db_backup_cron', array(&$this, 'cron_backup')); 94 80 add_action('wp_cron_daily', array(&$this, 'wp_cron_daily')); … … 124 110 } 125 111 126 $this->backup_dir = trailingslashit(apply_filters('wp_db_b_backup_dir', WP_BACKUP_DIR));112 $this->backup_dir = trailingslashit(apply_filters('wp_db_b_backup_dir', )); 127 113 $this->basename = 'wp-db-backup'; 128 114 … … 217 203 218 204 /* 219 * Add a link to back up your database when doing a core upgrade 205 * Add a link to back up your database when doing a core upgrade 220 206 */ 221 207 function update_notice_action() { 222 if ( 'upgrade-core' == $_REQUEST['action'] ) : 208 global $pagenow; 209 if ( 210 ( 211 isset($_REQUEST['action']) 212 && ('upgrade-core' == $_REQUEST['action']) 213 ) 214 || ( 215 !empty($pagenow) && ('update-core.php' == $pagenow) 216 ) 217 ) : 223 218 ob_start(array(&$this, 'update_notice')); 224 219 add_action('admin_footer', create_function('', 'ob_end_flush();')); 225 220 endif; 226 221 } 227 function update_notice($text = '') { 228 $pattern = '#(<a href\="' . __('http://codex.wordpress.org/WordPress_Backups') . '">.*?</p>)#'; 229 $replace = '$1' . "\n<p>" . sprintf(__('Click <a href="%s" target="_blank">here</a> to back up your database using the WordPress Database Backup plugin. <strong>Note:</strong> WordPress Database Backup does <em>not</em> back up your files, just your database.', 'wp-db-backup'), 'tools.php?page=wp-db-backup') . "</p>\n"; 230 $text = preg_replace($pattern, $replace, $text); 231 return $text; 232 } 222 223 function update_notice($text = '') { 224 $pattern = '#(<a href\="' . __('http://codex.wordpress.org/WordPress_Backups') . '">.*?</p>)#'; 225 $replace = '$1' . "\n<p>" . sprintf(__('Click <a href="%s" target="_blank">here</a> to back up your database using the WordPress Database Backup plugin. <strong>Note:</strong> WordPress Database Backup does <em>not</em> back up your files, just your database.', 'wp-db-backup'), 'tools.php?page=wp-db-backup') . "</p>\n"; 226 $text = preg_replace($pattern, $replace, $text); 227 return $text; 228 } 233 229 234 230 function build_backup_script() { … … 272 268 function backup(table, segment) { 273 269 var fram = document.getElementById("backuploader"); 274 fram.src = "' . $this->page_url . '&fragment=" + table + ":" + segment + ":' . $this->backup_filename . ': ";270 fram.src = "' . $this->page_url . '&fragment=" + table + ":" + segment + ":' . $this->backup_filename . ':"; 275 271 } 276 272 … … 1149 1145 switch($_POST['deliver']) { 1150 1146 case 'http': 1151 $feedback .= '<br />' . sprintf(__('Your backup file: <a href="%1s">%2s</a> should begin downloading shortly.','wp-db-backup'), WP_BACKUP_URL ."{$this->backup_file}", $this->backup_file);1147 $feedback .= '<br />' . sprintf(__('Your backup file: "{$this->backup_file}", $this->backup_file); 1152 1148 break; 1153 1149 case 'smtp': … … 1159 1155 $feedback = '<br />' . sprintf(__('Your backup has been emailed to %s','wp-db-backup'), $feedback); 1160 1156 break; 1161 case 'none':1162 $feedback .= '<br />' . __('Your backup file has been saved on the server. If you would like to download it now, right click and select "Save As"','wp-db-backup');1163 $feedback .= ':<br /> <a href="' . WP_BACKUP_URL . "$file\">$file</a> : " . sprintf(__('%s bytes','wp-db-backup'), filesize($this->backup_dir . $file));1164 1157 } 1165 1158 $feedback .= '</p></div>'; … … 1296 1289 <p><?php _e('What to do with the backup file:','wp-db-backup'); ?></p> 1297 1290 <ul> 1298 <li><label for="do_save">1299 <input type="radio" id="do_save" name="deliver" value="none" style="border:none;" />1300 <?php _e('Save to server','wp-db-backup');1301 echo " (<code>" . $this->backup_dir . "</code>)"; ?>1302 </label></li>1303 1291 <li><label for="do_download"> 1304 1292 <input type="radio" checked="checked" id="do_download" name="deliver" value="http" style="border:none;" />
Note: See TracChangeset
for help on using the changeset viewer.