WP-DBManager - Version 2.65

Version Description

N/A

Download this release

Release Info

Developer GamerZ
Plugin Icon WP-DBManager
Version 2.65
Comparing to
See all releases

Code changes from version 2.50 to 2.65

database-admin-css.css CHANGED
@@ -1,7 +1,7 @@
1
  /*
2
  +----------------------------------------------------------------+
3
  | |
4
- | WordPress 2.8 Plugin: WP-DBManager 2.50 |
5
  | Copyright (c) 2009 Lester "GaMerZ" Chan |
6
  | |
7
  | File Written By: |
1
  /*
2
  +----------------------------------------------------------------+
3
  | |
4
+ | WordPress 2.8 Plugin: WP-DBManager 2.63 |
5
  | Copyright (c) 2009 Lester "GaMerZ" Chan |
6
  | |
7
  | File Written By: |
database-backup.php CHANGED
@@ -1,209 +1,224 @@
1
- <?php
2
- /*
3
- +----------------------------------------------------------------+
4
- | |
5
- | WordPress 2.8 Plugin: WP-DBManager 2.50 |
6
- | Copyright (c) 2009 Lester "GaMerZ" Chan |
7
- | |
8
- | File Written By: |
9
- | - Lester "GaMerZ" Chan |
10
- | - http://lesterchan.net |
11
- | |
12
- | File Information: |
13
- | - Database Backup |
14
- | - wp-content/plugins/wp-dbmanager/database-backup.php |
15
- | |
16
- +----------------------------------------------------------------+
17
- */
18
-
19
-
20
- ### Check Whether User Can Manage Database
21
- if(!current_user_can('manage_database')) {
22
- die('Access Denied');
23
- }
24
-
25
-
26
- ### Variables Variables Variables
27
- $base_name = plugin_basename('wp-dbmanager/database-manager.php');
28
- $base_page = 'admin.php?page='.$base_name;
29
- $current_date = mysql2date(sprintf(__('%s @ %s', 'wp-dbmanager'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', current_time('timestamp')));
30
- $backup = array();
31
- $backup_options = get_option('dbmanager_options');
32
- $backup['date'] = current_time('timestamp');
33
- $backup['mysqldumppath'] = $backup_options['mysqldumppath'];
34
- $backup['mysqlpath'] = $backup_options['mysqlpath'];
35
- $backup['path'] = $backup_options['path'];
36
-
37
-
38
- ### Form Processing
39
- if($_POST['do']) {
40
- // Decide What To Do
41
- switch($_POST['do']) {
42
- case __('Backup', 'wp-dbmanager'):
43
- $brace = (substr(PHP_OS, 0, 3) == 'WIN') ? '"' : '';
44
- $gzip = intval($_POST['gzip']);
45
- if($gzip == 1) {
46
- $backup['filename'] = $backup['date'].'_-_'.DB_NAME.'.sql.gz';
47
- $backup['filepath'] = $backup['path'].'/'.$backup['filename'];
48
- $backup['command'] = $brace.$backup['mysqldumppath'].$brace.' --host="'.DB_HOST.'" --user="'.DB_USER.'" --password="'.DB_PASSWORD.'" --add-drop-table --skip-lock-tables '.DB_NAME.' | gzip > '.$brace.$backup['filepath'].$brace;
49
- } else {
50
- $backup['filename'] = $backup['date'].'_-_'.DB_NAME.'.sql';
51
- $backup['filepath'] = $backup['path'].'/'.$backup['filename'];
52
- $backup['command'] = $brace.$backup['mysqldumppath'].$brace.' --host="'.DB_HOST.'" --user="'.DB_USER.'" --password="'.DB_PASSWORD.'" --add-drop-table --skip-lock-tables '.DB_NAME.' > '.$brace.$backup['filepath'].$brace;
53
- }
54
- $error = execute_backup($backup['command']);
55
- if(!is_writable($backup['path'])) {
56
- $text = '<font color="red">'.sprintf(__('Database Failed To Backup On \'%s\'. Backup Folder Not Writable.', 'wp-dbmanager'), $current_date).'</font>';
57
- } elseif(filesize($backup['filepath']) == 0) {
58
- unlink($backup['filepath']);
59
- $text = '<font color="red">'.sprintf(__('Database Failed To Backup On \'%s\'. Backup File Size Is 0KB.', 'wp-dbmanager'), $current_date).'</font>';
60
- } elseif(!is_file($backup['filepath'])) {
61
- $text = '<font color="red">'.sprintf(__('Database Failed To Backup On \'%s\'. Invalid Backup File Path.', 'wp-dbmanager'), $current_date).'</font>';
62
- } elseif($error) {
63
- $text = '<font color="red">'.sprintf(__('Database Failed To Backup On \'%s\'.', 'wp-dbmanager'), $current_date).'</font>';
64
- } else {
65
- $text = '<font color="green">'.sprintf(__('Database Backed Up Successfully On \'%s\'.', 'wp-dbmanager'), $current_date).'</font>';
66
- }
67
- break;
68
- }
69
- }
70
-
71
-
72
- ### Backup File Name
73
- $backup['filename'] = $backup['date'].'_-_'.DB_NAME.'.sql';
74
-
75
-
76
- ### MYSQL Base Dir
77
- $status_count = 0;
78
- $stats_function_disabled = 0;
79
- ?>
80
- <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
81
- <!-- Checking Backup Status -->
82
- <div class="wrap">
83
- <div id="icon-wp-dbmanager" class="icon32"><br /></div>
84
- <h2><?php _e('Backup Database', 'wp-dbmanager'); ?></h2>
85
- <h3><?php _e('Checking Backup Status', 'wp-dbmanager'); ?></h3>
86
- <p>
87
- <?php _e('Checking Backup Folder', 'wp-dbmanager'); ?> <span dir="ltr">(<strong><?php echo stripslashes($backup['path']); ?></strong>)</span> ...<br />
88
- <?php
89
- if(@is_dir(stripslashes($backup['path']))) {
90
- echo '<font color="green">'.__('Backup folder exists', 'wp-dbmanager').'</font><br />';
91
- $status_count++;
92
- } else {
93
- echo '<font color="red">'.sprintf(__('Backup folder does NOT exist. Please create \'backup-db\' folder in \'%s\' folder and CHMOD it to \'777\' or change the location of the backup folder under DB Option.', 'wp-dbmanager'), WP_CONTENT_DIR).'</font><br />';
94
- }
95
- if(@is_writable(stripslashes($backup['path']))) {
96
- echo '<font color="green">'.__('Backup folder is writable', 'wp-dbmanager').'</font>';
97
- $status_count++;
98
- } else {
99
- echo '<font color="red">'.__('Backup folder is NOT writable. Please CHMOD it to \'777\'.', 'wp-dbmanager').'</font>';
100
- }
101
- ?>
102
- </p>
103
- <p>
104
- <?php
105
- if(@file_exists(stripslashes($backup['mysqldumppath']))) {
106
- echo __('Checking MYSQL Dump Path', 'wp-dbmanager').' <span dir="ltr">(<strong>'.stripslashes($backup['mysqldumppath']).'</strong>)</span> ...<br />';
107
- echo '<font color="green">'.__('MYSQL dump path exists.', 'wp-dbmanager').'</font>';
108
- $status_count++;
109
- } else {
110
- echo __('Checking MYSQL Dump Path', 'wp-dbmanager').' ...<br />';
111
- echo '<font color="red">'.__('MYSQL dump path does NOT exist. Please check your mysqldump path under DB Options. If uncertain, contact your server administrator.', 'wp-dbmanager').'</font>';
112
- }
113
- ?>
114
- </p>
115
- <p>
116
- <?php
117
- if(@file_exists(stripslashes($backup['mysqlpath']))) {
118
- echo __('Checking MYSQL Path', 'wp-dbmanager').' <span dir="ltr">(<strong>'.stripslashes($backup['mysqlpath']).'</strong>)</span> ...<br />';
119
- echo '<font color="green">'.__('MYSQL path exists.', 'wp-dbmanager').'</font>';
120
- $status_count++;
121
- } else {
122
- echo __('Checking MYSQL Path', 'wp-dbmanager').' ...<br />';
123
- echo '<font color="red">'.__('MYSQL path does NOT exist. Please check your mysql path under DB Options. If uncertain, contact your server administrator.', 'wp-dbmanager').'</font>';
124
- }
125
- ?>
126
- </p>
127
- <p>
128
- <?php _e('Checking PHP Functions', 'wp-dbmanager'); ?> <span dir="ltr">(<strong>passthru()</strong>, <strong>system()</strong> <?php _e('and', 'wp-dbmanager'); ?> <strong>exec()</strong>)</span> ...<br />
129
- <?php
130
- if(function_exists('passthru')) {
131
- echo '<font color="green"><span dir="ltr">passthru()</span> '.__('enabled', 'wp-dbmanager').'.</font><br />';
132
- $status_count++;
133
- } else {
134
- echo '<font color="red"><span dir="ltr">passthru()</span> '.__('disabled', 'wp-dbmanager').'.</font><br />';
135
- $stats_function_disabled++;
136
- }
137
- if(function_exists('system')) {
138
- echo '<font color="green"><span dir="ltr">system()</span> '.__('enabled', 'wp-dbmanager').'.</font><br />';
139
- } else {
140
- echo '<font color="red"><span dir="ltr">system()</span> '.__('disabled', 'wp-dbmanager').'.</font><br />';
141
- $stats_function_disabled++;
142
- }
143
- if(function_exists('exec')) {
144
- echo '<font color="green"><span dir="ltr">exec()</span> '.__('enabled', 'wp-dbmanager').'.</font>';
145
- } else {
146
- echo '<font color="red"><span dir="ltr">exec()</span> '.__('disabled', 'wp-dbmanager').'.</font>';
147
- $stats_function_disabled++;
148
- }
149
- ?>
150
- </p>
151
- <p>
152
- <?php
153
- if($status_count == 5) {
154
- echo '<strong><font color="green">'.__('Excellent. You Are Good To Go.', 'wp-dbmanager').'</font></strong>';
155
- } else if($stats_function_disabled == 3) {
156
- echo '<strong><font color="red">'.__('I\'m sorry, your server administrator has disabled passthru(), system() and exec(), thus you cannot use this backup script. You may consider using the default WordPress database backup script instead.', 'wp-dbmanager').'</font></strong>';
157
- } else {
158
- echo '<strong><font color="red">'.__('Please Rectify The Error Highlighted In Red Before Proceeding On.', 'wp-dbmanager').'</font></strong>';
159
- }
160
- ?>
161
- </p>
162
- <p><i><?php _e('Note: The checking of backup status is still undergoing testing, it may not be accurate.', 'wp-dbmanager'); ?></i></p>
163
- </div>
164
- <!-- Backup Database -->
165
- <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo plugin_basename(__FILE__); ?>">
166
- <div class="wrap">
167
- <h3><?php _e('Backup Database', 'wp-dbmanager'); ?></h3>
168
- <br style="clear" />
169
- <table class="widefat">
170
- <thead>
171
- <tr>
172
- <th><?php _e('Option', 'wp-dbmanager'); ?></th>
173
- <th><?php _e('Value', 'wp-dbmanager'); ?></th>
174
- </tr>
175
- </thead>
176
- <tr>
177
- <th><?php _e('Database Name:', 'wp-dbmanager'); ?></th>
178
- <td><?php echo DB_NAME; ?></td>
179
- </tr>
180
- <tr style="background-color: #eee;">
181
- <th><?php _e('Database Backup To:', 'wp-dbmanager'); ?></th>
182
- <td><span dir="ltr"><?php echo stripslashes($backup['path']); ?></span></td>
183
- </tr>
184
- <tr>
185
- <th><?php _e('Database Backup Date:', 'wp-dbmanager'); ?></th>
186
- <td><?php echo mysql2date(sprintf(__('%s @ %s', 'wp-dbmanager'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $backup['date'])); ?></td>
187
- </tr>
188
- <tr style="background-color: #eee;">
189
- <th><?php _e('Database Backup File Name:', 'wp-dbmanager'); ?></th>
190
- <td><span dir="ltr"><?php echo $backup['filename']; ?></span></td>
191
- </tr>
192
- <tr>
193
- <th><?php _e('Database Backup Type:', 'wp-dbmanager'); ?></th>
194
- <td><?php _e('Full (Structure and Data)', 'wp-dbmanager'); ?></td>
195
- </tr>
196
- <tr style="background-color: #eee;">
197
- <th><?php _e('MYSQL Dump Location:', 'wp-dbmanager'); ?></th>
198
- <td><span dir="ltr"><?php echo stripslashes($backup['mysqldumppath']); ?></span></td>
199
- </tr>
200
- <tr>
201
- <th><?php _e('GZIP Database Backup File?', 'wp-dbmanager'); ?></th>
202
- <td><input type="radio" id="gzip-yes" name="gzip" value="1" />&nbsp;<label for="gzip-yes"><?php _e('Yes', 'wp-dbmanager'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" id="gzip-no" name="gzip" value="0" checked="checked" />&nbsp;<label for="gzip-no"><?php _e('No', 'wp-dbmanager'); ?></label></td>
203
- </tr>
204
- <tr>
205
- <td colspan="2" align="center"><input type="submit" name="do" value="<?php _e('Backup', 'wp-dbmanager'); ?>" class="button" />&nbsp;&nbsp;<input type="button" name="cancel" value="<?php _e('Cancel', 'wp-dbmanager'); ?>" class="button" onclick="javascript:history.go(-1)" /></td>
206
- </tr>
207
- </table>
208
- </div>
209
- </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ +----------------------------------------------------------------+
4
+ | |
5
+ | WordPress 2.8 Plugin: WP-DBManager 2.63 |
6
+ | Copyright (c) 2009 Lester "GaMerZ" Chan |
7
+ | |
8
+ | File Written By: |
9
+ | - Lester "GaMerZ" Chan |
10
+ | - http://lesterchan.net |
11
+ | |
12
+ | File Information: |
13
+ | - Database Backup |
14
+ | - wp-content/plugins/wp-dbmanager/database-backup.php |
15
+ | |
16
+ +----------------------------------------------------------------+
17
+ */
18
+
19
+
20
+ ### Check Whether User Can Manage Database
21
+ if(!current_user_can('manage_database')) {
22
+ die('Access Denied');
23
+ }
24
+
25
+
26
+ ### Variables Variables Variables
27
+ $base_name = plugin_basename('wp-dbmanager/database-manager.php');
28
+ $base_page = 'admin.php?page='.$base_name;
29
+ $current_date = mysql2date(sprintf(__('%s @ %s', 'wp-dbmanager'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', current_time('timestamp')));
30
+ $backup = array();
31
+ $backup_options = get_option('dbmanager_options');
32
+ $backup['date'] = current_time('timestamp');
33
+ $backup['mysqldumppath'] = $backup_options['mysqldumppath'];
34
+ $backup['mysqlpath'] = $backup_options['mysqlpath'];
35
+ $backup['path'] = $backup_options['path'];
36
+ $backup['password'] = str_replace('$', '\$', DB_PASSWORD);
37
+ $backup['charset'] = ' --default-character-set="utf8"';
38
+
39
+ ### Form Processing
40
+ if($_POST['do']) {
41
+ // Decide What To Do
42
+ switch($_POST['do']) {
43
+ case __('Backup', 'wp-dbmanager'):
44
+ check_admin_referer('wp-dbmanager_backup');
45
+ $brace = (substr(PHP_OS, 0, 3) == 'WIN') ? '"' : '';
46
+ $backup['host'] = DB_HOST;
47
+ $backup['port'] = '';
48
+ $backup['sock'] = '';
49
+ if(strpos(DB_HOST, ':') !== false) {
50
+ $db_host = explode(':', DB_HOST);
51
+ $backup['host'] = $db_host[0];
52
+ if(intval($db_host[1]) != 0) {
53
+ $backup['port'] = ' --port="'.intval($db_host[1]).'"';
54
+ } else {
55
+ $backup['sock'] = ' --socket="'.$db_host[1].'"';
56
+ }
57
+ }
58
+ $gzip = intval($_POST['gzip']);
59
+ if($gzip == 1) {
60
+ $backup['filename'] = $backup['date'].'_-_'.DB_NAME.'.sql.gz';
61
+ $backup['filepath'] = $backup['path'].'/'.$backup['filename'];
62
+ $backup['command'] = $brace.$backup['mysqldumppath'].$brace.' --force --host="'.$backup['host'].'" --user="'.DB_USER.'" --password="'.$backup['password'].'"'.$backup['port'].$backup['sock'].$backup['charset'].' --add-drop-table --skip-lock-tables '.DB_NAME.' | gzip > '.$brace.$backup['filepath'].$brace;
63
+ } else {
64
+ $backup['filename'] = $backup['date'].'_-_'.DB_NAME.'.sql';
65
+ $backup['filepath'] = $backup['path'].'/'.$backup['filename'];
66
+ $backup['command'] = $brace.$backup['mysqldumppath'].$brace.' --force --host="'.$backup['host'].'" --user="'.DB_USER.'" --password="'.$backup['password'].'"'.$backup['port'].$backup['sock'].$backup['charset'].' --add-drop-table --skip-lock-tables '.DB_NAME.' > '.$brace.$backup['filepath'].$brace;
67
+ }
68
+ $error = execute_backup($backup['command']);
69
+ if(!is_writable($backup['path'])) {
70
+ $text = '<font color="red">'.sprintf(__('Database Failed To Backup On \'%s\'. Backup Folder Not Writable.', 'wp-dbmanager'), $current_date).'</font>';
71
+ } elseif(filesize($backup['filepath']) == 0) {
72
+ unlink($backup['filepath']);
73
+ $text = '<font color="red">'.sprintf(__('Database Failed To Backup On \'%s\'. Backup File Size Is 0KB.', 'wp-dbmanager'), $current_date).'</font>';
74
+ } elseif(!is_file($backup['filepath'])) {
75
+ $text = '<font color="red">'.sprintf(__('Database Failed To Backup On \'%s\'. Invalid Backup File Path.', 'wp-dbmanager'), $current_date).'</font>';
76
+ } elseif($error) {
77
+ $text = '<font color="red">'.sprintf(__('Database Failed To Backup On \'%s\'.', 'wp-dbmanager'), $current_date).'</font>';
78
+ } else {
79
+ $text = '<font color="green">'.sprintf(__('Database Backed Up Successfully On \'%s\'.', 'wp-dbmanager'), $current_date).'</font>';
80
+ }
81
+ break;
82
+ }
83
+ }
84
+
85
+
86
+ ### Backup File Name
87
+ $backup['filename'] = $backup['date'].'_-_'.DB_NAME.'.sql';
88
+
89
+
90
+ ### MYSQL Base Dir
91
+ $status_count = 0;
92
+ $stats_function_disabled = 0;
93
+ ?>
94
+ <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
95
+ <!-- Checking Backup Status -->
96
+ <div class="wrap">
97
+ <div id="icon-wp-dbmanager" class="icon32"><br /></div>
98
+ <h2><?php _e('Backup Database', 'wp-dbmanager'); ?></h2>
99
+ <h3><?php _e('Checking Backup Status', 'wp-dbmanager'); ?></h3>
100
+ <p>
101
+ <?php _e('Checking Backup Folder', 'wp-dbmanager'); ?> <span dir="ltr">(<strong><?php echo stripslashes($backup['path']); ?></strong>)</span> ...<br />
102
+ <?php
103
+ if(@is_dir(stripslashes($backup['path']))) {
104
+ echo '<font color="green">'.__('Backup folder exists', 'wp-dbmanager').'</font><br />';
105
+ $status_count++;
106
+ } else {
107
+ echo '<font color="red">'.sprintf(__('Backup folder does NOT exist. Please create \'backup-db\' folder in \'%s\' folder and CHMOD it to \'777\' or change the location of the backup folder under DB Option.', 'wp-dbmanager'), WP_CONTENT_DIR).'</font><br />';
108
+ }
109
+ if(@is_writable(stripslashes($backup['path']))) {
110
+ echo '<font color="green">'.__('Backup folder is writable', 'wp-dbmanager').'</font>';
111
+ $status_count++;
112
+ } else {
113
+ echo '<font color="red">'.__('Backup folder is NOT writable. Please CHMOD it to \'777\'.', 'wp-dbmanager').'</font>';
114
+ }
115
+ ?>
116
+ </p>
117
+ <p>
118
+ <?php
119
+ if(@file_exists(stripslashes($backup['mysqldumppath']))) {
120
+ echo __('Checking MYSQL Dump Path', 'wp-dbmanager').' <span dir="ltr">(<strong>'.stripslashes($backup['mysqldumppath']).'</strong>)</span> ...<br />';
121
+ echo '<font color="green">'.__('MYSQL dump path exists.', 'wp-dbmanager').'</font>';
122
+ $status_count++;
123
+ } else {
124
+ echo __('Checking MYSQL Dump Path', 'wp-dbmanager').' ...<br />';
125
+ echo '<font color="red">'.__('MYSQL dump path does NOT exist. Please check your mysqldump path under DB Options. If uncertain, contact your server administrator.', 'wp-dbmanager').'</font>';
126
+ }
127
+ ?>
128
+ </p>
129
+ <p>
130
+ <?php
131
+ if(@file_exists(stripslashes($backup['mysqlpath']))) {
132
+ echo __('Checking MYSQL Path', 'wp-dbmanager').' <span dir="ltr">(<strong>'.stripslashes($backup['mysqlpath']).'</strong>)</span> ...<br />';
133
+ echo '<font color="green">'.__('MYSQL path exists.', 'wp-dbmanager').'</font>';
134
+ $status_count++;
135
+ } else {
136
+ echo __('Checking MYSQL Path', 'wp-dbmanager').' ...<br />';
137
+ echo '<font color="red">'.__('MYSQL path does NOT exist. Please check your mysql path under DB Options. If uncertain, contact your server administrator.', 'wp-dbmanager').'</font>';
138
+ }
139
+ ?>
140
+ </p>
141
+ <p>
142
+ <?php _e('Checking PHP Functions', 'wp-dbmanager'); ?> <span dir="ltr">(<strong>passthru()</strong>, <strong>system()</strong> <?php _e('and', 'wp-dbmanager'); ?> <strong>exec()</strong>)</span> ...<br />
143
+ <?php
144
+ if(function_exists('passthru')) {
145
+ echo '<font color="green"><span dir="ltr">passthru()</span> '.__('enabled', 'wp-dbmanager').'.</font><br />';
146
+ $status_count++;
147
+ } else {
148
+ echo '<font color="red"><span dir="ltr">passthru()</span> '.__('disabled', 'wp-dbmanager').'.</font><br />';
149
+ $stats_function_disabled++;
150
+ }
151
+ if(function_exists('system')) {
152
+ echo '<font color="green"><span dir="ltr">system()</span> '.__('enabled', 'wp-dbmanager').'.</font><br />';
153
+ } else {
154
+ echo '<font color="red"><span dir="ltr">system()</span> '.__('disabled', 'wp-dbmanager').'.</font><br />';
155
+ $stats_function_disabled++;
156
+ }
157
+ if(function_exists('exec')) {
158
+ echo '<font color="green"><span dir="ltr">exec()</span> '.__('enabled', 'wp-dbmanager').'.</font>';
159
+ } else {
160
+ echo '<font color="red"><span dir="ltr">exec()</span> '.__('disabled', 'wp-dbmanager').'.</font>';
161
+ $stats_function_disabled++;
162
+ }
163
+ ?>
164
+ </p>
165
+ <p>
166
+ <?php
167
+ if($status_count == 5) {
168
+ echo '<strong><font color="green">'.__('Excellent. You Are Good To Go.', 'wp-dbmanager').'</font></strong>';
169
+ } else if($stats_function_disabled == 3) {
170
+ echo '<strong><font color="red">'.__('I\'m sorry, your server administrator has disabled passthru(), system() and exec(), thus you cannot use this backup script. You may consider using the default WordPress database backup script instead.', 'wp-dbmanager').'</font></strong>';
171
+ } else {
172
+ echo '<strong><font color="red">'.__('Please Rectify The Error Highlighted In Red Before Proceeding On.', 'wp-dbmanager').'</font></strong>';
173
+ }
174
+ ?>
175
+ </p>
176
+ <p><i><?php _e('Note: The checking of backup status is still undergoing testing, it may not be accurate.', 'wp-dbmanager'); ?></i></p>
177
+ </div>
178
+ <!-- Backup Database -->
179
+ <form method="post" action="<?php echo admin_url('admin.php?page='.plugin_basename(__FILE__)); ?>">
180
+ <?php wp_nonce_field('wp-dbmanager_backup'); ?>
181
+ <div class="wrap">
182
+ <h3><?php _e('Backup Database', 'wp-dbmanager'); ?></h3>
183
+ <br style="clear" />
184
+ <table class="widefat">
185
+ <thead>
186
+ <tr>
187
+ <th><?php _e('Option', 'wp-dbmanager'); ?></th>
188
+ <th><?php _e('Value', 'wp-dbmanager'); ?></th>
189
+ </tr>
190
+ </thead>
191
+ <tr>
192
+ <th><?php _e('Database Name:', 'wp-dbmanager'); ?></th>
193
+ <td><?php echo DB_NAME; ?></td>
194
+ </tr>
195
+ <tr style="background-color: #eee;">
196
+ <th><?php _e('Database Backup To:', 'wp-dbmanager'); ?></th>
197
+ <td><span dir="ltr"><?php echo stripslashes($backup['path']); ?></span></td>
198
+ </tr>
199
+ <tr>
200
+ <th><?php _e('Database Backup Date:', 'wp-dbmanager'); ?></th>
201
+ <td><?php echo mysql2date(sprintf(__('%s @ %s', 'wp-dbmanager'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $backup['date'])); ?></td>
202
+ </tr>
203
+ <tr style="background-color: #eee;">
204
+ <th><?php _e('Database Backup File Name:', 'wp-dbmanager'); ?></th>
205
+ <td><span dir="ltr"><?php echo $backup['filename']; ?></span></td>
206
+ </tr>
207
+ <tr>
208
+ <th><?php _e('Database Backup Type:', 'wp-dbmanager'); ?></th>
209
+ <td><?php _e('Full (Structure and Data)', 'wp-dbmanager'); ?></td>
210
+ </tr>
211
+ <tr style="background-color: #eee;">
212
+ <th><?php _e('MYSQL Dump Location:', 'wp-dbmanager'); ?></th>
213
+ <td><span dir="ltr"><?php echo stripslashes($backup['mysqldumppath']); ?></span></td>
214
+ </tr>
215
+ <tr>
216
+ <th><?php _e('GZIP Database Backup File?', 'wp-dbmanager'); ?></th>
217
+ <td><input type="radio" id="gzip-yes" name="gzip" value="1" />&nbsp;<label for="gzip-yes"><?php _e('Yes', 'wp-dbmanager'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" id="gzip-no" name="gzip" value="0" checked="checked" />&nbsp;<label for="gzip-no"><?php _e('No', 'wp-dbmanager'); ?></label></td>
218
+ </tr>
219
+ <tr>
220
+ <td colspan="2" align="center"><input type="submit" name="do" value="<?php _e('Backup', 'wp-dbmanager'); ?>" class="button" />&nbsp;&nbsp;<input type="button" name="cancel" value="<?php _e('Cancel', 'wp-dbmanager'); ?>" class="button" onclick="javascript:history.go(-1)" /></td>
221
+ </tr>
222
+ </table>
223
+ </div>
224
+ </form>
database-empty.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  +----------------------------------------------------------------+
4
  | |
5
- | WordPress 2.8 Plugin: WP-DBManager 2.50 |
6
  | Copyright (c) 2009 Lester "GaMerZ" Chan |
7
  | |
8
  | File Written By: |
@@ -42,6 +42,7 @@ if($_POST['do']) {
42
  // Decide What To Do
43
  switch($_POST['do']) {
44
  case __('Empty/Drop', 'wp-dbmanager'):
 
45
  $empty_tables = array();
46
  if(!empty($emptydrop)) {
47
  foreach($emptydrop as $key => $value) {
@@ -75,7 +76,8 @@ $tables = $wpdb->get_col("SHOW TABLES");
75
  ?>
76
  <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
77
  <!-- Empty/Drop Tables -->
78
- <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo plugin_basename(__FILE__); ?>">
 
79
  <div class="wrap">
80
  <div id="icon-wp-dbmanager" class="icon32"><br /></div>
81
  <h2><?php _e('Empty/Drop Tables', 'wp-dbmanager'); ?></h2>
2
  /*
3
  +----------------------------------------------------------------+
4
  | |
5
+ | WordPress 2.8 Plugin: WP-DBManager 2.63 |
6
  | Copyright (c) 2009 Lester "GaMerZ" Chan |
7
  | |
8
  | File Written By: |
42
  // Decide What To Do
43
  switch($_POST['do']) {
44
  case __('Empty/Drop', 'wp-dbmanager'):
45
+ check_admin_referer('wp-dbmanager_empty');
46
  $empty_tables = array();
47
  if(!empty($emptydrop)) {
48
  foreach($emptydrop as $key => $value) {
76
  ?>
77
  <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
78
  <!-- Empty/Drop Tables -->
79
+ <form method="post" action="<?php echo admin_url('admin.php?page='.plugin_basename(__FILE__)); ?>">
80
+ <?php wp_nonce_field('wp-dbmanager_empty'); ?>
81
  <div class="wrap">
82
  <div id="icon-wp-dbmanager" class="icon32"><br /></div>
83
  <h2><?php _e('Empty/Drop Tables', 'wp-dbmanager'); ?></h2>
database-manage.php CHANGED
@@ -1,211 +1,227 @@
1
- <?php
2
- /*
3
- +----------------------------------------------------------------+
4
- | |
5
- | WordPress 2.8 Plugin: WP-DBManager 2.50 |
6
- | Copyright (c) 2009 Lester "GaMerZ" Chan |
7
- | |
8
- | File Written By: |
9
- | - Lester "GaMerZ" Chan |
10
- | - http://lesterchan.net |
11
- | |
12
- | File Information: |
13
- | - Database Restore |
14
- | - wp-content/plugins/wp-dbmanager/database-restore.php |
15
- | |
16
- +----------------------------------------------------------------+
17
- */
18
-
19
-
20
- ### Check Whether User Can Manage Database
21
- if(!current_user_can('manage_database')) {
22
- die('Access Denied');
23
- }
24
-
25
-
26
- ### Variables Variables Variables
27
- $base_name = plugin_basename('wp-dbmanager/database-manager.php');
28
- $base_page = 'admin.php?page='.$base_name;
29
- $backup = array();
30
- $backup_options = get_option('dbmanager_options');
31
- $backup['date'] = current_time('timestamp');
32
- $backup['mysqldumppath'] = $backup_options['mysqldumppath'];
33
- $backup['mysqlpath'] = $backup_options['mysqlpath'];
34
- $backup['path'] = $backup_options['path'];
35
-
36
-
37
- ### Form Processing
38
- if($_POST['do']) {
39
- // Lets Prepare The Variables
40
- $database_file = trim($_POST['database_file']);
41
- $nice_file_date = mysql2date(sprintf(__('%s @ %s', 'wp-dbmanager'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', substr($database_file, 0, 10)));
42
-
43
- // Decide What To Do
44
- switch($_POST['do']) {
45
- case __('Restore', 'wp-dbmanager'):
46
- if(!empty($database_file)) {
47
- $brace = (substr(PHP_OS, 0, 3) == 'WIN') ? '"' : '';
48
- if(stristr($database_file, '.gz')) {
49
- $backup['command'] = 'gunzip < '.$brace.$backup['path'].'/'.$database_file.$brace.' | '.$brace.$backup['mysqlpath'].$brace.' --host="'.DB_HOST.'" --user="'.DB_USER.'" --password="'.DB_PASSWORD.'" '.DB_NAME;
50
- } else {
51
- $backup['command'] = $brace.$backup['mysqlpath'].$brace.' --host="'.DB_HOST.'" --user="'.DB_USER.'" --password="'.DB_PASSWORD.'" '.DB_NAME.' < '.$brace.$backup['path'].'/'.$database_file.$brace;
52
- }
53
- passthru($backup['command'], $error);
54
- if($error) {
55
- $text = '<font color="red">'.sprintf(__('Database On \'%s\' Failed To Restore', 'wp-dbmanager'), $nice_file_date).'</font>';
56
- } else {
57
- $text = '<font color="green">'.sprintf(__('Database On \'%s\' Restored Successfully', 'wp-dbmanager'), $nice_file_date).'</font>';
58
- }
59
- } else {
60
- $text = '<font color="red">'.__('No Backup Database File Selected', 'wp-dbmanager').'</font>';
61
- }
62
- break;
63
- case __('E-Mail', 'wp-dbmanager'):
64
- if(!empty($database_file)) {
65
- // Get And Read The Database Backup File
66
- $file_path = $backup['path'].'/'.$database_file;
67
- $file_size = format_size(filesize($file_path));
68
- $file_date = $nice_file_date;
69
- $file = fopen($file_path,'rb');
70
- $file_data = fread($file,filesize($file_path));
71
- fclose($file);
72
- $file_data = chunk_split(base64_encode($file_data));
73
- // Create Mail To, Mail Subject And Mail Header
74
- if(!empty($_POST['email_to'])) {
75
- $mail_to = trim($_POST['email_to']);
76
- } else {
77
- $mail_to = get_option('admin_email');
78
- }
79
- $mail_subject = sprintf(__('%s Database Backup File For %s', 'wp-dbmanager'), get_bloginfo('name'), $file_date);
80
- $mail_header = 'From: '.get_bloginfo('name').' Administrator <'.get_option('admin_email').'>';
81
- // MIME Boundary
82
- $random_time = md5(time());
83
- $mime_boundary = "==WP-DBManager- $random_time";
84
- // Create Mail Header And Mail Message
85
- $mail_header .= "\nMIME-Version: 1.0\n" .
86
- "Content-Type: multipart/mixed;\n" .
87
- " boundary=\"{$mime_boundary}\"";
88
- $mail_message = __('Website Name:', 'wp-dbmanager').' '.get_bloginfo('name')."\n".
89
- __('Website URL:', 'wp-dbmanager').' '.get_bloginfo('siteurl')."\n".
90
- __('Backup File Name:', 'wp-dbmanager').' '.$database_file."\n".
91
- __('Backup File Date:', 'wp-dbmanager').' '.$file_date."\n".
92
- __('Backup File Size:', 'wp-dbmanager').' '.$file_size."\n\n".
93
- __('With Regards,', 'wp-dbmanager')."\n".
94
- get_bloginfo('name').' '. __('Administrator', 'wp-dbmanager')."\n".
95
- get_bloginfo('siteurl');
96
- $mail_message = "This is a multi-part message in MIME format.\n\n" .
97
- "--{$mime_boundary}\n" .
98
- "Content-Type: text/plain; charset=\"utf-8\"\n" .
99
- "Content-Transfer-Encoding: 7bit\n\n".$mail_message."\n\n";
100
- $mail_message .= "--{$mime_boundary}\n" .
101
- "Content-Type: application/octet-stream;\n" .
102
- " name=\"$database_file\"\n" .
103
- "Content-Disposition: attachment;\n" .
104
- " filename=\"$database_file\"\n" .
105
- "Content-Transfer-Encoding: base64\n\n" .
106
- $file_data."\n\n--{$mime_boundary}--\n";
107
- if(mail($mail_to, $mail_subject, $mail_message, $mail_header)) {
108
- $text .= '<font color="green">'.sprintf(__('Database Backup File For \'%s\' Successfully E-Mailed To \'%s\'', 'wp-dbmanager'), $file_date, $mail_to).'</font><br />';
109
- } else {
110
- $text = '<font color="red">'.sprintf(__('Unable To E-Mail Database Backup File For \'%s\' To \'%s\'', 'wp-dbmanager'), $file_date, $mail_to).'</font>';
111
- }
112
- } else {
113
- $text = '<font color="red">'.__('No Backup Database File Selected', 'wp-dbmanager').'</font>';
114
- }
115
- break;
116
- case __('Download', 'wp-dbmanager'):
117
- if(empty($database_file)) {
118
- $text = '<font color="red">'.__('No Backup Database File Selected', 'wp-dbmanager').'</font>';
119
- }
120
- break;
121
- case __('Delete', 'wp-dbmanager'):
122
- if(!empty($database_file)) {
123
- if(is_file($backup['path'].'/'.$database_file)) {
124
- if(!unlink($backup['path'].'/'.$database_file)) {
125
- $text .= '<font color="red">'.sprintf(__('Unable To Delete Database Backup File On \'%s\'', 'wp-dbmanager'), $nice_file_date).'</font><br />';
126
- } else {
127
- $text .= '<font color="green">'.sprintf(__('Database Backup File On \'%s\' Deleted Successfully', 'wp-dbmanager'), $nice_file_date).'</font><br />';
128
- }
129
- } else {
130
- $text = '<font color="red">'.sprintf(__('Invalid Database Backup File On \'%s\'', 'wp-dbmanager'), $nice_file_date).'</font>';
131
- }
132
- } else {
133
- $text = '<font color="red">'.__('No Backup Database File Selected', 'wp-dbmanager').'</font>';
134
- }
135
- break;
136
- }
137
- }
138
- ?>
139
- <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
140
- <!-- Manage Backup Database -->
141
- <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo plugin_basename(__FILE__); ?>">
142
- <div class="wrap">
143
- <div id="icon-wp-dbmanager" class="icon32"><br /></div>
144
- <h2><?php _e('Manage Backup Database', 'wp-dbmanager'); ?></h2>
145
- <p><?php _e('Choose A Backup Date To E-Mail, Restore, Download Or Delete', 'wp-dbmanager'); ?></p>
146
- <table class="widefat">
147
- <thead>
148
- <tr>
149
- <th><?php _e('No.', 'wp-dbmanager'); ?></th>
150
- <th><?php _e('Database File', 'wp-dbmanager'); ?></th>
151
- <th><?php _e('Date/Time', 'wp-dbmanager'); ?></th>
152
- <th><?php _e('Size', 'wp-dbmanager'); ?></th>
153
- <th><?php _e('Select', 'wp-dbmanager'); ?></th>
154
- </tr>
155
- </thead>
156
- <?php
157
- if(!is_emtpy_folder($backup['path'])) {
158
- if ($handle = opendir($backup['path'])) {
159
- $database_files = array();
160
- while (false !== ($file = readdir($handle))) {
161
- if ($file != '.' && $file != '..' && $file != '.htaccess' && (file_ext($file) == 'sql' || file_ext($file) == 'gz')) {
162
- $database_files[] = $file;
163
- }
164
- }
165
- closedir($handle);
166
- sort($database_files);
167
- for($i = (sizeof($database_files)-1); $i > -1; $i--) {
168
- if($no%2 == 0) {
169
- $style = '';
170
- } else {
171
- $style = ' class="alternate"';
172
- }
173
- $no++;
174
- $database_text = substr($database_files[$i], 13);
175
- $date_text = mysql2date(sprintf(__('%s @ %s', 'wp-dbmanager'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', substr($database_files[$i], 0, 10)));
176
- $size_text = filesize($backup['path'].'/'.$database_files[$i]);
177
- echo "<tr$style>\n";
178
- echo '<td>'.number_format_i18n($no).'</td>';
179
- echo "<td>$database_text</td>";
180
- echo "<td>$date_text</td>";
181
- echo '<td>'.format_size($size_text).'</td>';
182
- echo "<td><input type=\"radio\" name=\"database_file\" value=\"$database_files[$i]\" /></td>\n</tr>\n";
183
- $totalsize += $size_text;
184
- }
185
- } else {
186
- echo '<tr><td align="center" colspan="5">'.__('There Are No Database Backup Files Available.', 'wp-dbmanager').'</td></tr>';
187
- }
188
- } else {
189
- echo '<tr><td align="center" colspan="5">'.__('There Are No Database Backup Files Available.', 'wp-dbmanager').'</td></tr>';
190
- }
191
- ?>
192
- <tr class="thead">
193
- <th colspan="3"><?php printf(_n('%s Backup File', '%s Backup Files', $no, 'wp-dbmanager'), number_format_i18n($no)); ?></th>
194
- <th><?php echo format_size($totalsize); ?></th>
195
- <th>&nbsp;</th>
196
- </tr>
197
- </table>
198
- <table class="form-table">
199
- <tr>
200
- <td colspan="5" align="center"><label for="email_to"><?php _e('E-mail database backup file to:', 'wp-dbmanager'); ?></label> <input type="text" id="email_to" name="email_to" size="30" maxlength="50" value="<?php echo get_option('admin_email'); ?>" dir="ltr" />&nbsp;&nbsp;<input type="submit" name="do" value="<?php _e('E-Mail', 'wp-dbmanager'); ?>" class="button" /></td>
201
- </tr>
202
- <tr>
203
- <td colspan="5" align="center">
204
- <input type="submit" name="do" value="<?php _e('Download', 'wp-dbmanager'); ?>" class="button" />&nbsp;&nbsp;
205
- <input type="submit" name="do" value="<?php _e('Restore', 'wp-dbmanager'); ?>" onclick="return confirm('<?php _e('You Are About To Restore A Database.\nThis Action Is Not Reversible.\nAny Data Inserted After The Backup Date Will Be Gone.\n\n Choose [Cancel] to stop, [Ok] to restore.', 'wp-dbmanager'); ?>')" class="button" />&nbsp;&nbsp;
206
- <input type="submit" class="button" name="do" value="<?php _e('Delete', 'wp-dbmanager'); ?>" onclick="return confirm('<?php _e('You Are About To Delete The Selected Database Backup Files.\nThis Action Is Not Reversible.\n\n Choose [Cancel] to stop, [Ok] to delete.', 'wp-dbmanager'); ?>')" />&nbsp;&nbsp;
207
- <input type="button" name="cancel" value="<?php _e('Cancel', 'wp-dbmanager'); ?>" class="button" onclick="javascript:history.go(-1)" /></td>
208
- </tr>
209
- </table>
210
- </div>
211
- </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ +----------------------------------------------------------------+
4
+ | |
5
+ | WordPress 2.8 Plugin: WP-DBManager 2.63 |
6
+ | Copyright (c) 2009 Lester "GaMerZ" Chan |
7
+ | |
8
+ | File Written By: |
9
+ | - Lester "GaMerZ" Chan |
10
+ | - http://lesterchan.net |
11
+ | |
12
+ | File Information: |
13
+ | - Database Restore |
14
+ | - wp-content/plugins/wp-dbmanager/database-restore.php |
15
+ | |
16
+ +----------------------------------------------------------------+
17
+ */
18
+
19
+
20
+ ### Check Whether User Can Manage Database
21
+ if(!current_user_can('manage_database')) {
22
+ die('Access Denied');
23
+ }
24
+
25
+
26
+ ### Variables Variables Variables
27
+ $base_name = plugin_basename('wp-dbmanager/database-manager.php');
28
+ $base_page = 'admin.php?page='.$base_name;
29
+ $backup = array();
30
+ $backup_options = get_option('dbmanager_options');
31
+ $backup['date'] = current_time('timestamp');
32
+ $backup['mysqldumppath'] = $backup_options['mysqldumppath'];
33
+ $backup['mysqlpath'] = $backup_options['mysqlpath'];
34
+ $backup['path'] = $backup_options['path'];
35
+ $backup['password'] = str_replace('$', '\$', DB_PASSWORD);
36
+ $backup['charset'] = ' --default-character-set="utf8"';
37
+
38
+
39
+ ### Form Processing
40
+ if($_POST['do']) {
41
+ check_admin_referer('wp-dbmanager_manage');
42
+ // Lets Prepare The Variables
43
+ $database_file = trim($_POST['database_file']);
44
+ $nice_file_date = mysql2date(sprintf(__('%s @ %s', 'wp-dbmanager'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', substr($database_file, 0, 10)));
45
+
46
+ // Decide What To Do
47
+ switch($_POST['do']) {
48
+ case __('Restore', 'wp-dbmanager'):
49
+ if(!empty($database_file)) {
50
+ $brace = (substr(PHP_OS, 0, 3) == 'WIN') ? '"' : '';
51
+ $backup['host'] = DB_HOST;
52
+ $backup['port'] = '';
53
+ $backup['sock'] = '';
54
+ if(strpos(DB_HOST, ':') !== false) {
55
+ $db_host = explode(':', DB_HOST);
56
+ $backup['host'] = $db_host[0];
57
+ if(intval($db_host[1]) != 0) {
58
+ $backup['port'] = ' --port="'.intval($db_host[1]).'"';
59
+ } else {
60
+ $backup['sock'] = ' --socket="'.$db_host[1].'"';
61
+ }
62
+ }
63
+ if(stristr($database_file, '.gz')) {
64
+ $backup['command'] = 'gunzip < '.$brace.$backup['path'].'/'.$database_file.$brace.' | '.$brace.$backup['mysqlpath'].$brace.' --host="'.$backup['host'].'" --user="'.DB_USER.'" --password="'.$backup['password'].'"'.$backup['port'].$backup['sock'].$backup['charset'].' '.DB_NAME;
65
+ } else {
66
+ $backup['command'] = $brace.$backup['mysqlpath'].$brace.' --host="'.$backup['host'].'" --user="'.DB_USER.'" --password="'.$backup['password'].'"'.$backup['port'].$backup['sock'].$backup['charset'].' '.DB_NAME.' < '.$brace.$backup['path'].'/'.$database_file.$brace;
67
+ }
68
+ passthru($backup['command'], $error);
69
+ if($error) {
70
+ $text = '<font color="red">'.sprintf(__('Database On \'%s\' Failed To Restore', 'wp-dbmanager'), $nice_file_date).'</font>';
71
+ } else {
72
+ $text = '<font color="green">'.sprintf(__('Database On \'%s\' Restored Successfully', 'wp-dbmanager'), $nice_file_date).'</font>';
73
+ }
74
+ } else {
75
+ $text = '<font color="red">'.__('No Backup Database File Selected', 'wp-dbmanager').'</font>';
76
+ }
77
+ break;
78
+ case __('E-Mail', 'wp-dbmanager'):
79
+ if(!empty($database_file)) {
80
+ // Get And Read The Database Backup File
81
+ $file_path = $backup['path'].'/'.$database_file;
82
+ $file_size = format_size(filesize($file_path));
83
+ $file_date = $nice_file_date;
84
+ $file = fopen($file_path,'rb');
85
+ $file_data = fread($file,filesize($file_path));
86
+ fclose($file);
87
+ $file_data = chunk_split(base64_encode($file_data));
88
+ // Create Mail To, Mail Subject And Mail Header
89
+ if(!empty($_POST['email_to'])) {
90
+ $mail_to = trim($_POST['email_to']);
91
+ } else {
92
+ $mail_to = get_option('admin_email');
93
+ }
94
+ $mail_subject = sprintf(__('%s Database Backup File For %s', 'wp-dbmanager'), wp_specialchars_decode(get_option('blogname')), $file_date);
95
+ $mail_header = 'From: '.wp_specialchars_decode(get_option('blogname')).' Administrator <'.get_option('admin_email').'>';
96
+ // MIME Boundary
97
+ $random_time = md5(time());
98
+ $mime_boundary = "==WP-DBManager- $random_time";
99
+ // Create Mail Header And Mail Message
100
+ $mail_header .= "\nMIME-Version: 1.0\n" .
101
+ "Content-Type: multipart/mixed;\n" .
102
+ " boundary=\"{$mime_boundary}\"";
103
+ $mail_message = __('Website Name:', 'wp-dbmanager').' '.wp_specialchars_decode(get_option('blogname'))."\n".
104
+ __('Website URL:', 'wp-dbmanager').' '.get_bloginfo('siteurl')."\n".
105
+ __('Backup File Name:', 'wp-dbmanager').' '.$database_file."\n".
106
+ __('Backup File Date:', 'wp-dbmanager').' '.$file_date."\n".
107
+ __('Backup File Size:', 'wp-dbmanager').' '.$file_size."\n\n".
108
+ __('With Regards,', 'wp-dbmanager')."\n".
109
+ wp_specialchars_decode(get_option('blogname')).' '. __('Administrator', 'wp-dbmanager')."\n".
110
+ get_bloginfo('siteurl');
111
+ $mail_message = "This is a multi-part message in MIME format.\n\n" .
112
+ "--{$mime_boundary}\n" .
113
+ "Content-Type: text/plain; charset=\"utf-8\"\n" .
114
+ "Content-Transfer-Encoding: 7bit\n\n".$mail_message."\n\n";
115
+ $mail_message .= "--{$mime_boundary}\n" .
116
+ "Content-Type: application/octet-stream;\n" .
117
+ " name=\"$database_file\"\n" .
118
+ "Content-Disposition: attachment;\n" .
119
+ " filename=\"$database_file\"\n" .
120
+ "Content-Transfer-Encoding: base64\n\n" .
121
+ $file_data."\n\n--{$mime_boundary}--\n";
122
+ if(mail($mail_to, $mail_subject, $mail_message, $mail_header)) {
123
+ $text .= '<font color="green">'.sprintf(__('Database Backup File For \'%s\' Successfully E-Mailed To \'%s\'', 'wp-dbmanager'), $file_date, $mail_to).'</font><br />';
124
+ } else {
125
+ $text = '<font color="red">'.sprintf(__('Unable To E-Mail Database Backup File For \'%s\' To \'%s\'', 'wp-dbmanager'), $file_date, $mail_to).'</font>';
126
+ }
127
+ } else {
128
+ $text = '<font color="red">'.__('No Backup Database File Selected', 'wp-dbmanager').'</font>';
129
+ }
130
+ break;
131
+ case __('Download', 'wp-dbmanager'):
132
+ if(empty($database_file)) {
133
+ $text = '<font color="red">'.__('No Backup Database File Selected', 'wp-dbmanager').'</font>';
134
+ }
135
+ break;
136
+ case __('Delete', 'wp-dbmanager'):
137
+ if(!empty($database_file)) {
138
+ if(is_file($backup['path'].'/'.$database_file)) {
139
+ if(!unlink($backup['path'].'/'.$database_file)) {
140
+ $text .= '<font color="red">'.sprintf(__('Unable To Delete Database Backup File On \'%s\'', 'wp-dbmanager'), $nice_file_date).'</font><br />';
141
+ } else {
142
+ $text .= '<font color="green">'.sprintf(__('Database Backup File On \'%s\' Deleted Successfully', 'wp-dbmanager'), $nice_file_date).'</font><br />';
143
+ }
144
+ } else {
145
+ $text = '<font color="red">'.sprintf(__('Invalid Database Backup File On \'%s\'', 'wp-dbmanager'), $nice_file_date).'</font>';
146
+ }
147
+ } else {
148
+ $text = '<font color="red">'.__('No Backup Database File Selected', 'wp-dbmanager').'</font>';
149
+ }
150
+ break;
151
+ }
152
+ }
153
+ ?>
154
+ <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
155
+ <!-- Manage Backup Database -->
156
+ <form method="post" action="<?php echo admin_url('admin.php?page='.plugin_basename(__FILE__)); ?>">
157
+ <?php wp_nonce_field('wp-dbmanager_manage'); ?>
158
+ <div class="wrap">
159
+ <div id="icon-wp-dbmanager" class="icon32"><br /></div>
160
+ <h2><?php _e('Manage Backup Database', 'wp-dbmanager'); ?></h2>
161
+ <p><?php _e('Choose A Backup Date To E-Mail, Restore, Download Or Delete', 'wp-dbmanager'); ?></p>
162
+ <table class="widefat">
163
+ <thead>
164
+ <tr>
165
+ <th><?php _e('No.', 'wp-dbmanager'); ?></th>
166
+ <th><?php _e('Database File', 'wp-dbmanager'); ?></th>
167
+ <th><?php _e('Date/Time', 'wp-dbmanager'); ?></th>
168
+ <th><?php _e('Size', 'wp-dbmanager'); ?></th>
169
+ <th><?php _e('Select', 'wp-dbmanager'); ?></th>
170
+ </tr>
171
+ </thead>
172
+ <?php
173
+ if(!is_emtpy_folder($backup['path'])) {
174
+ if ($handle = opendir($backup['path'])) {
175
+ $database_files = array();
176
+ while (false !== ($file = readdir($handle))) {
177
+ if ($file != '.' && $file != '..' && $file != '.htaccess' && (file_ext($file) == 'sql' || file_ext($file) == 'gz')) {
178
+ $database_files[] = $file;
179
+ }
180
+ }
181
+ closedir($handle);
182
+ sort($database_files);
183
+ for($i = (sizeof($database_files)-1); $i > -1; $i--) {
184
+ if($no%2 == 0) {
185
+ $style = '';
186
+ } else {
187
+ $style = ' class="alternate"';
188
+ }
189
+ $no++;
190
+ $database_text = substr($database_files[$i], 13);
191
+ $date_text = mysql2date(sprintf(__('%s @ %s', 'wp-dbmanager'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', substr($database_files[$i], 0, 10)));
192
+ $size_text = filesize($backup['path'].'/'.$database_files[$i]);
193
+ echo "<tr$style>\n";
194
+ echo '<td>'.number_format_i18n($no).'</td>';
195
+ echo "<td>$database_text</td>";
196
+ echo "<td>$date_text</td>";
197
+ echo '<td>'.format_size($size_text).'</td>';
198
+ echo "<td><input type=\"radio\" name=\"database_file\" value=\"$database_files[$i]\" /></td>\n</tr>\n";
199
+ $totalsize += $size_text;
200
+ }
201
+ } else {
202
+ echo '<tr><td align="center" colspan="5">'.__('There Are No Database Backup Files Available.', 'wp-dbmanager').'</td></tr>';
203
+ }
204
+ } else {
205
+ echo '<tr><td align="center" colspan="5">'.__('There Are No Database Backup Files Available.', 'wp-dbmanager').'</td></tr>';
206
+ }
207
+ ?>
208
+ <tr class="thead">
209
+ <th colspan="3"><?php printf(_n('%s Backup File', '%s Backup Files', $no, 'wp-dbmanager'), number_format_i18n($no)); ?></th>
210
+ <th><?php echo format_size($totalsize); ?></th>
211
+ <th>&nbsp;</th>
212
+ </tr>
213
+ </table>
214
+ <table class="form-table">
215
+ <tr>
216
+ <td colspan="5" align="center"><label for="email_to"><?php _e('E-mail database backup file to:', 'wp-dbmanager'); ?></label> <input type="text" id="email_to" name="email_to" size="30" maxlength="50" value="<?php echo get_option('admin_email'); ?>" dir="ltr" />&nbsp;&nbsp;<input type="submit" name="do" value="<?php _e('E-Mail', 'wp-dbmanager'); ?>" class="button" /></td>
217
+ </tr>
218
+ <tr>
219
+ <td colspan="5" align="center">
220
+ <input type="submit" name="do" value="<?php _e('Download', 'wp-dbmanager'); ?>" class="button" />&nbsp;&nbsp;
221
+ <input type="submit" name="do" value="<?php _e('Restore', 'wp-dbmanager'); ?>" onclick="return confirm('<?php _e('You Are About To Restore A Database.\nThis Action Is Not Reversible.\nAny Data Inserted After The Backup Date Will Be Gone.\n\n Choose [Cancel] to stop, [Ok] to restore.', 'wp-dbmanager'); ?>')" class="button" />&nbsp;&nbsp;
222
+ <input type="submit" class="button" name="do" value="<?php _e('Delete', 'wp-dbmanager'); ?>" onclick="return confirm('<?php _e('You Are About To Delete The Selected Database Backup Files.\nThis Action Is Not Reversible.\n\n Choose [Cancel] to stop, [Ok] to delete.', 'wp-dbmanager'); ?>')" />&nbsp;&nbsp;
223
+ <input type="button" name="cancel" value="<?php _e('Cancel', 'wp-dbmanager'); ?>" class="button" onclick="javascript:history.go(-1)" /></td>
224
+ </tr>
225
+ </table>
226
+ </div>
227
+ </form>
database-manager.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  +----------------------------------------------------------------+
4
  | |
5
- | WordPress 2.8 Plugin: WP-DBManager 2.50 |
6
  | Copyright (c) 2009 Lester "GaMerZ" Chan |
7
  | |
8
  | File Written By: |
2
  /*
3
  +----------------------------------------------------------------+
4
  | |
5
+ | WordPress 2.8 Plugin: WP-DBManager 2.63 |
6
  | Copyright (c) 2009 Lester "GaMerZ" Chan |
7
  | |
8
  | File Written By: |
database-optimize.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  +----------------------------------------------------------------+
4
  | |
5
- | WordPress 2.8 Plugin: WP-DBManager 2.50 |
6
  | Copyright (c) 2009 Lester "GaMerZ" Chan |
7
  | |
8
  | File Written By: |
@@ -35,6 +35,7 @@ if($_POST['do']) {
35
  // Decide What To Do
36
  switch($_POST['do']) {
37
  case __('Optimize', 'wp-dbmanager'):
 
38
  if(!empty($optimize)) {
39
  foreach($optimize as $key => $value) {
40
  if($value == 'yes') {
@@ -64,7 +65,8 @@ $tables = $wpdb->get_col("SHOW TABLES");
64
  ?>
65
  <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
66
  <!-- Optimize Database -->
67
- <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo plugin_basename(__FILE__); ?>">
 
68
  <div class="wrap">
69
  <div id="icon-wp-dbmanager" class="icon32"><br /></div>
70
  <h2><?php _e('Optimize Database', 'wp-dbmanager'); ?></h2>
2
  /*
3
  +----------------------------------------------------------------+
4
  | |
5
+ | WordPress 2.8 Plugin: WP-DBManager 2.63 |
6
  | Copyright (c) 2009 Lester "GaMerZ" Chan |
7
  | |
8
  | File Written By: |
35
  // Decide What To Do
36
  switch($_POST['do']) {
37
  case __('Optimize', 'wp-dbmanager'):
38
+ check_admin_referer('wp-dbmanager_optimize');
39
  if(!empty($optimize)) {
40
  foreach($optimize as $key => $value) {
41
  if($value == 'yes') {
65
  ?>
66
  <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
67
  <!-- Optimize Database -->
68
+ <form method="post" action="<?php echo admin_url('admin.php?page='.plugin_basename(__FILE__)); ?>">
69
+ <?php wp_nonce_field('wp-dbmanager_optimize'); ?>
70
  <div class="wrap">
71
  <div id="icon-wp-dbmanager" class="icon32"><br /></div>
72
  <h2><?php _e('Optimize Database', 'wp-dbmanager'); ?></h2>
database-repair.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  +----------------------------------------------------------------+
4
  | |
5
- | WordPress 2.8 Plugin: WP-DBManager 2.50 |
6
  | Copyright (c) 2009 Lester "GaMerZ" Chan |
7
  | |
8
  | File Written By: |
@@ -34,7 +34,8 @@ if($_POST['do']) {
34
 
35
  // Decide What To Do
36
  switch($_POST['do']) {
37
- case 'Repair':
 
38
  if(!empty($repair)) {
39
  foreach($repair as $key => $value) {
40
  if($value == 'yes') {
@@ -64,7 +65,8 @@ $tables = $wpdb->get_col("SHOW TABLES");
64
  ?>
65
  <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
66
  <!-- Repair Database -->
67
- <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo plugin_basename(__FILE__); ?>">
 
68
  <div class="wrap">
69
  <div id="icon-wp-dbmanager" class="icon32"><br /></div>
70
  <h2><?php _e('Repair Database', 'wp-dbmanager'); ?></h2>
2
  /*
3
  +----------------------------------------------------------------+
4
  | |
5
+ | WordPress 2.8 Plugin: WP-DBManager 2.63 |
6
  | Copyright (c) 2009 Lester "GaMerZ" Chan |
7
  | |
8
  | File Written By: |
34
 
35
  // Decide What To Do
36
  switch($_POST['do']) {
37
+ case __('Repair', 'wp-dbmanager'):
38
+ check_admin_referer('wp-dbmanager_repair');
39
  if(!empty($repair)) {
40
  foreach($repair as $key => $value) {
41
  if($value == 'yes') {
65
  ?>
66
  <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
67
  <!-- Repair Database -->
68
+ <form method="post" action="<?php echo admin_url('admin.php?page='.plugin_basename(__FILE__)); ?>">
69
+ <?php wp_nonce_field('wp-dbmanager_repair'); ?>
70
  <div class="wrap">
71
  <div id="icon-wp-dbmanager" class="icon32"><br /></div>
72
  <h2><?php _e('Repair Database', 'wp-dbmanager'); ?></h2>
database-run.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  +----------------------------------------------------------------+
4
  | |
5
- | WordPress 2.8 Plugin: WP-DBManager 2.50 |
6
  | Copyright (c) 2009 Lester "GaMerZ" Chan |
7
  | |
8
  | File Written By: |
@@ -39,6 +39,7 @@ if($_POST['do']) {
39
  // Decide What To Do
40
  switch($_POST['do']) {
41
  case __('Run', 'wp-dbmanager'):
 
42
  $sql_queries2 = trim($_POST['sql_query']);
43
  $totalquerycount = 0;
44
  $successquery = 0;
@@ -81,7 +82,8 @@ if($_POST['do']) {
81
  ?>
82
  <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
83
  <!-- Run SQL Query -->
84
- <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo plugin_basename(__FILE__); ?>">
 
85
  <div class="wrap">
86
  <div id="icon-wp-dbmanager" class="icon32"><br /></div>
87
  <h2><?php _e('Run SQL Query', 'wp-dbmanager'); ?></h2>
2
  /*
3
  +----------------------------------------------------------------+
4
  | |
5
+ | WordPress 2.8 Plugin: WP-DBManager 2.63 |
6
  | Copyright (c) 2009 Lester "GaMerZ" Chan |
7
  | |
8
  | File Written By: |
39
  // Decide What To Do
40
  switch($_POST['do']) {
41
  case __('Run', 'wp-dbmanager'):
42
+ check_admin_referer('wp-dbmanager_run');
43
  $sql_queries2 = trim($_POST['sql_query']);
44
  $totalquerycount = 0;
45
  $successquery = 0;
82
  ?>
83
  <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
84
  <!-- Run SQL Query -->
85
+ <form method="post" action="<?php echo admin_url('admin.php?page='.plugin_basename(__FILE__)); ?>">
86
+ <?php wp_nonce_field('wp-dbmanager_run'); ?>
87
  <div class="wrap">
88
  <div id="icon-wp-dbmanager" class="icon32"><br /></div>
89
  <h2><?php _e('Run SQL Query', 'wp-dbmanager'); ?></h2>
database-uninstall.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  +----------------------------------------------------------------+
4
  | |
5
- | WordPress 2.8 Plugin: WP-DBManager 2.50 |
6
  | Copyright (c) 2009 Lester "GaMerZ" Chan |
7
  | |
8
  | File Written By: |
@@ -37,6 +37,7 @@ if(!empty($_POST['do'])) {
37
  switch($_POST['do']) {
38
  // Uninstall WP-DBManager
39
  case __('UNINSTALL WP-DBManager', 'wp-dbmanager') :
 
40
  if(trim($_POST['uninstall_db_yes']) == 'yes') {
41
  echo '<div id="message" class="updated fade">';
42
  echo '<p>';
@@ -84,7 +85,8 @@ switch($mode) {
84
  default:
85
  ?>
86
  <!-- Uninstall WP-DBManager -->
87
- <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo plugin_basename(__FILE__); ?>">
 
88
  <div class="wrap">
89
  <div id="icon-wp-dbmanager" class="icon32"><br /></div>
90
  <h2><?php _e('Uninstall WP-DBManager', 'wp-dbmanager'); ?></h2>
2
  /*
3
  +----------------------------------------------------------------+
4
  | |
5
+ | WordPress 2.8 Plugin: WP-DBManager 2.63 |
6
  | Copyright (c) 2009 Lester "GaMerZ" Chan |
7
  | |
8
  | File Written By: |
37
  switch($_POST['do']) {
38
  // Uninstall WP-DBManager
39
  case __('UNINSTALL WP-DBManager', 'wp-dbmanager') :
40
+ check_admin_referer('wp-dbmanager_uninstall');
41
  if(trim($_POST['uninstall_db_yes']) == 'yes') {
42
  echo '<div id="message" class="updated fade">';
43
  echo '<p>';
85
  default:
86
  ?>
87
  <!-- Uninstall WP-DBManager -->
88
+ <form method="post" action="<?php echo admin_url('admin.php?page='.plugin_basename(__FILE__)); ?>">
89
+ <?php wp_nonce_field('wp-dbmanager_uninstall'); ?>
90
  <div class="wrap">
91
  <div id="icon-wp-dbmanager" class="icon32"><br /></div>
92
  <h2><?php _e('Uninstall WP-DBManager', 'wp-dbmanager'); ?></h2>
readme.html DELETED
@@ -1,490 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
- <head>
4
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5
- <title>WP-DBManager 2.50 Readme</title>
6
- <style type="text/css" media="screen">
7
- /* Default Style */
8
- BODY {
9
- font-family: Verdana, Arial;
10
- font-size: 12px;
11
- color: #000000;
12
- background: #FFFFFF;
13
- }
14
- P {
15
- padding-left: 10px;
16
- }
17
- BLOCKQUOTE {
18
- margin: 10px 20px 0px 20px;
19
- padding: 10px;
20
- border: 1px solid #8d8d8d;
21
- background-color: #f5f5f5;
22
- }
23
- LI {
24
- margin-top: 20px;
25
- }
26
- UL LI UL LI {
27
- margin-top: 10px;
28
- }
29
- A, A:active, A:link, A:visited {
30
- color: #2d3a4c;
31
- text-decoration: none;
32
- }
33
- A:hover {
34
- color: #5577a5;
35
- text-decoration: underline;
36
- }
37
- /* Place Holder Style */
38
- #Container {
39
- width: 780px;
40
- margin-left: auto;
41
- margin-right: auto;
42
- }
43
- #Content {
44
- background-color: #fafafa;
45
- border: 1px solid #a2b6cb;
46
- padding: 10px;
47
- margin-top: -13px;
48
- }
49
- /* Title Style */
50
- #Title {
51
- font-family: Verdana, Arial;
52
- font-size: 22px;
53
- font-weight: bold;
54
- color: #389aff;
55
- border-bottom: 1px solid #389aff;
56
- margin-bottom: 10px;
57
- }
58
- .SubTitle {
59
- font-family: Verdana, Arial;
60
- font-size: 18px;
61
- font-weight: bold;
62
- color: #5b87b4;
63
- }
64
- .SubSubTitle {
65
- font-family: Verdana, Arial;
66
- font-size: 14px;
67
- font-weight: bold;
68
- color: #73a4d6;
69
- }
70
- /* Tabs */
71
- UL#Tabs {
72
- font-family: Verdana, Arial;
73
- font-size: 12px;
74
- font-weight: bold;
75
- list-style-type: none;
76
- padding-bottom: 28px;
77
- border-bottom: 1px solid #a2b6cb;
78
- margin-bottom: 12px;
79
- z-index: 1;
80
- }
81
- #Tabs LI.Tab {
82
- float: right;
83
- height: 25px;
84
- background-color: #deedfb;
85
- margin: 2px 0px 0px 5px;
86
- border: 1px solid #a2b6cb;
87
- }
88
- #Tabs LI.Tab A {
89
- float: left;
90
- display: block;
91
- color: #666666;
92
- text-decoration: none;
93
- padding: 5px;
94
- }
95
- #Tabs LI.Tab A:hover {
96
- background-color: #bfe0fe;
97
- border-bottom: 1px solid #bfe0fe;
98
- }
99
- /* Selected Tab */
100
- #Tabs LI.SelectedTab {
101
- float: right;
102
- height: 25px;
103
- background-color: #fafafa;
104
- margin: 2px 0px 0px 5px;
105
- border-top: 1px solid #a2b6cb;
106
- border-right: 1px solid #a2b6cb;
107
- border-bottom: 1px solid #fafafa;
108
- border-left: 1px solid #a2b6cb;
109
- }
110
- #Tabs LI.SelectedTab A {
111
- float: left;
112
- display: block;
113
- color: #666666;
114
- text-decoration: none;
115
- padding: 5px;
116
- cursor: default;
117
- }
118
- /* Copyright */
119
- #Copyright {
120
- text-align: center;
121
- }
122
- </style>
123
- <script type="text/javascript">
124
- /* <![CDATA[*/
125
- // Index Page
126
- function index() {
127
- // Tab
128
- document.getElementById('IndexTab').className = 'SelectedTab';
129
- document.getElementById('ChangelogTab').className = 'Tab';
130
- document.getElementById('InstallTab').className = 'Tab';
131
- document.getElementById('UpgradeTab').className = 'Tab';
132
- document.getElementById('UsageTab').className = 'Tab';
133
- // Page
134
- document.getElementById('Index').style.display= 'block';
135
- document.getElementById('Changelog').style.display = 'none';
136
- document.getElementById('Install').style.display = 'none';
137
- document.getElementById('Upgrade').style.display = 'none';
138
- document.getElementById('Usage').style.display = 'none';
139
- }
140
- // Changelog Page
141
- function changelog() {
142
- // Tab
143
- document.getElementById('IndexTab').className = 'Tab';
144
- document.getElementById('ChangelogTab').className = 'SelectedTab';
145
- document.getElementById('InstallTab').className = 'Tab';
146
- document.getElementById('UpgradeTab').className = 'Tab';
147
- document.getElementById('UsageTab').className = 'Tab';
148
- // Page
149
- document.getElementById('Index').style.display = 'none';
150
- document.getElementById('Changelog').style.display = 'block';
151
- document.getElementById('Install').style.display = 'none';
152
- document.getElementById('Upgrade').style.display = 'none';
153
- document.getElementById('Usage').style.display = 'none';
154
- }
155
- // Installation Page
156
- function install() {
157
- // Tab
158
- document.getElementById('IndexTab').className = 'Tab';
159
- document.getElementById('ChangelogTab').className = 'Tab';
160
- document.getElementById('InstallTab').className = 'SelectedTab';
161
- document.getElementById('UpgradeTab').className = 'Tab';
162
- document.getElementById('UsageTab').className = 'Tab';
163
- // Page
164
- document.getElementById('Index').style.display= 'none';
165
- document.getElementById('Changelog').style.display = 'none';
166
- document.getElementById('Install').style.display = 'block';
167
- document.getElementById('Upgrade').style.display = 'none';
168
- document.getElementById('Usage').style.display = 'none';
169
- }
170
- // Upgrade Page
171
- function upgrade() {
172
- // Tab
173
- document.getElementById('IndexTab').className = 'Tab';
174
- document.getElementById('ChangelogTab').className = 'Tab';
175
- document.getElementById('InstallTab').className = 'Tab';
176
- document.getElementById('UpgradeTab').className = 'SelectedTab';
177
- document.getElementById('UsageTab').className = 'Tab';
178
- // Page
179
- document.getElementById('Index').style.display= 'none';
180
- document.getElementById('Changelog').style.display = 'none';
181
- document.getElementById('Install').style.display = 'none';
182
- document.getElementById('Upgrade').style.display = 'block';
183
- document.getElementById('Usage').style.display = 'none';
184
- }
185
- // Usage Page
186
- function usage() {
187
- // Tab
188
- document.getElementById('IndexTab').className = 'Tab';
189
- document.getElementById('ChangelogTab').className = 'Tab';
190
- document.getElementById('InstallTab').className = 'Tab';
191
- document.getElementById('UpgradeTab').className = 'Tab';
192
- document.getElementById('UsageTab').className = 'SelectedTab';
193
- // Page
194
- document.getElementById('Index').style.display= 'none';
195
- document.getElementById('Changelog').style.display = 'none';
196
- document.getElementById('Install').style.display = 'none';
197
- document.getElementById('Upgrade').style.display = 'none';
198
- document.getElementById('Usage').style.display = 'block';
199
- }
200
- /* ]]> */
201
- </script>
202
- </head>
203
- <body>
204
- <div id="Container">
205
- <!-- Title -->
206
- <div id="Title">WP-DBManager 2.50&nbsp;&nbsp;&nbsp;<span style="color: #aaaaaa;">Readme</span></div>
207
-
208
- <!-- Tabs -->
209
- <ul id="Tabs">
210
- <li id="UsageTab" class="Tab"><a href="#Usage" onclick="usage(); return false;" title="Usage Instructions">Usage</a></li>
211
- <li id="UpgradeTab" class="Tab"><a href="#Upgrade" onclick="upgrade(); return false;" title="Upgrade Instructions">Upgrade</a></li>
212
- <li id="InstallTab" class="Tab"><a href="#Installation" onclick="install(); return false;" title="Installation Instructions">Installation</a></li>
213
- <li id="ChangelogTab" class="Tab"><a href="#Changelog" onclick="changelog(); return false;" title="Changelog">Changelog</a></li>
214
- <li id="IndexTab" class="SelectedTab"><a href="#Index" onclick="index(); return false;" title="Index Instructions">Index</a></li>
215
- </ul>
216
-
217
- <!-- Content -->
218
- <div id="Content">
219
- <!-- Index -->
220
- <div id="Index">
221
- <div class="SubTitle">&raquo; Index</div>
222
- <div class="SubSubTitle">Plugin Information</div>
223
- <p>
224
- <strong>Author:</strong><br />
225
- <strong>&raquo;</strong> Lester 'GaMerZ' Chan
226
- </p>
227
- <p>
228
- <strong>Website:</strong><br />
229
- <strong>&raquo;</strong> <a href="http://lesterchan.net/" title="http://lesterchan.net/">http://lesterchan.net/</a>
230
- </p>
231
- <p>
232
- <strong>Features:</strong><br />
233
- <strong>&raquo;</strong> Manages your Wordpress database. Allows you to optimize database, repair database, backup database, restore database, delete backup database , drop/empty tables and run selected queries. Supports automatic scheduling of backing up and optimizing of database.
234
- </p>
235
- <p>
236
- <strong>Download:</strong><br />
237
- <strong>&raquo;</strong> <a href="http://downloads.wordpress.org/plugin/wp-dbmanager.2.50.zip" title="http://downloads.wordpress.org/plugin/wp-dbmanager.2.50.zip">WP-DBManager 2.50 For WordPress 2.8.x</a><br />
238
- <strong>&raquo;</strong> <a href="http://downloads.wordpress.org/plugin/wp-dbmanager.2.40.zip" title="http://downloads.wordpress.org/plugin/wp-dbmanager.2.40.zip">WP-DBManager 2.40 For WordPress 2.7.x</a><br />
239
- <strong>&raquo;</strong> <a href="http://downloads.wordpress.org/plugin/wp-dbmanager.2.31.zip" title="http://downloads.wordpress.org/plugin/wp-dbmanager.2.31.zip">WP-DBManager 2.31 For WordPress 2.1.x To 2.6.x</a><br />
240
- <strong>&raquo;</strong> <a href="http://downloads.wordpress.org/plugin/wp-dbmanager.2.05.zip" title="http://downloads.wordpress.org/plugin/wp-dbmanager.2.05.zip">WP-DBManager 2.05 For WordPress 2.0.x</a><br />
241
- <strong>&raquo;</strong> <a href="http://downloads.wordpress.org/plugin/wp-dbmanager.1.00.zip" title="http://downloads.wordpress.org/plugin/wp-dbmanager.1.00.zip">WP-DBManager 1.00 For WordPress 1.5.2</a>
242
- </p>
243
- <p>
244
- <strong>Screenshots:</strong><br />
245
- <strong>&raquo;</strong> <a href="http://lesterchan.net/wordpress/screenshots/browse/wp-dbmanager/" title="http://lesterchan.net/wordpress/screenshots/browse/wp-dbmanager/">http://lesterchan.net/wordpress/screenshots/browse/wp-dbmanager/</a>
246
- </p>
247
- <p>
248
- <strong>Demo:</strong><br />
249
- <strong>&raquo;</strong> N/A
250
- </p>
251
- <p>
252
- <strong>Development:</strong><br />
253
- <strong>&raquo;</strong> <a href="http://dev.wp-plugins.org/browser/wp-dbmanager/" title="http://dev.wp-plugins.org/browser/wp-dbmanager/">http://dev.wp-plugins.org/browser/wp-dbmanager/</a>
254
- </p>
255
- <p>
256
- <strong>Translations:</strong><br />
257
- <strong>&raquo;</strong> <a href="http://dev.wp-plugins.org/browser/wp-dbmanager/i18n/" title="http://dev.wp-plugins.org/browser/wp-dbmanager/i18n/">http://dev.wp-plugins.org/browser/wp-dbmanager/i18n/</a>
258
- </p>
259
- <p>
260
- <strong>Support Forums:</strong><br />
261
- <strong>&raquo;</strong> <a href="http://forums.lesterchan.net/index.php?board=11.0" title="http://forums.lesterchan.net/index.php?board=11.0">http://forums.lesterchan.net/index.php?board=11.0</a>
262
- </p>
263
- <p>
264
- <strong>Credits:</strong><br />
265
- <strong>&raquo;</strong> __ngetext() by <a href="http://hweia.ru/" title="http://hweia.ru/">Anna Ozeritskaya</a>.<br />
266
- <strong>&raquo;</strong> Right To Left Language Support by <a href="http://persian-programming.com/" title="http://persian-programming.com/">Kambiz R. Khojasteh</a>.
267
- </p>
268
- <p>
269
- <strong>Note:</strong><br />
270
- <strong>&raquo;</strong> The <strong>Changelog</strong>, <strong>Installation</strong>, <strong>Upgrade</strong>, <strong>Usage</strong> Tab at the top of the page.
271
- </p>
272
- <p>
273
- <strong>Donations:</strong><br />
274
- <strong>&raquo;</strong> I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks as my school allowance, I will really appericiate it. If not feel free to use it without any obligations. Thank You. My Paypal account is
275
- <script type="text/javascript">
276
- /* <![CDATA[*/
277
- document.write(' <strong>lesterchan@gmail.com</strong>.');
278
- /* ]]> */
279
- </script>
280
- </p>
281
- </div>
282
-
283
- <!-- Changelog -->
284
- <div id="Changelog" style="display: none;">
285
- <div class="SubTitle">&raquo; Changelog</div>
286
- <ul>
287
- <li>
288
- <strong>Version 2.50 (01-06-2009)</strong>
289
- <ul>
290
- <li>NEW: Works For WordPress 2.8 Only</li>
291
- <li>NEW: Uses jQuery Framework</li>
292
- <li>NEW: Ensure That .htaccess Is In Backup Folder By Informing The User If It Is NOT There</li>
293
- <li>NEW: Use _n() Instead Of __ngettext() And _n_noop() Instead Of __ngettext_noop()</li>
294
- <li>FIXED: Uses $_SERVER['PHP_SELF'] With plugin_basename(__FILE__) Instead Of Just $_SERVER['REQUEST_URI']</li>
295
- </ul>
296
- </li>
297
- <li>
298
- <strong>Version 2.40 (12-12-2008)</strong>
299
- <ul>
300
- <li>NEW: Works For WordPress 2.7 Only</li>
301
- <li>NEW: Load Admin JS And CSS Only In WP-DBManager Admin Pages</li>
302
- <li>NEW: Added database-admin-css.css For WP-DBManager Admin CSS Styles</li>
303
- <li>NEW: Uses admin_url(), plugins_url() And site_url()</li>
304
- <li>NEW: Better Translation Using __ngetext() by <a href="http://hweia.ru/" title="http://hweia.ru/">Anna Ozeritskaya</a></li>
305
- <li>NEW: Right To Left Language Support by <a href="http://persian-programming.com/" title="http://persian-programming.com/">Kambiz R. Khojasteh</a></li>
306
- <li>FIXED: SSL Support</li>
307
- <li>FIXED: Bug In Downloading Backups In Other Languages by <a href="http://persian-programming.com/" title="http://persian-programming.com/">Kambiz R. Khojasteh</a></li>
308
- <li>FIXED: Bug In Backup/Restore On Windows Server When Path To mysqldump/mysql Or Backup File Contains Space <a href="http://persian-programming.com/" title="http://persian-programming.com/">Kambiz R. Khojasteh</a></li>
309
- <li>FIXED: In database-manage.php, $nice_file_date Was Calculated More Than Once by <a href="http://persian-programming.com/" title="http://persian-programming.com/">Kambiz R. Khojasteh</a></li>
310
- <li>FIXED: Returning Only DBManager Cron Schedules</li>
311
- </ul>
312
- </li>
313
- <li>
314
- <strong>Version 2.31 (16-07-2008)</strong>
315
- <ul>
316
- <li>NEW: Works For WordPress 2.6</li>
317
- <li>FIXED: Unable To Optimize Or Repair Tables If Table Name Contains - (dash)</li>
318
- </ul>
319
- </li>
320
- <li>
321
- <strong>Version 2.30 (01-06-2008)</strong>
322
- <ul>
323
- <li>NEW: Uses /wp-dbmanager/ Folder Instead Of /dbmanager/</li>
324
- <li>NEW: Uses wp-dbmanager.php Instead Of dbmanager.php</li>
325
- <li>NEW: Added Minute(s) Option To Backup And Optimize Cron Jobs</li>
326
- <li>NEW: Uses GiB, MiB, KiB Instead Of GB, MB, KB</li>
327
- </ul>
328
- </li>
329
- <li>
330
- <strong>Version 2.20 (01-10-2007)</strong>
331
- <ul>
332
- <li>NEW: Added --skip-lock-tables Argument When Backing Up Database</li>
333
- <li>NEW: Limit The Maximum Number Of Backup Files In The Backup Folder</li>
334
- <li>NEW: Ability To Uninstall WP-DBManager</li>
335
- </ul>
336
- </li>
337
- <li>
338
- <strong>Version 2.11 (01-06-2007)</strong>
339
- <ul>
340
- <li>NEW: Sort Database Backup Files By Date In Descending Order</li>
341
- <li>NEW: Added Repair Database Feature</li>
342
- <li>NEW: Automatic Scheduling Of Backing Up And Optimizing Of Database</li>
343
- </ul>
344
- </li>
345
- <li>
346
- <strong>Version 2.10 (01-02-2007)</strong>
347
- <ul>
348
- <li>NEW: Works For WordPress 2.1 Only</li>
349
- <li>NEW: Removed database-config.php</li>
350
- <li>NEW: Localize WP-DBManager</li>
351
- <li>NEW: Added The Ability To Auto Detect MYSQL And MYSQL Dump Path</li>
352
- </ul>
353
- </li>
354
- <li>
355
- <strong>Version 2.05 (01-06-2006)</strong>
356
- <ul>
357
- <li>FIXED: Database Table Names Not Appearing Correctly</li>
358
- <li>NEW: DBManager Administration Panel Is XHTML 1.0 Transitional</li>
359
- </ul>
360
- </li>
361
- <li>
362
- <strong>Version 2.04 (10-05-2006)</strong>
363
- <ul>
364
- <li>FIXED: Unable To Download Backup DB Due To Header Sent Error</li>
365
- <li>FIXED: Some XHTML Code Fixes</li>
366
- </ul>
367
- </li>
368
- <li>
369
- <strong>Version 2.03 (01-04-2006)</strong>
370
- <ul>
371
- <li>FIXED: Run Query Box Too Big</li>
372
- <li>FIXED: Header Sent Error</li>
373
- <li>FIXED: Extra Slashes For Mysql/Mysql Dump Path</li>
374
- <li>FIXED: Mismatch Date Due To GMT</li>
375
- </ul>
376
- </li>
377
- <li>
378
- <strong>Version 2.02 (01-03-2006)</strong>
379
- <ul>
380
- <li>NEW: Improved On 'manage_database' Capabilities</li>
381
- <li>NEW: Added GigaBytes To File Size</li>
382
- <li>NEW: Added ALTER Statement To Allowed Queries</li>
383
- <li>NEW: Able To Empty/Drop Tables</li>
384
- <li>NEW: Able To EMail Database Backup File</li>
385
- <li>NEW: Splitted database-manager.php Into Individual Files</li>
386
- <li>NEW: Merge Restore And Delete Backup Database</li>
387
- <li>NEW: Included .htaccess File To Protect Backup Folder</li>
388
- <li>NEW: Checking Of Backup Status</li>
389
- <li>FIXED: Using Old Method To Add Submenu</li>
390
- <li>FIXED: PHP Short Tags</li>
391
- <li>FIXED: Redirect Back To The Same Page Instead Of Manage Database Page After Submitting Form</li>
392
- </ul>
393
- </li>
394
- <li>
395
- <strong>Version 2.01 (01-02-2006)</strong>
396
- <ul>
397
- <li>NEW: Added 'manage_database' Capabilities To Administrator Role</li>
398
- </ul>
399
- </li>
400
- <li>
401
- <strong>Version 2.00 (01-01-2006)</strong>
402
- <ul>
403
- <li>NEW: Compatible With WordPress 2.0 Only</li>
404
- <li>NEW: GPL License Added</li>
405
- </ul>
406
- </li>
407
- </ul>
408
- </div>
409
-
410
- <!-- Installation Instructions -->
411
- <div id="Install" style="display: none;">
412
- <div class="SubTitle">&raquo; Installation Instructions</div>
413
- <ol>
414
- <li>
415
- Open <strong>wp-content/plugins</strong> Folder
416
- </li>
417
- <li>
418
- Put:
419
- <blockquote>Folder: wp-dbmanager</blockquote>
420
- </li>
421
- <li>
422
- <strong>Activate</strong> WP-DBManager Plugin
423
- </li>
424
- <li>
425
- Open <strong>wp-content/backup-db</strong> Folder
426
- </li>
427
- <li>
428
- The script will automatically create a folder called <strong>backup-db</strong> in the wp-content folder if that folder is writable. If it is not created, please create it and CHMOD it to 777
429
- </li>
430
- <li>
431
- Renamed <strong>htaccess.txt</strong> to <strong>.htaccess</strong> file in
432
- <blockquote>Folder: wp-content/plugins/wp-dbmanager</blockquote>
433
- </li>
434
- <li>
435
- Move the <strong>.htaccess</strong> file from:
436
- <blockquote>Folder: wp-content/plugins/wp-dbmanager</blockquote>
437
- to:
438
- <blockquote>Folder: wp-content/backup-db</blockquote>
439
- </li>
440
- <li>
441
- Refer To <strong>Usage</strong> For Further Instructions
442
- </li>
443
- </ol>
444
- </div>
445
-
446
- <!-- Upgrade Instructions -->
447
- <div id="Upgrade" style="display: none;">
448
- <div class="SubTitle">&raquo; Upgrade Instructions</div>
449
- <div class="SubSubTitle">From v2.0x To v2.50</div>
450
- <ol>
451
- <li>
452
- <strong>Deactivate</strong> WP-DBManager Plugin
453
- </li>
454
- <li>
455
- Open <strong>wp-content/plugins</strong> Folder
456
- </li>
457
- <li>
458
- Put/Overwrite:
459
- <blockquote>Folder: wp-dbmanager</blockquote>
460
- </li>
461
- <li>
462
- Delete this folder if exists:
463
- <blockquote>
464
- Folder: dbmanager
465
- </blockquote>
466
- </li>
467
- <li>
468
- <strong>Activate</strong> WP-DBManager Plugin
469
- </li>
470
- <li>
471
- Refer To <strong>Usage</strong> For Further Instructions
472
- </li>
473
- </ol>
474
- </div>
475
-
476
- <!-- Usage Instructions -->
477
- <div id="Usage" style="display: none;">
478
- <div class="SubTitle">&raquo; Usage Instructions</div>
479
- <div class="SubSubTitle">General Usage</div>
480
- <ol>
481
- <li>
482
- Go to <strong>'WP-Admin -> Database -> DB Options'</strong> to configure the database options.
483
- </li>
484
- </ol>
485
- </div>
486
- </div>
487
- </div>
488
- <p id="Copyright">WP-DBManager 2.50<br />Copyright &copy; 2009 Lester 'GaMerZ' Chan. All Rights Reserved.</p>
489
- </body>
490
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -1,31 +1,191 @@
1
- === WP-DBManager ===
2
- Contributors: GamerZ
3
- Donate link: http://lesterchan.net/wordpress
4
- Tags: database, manage, wp-dbmanager, manager, table, optimize, backup, queries, query, drop, empty, tables, table, run, repair, cron, schedule, scheduling, automatic
5
- Requires at least: 2.8
6
- Stable tag: 2.50
7
-
8
- Manages your WordPress database.
9
-
10
- == Description ==
11
-
12
- Allows you to optimize database, repair database, backup database, restore database, delete backup database , drop/empty tables and run selected queries. Supports automatic scheduling of backing up and optimizing of database.
13
-
14
- All the information (general, changelog, installation, upgrade, usage) you need about this plugin can be found here: [WP-DBManager Readme](http://lesterchan.net/wordpress/readme/wp-dbmanager.html "WP-DBManager Readme").
15
- It is the exact same readme.html is included in the zip package.
16
-
17
- == Development Blog ==
18
-
19
- [GaMerZ WordPress Plugins Development Blog](http://lesterchan.net/wordpress/ "GaMerZ WordPress Plugins Development Blog")
20
-
21
- == Installation ==
22
-
23
- [WP-DBManager Readme](http://lesterchan.net/wordpress/readme/wp-dbmanager.html "WP-DBManager Readme") (Installation Tab)
24
-
25
- == Screenshots ==
26
-
27
- [WP-DBManager Screenshots](http://lesterchan.net/wordpress/screenshots/browse/wp-dbmanager/ "WP-DBManager Screenshots")
28
-
29
- == Frequently Asked Questions ==
30
-
31
- [WP-DBManager Support Forums](http://forums.lesterchan.net/index.php?board=11.0 "WP-DBManager Support Forums")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === WP-DBManager ===
2
+ Contributors: GamerZ
3
+ Donate link: http://lesterchan.net/site/donation/
4
+ Tags: database, manage, wp-dbmanager, manager, table, optimize, backup, queries, query, drop, empty, tables, table, run, repair, cron, schedule, scheduling, automatic
5
+ Requires at least: 2.8
6
+ Tested up to: 3.7
7
+ Stable tag: trunk
8
+
9
+ Manages your WordPress database.
10
+
11
+ == Description ==
12
+
13
+ Allows you to optimize database, repair database, backup database, restore database, delete backup database , drop/empty tables and run selected queries. Supports automatic scheduling of backing up, optimizing and repairing of database.
14
+
15
+ = Previous Versions =
16
+ * [WP-DBManager 2.40 For WordPress 2.7.x](http://downloads.wordpress.org/plugin/wp-dbmanager.2.40.zip "WP-DBManager 2.40 For WordPress 2.7.x")
17
+ * [WP-DBManager 2.31 For WordPress 2.1.x To 2.6.x](http://downloads.wordpress.org/plugin/wp-dbmanager.2.31.zip "WP-DBManager 2.31 For WordPress 2.1.x To 2.6.x")
18
+ * [WP-DBManager 2.05 For WordPress 2.0.x](http://downloads.wordpress.org/plugin/wp-dbmanager.2.05.zip "WP-DBManager 2.05 For WordPress 2.0.x")
19
+ * [WP-DBManager 1.00 For WordPress 1.5.2](http://downloads.wordpress.org/plugin/wp-dbmanager.1.00.zip "WP-DBManager 1.00 For WordPress 1.5.2")
20
+
21
+ = Development =
22
+ * [http://dev.wp-plugins.org/browser/wp-dbmanager/](http://dev.wp-plugins.org/browser/wp-dbmanager/ "http://dev.wp-plugins.org/browser/wp-dbmanager/")
23
+
24
+ = Translations =
25
+ * [http://dev.wp-plugins.org/browser/wp-dbmanager/i18n/](http://dev.wp-plugins.org/browser/wp-dbmanager/i18n/ "http://dev.wp-plugins.org/browser/wp-dbmanager/i18n/")
26
+
27
+ = Support Forums =
28
+ * [http://forums.lesterchan.net/index.php?board=11.0](http://forums.lesterchan.net/index.php?board=11.0 "http://forums.lesterchan.net/index.php?board=11.0")
29
+
30
+ = Credits =
31
+ * __ngetext() by [Anna Ozeritskaya](http://hweia.ru/ "Anna Ozeritskaya")
32
+ * Right To Left Language Support by [Kambiz R. Khojasteh](http://persian-programming.com/ "Kambiz R. Khojasteh")
33
+
34
+ = Donations =
35
+ * I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks, I will really appericiate it. If not feel free to use it without any obligations.
36
+
37
+ == Changelog ==
38
+ = Version 2.65 =
39
+ * FIXED: Set default character set to UTF-8. Props Karsonito
40
+
41
+ = Version 2.64 =
42
+ * FIXED: Use intval() instead of is_int() when checking for port number. Props [Webby Scots](http://webbyscots.com/ "Webby Scots")
43
+
44
+ = Version 2.63 (03-05-2011) =
45
+ * NEW: Added Auto Repair Functionality
46
+ * NEW: Added nonce To All Forms For Added Security
47
+
48
+ = Version 2.61 (30-04-2011) =
49
+ * FIXED: Checks File Extension And Sanitise File Name That Is Pass Through The URL When Downloading Database File. Props to [Joakim Jardenberg](http://jardenberg.se "Joakim Jardenberg"), [Jonas Nordstram](http://jonasnordstrom.se "Jonas Nordstr�m"), [Andreas Viklund](http://andreasviklund.com/ "Andreas Viklund")
50
+
51
+ = Version 2.60 (01-12-2009) =
52
+ * FIXED: Bug In Cron Backup On Windows Server
53
+
54
+ = Version 2.50 (01-06-2009) =
55
+ * NEW: Works For WordPress 2.8 Only
56
+ * NEW: Uses jQuery Framework
57
+ * NEW: Ensure That .htaccess Is In Backup Folder By Informing The User If It Is NOT There
58
+ * NEW: Use _n() Instead Of __ngettext() And _n_noop() Instead Of __ngettext_noop()
59
+ * FIXED: Uses $_SERVER['PHP_SELF'] With plugin_basename(__FILE__) Instead Of Just $_SERVER['REQUEST_URI']
60
+
61
+ = Version 2.40 (12-12-2008) =
62
+ * NEW: Works For WordPress 2.7 Only
63
+ * NEW: Load Admin JS And CSS Only In WP-DBManager Admin Pages
64
+ * NEW: Added database-admin-css.css For WP-DBManager Admin CSS Styles
65
+ * NEW: Uses admin_url(), plugins_url() And site_url()
66
+ * NEW: Better Translation Using __ngetext() by Anna Ozeritskaya
67
+ * NEW: Right To Left Language Support by Kambiz R. Khojasteh
68
+ * FIXED: SSL Support
69
+ * FIXED: Bug In Downloading Backups In Other Languages by Kambiz R. Khojasteh
70
+ * FIXED: Bug In Backup/Restore On Windows Server When Path To mysqldump/mysql Or Backup File Contains Space Kambiz R. Khojasteh
71
+ * FIXED: In database-manage.php, $nice_file_date Was Calculated More Than Once by Kambiz R. Khojasteh
72
+ * FIXED: Returning Only DBManager Cron Schedules
73
+
74
+ = Version 2.31 (16-07-2008) =
75
+ * NEW: Works For WordPress 2.6
76
+ * FIXED: Unable To Optimize Or Repair Tables If Table Name Contains - (dash)
77
+
78
+ = Version 2.30 (01-06-2008) =
79
+ * NEW: Uses /wp-dbmanager/ Folder Instead Of /dbmanager/
80
+ * NEW: Uses wp-dbmanager.php Instead Of dbmanager.php
81
+ * NEW: Added Minute(s) Option To Backup And Optimize Cron Jobs
82
+ * NEW: Uses GiB, MiB, KiB Instead Of GB, MB, KB
83
+
84
+ = Version 2.20 (01-10-2007) =
85
+ * NEW: Added --skip-lock-tables Argument When Backing Up Database
86
+ * NEW: Limit The Maximum Number Of Backup Files In The Backup Folder
87
+ * NEW: Ability To Uninstall WP-DBManager
88
+
89
+ = Version 2.11 (01-06-2007) =
90
+ * NEW: Sort Database Backup Files By Date In Descending Order
91
+ * NEW: Added Repair Database Feature
92
+ * NEW: Automatic Scheduling Of Backing Up And Optimizing Of Database
93
+
94
+ = Version 2.10 (01-02-2007) =
95
+ * NEW: Works For WordPress 2.1 Only
96
+ * NEW: Removed database-config.php
97
+ * NEW: Localize WP-DBManager
98
+ * NEW: Added The Ability To Auto Detect MYSQL And MYSQL Dump Path
99
+
100
+ = Version 2.05 (01-06-2006) =
101
+ * FIXED: Database Table Names Not Appearing Correctly
102
+ * NEW: DBManager Administration Panel Is XHTML 1.0 Transitional
103
+
104
+ = Version 2.04 (10-05-2006) =
105
+ * FIXED: Unable To Download Backup DB Due To Header Sent Error
106
+ * FIXED: Some XHTML Code Fixes
107
+
108
+ = Version 2.03 (01-04-2006) =
109
+ * FIXED: Run Query Box Too Big
110
+ * FIXED: Header Sent Error
111
+ * FIXED: Extra Slashes For Mysql/Mysql Dump Path
112
+ * FIXED: Mismatch Date Due To GMT
113
+
114
+ = Version 2.02 (01-03-2006) =
115
+ * NEW: Improved On 'manage_database' Capabilities
116
+ * NEW: Added GigaBytes To File Size
117
+ * NEW: Added ALTER Statement To Allowed Queries
118
+ * NEW: Able To Empty/Drop Tables
119
+ * NEW: Able To EMail Database Backup File
120
+ * NEW: Splitted database-manager.php Into Individual Files
121
+ * NEW: Merge Restore And Delete Backup Database
122
+ * NEW: Included .htaccess File To Protect Backup Folder
123
+ * NEW: Checking Of Backup Status
124
+ * FIXED: Using Old Method To Add Submenu
125
+ * FIXED: PHP Short Tags
126
+ * FIXED: Redirect Back To The Same Page Instead Of Manage Database Page After Submitting Form
127
+
128
+ = Version 2.01 (01-02-2006) =
129
+ * NEW: Added 'manage_database' Capabilities To Administrator Role
130
+
131
+ = Version 2.00 (01-01-2006) =
132
+ * NEW: Compatible With WordPress 2.0 Only
133
+ * NEW: GPL License Added
134
+
135
+ == Installation ==
136
+
137
+ 1. Open `wp-content/plugins` Folder
138
+ 2. Put: `Folder: wp-dbmanager`
139
+ 3. Activate `WP-DBManager` Plugin
140
+ 4. Rename `htaccess.txt` to `.htaccess` file in `Folder: wp-content/plugins/wp-dbmanager`
141
+ 5. The script will automatically create a folder called `backup-db` in the wp-content folder if that folder is writable. If it is not created, please create it and CHMOD it to 777
142
+ 6. Open `Folder: wp-content/backup-db`
143
+ 7. Move the `.htaccess` file from `Folder: wp-content/plugins/wp-dbmanager` to `Folder: wp-content/backup-db`
144
+ 8. Go to `WP-Admin -> Database -> DB Options` to configure the database options.
145
+
146
+ == Upgrading ==
147
+
148
+ 1. Deactivate `WP-DBManager` Plugin
149
+ 2. Open `wp-content/plugins` Folder
150
+ 3. Put/Overwrite: `Folder: wp-dbmanager`
151
+ 4. Activate `WP-DBManager` Plugin
152
+ 5. Go to `WP-Admin -> Database -> DB Options` to re-configure the database options.
153
+
154
+ == Upgrade Notice ==
155
+
156
+ N/A
157
+
158
+ == Screenshots ==
159
+
160
+ 1. Admin - Backup DB
161
+ 2. Admin - Empty/Drop Tables In DB
162
+ 3. Admin - DB Information
163
+ 4. Admin - Manage DB
164
+ 5. Admin - Optimize DB
165
+ 6. Admin - DB Options
166
+ 7. Admin - DB Options
167
+ 8. Admin - Repair DB
168
+ 9. Admin - Run Query in DB
169
+
170
+ == Frequently Asked Questions ==
171
+
172
+ = My database is not backed up / My backup file is 0Kb =
173
+ * Ensure that your host allows you to access mysqldump. You can try to narrow the problem by Debugging via SSH:
174
+ 1. In `wp-dbmanager.php`
175
+ 2. Find `check_backup_files();` on line 243
176
+ 3. Add below it `echo $command;`
177
+ 4. Go to `WP-Admin -> Database -> Backup`
178
+ 5. Click `Backup`
179
+ 6. It should print some debugging statements
180
+ 7. Copy that line than run it in SSH
181
+ 8. If you need help on SSH contact your host or google for more info
182
+
183
+
184
+ = What is the difference between WP-DBManager and WP-DB-Backup? =
185
+ * WP-DBManager uses `mysqldump` application to generate the backup and `mysql` application to restore them via shell.
186
+ * WP-DB-Backup uses PHP to generate the backup. In some cases WP-DB-Backup will work better for you because it requires less permissions. Not all host allows you to access mysqldump/mysql directly via shell.
187
+ * WP-DBManager allows you to have automatic optimizing and repairing of database on top of backing up of database.
188
+
189
+ = Why do I get the message "Warning: Your backup folder MIGHT be visible to the public!"? =
190
+ * Ensure that you have renamed `htaccess.txt` to `.htaccess` and placed it in your backup folder (defaults to `wp-content/backup-db/`)
191
+ * If you are 100% sure you have did that and have verfied that the folder no longer is accessible to the public by visiting the URL `http://yousite.com/wp-content/backup-db/`, you can safely remove it by deleting `add_action('admin_notices', 'dbmanager_admin_notices');` on `line 204` in `wp-dbmanager.php`.
screenshot-1.png ADDED
Binary file
screenshot-2.png ADDED
Binary file
screenshot-3.png ADDED
Binary file
screenshot-4.png ADDED
Binary file
screenshot-5.png ADDED
Binary file
screenshot-6.png ADDED
Binary file
screenshot-7.png ADDED
Binary file
screenshot-8.png ADDED
Binary file
screenshot-9.png ADDED
Binary file
wp-dbmanager.mo DELETED
Binary file
wp-dbmanager.php CHANGED
@@ -1,525 +1,604 @@
1
- <?php
2
- /*
3
- Plugin Name: WP-DBManager
4
- Plugin URI: http://lesterchan.net/portfolio/programming/php/
5
- Description: Manages your Wordpress database. Allows you to optimize database, repair database, backup database, restore database, delete backup database , drop/empty tables and run selected queries. Supports automatic scheduling of backing up and optimizing of database.
6
- Version: 2.50
7
- Author: Lester 'GaMerZ' Chan
8
- Author URI: http://lesterchan.net
9
- */
10
-
11
-
12
- /*
13
- Copyright 2009 Lester Chan (email : lesterchan@gmail.com)
14
-
15
- This program is free software; you can redistribute it and/or modify
16
- it under the terms of the GNU General Public License as published by
17
- the Free Software Foundation; either version 2 of the License, or
18
- (at your option) any later version.
19
-
20
- This program is distributed in the hope that it will be useful,
21
- but WITHOUT ANY WARRANTY; without even the implied warranty of
22
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
- GNU General Public License for more details.
24
-
25
- You should have received a copy of the GNU General Public License
26
- along with this program; if not, write to the Free Software
27
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28
- */
29
-
30
-
31
- ### Create Text Domain For Translations
32
- add_action('init', 'dbmanager_textdomain');
33
- function dbmanager_textdomain() {
34
- load_plugin_textdomain('wp-dbmanager', false, 'wp-dbmanager');
35
- }
36
-
37
-
38
- ### Function: Database Manager Menu
39
- add_action('admin_menu', 'dbmanager_menu');
40
- function dbmanager_menu() {
41
- if (function_exists('add_menu_page')) {
42
- add_menu_page(__('Database', 'wp-dbmanager'), __('Database', 'wp-dbmanager'), 'manage_database', 'wp-dbmanager/database-manager.php', '', plugins_url('wp-dbmanager/images/database.png'));
43
- }
44
- if (function_exists('add_submenu_page')) {
45
- add_submenu_page('wp-dbmanager/database-manager.php', __('Backup DB', 'wp-dbmanager'), __('Backup DB', 'wp-dbmanager'), 'manage_database', 'wp-dbmanager/database-backup.php');
46
- add_submenu_page('wp-dbmanager/database-manager.php', __('Manage Backup DB', 'wp-dbmanager'), __('Manage Backup DB', 'wp-dbmanager'), 'manage_database', 'wp-dbmanager/database-manage.php');
47
- add_submenu_page('wp-dbmanager/database-manager.php', __('Optimize DB', 'wp-dbmanager'), __('Optimize DB', 'wp-dbmanager'), 'manage_database', 'wp-dbmanager/database-optimize.php');
48
- add_submenu_page('wp-dbmanager/database-manager.php', __('Repair DB', 'wp-dbmanager'), __('Repair DB', 'wp-dbmanager'), 'manage_database', 'wp-dbmanager/database-repair.php');
49
- add_submenu_page('wp-dbmanager/database-manager.php', __('Empty/Drop Tables', 'wp-dbmanager'), __('Empty/Drop Tables', 'wp-dbmanager'), 'manage_database', 'wp-dbmanager/database-empty.php');
50
- add_submenu_page('wp-dbmanager/database-manager.php', __('Run SQL Query', 'wp-dbmanager'), __('Run SQL Query', 'wp-dbmanager'), 'manage_database', 'wp-dbmanager/database-run.php');
51
- add_submenu_page('wp-dbmanager/database-manager.php', __('DB Options', 'wp-dbmanager'), __('DB Options', 'wp-dbmanager'), 'manage_database', 'wp-dbmanager/wp-dbmanager.php', 'dbmanager_options');
52
- add_submenu_page('wp-dbmanager/database-manager.php', __('Uninstall WP-DBManager', 'wp-dbmanager'), __('Uninstall WP-DBManager', 'wp-dbmanager'), 'manage_database', 'wp-dbmanager/database-uninstall.php');
53
- }
54
- }
55
-
56
-
57
- ### Function: Displays DBManager Header In WP-Admin
58
- add_action('admin_enqueue_scripts', 'dbmanager_stylesheets_admin');
59
- function dbmanager_stylesheets_admin($hook_suffix) {
60
- $dbmanager_admin_pages = array('wp-dbmanager/database-manager.php', 'wp-dbmanager/database-backup.php', 'wp-dbmanager/database-manage.php', 'wp-dbmanager/database-optimize.php', 'wp-dbmanager/database-repair.php', 'wp-dbmanager/database-empty.php', 'wp-dbmanager/database-run.php', 'database_page_wp-dbmanager/wp-dbmanager', 'wp-dbmanager/database-uninstall.php');
61
- if(in_array($hook_suffix, $dbmanager_admin_pages)) {
62
- wp_enqueue_style('wp-dbmanager-admin', plugins_url('wp-dbmanager/database-admin-css.css'), false, '2.50', 'all');
63
- }
64
- }
65
-
66
-
67
- ### Funcion: Database Manager Cron
68
- add_filter('cron_schedules', 'cron_dbmanager_reccurences');
69
- add_action('dbmanager_cron_backup', 'cron_dbmanager_backup');
70
- add_action('dbmanager_cron_optimize', 'cron_dbmanager_optimize');
71
- function cron_dbmanager_backup() {
72
- global $wpdb;
73
- $backup_options = get_option('dbmanager_options');
74
- $backup_email = stripslashes($backup_options['backup_email']);
75
- if(intval($backup_options['backup_period']) > 0) {
76
- $current_date = mysql2date(sprintf(__('%s @ %s', 'wp-dbmanager'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', current_time('timestamp')));
77
- $backup = array();
78
- $backup['date'] = current_time('timestamp');
79
- $backup['mysqldumppath'] = $backup_options['mysqldumppath'];
80
- $backup['mysqlpath'] = $backup_options['mysqlpath'];
81
- $backup['path'] = $backup_options['path'];
82
- $backup['command'] = '';
83
- if(intval($backup_options['backup_gzip']) == 1) {
84
- $backup['filename'] = $backup['date'].'_-_'.DB_NAME.'.sql.gz';
85
- $backup['filepath'] = $backup['path'].'/'.$backup['filename'];
86
- $backup['command'] = $backup['mysqldumppath'].' --host="'.DB_HOST.'" --user="'.DB_USER.'" --password="'.DB_PASSWORD.'" --add-drop-table --skip-lock-tables '.DB_NAME.' | gzip > '.$backup['filepath'];
87
- } else {
88
- $backup['filename'] = $backup['date'].'_-_'.DB_NAME.'.sql';
89
- $backup['filepath'] = $backup['path'].'/'.$backup['filename'];
90
- $backup['command'] = $backup['mysqldumppath'].' --host="'.DB_HOST.'" --user="'.DB_USER.'" --password="'.DB_PASSWORD.'" --add-drop-table --skip-lock-tables '.DB_NAME.' > '.$backup['filepath'];
91
- }
92
- execute_backup($backup['command']);
93
- if(!empty($backup_email)) {
94
- // Get And Read The Database Backup File
95
- $file_path = $backup['filepath'];
96
- $file_size = format_size(filesize($file_path));
97
- $file_date = mysql2date(sprintf(__('%s @ %s', 'wp-dbmanager'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', substr($backup['filename'], 0, 10)));
98
- $file = fopen($file_path,'rb');
99
- $file_data = fread($file,filesize($file_path));
100
- fclose($file);
101
- $file_data = chunk_split(base64_encode($file_data));
102
- // Create Mail To, Mail Subject And Mail Header
103
- $mail_subject = sprintf(__('%s Database Backup File For %s', 'wp-dbmanager'), get_bloginfo('name'), $file_date);
104
- $mail_header = 'From: '.get_bloginfo('name').' Administrator <'.get_option('admin_email').'>';
105
- // MIME Boundary
106
- $random_time = md5(time());
107
- $mime_boundary = "==WP-DBManager- $random_time";
108
- // Create Mail Header And Mail Message
109
- $mail_header .= "\nMIME-Version: 1.0\n" .
110
- "Content-Type: multipart/mixed;\n" .
111
- " boundary=\"{$mime_boundary}\"";
112
- $mail_message = __('Website Name:', 'wp-dbmanager').' '.get_bloginfo('name')."\n".
113
- __('Website URL:', 'wp-dbmanager').' '.get_bloginfo('siteurl')."\n".
114
- __('Backup File Name:', 'wp-dbmanager').' '.$backup['filename']."\n".
115
- __('Backup File Date:', 'wp-dbmanager').' '.$file_date."\n".
116
- __('Backup File Size:', 'wp-dbmanager').' '.$file_size."\n\n".
117
- __('With Regards,', 'wp-dbmanager')."\n".
118
- get_bloginfo('name').' '. __('Administrator', 'wp-dbmanager')."\n".
119
- get_bloginfo('siteurl');
120
- $mail_message = "This is a multi-part message in MIME format.\n\n" .
121
- "--{$mime_boundary}\n" .
122
- "Content-Type: text/plain; charset=\"utf-8\"\n" .
123
- "Content-Transfer-Encoding: 7bit\n\n".$mail_message."\n\n";
124
- $mail_message .= "--{$mime_boundary}\n" .
125
- "Content-Type: application/octet-stream;\n" .
126
- " name=\"{$backup['filename']}\"\n" .
127
- "Content-Disposition: attachment;\n" .
128
- " filename=\"{$backup['filename']}\"\n" .
129
- "Content-Transfer-Encoding: base64\n\n" .
130
- $file_data."\n\n--{$mime_boundary}--\n";
131
- mail($backup_email, $mail_subject, $mail_message, $mail_header);
132
- }
133
- }
134
- return;
135
- }
136
- function cron_dbmanager_optimize() {
137
- global $wpdb;
138
- $backup_options = get_option('dbmanager_options');
139
- $optimize = intval($backup_options['optimize']);
140
- $optimize_period = intval($backup_options['optimize_period']);
141
- if($optimize_period > 0) {
142
- $optimize_tables = array();
143
- $tables = $wpdb->get_col("SHOW TABLES");
144
- foreach($tables as $table_name) {
145
- $optimize_tables[] = '`'.$table_name.'`';
146
- }
147
- $wpdb->query('OPTIMIZE TABLE '.implode(',', $optimize_tables));
148
- }
149
- return;
150
- }
151
- function cron_dbmanager_reccurences($schedules) {
152
- $backup_options = get_option('dbmanager_options');
153
- $backup = intval($backup_options['backup'])*intval($backup_options['backup_period']);
154
- $optimize = intval($backup_options['optimize'])*intval($backup_options['optimize_period']);
155
- if($backup == 0) {
156
- $backup = 31536000;
157
- }
158
- if($optimize == 0) {
159
- $optimize = 31536000;
160
- }
161
- $schedules['dbmanager_backup'] = array('interval' => $backup, 'display' => __('WP-DBManager Backup Schedule', 'wp-dbmanager'));
162
- $schedules['dbmanager_optimize'] = array('interval' => $optimize, 'display' => __('WP-DBManager Optimize Schedule', 'wp-dbmanager'));
163
- return $schedules;
164
- }
165
-
166
-
167
- ### Function: Ensure .htaccess Is In The Backup Folder
168
- add_action('admin_notices', 'dbmanager_admin_notices');
169
- function dbmanager_admin_notices() {
170
- $backup_options = get_option('dbmanager_options');
171
- if(!@file_exists($backup_options['path'].'/.htaccess')) {
172
- echo '<div class="error" style="text-align: center;"><p style="color: red; font-size: 14px; font-weight: bold;">'.__('Your backup folder MIGHT be visible to the public', 'wp-postratings').'</p><p>'.sprintf(__('To correct this issue, move the <strong>.htaccess</strong> file from <strong>wp-content/plugins/wp-dbmanager</strong> to <strong>%s</strong>', 'wp-postratings'), $backup_options['path']).'</p></div>';
173
- }
174
- }
175
-
176
-
177
- ### Function: Auto Detect MYSQL and MYSQL Dump Paths
178
- function detect_mysql() {
179
- global $wpdb;
180
- $paths = array('mysq' => '', 'mysqldump' => '');
181
- if(substr(PHP_OS,0,3) == 'WIN') {
182
- $mysql_install = $wpdb->get_row("SHOW VARIABLES LIKE 'basedir'");
183
- if($mysql_install) {
184
- $install_path = str_replace('\\', '/', $mysql_install->Value);
185
- $paths['mysql'] = $install_path.'bin/mysql.exe';
186
- $paths['mysqldump'] = $install_path.'bin/mysqldump.exe';
187
- } else {
188
- $paths['mysql'] = 'mysql.exe';
189
- $paths['mysqldump'] = 'mysqldump.exe';
190
- }
191
- } else {
192
- if(function_exists('exec')) {
193
- $paths['mysql'] = @exec('which mysql');
194
- $paths['mysqldump'] = @exec('which mysqldump');
195
- } else {
196
- $paths['mysql'] = 'mysql';
197
- $paths['mysqldump'] = 'mysqldump';
198
- }
199
- }
200
- return $paths;
201
- }
202
-
203
-
204
- ### Executes OS-Dependent mysqldump Command (By: Vlad Sharanhovich)
205
- function execute_backup($command) {
206
- $backup_options = get_option('dbmanager_options');
207
- check_backup_files();
208
- if(substr(PHP_OS, 0, 3) == 'WIN') {
209
- $writable_dir = $backup_options['path'];
210
- $tmpnam = $writable_dir.'/wp-dbmanager.bat';
211
- $fp = fopen($tmpnam, 'w');
212
- fwrite($fp, $command);
213
- fclose($fp);
214
- system($tmpnam.' > NUL', $error);
215
- unlink($tmpnam);
216
- } else {
217
- passthru($command, $error);
218
- }
219
- return $error;
220
- }
221
-
222
-
223
- ### Function: Format Bytes Into KB/MB
224
- if(!function_exists('format_size')) {
225
- function format_size($rawSize) {
226
- if($rawSize / 1073741824 > 1)
227
- return number_format_i18n($rawSize/1048576, 1) . ' '.__('GiB', 'wp-dbmanager');
228
- else if ($rawSize / 1048576 > 1)
229
- return number_format_i18n($rawSize/1048576, 1) . ' '.__('MiB', 'wp-dbmanager');
230
- else if ($rawSize / 1024 > 1)
231
- return number_format_i18n($rawSize/1024, 1) . ' '.__('KiB', 'wp-dbmanager');
232
- else
233
- return number_format_i18n($rawSize, 0) . ' '.__('bytes', 'wp-dbmanager');
234
- }
235
- }
236
-
237
-
238
- ### Function: Get File Extension
239
- if(!function_exists('file_ext')) {
240
- function file_ext($file_name) {
241
- return substr(strrchr($file_name, '.'), 1);
242
- }
243
- }
244
-
245
-
246
- ### Function: Check Folder Whether There Is Any File Inside
247
- if(!function_exists('is_emtpy_folder')) {
248
- function is_emtpy_folder($folder){
249
- if(is_dir($folder) ){
250
- $handle = opendir($folder);
251
- while( (gettype( $name = readdir($handle)) != 'boolean')){
252
- if($name != '.htaccess') {
253
- $name_array[] = $name;
254
- }
255
- }
256
- foreach($name_array as $temp)
257
- $folder_content .= $temp;
258
-
259
- if($folder_content == '...')
260
- return true;
261
- else
262
- return false;
263
- closedir($handle);
264
- }
265
- else
266
- return true;
267
- }
268
- }
269
-
270
-
271
- ### Function: Make Sure Maximum Number Of Database Backup Files Does Not Exceed
272
- function check_backup_files() {
273
- $backup_options = get_option('dbmanager_options');
274
- $database_files = array();
275
- if(!is_emtpy_folder($backup_options['path'])) {
276
- if ($handle = opendir($backup_options['path'])) {
277
- while (false !== ($file = readdir($handle))) {
278
- if ($file != '.' && $file != '..' && (file_ext($file) == 'sql' || file_ext($file) == 'gz')) {
279
- $database_files[] = $file;
280
- }
281
- }
282
- closedir($handle);
283
- sort($database_files);
284
- }
285
- }
286
- if(sizeof($database_files) >= $backup_options['max_backup']) {
287
- @unlink($backup_options['path'].'/'.$database_files[0]);
288
- }
289
- }
290
-
291
-
292
- ### Function: Database Manager Role
293
- add_action('activate_wp-dbmanager/wp-dbmanager.php', 'dbmanager_init');
294
- function dbmanager_init() {
295
- global $wpdb;
296
- $auto = detect_mysql();
297
- // Add Options
298
- $backup_options = array();
299
- $backup_options['mysqldumppath'] = $auto['mysqldump'];
300
- $backup_options['mysqlpath'] = $auto['mysql'];
301
- $backup_options['path'] = str_replace('\\', '/', WP_CONTENT_DIR).'/backup-db';
302
- $backup_options['max_backup'] = 10;
303
- $backup_options['backup'] = 1;
304
- $backup_options['backup_gzip'] = 0;
305
- $backup_options['backup_period'] = 604800;
306
- $backup_options['backup_email'] = get_option('admin_email');
307
- $backup_options['optimize'] = 3;
308
- $backup_options['optimize_period'] = 86400;
309
- add_option('dbmanager_options', $backup_options, 'WP-DBManager Options');
310
-
311
- // Create Backup Folder
312
- if(!is_dir(WP_CONTENT_DIR.'/backup-db')) {
313
- mkdir(WP_CONTENT_DIR.'/backup-db');
314
- chmod(WP_CONTENT_DIR.'/backup-db', 0750);
315
- }
316
-
317
- // Set 'manage_database' Capabilities To Administrator
318
- $role = get_role('administrator');
319
- if(!$role->has_cap('manage_database')) {
320
- $role->add_cap('manage_database');
321
- }
322
- }
323
-
324
-
325
- ### Function: Download Database
326
- add_action('init', 'download_database');
327
- function download_database() {
328
- if(isset($_POST['do']) && $_POST['do'] == __('Download', 'wp-dbmanager') && !empty($_POST['database_file'])) {
329
- if(strpos($_SERVER['HTTP_REFERER'], admin_url('admin.php?page=wp-dbmanager/database-manage.php')) !== false) {
330
- $backup_options = get_option('dbmanager_options');
331
- $file_path = $backup_options['path'].'/'.$_POST['database_file'];
332
- header("Pragma: public");
333
- header("Expires: 0");
334
- header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
335
- header("Content-Type: application/force-download");
336
- header("Content-Type: application/octet-stream");
337
- header("Content-Type: application/download");
338
- header("Content-Disposition: attachment; filename=".basename($file_path).";");
339
- header("Content-Transfer-Encoding: binary");
340
- header("Content-Length: ".filesize($file_path));
341
- @readfile($file_path);
342
- }
343
- exit();
344
- }
345
- }
346
-
347
-
348
- ### Function: Database Options
349
- function dbmanager_options() {
350
- global $wpdb;
351
- $text = '';
352
- $backup_options = array();
353
- $backup_options = get_option('dbmanager_options');
354
- if($_POST['Submit']) {
355
- $backup_options['mysqldumppath'] = trim($_POST['db_mysqldumppath']);
356
- $backup_options['mysqlpath'] = trim($_POST['db_mysqlpath']);
357
- $backup_options['path'] = trim($_POST['db_path']);
358
- $backup_options['max_backup'] = intval($_POST['db_max_backup']);
359
- $backup_options['backup'] = intval($_POST['db_backup']);
360
- $backup_options['backup_gzip'] = intval($_POST['db_backup_gzip']);
361
- $backup_options['backup_period'] = intval($_POST['db_backup_period']);
362
- $backup_options['backup_email'] = trim(addslashes($_POST['db_backup_email']));
363
- $backup_options['optimize'] = intval($_POST['db_optimize']);
364
- $backup_options['optimize_period'] = intval($_POST['db_optimize_period']);
365
- $update_db_options = update_option('dbmanager_options', $backup_options);
366
- if($update_db_options) {
367
- $text = '<font color="green">'.__('Database Options Updated', 'wp-dbmanager').'</font>';
368
- }
369
- if(empty($text)) {
370
- $text = '<font color="red">'.__('No Database Option Updated', 'wp-dbmanager').'</font>';
371
- }
372
- wp_clear_scheduled_hook('dbmanager_cron_backup');
373
- if($backup_options['backup_period'] > 0) {
374
- if (!wp_next_scheduled('dbmanager_cron_backup')) {
375
- wp_schedule_event(time(), 'dbmanager_backup', 'dbmanager_cron_backup');
376
- }
377
- }
378
- wp_clear_scheduled_hook('dbmanager_cron_optimize');
379
- if($backup_options['optimize_period'] > 0) {
380
- if (!wp_next_scheduled('dbmanager_cron_optimize')) {
381
- wp_schedule_event(time(), 'dbmanager_optimize', 'dbmanager_cron_optimize');
382
- }
383
- }
384
- }
385
- $path = detect_mysql();
386
- ?>
387
- <script type="text/javascript">
388
- /* <![CDATA[*/
389
- function mysqlpath() {
390
- jQuery("#db_mysqlpath").val("<?php echo $path['mysql']; ?>");
391
- }
392
- function mysqldumppath() {
393
- jQuery("#db_mysqldumppath").val("<?php echo $path['mysqldump']; ?>");
394
- }
395
- /* ]]> */
396
- </script>
397
- <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
398
- <!-- Database Options -->
399
- <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo plugin_basename(__FILE__); ?>">
400
- <div class="wrap">
401
- <div id="icon-wp-dbmanager" class="icon32"><br /></div>
402
- <h2><?php _e('Database Options', 'wp-dbmanager'); ?></h2>
403
- <h3><?php _e('Paths', 'wp-dbmanager'); ?></h3>
404
- <table class="form-table">
405
- <tr>
406
- <td width="20%" valign="top"><strong><?php _e('Path To mysqldump:', 'wp-dbmanager'); ?></strong></td>
407
- <td width="80%">
408
- <input type="text" id="db_mysqldumppath" name="db_mysqldumppath" size="60" maxlength="100" value="<?php echo stripslashes($backup_options['mysqldumppath']); ?>" dir="ltr" />&nbsp;&nbsp;<input type="button" value="<?php _e('Auto Detect', 'wp-dbmanager'); ?>" onclick="mysqldumppath();" />
409
- <p><?php _e('The absolute path to mysqldump without trailing slash. If unsure, please email your server administrator about this.', 'wp-dbmanager'); ?></p>
410
- </td>
411
- </tr>
412
- <tr>
413
- <td valign="top"><strong><?php _e('Path To mysql:', 'wp-dbmanager'); ?></strong></td>
414
- <td>
415
- <input type="text" id="db_mysqlpath" name="db_mysqlpath" size="60" maxlength="100" value="<?php echo stripslashes($backup_options['mysqlpath']); ?>" dir="ltr" />&nbsp;&nbsp;<input type="button" value="<?php _e('Auto Detect', 'wp-dbmanager'); ?>" onclick="mysqlpath();" />
416
- <p><?php _e('The absolute path to mysql without trailing slash. If unsure, please email your server administrator about this.', 'wp-dbmanager'); ?></p>
417
- </td>
418
- </tr>
419
- <tr>
420
- <td valign="top"><strong><?php _e('Path To Backup:', 'wp-dbmanager'); ?></strong></td>
421
- <td>
422
- <input type="text" name="db_path" size="60" maxlength="100" value="<?php echo stripslashes($backup_options['path']); ?>" dir="ltr" />
423
- <p><?php _e('The absolute path to your database backup folder without trailing slash. Make sure the folder is writable.', 'wp-dbmanager'); ?></p>
424
- </td>
425
- </tr>
426
- <tr>
427
- <td valign="top"><strong><?php _e('Maximum Backup Files:', 'wp-dbmanager'); ?></strong></td>
428
- <td>
429
- <input type="text" name="db_max_backup" size="5" maxlength="5" value="<?php echo stripslashes($backup_options['max_backup']); ?>" />
430
- <p><?php _e('The maximum number of database backup files that is allowed in the backup folder as stated above. The oldest database backup file is always deleted in order to maintain this value. This is to prevent the backup folder from getting too large.', 'wp-dbmanager'); ?></p>
431
- </td>
432
- </tr>
433
- </table>
434
-
435
- <h3><?php _e('Note', 'wp-dbmanager'); ?></h3>
436
- <table class="form-table">
437
- <tr>
438
- <td>
439
- <strong><?php _e('Windows Server', 'wp-dbmanager'); ?></strong><br />
440
- <?php _e('For mysqldump path, you can try \'<strong>mysqldump.exe</strong>\'.', 'wp-dbmanager'); ?><br />
441
- <?php _e('For mysql path, you can try \'<strong>mysql.exe</strong>\'.', 'wp-dbmanager'); ?>
442
- </td>
443
- </tr>
444
- <tr>
445
- <td>
446
- <strong><?php _e('Linux Server', 'wp-dbmanager'); ?></strong><br />
447
- <?php _e('For mysqldump path, normally is just \'<strong>mysqldump</strong>\'.', 'wp-dbmanager'); ?><br />
448
- <?php _e('For mysql path, normally is just \'<strong>mysql</strong>\'.', 'wp-dbmanager'); ?>
449
- </td>
450
- </tr>
451
- <tr>
452
- <td>
453
- <strong><?php _e('Note', 'wp-dbmanager'); ?></strong><br />
454
- <?php _e('The \'Auto Detect\' function does not work for some servers. If it does not work for you, please contact your server administrator for the MYSQL and MYSQL DUMP paths.', 'wp-dbmanager'); ?>
455
- </td>
456
- </tr>
457
- </table>
458
-
459
- <h3><?php _e('Automatic Scheduling', 'wp-dbmanager'); ?></h3>
460
- <table class="form-table">
461
- <tr>
462
- <td valign="top"><strong><?php _e('Automatic Backing Up Of DB:', 'wp-dbmanager'); ?></strong></td>
463
- <td>
464
- <?php
465
- _e('Next backup date: ', 'wp-dbmanager');
466
- if(wp_next_scheduled('dbmanager_cron_backup')) {
467
- echo '<strong>'.mysql2date(sprintf(__('%s @ %s', 'wp-dbmanager'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', (wp_next_scheduled('dbmanager_cron_backup') + (get_option('gmt_offset') * 3600)))).'</strong>';
468
- } else {
469
- _e('N/A', 'wp-dbmanager');
470
- }
471
- ?>
472
- <p>
473
- <?php _e('Every', 'wp-dbmanager'); ?>&nbsp;<input type="text" name="db_backup" size="3" maxlength="5" value="<?php echo intval($backup_options['backup']); ?>" />&nbsp;
474
- <select name="db_backup_period" size="1">
475
- <option value="0"<?php selected('0', $backup_options['backup_period']); ?>><?php _e('Disable', 'wp-dbmanager'); ?></option>
476
- <option value="60"<?php selected('60', $backup_options['backup_period']); ?>><?php _e('Minutes(s)', 'wp-dbmanager'); ?></option>
477
- <option value="3600"<?php selected('3600', $backup_options['backup_period']); ?>><?php _e('Hour(s)', 'wp-dbmanager'); ?></option>
478
- <option value="86400"<?php selected('86400', $backup_options['backup_period']); ?>><?php _e('Day(s)', 'wp-dbmanager'); ?></option>
479
- <option value="604800"<?php selected('604800', $backup_options['backup_period']); ?>><?php _e('Week(s)', 'wp-dbmanager'); ?></option>
480
- <option value="18144000"<?php selected('18144000', $backup_options['backup_period']); ?>><?php _e('Month(s)', 'wp-dbmanager'); ?></option>
481
- </select>&nbsp;&nbsp;&nbsp;
482
- <?php _e('Gzip', 'wp-dbmanager'); ?>
483
- <select name="db_backup_gzip" size="1">
484
- <option value="0"<?php selected('0', $backup_options['backup_gzip']); ?>><?php _e('No', 'wp-dbmanager'); ?></option>
485
- <option value="1"<?php selected('1', $backup_options['backup_gzip']); ?>><?php _e('Yes', 'wp-dbmanager'); ?></option>
486
- </select>
487
- </p>
488
- <p><?php _e('E-mail backup to:', 'wp-dbmanager'); ?> <input type="text" name="db_backup_email" size="30" maxlength="50" value="<?php echo stripslashes($backup_options['backup_email']) ?>" dir="ltr" />&nbsp;&nbsp;&nbsp;<?php _e('(Leave blank to disable this feature)', 'wp-dbmanager'); ?></p>
489
- <p><?php _e('WP-DBManager can automatically backup your database after a certain period.', 'wp-dbmanager'); ?></p>
490
- </td>
491
- </tr>
492
- <tr>
493
- <td valign="top"><strong><?php _e('Automatic Optimizing Of DB:', 'wp-dbmanager'); ?></strong></td>
494
- <td>
495
- <?php
496
- _e('Next optimize date: ', 'wp-dbmanager');
497
- if(wp_next_scheduled('dbmanager_cron_optimize')) {
498
- echo '<strong>'.mysql2date(sprintf(__('%s @ %s', 'wp-dbmanager'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', (wp_next_scheduled('dbmanager_cron_optimize') + (get_option('gmt_offset') * 3600)))).'</strong>';
499
- } else {
500
- _e('N/A', 'wp-dbmanager');
501
- }
502
- ?>
503
- <p>
504
- <?php _e('Every', 'wp-dbmanager'); ?>&nbsp;<input type="text" name="db_optimize" size="3" maxlength="5" value="<?php echo intval($backup_options['optimize']); ?>" />&nbsp;
505
- <select name="db_optimize_period" size="1">
506
- <option value="0"<?php selected('0', $backup_options['optimize_period']); ?>><?php _e('Disable', 'wp-dbmanager'); ?></option>
507
- <option value="60"<?php selected('60', $backup_options['optimize_period']); ?>><?php _e('Minutes(s)', 'wp-dbmanager'); ?></option>
508
- <option value="3600"<?php selected('3600', $backup_options['optimize_period']); ?>><?php _e('Hour(s)', 'wp-dbmanager'); ?></option>
509
- <option value="86400"<?php selected('86400', $backup_options['optimize_period']); ?>><?php _e('Day(s)', 'wp-dbmanager'); ?></option>
510
- <option value="604800"<?php selected('604800', $backup_options['optimize_period']); ?>><?php _e('Week(s)', 'wp-dbmanager'); ?></option>
511
- <option value="18144000"<?php selected('18144000', $backup_options['optimize_period']); ?>><?php _e('Month(s)', 'wp-dbmanager'); ?></option>
512
- </select>
513
- </p>
514
- <p><?php _e('WP-DBManager can automatically optimize your database after a certain period.', 'wp-dbmanager'); ?></p>
515
- </td>
516
- </tr>
517
- </table>
518
- <p class="submit">
519
- <input type="submit" name="Submit" class="button" value="<?php _e('Save Changes', 'wp-dbmanager'); ?>" />
520
- </p>
521
- </div>
522
- </form>
523
- <?php
524
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
525
  ?>
1
+ <?php
2
+ /*
3
+ Plugin Name: WP-DBManager
4
+ Plugin URI: http://lesterchan.net/portfolio/programming/php/
5
+ Description: Manages your WordPress database. Allows you to optimize database, repair database, backup database, restore database, delete backup database , drop/empty tables and run selected queries. Supports automatic scheduling of backing up, optimizing and repairing of database.
6
+ Version: 2.65
7
+ Author: Lester 'GaMerZ' Chan
8
+ Author URI: http://lesterchan.net
9
+ Text Domain: wp-dbmanager
10
+ */
11
+
12
+
13
+ /*
14
+ Copyright 2013 Lester Chan (email : lesterchan@gmail.com)
15
+
16
+ This program is free software; you can redistribute it and/or modify
17
+ it under the terms of the GNU General Public License as published by
18
+ the Free Software Foundation; either version 2 of the License, or
19
+ (at your option) any later version.
20
+
21
+ This program is distributed in the hope that it will be useful,
22
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
+ GNU General Public License for more details.
25
+
26
+ You should have received a copy of the GNU General Public License
27
+ along with this program; if not, write to the Free Software
28
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29
+ */
30
+
31
+
32
+ ### Create Text Domain For Translations
33
+ add_action('init', 'dbmanager_textdomain');
34
+ function dbmanager_textdomain() {
35
+ load_plugin_textdomain('wp-dbmanager', false, 'wp-dbmanager');
36
+ }
37
+
38
+
39
+ ### Function: Database Manager Menu
40
+ add_action('admin_menu', 'dbmanager_menu');
41
+ function dbmanager_menu() {
42
+ if (function_exists('add_menu_page')) {
43
+ add_menu_page(__('Database', 'wp-dbmanager'), __('Database', 'wp-dbmanager'), 'manage_database', 'wp-dbmanager/database-manager.php', '', plugins_url('wp-dbmanager/images/database.png'));
44
+ }
45
+ if (function_exists('add_submenu_page')) {
46
+ add_submenu_page('wp-dbmanager/database-manager.php', __('Backup DB', 'wp-dbmanager'), __('Backup DB', 'wp-dbmanager'), 'manage_database', 'wp-dbmanager/database-backup.php');
47
+ add_submenu_page('wp-dbmanager/database-manager.php', __('Manage Backup DB', 'wp-dbmanager'), __('Manage Backup DB', 'wp-dbmanager'), 'manage_database', 'wp-dbmanager/database-manage.php');
48
+ add_submenu_page('wp-dbmanager/database-manager.php', __('Optimize DB', 'wp-dbmanager'), __('Optimize DB', 'wp-dbmanager'), 'manage_database', 'wp-dbmanager/database-optimize.php');
49
+ add_submenu_page('wp-dbmanager/database-manager.php', __('Repair DB', 'wp-dbmanager'), __('Repair DB', 'wp-dbmanager'), 'manage_database', 'wp-dbmanager/database-repair.php');
50
+ add_submenu_page('wp-dbmanager/database-manager.php', __('Empty/Drop Tables', 'wp-dbmanager'), __('Empty/Drop Tables', 'wp-dbmanager'), 'manage_database', 'wp-dbmanager/database-empty.php');
51
+ add_submenu_page('wp-dbmanager/database-manager.php', __('Run SQL Query', 'wp-dbmanager'), __('Run SQL Query', 'wp-dbmanager'), 'manage_database', 'wp-dbmanager/database-run.php');
52
+ add_submenu_page('wp-dbmanager/database-manager.php', __('DB Options', 'wp-dbmanager'), __('DB Options', 'wp-dbmanager'), 'manage_database', 'wp-dbmanager/wp-dbmanager.php', 'dbmanager_options');
53
+ add_submenu_page('wp-dbmanager/database-manager.php', __('Uninstall WP-DBManager', 'wp-dbmanager'), __('Uninstall WP-DBManager', 'wp-dbmanager'), 'manage_database', 'wp-dbmanager/database-uninstall.php');
54
+ }
55
+ }
56
+
57
+
58
+ ### Function: Displays DBManager Header In WP-Admin
59
+ add_action('admin_enqueue_scripts', 'dbmanager_stylesheets_admin');
60
+ function dbmanager_stylesheets_admin($hook_suffix) {
61
+ $dbmanager_admin_pages = array('wp-dbmanager/database-manager.php', 'wp-dbmanager/database-backup.php', 'wp-dbmanager/database-manage.php', 'wp-dbmanager/database-optimize.php', 'wp-dbmanager/database-repair.php', 'wp-dbmanager/database-empty.php', 'wp-dbmanager/database-run.php', 'database_page_wp-dbmanager/wp-dbmanager', 'wp-dbmanager/database-uninstall.php');
62
+ if(in_array($hook_suffix, $dbmanager_admin_pages)) {
63
+ wp_enqueue_style('wp-dbmanager-admin', plugins_url('wp-dbmanager/database-admin-css.css'), false, '2.63', 'all');
64
+ }
65
+ }
66
+
67
+
68
+ ### Funcion: Database Manager Cron
69
+ add_filter('cron_schedules', 'cron_dbmanager_reccurences');
70
+ add_action('dbmanager_cron_backup', 'cron_dbmanager_backup');
71
+ add_action('dbmanager_cron_optimize', 'cron_dbmanager_optimize');
72
+ add_action('dbmanager_cron_repair', 'cron_dbmanager_repair');
73
+ function cron_dbmanager_backup() {
74
+ global $wpdb;
75
+ $backup_options = get_option('dbmanager_options');
76
+ $backup_email = stripslashes($backup_options['backup_email']);
77
+ if(intval($backup_options['backup_period']) > 0) {
78
+ $current_date = mysql2date(sprintf(__('%s @ %s', 'wp-dbmanager'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', current_time('timestamp')));
79
+ $backup = array();
80
+ $backup['date'] = current_time('timestamp');
81
+ $backup['mysqldumppath'] = $backup_options['mysqldumppath'];
82
+ $backup['mysqlpath'] = $backup_options['mysqlpath'];
83
+ $backup['path'] = $backup_options['path'];
84
+ $backup['password'] = str_replace('$', '\$', DB_PASSWORD);
85
+ $backup['host'] = DB_HOST;
86
+ $backup['port'] = '';
87
+ $backup['sock'] = '';
88
+ if(strpos(DB_HOST, ':') !== false) {
89
+ $db_host = explode(':', DB_HOST);
90
+ $backup['host'] = $db_host[0];
91
+ if(intval($db_host[1]) != 0) {
92
+ $backup['port'] = ' --port="'.intval($db_host[1]).'"';
93
+ } else {
94
+ $backup['sock'] = ' --socket="'.$db_host[1].'"';
95
+ }
96
+ }
97
+ $backup['command'] = '';
98
+ $brace = (substr(PHP_OS, 0, 3) == 'WIN') ? '"' : '';
99
+ if(intval($backup_options['backup_gzip']) == 1) {
100
+ $backup['filename'] = $backup['date'].'_-_'.DB_NAME.'.sql.gz';
101
+ $backup['filepath'] = $backup['path'].'/'.$backup['filename'];
102
+ $backup['command'] = $brace.$backup['mysqldumppath'].$brace.' --force --host="'.$backup['host'].'" --user="'.DB_USER.'" --password="'.$backup['password'].'"'.$backup['port'].$backup['sock'].' --add-drop-table --skip-lock-tables '.DB_NAME.' | gzip > '.$brace.$backup['filepath'].$brace;
103
+ } else {
104
+ $backup['filename'] = $backup['date'].'_-_'.DB_NAME.'.sql';
105
+ $backup['filepath'] = $backup['path'].'/'.$backup['filename'];
106
+ $backup['command'] = $brace.$backup['mysqldumppath'].$brace.' --force --host="'.$backup['host'].'" --user="'.DB_USER.'" --password="'.$backup['password'].'"'.$backup['port'].$backup['sock'].' --add-drop-table --skip-lock-tables '.DB_NAME.' > '.$brace.$backup['filepath'].$brace;
107
+ }
108
+ execute_backup($backup['command']);
109
+ if(!empty($backup_email)) {
110
+ // Get And Read The Database Backup File
111
+ $file_path = $backup['filepath'];
112
+ $file_size = format_size(filesize($file_path));
113
+ $file_date = mysql2date(sprintf(__('%s @ %s', 'wp-dbmanager'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', substr($backup['filename'], 0, 10)));
114
+ $file = fopen($file_path,'rb');
115
+ $file_data = fread($file,filesize($file_path));
116
+ fclose($file);
117
+ $file_data = chunk_split(base64_encode($file_data));
118
+ // Create Mail To, Mail Subject And Mail Header
119
+ $mail_subject = sprintf(__('%s Database Backup File For %s', 'wp-dbmanager'), wp_specialchars_decode(get_option('blogname')), $file_date);
120
+ $mail_header = 'From: '.wp_specialchars_decode(get_option('blogname')).' Administrator <'.get_option('admin_email').'>';
121
+ // MIME Boundary
122
+ $random_time = md5(time());
123
+ $mime_boundary = "==WP-DBManager- $random_time";
124
+ // Create Mail Header And Mail Message
125
+ $mail_header .= "\nMIME-Version: 1.0\n" .
126
+ "Content-Type: multipart/mixed;\n" .
127
+ " boundary=\"{$mime_boundary}\"";
128
+ $mail_message = __('Website Name:', 'wp-dbmanager').' '.wp_specialchars_decode(get_option('blogname'))."\n".
129
+ __('Website URL:', 'wp-dbmanager').' '.get_bloginfo('siteurl')."\n".
130
+ __('Backup File Name:', 'wp-dbmanager').' '.$backup['filename']."\n".
131
+ __('Backup File Date:', 'wp-dbmanager').' '.$file_date."\n".
132
+ __('Backup File Size:', 'wp-dbmanager').' '.$file_size."\n\n".
133
+ __('With Regards,', 'wp-dbmanager')."\n".
134
+ wp_specialchars_decode(get_option('blogname')).' '. __('Administrator', 'wp-dbmanager')."\n".
135
+ get_bloginfo('siteurl');
136
+ $mail_message = "This is a multi-part message in MIME format.\n\n" .
137
+ "--{$mime_boundary}\n" .
138
+ "Content-Type: text/plain; charset=\"utf-8\"\n" .
139
+ "Content-Transfer-Encoding: 7bit\n\n".$mail_message."\n\n";
140
+ $mail_message .= "--{$mime_boundary}\n" .
141
+ "Content-Type: application/octet-stream;\n" .
142
+ " name=\"{$backup['filename']}\"\n" .
143
+ "Content-Disposition: attachment;\n" .
144
+ " filename=\"{$backup['filename']}\"\n" .
145
+ "Content-Transfer-Encoding: base64\n\n" .
146
+ $file_data."\n\n--{$mime_boundary}--\n";
147
+ mail($backup_email, $mail_subject, $mail_message, $mail_header);
148
+ }
149
+ }
150
+ return;
151
+ }
152
+ function cron_dbmanager_optimize() {
153
+ global $wpdb;
154
+ $backup_options = get_option('dbmanager_options');
155
+ $optimize = intval($backup_options['optimize']);
156
+ $optimize_period = intval($backup_options['optimize_period']);
157
+ if($optimize_period > 0) {
158
+ $optimize_tables = array();
159
+ $tables = $wpdb->get_col("SHOW TABLES");
160
+ foreach($tables as $table_name) {
161
+ $optimize_tables[] = '`'.$table_name.'`';
162
+ }
163
+ $wpdb->query('OPTIMIZE TABLE '.implode(',', $optimize_tables));
164
+ }
165
+ return;
166
+ }
167
+ function cron_dbmanager_repair() {
168
+ global $wpdb;
169
+ $backup_options = get_option('dbmanager_options');
170
+ $repair = intval($backup_options['repair']);
171
+ $repair_period = intval($backup_options['repair_period']);
172
+ if($repair_period > 0) {
173
+ $repair_tables = array();
174
+ $tables = $wpdb->get_col("SHOW TABLES");
175
+ foreach($tables as $table_name) {
176
+ $repair_tables[] = '`'.$table_name.'`';
177
+ }
178
+ $wpdb->query('REPAIR TABLE '.implode(',', $repair_tables));
179
+ }
180
+ return;
181
+ }
182
+ function cron_dbmanager_reccurences($schedules) {
183
+ $backup_options = get_option('dbmanager_options');
184
+ $backup = intval($backup_options['backup'])*intval($backup_options['backup_period']);
185
+ $optimize = intval($backup_options['optimize'])*intval($backup_options['optimize_period']);
186
+ $repair = intval($backup_options['repair'])*intval($backup_options['repair_period']);
187
+ if($backup == 0) {
188
+ $backup = 31536000;
189
+ }
190
+ if($optimize == 0) {
191
+ $optimize = 31536000;
192
+ }
193
+ if($repair == 0) {
194
+ $repair = 31536000;
195
+ }
196
+ $schedules['dbmanager_backup'] = array('interval' => $backup, 'display' => __('WP-DBManager Backup Schedule', 'wp-dbmanager'));
197
+ $schedules['dbmanager_optimize'] = array('interval' => $optimize, 'display' => __('WP-DBManager Optimize Schedule', 'wp-dbmanager'));
198
+ $schedules['dbmanager_repair'] = array('interval' => $repair, 'display' => __('WP-DBManager Repair Schedule', 'wp-dbmanager'));
199
+ return $schedules;
200
+ }
201
+
202
+
203
+ ### Function: Ensure .htaccess Is In The Backup Folder
204
+ add_action('admin_notices', 'dbmanager_admin_notices');
205
+ function dbmanager_admin_notices() {
206
+ $backup_options = get_option('dbmanager_options');
207
+ if(!@file_exists($backup_options['path'].'/.htaccess')) {
208
+ echo '<div class="error" style="text-align: center;"><p style="color: red; font-size: 14px; font-weight: bold;">'.__('Your backup folder MIGHT be visible to the public', 'wp-postratings').'</p><p>'.sprintf(__('To correct this issue, move the <strong>.htaccess</strong> file from <strong>wp-content/plugins/wp-dbmanager</strong> to <strong>%s</strong>', 'wp-postratings'), $backup_options['path']).'</p></div>';
209
+ }
210
+ }
211
+
212
+
213
+ ### Function: Auto Detect MYSQL and MYSQL Dump Paths
214
+ function detect_mysql() {
215
+ global $wpdb;
216
+ $paths = array('mysq' => '', 'mysqldump' => '');
217
+ if(substr(PHP_OS,0,3) == 'WIN') {
218
+ $mysql_install = $wpdb->get_row("SHOW VARIABLES LIKE 'basedir'");
219
+ if($mysql_install) {
220
+ $install_path = str_replace('\\', '/', $mysql_install->Value);
221
+ $paths['mysql'] = $install_path.'bin/mysql.exe';
222
+ $paths['mysqldump'] = $install_path.'bin/mysqldump.exe';
223
+ } else {
224
+ $paths['mysql'] = 'mysql.exe';
225
+ $paths['mysqldump'] = 'mysqldump.exe';
226
+ }
227
+ } else {
228
+ if(function_exists('exec')) {
229
+ $paths['mysql'] = @exec('which mysql');
230
+ $paths['mysqldump'] = @exec('which mysqldump');
231
+ } else {
232
+ $paths['mysql'] = 'mysql';
233
+ $paths['mysqldump'] = 'mysqldump';
234
+ }
235
+ }
236
+ return $paths;
237
+ }
238
+
239
+
240
+ ### Executes OS-Dependent mysqldump Command (By: Vlad Sharanhovich)
241
+ function execute_backup($command) {
242
+ $backup_options = get_option('dbmanager_options');
243
+ check_backup_files();
244
+ if(substr(PHP_OS, 0, 3) == 'WIN') {
245
+ $writable_dir = $backup_options['path'];
246
+ $tmpnam = $writable_dir.'/wp-dbmanager.bat';
247
+ $fp = fopen($tmpnam, 'w');
248
+ fwrite($fp, $command);
249
+ fclose($fp);
250
+ system($tmpnam.' > NUL', $error);
251
+ unlink($tmpnam);
252
+ } else {
253
+ passthru($command, $error);
254
+ }
255
+ return $error;
256
+ }
257
+
258
+
259
+ ### Function: Format Bytes Into KB/MB
260
+ if(!function_exists('format_size')) {
261
+ function format_size($rawSize) {
262
+ if($rawSize / 1073741824 > 1)
263
+ return number_format_i18n($rawSize/1048576, 1) . ' '.__('GiB', 'wp-dbmanager');
264
+ else if ($rawSize / 1048576 > 1)
265
+ return number_format_i18n($rawSize/1048576, 1) . ' '.__('MiB', 'wp-dbmanager');
266
+ else if ($rawSize / 1024 > 1)
267
+ return number_format_i18n($rawSize/1024, 1) . ' '.__('KiB', 'wp-dbmanager');
268
+ else
269
+ return number_format_i18n($rawSize, 0) . ' '.__('bytes', 'wp-dbmanager');
270
+ }
271
+ }
272
+
273
+
274
+ ### Function: Get File Extension
275
+ if(!function_exists('file_ext')) {
276
+ function file_ext($file_name) {
277
+ return substr(strrchr($file_name, '.'), 1);
278
+ }
279
+ }
280
+
281
+
282
+ ### Function: Check Folder Whether There Is Any File Inside
283
+ if(!function_exists('is_emtpy_folder')) {
284
+ function is_emtpy_folder($folder){
285
+ if(is_dir($folder) ){
286
+ $handle = opendir($folder);
287
+ while( (gettype( $name = readdir($handle)) != 'boolean')){
288
+ if($name != '.htaccess') {
289
+ $name_array[] = $name;
290
+ }
291
+ }
292
+ foreach($name_array as $temp)
293
+ $folder_content .= $temp;
294
+
295
+ if($folder_content == '...')
296
+ return true;
297
+ else
298
+ return false;
299
+ closedir($handle);
300
+ }
301
+ else
302
+ return true;
303
+ }
304
+ }
305
+
306
+
307
+ ### Function: Make Sure Maximum Number Of Database Backup Files Does Not Exceed
308
+ function check_backup_files() {
309
+ $backup_options = get_option('dbmanager_options');
310
+ $database_files = array();
311
+ if(!is_emtpy_folder($backup_options['path'])) {
312
+ if ($handle = opendir($backup_options['path'])) {
313
+ while (false !== ($file = readdir($handle))) {
314
+ if ($file != '.' && $file != '..' && (file_ext($file) == 'sql' || file_ext($file) == 'gz')) {
315
+ $database_files[] = $file;
316
+ }
317
+ }
318
+ closedir($handle);
319
+ sort($database_files);
320
+ }
321
+ }
322
+ if(sizeof($database_files) >= $backup_options['max_backup']) {
323
+ @unlink($backup_options['path'].'/'.$database_files[0]);
324
+ }
325
+ }
326
+
327
+
328
+ ### Function: Database Manager Role
329
+ add_action('activate_wp-dbmanager/wp-dbmanager.php', 'dbmanager_init');
330
+ function dbmanager_init() {
331
+ global $wpdb;
332
+ $auto = detect_mysql();
333
+ // Add Options
334
+ $backup_options = array();
335
+ $backup_options['mysqldumppath'] = $auto['mysqldump'];
336
+ $backup_options['mysqlpath'] = $auto['mysql'];
337
+ $backup_options['path'] = str_replace('\\', '/', WP_CONTENT_DIR).'/backup-db';
338
+ $backup_options['max_backup'] = 10;
339
+ $backup_options['backup'] = 1;
340
+ $backup_options['backup_gzip'] = 0;
341
+ $backup_options['backup_period'] = 604800;
342
+ $backup_options['backup_email'] = get_option('admin_email');
343
+ $backup_options['optimize'] = 3;
344
+ $backup_options['optimize_period'] = 86400;
345
+ $backup_options['repair'] = 2;
346
+ $backup_options['repair_period'] = 604800;
347
+ add_option('dbmanager_options', $backup_options, 'WP-DBManager Options');
348
+
349
+ // Create Backup Folder
350
+ if(!is_dir(WP_CONTENT_DIR.'/backup-db')) {
351
+ mkdir(WP_CONTENT_DIR.'/backup-db');
352
+ chmod(WP_CONTENT_DIR.'/backup-db', 0750);
353
+ }
354
+
355
+ // Set 'manage_database' Capabilities To Administrator
356
+ $role = get_role('administrator');
357
+ if(!$role->has_cap('manage_database')) {
358
+ $role->add_cap('manage_database');
359
+ }
360
+ }
361
+
362
+
363
+ ### Function: Download Database
364
+ add_action('init', 'download_database');
365
+ function download_database() {
366
+ if(isset($_POST['do']) && $_POST['do'] == __('Download', 'wp-dbmanager') && !empty($_POST['database_file'])) {
367
+ if(strpos($_SERVER['HTTP_REFERER'], admin_url('admin.php?page=wp-dbmanager/database-manage.php')) !== false) {
368
+ $database_file = trim($_POST['database_file']);
369
+ if(substr($database_file, strlen($database_file) - 4, 4) == '.sql' || substr($database_file, strlen($database_file) - 7, 7) == '.sql.gz') {
370
+ check_admin_referer('wp-dbmanager_manage');
371
+ $backup_options = get_option('dbmanager_options');
372
+ $clean_file_name = sanitize_file_name($database_file);
373
+ $clean_file_name = str_replace('sql_.gz', 'sql.gz', $clean_file_name);
374
+ $file_path = $backup_options['path'].'/'.$clean_file_name;
375
+ header("Pragma: public");
376
+ header("Expires: 0");
377
+ header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
378
+ header("Content-Type: application/force-download");
379
+ header("Content-Type: application/octet-stream");
380
+ header("Content-Type: application/download");
381
+ header("Content-Disposition: attachment; filename=".basename($file_path).";");
382
+ header("Content-Transfer-Encoding: binary");
383
+ header("Content-Length: ".filesize($file_path));
384
+ @readfile($file_path);
385
+ }
386
+ }
387
+ exit();
388
+ }
389
+ }
390
+
391
+
392
+ ### Function: Database Options
393
+ function dbmanager_options() {
394
+ global $wpdb;
395
+ $text = '';
396
+ $backup_options = array();
397
+ $backup_options = get_option('dbmanager_options');
398
+ if($_POST['Submit']) {
399
+ check_admin_referer('wp-dbmanager_options');
400
+ $backup_options['mysqldumppath'] = trim($_POST['db_mysqldumppath']);
401
+ $backup_options['mysqlpath'] = trim($_POST['db_mysqlpath']);
402
+ $backup_options['path'] = trim($_POST['db_path']);
403
+ $backup_options['max_backup'] = intval($_POST['db_max_backup']);
404
+ $backup_options['backup'] = intval($_POST['db_backup']);
405
+ $backup_options['backup_gzip'] = intval($_POST['db_backup_gzip']);
406
+ $backup_options['backup_period'] = intval($_POST['db_backup_period']);
407
+ $backup_options['backup_email'] = trim(addslashes($_POST['db_backup_email']));
408
+ $backup_options['optimize'] = intval($_POST['db_optimize']);
409
+ $backup_options['optimize_period'] = intval($_POST['db_optimize_period']);
410
+ $backup_options['repair'] = intval($_POST['db_repair']);
411
+ $backup_options['repair_period'] = intval($_POST['db_repair_period']);
412
+ $update_db_options = update_option('dbmanager_options', $backup_options);
413
+ if($update_db_options) {
414
+ $text = '<font color="green">'.__('Database Options Updated', 'wp-dbmanager').'</font>';
415
+ }
416
+ if(empty($text)) {
417
+ $text = '<font color="red">'.__('No Database Option Updated', 'wp-dbmanager').'</font>';
418
+ }
419
+ wp_clear_scheduled_hook('dbmanager_cron_backup');
420
+ if($backup_options['backup_period'] > 0) {
421
+ if (!wp_next_scheduled('dbmanager_cron_backup')) {
422
+ wp_schedule_event(time(), 'dbmanager_backup', 'dbmanager_cron_backup');
423
+ }
424
+ }
425
+ wp_clear_scheduled_hook('dbmanager_cron_optimize');
426
+ if($backup_options['optimize_period'] > 0) {
427
+ if (!wp_next_scheduled('dbmanager_cron_optimize')) {
428
+ wp_schedule_event(time(), 'dbmanager_optimize', 'dbmanager_cron_optimize');
429
+ }
430
+ }
431
+ wp_clear_scheduled_hook('dbmanager_cron_repair');
432
+ if($backup_options['repair_period'] > 0) {
433
+ if (!wp_next_scheduled('dbmanager_cron_repair')) {
434
+ wp_schedule_event(time(), 'dbmanager_repair', 'dbmanager_cron_repair');
435
+ }
436
+ }
437
+ }
438
+ $path = detect_mysql();
439
+ ?>
440
+ <script type="text/javascript">
441
+ /* <![CDATA[*/
442
+ function mysqlpath() {
443
+ jQuery("#db_mysqlpath").val("<?php echo $path['mysql']; ?>");
444
+ }
445
+ function mysqldumppath() {
446
+ jQuery("#db_mysqldumppath").val("<?php echo $path['mysqldump']; ?>");
447
+ }
448
+ /* ]]> */
449
+ </script>
450
+ <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
451
+ <!-- Database Options -->
452
+ <form method="post" action="<?php echo admin_url('admin.php?page='.plugin_basename(__FILE__)); ?>">
453
+ <?php wp_nonce_field('wp-dbmanager_options'); ?>
454
+ <div class="wrap">
455
+ <div id="icon-wp-dbmanager" class="icon32"><br /></div>
456
+ <h2><?php _e('Database Options', 'wp-dbmanager'); ?></h2>
457
+ <h3><?php _e('Paths', 'wp-dbmanager'); ?></h3>
458
+ <table class="form-table">
459
+ <tr>
460
+ <td width="20%" valign="top"><strong><?php _e('Path To mysqldump:', 'wp-dbmanager'); ?></strong></td>
461
+ <td width="80%">
462
+ <input type="text" id="db_mysqldumppath" name="db_mysqldumppath" size="60" maxlength="100" value="<?php echo stripslashes($backup_options['mysqldumppath']); ?>" dir="ltr" />&nbsp;&nbsp;<input type="button" value="<?php _e('Auto Detect', 'wp-dbmanager'); ?>" onclick="mysqldumppath();" />
463
+ <p><?php _e('The absolute path to mysqldump without trailing slash. If unsure, please email your server administrator about this.', 'wp-dbmanager'); ?></p>
464
+ </td>
465
+ </tr>
466
+ <tr>
467
+ <td valign="top"><strong><?php _e('Path To mysql:', 'wp-dbmanager'); ?></strong></td>
468
+ <td>
469
+ <input type="text" id="db_mysqlpath" name="db_mysqlpath" size="60" maxlength="100" value="<?php echo stripslashes($backup_options['mysqlpath']); ?>" dir="ltr" />&nbsp;&nbsp;<input type="button" value="<?php _e('Auto Detect', 'wp-dbmanager'); ?>" onclick="mysqlpath();" />
470
+ <p><?php _e('The absolute path to mysql without trailing slash. If unsure, please email your server administrator about this.', 'wp-dbmanager'); ?></p>
471
+ </td>
472
+ </tr>
473
+ <tr>
474
+ <td valign="top"><strong><?php _e('Path To Backup:', 'wp-dbmanager'); ?></strong></td>
475
+ <td>
476
+ <input type="text" name="db_path" size="60" maxlength="100" value="<?php echo stripslashes($backup_options['path']); ?>" dir="ltr" />
477
+ <p><?php _e('The absolute path to your database backup folder without trailing slash. Make sure the folder is writable.', 'wp-dbmanager'); ?></p>
478
+ </td>
479
+ </tr>
480
+ <tr>
481
+ <td valign="top"><strong><?php _e('Maximum Backup Files:', 'wp-dbmanager'); ?></strong></td>
482
+ <td>
483
+ <input type="text" name="db_max_backup" size="5" maxlength="5" value="<?php echo stripslashes($backup_options['max_backup']); ?>" />
484
+ <p><?php _e('The maximum number of database backup files that is allowed in the backup folder as stated above. The oldest database backup file is always deleted in order to maintain this value. This is to prevent the backup folder from getting too large.', 'wp-dbmanager'); ?></p>
485
+ </td>
486
+ </tr>
487
+ </table>
488
+
489
+ <h3><?php _e('Note', 'wp-dbmanager'); ?></h3>
490
+ <table class="form-table">
491
+ <tr>
492
+ <td>
493
+ <strong><?php _e('Windows Server', 'wp-dbmanager'); ?></strong><br />
494
+ <?php _e('For mysqldump path, you can try \'<strong>mysqldump.exe</strong>\'.', 'wp-dbmanager'); ?><br />
495
+ <?php _e('For mysql path, you can try \'<strong>mysql.exe</strong>\'.', 'wp-dbmanager'); ?>
496
+ </td>
497
+ </tr>
498
+ <tr>
499
+ <td>
500
+ <strong><?php _e('Linux Server', 'wp-dbmanager'); ?></strong><br />
501
+ <?php _e('For mysqldump path, normally is just \'<strong>mysqldump</strong>\'.', 'wp-dbmanager'); ?><br />
502
+ <?php _e('For mysql path, normally is just \'<strong>mysql</strong>\'.', 'wp-dbmanager'); ?>
503
+ </td>
504
+ </tr>
505
+ <tr>
506
+ <td>
507
+ <strong><?php _e('Note', 'wp-dbmanager'); ?></strong><br />
508
+ <?php _e('The \'Auto Detect\' function does not work for some servers. If it does not work for you, please contact your server administrator for the MYSQL and MYSQL DUMP paths.', 'wp-dbmanager'); ?>
509
+ </td>
510
+ </tr>
511
+ </table>
512
+
513
+ <h3><?php _e('Automatic Scheduling', 'wp-dbmanager'); ?></h3>
514
+ <table class="form-table">
515
+ <tr>
516
+ <td valign="top"><strong><?php _e('Automatic Backing Up Of DB:', 'wp-dbmanager'); ?></strong></td>
517
+ <td>
518
+ <?php
519
+ _e('Next backup date: ', 'wp-dbmanager');
520
+ if(wp_next_scheduled('dbmanager_cron_backup')) {
521
+ echo '<strong>'.mysql2date(sprintf(__('%s @ %s', 'wp-dbmanager'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', (wp_next_scheduled('dbmanager_cron_backup') + (get_option('gmt_offset') * 3600)))).'</strong>';
522
+ } else {
523
+ _e('N/A', 'wp-dbmanager');
524
+ }
525
+ ?>
526
+ <p>
527
+ <?php _e('Every', 'wp-dbmanager'); ?>&nbsp;<input type="text" name="db_backup" size="3" maxlength="5" value="<?php echo intval($backup_options['backup']); ?>" />&nbsp;
528
+ <select name="db_backup_period" size="1">
529
+ <option value="0"<?php selected('0', $backup_options['backup_period']); ?>><?php _e('Disable', 'wp-dbmanager'); ?></option>
530
+ <option value="60"<?php selected('60', $backup_options['backup_period']); ?>><?php _e('Minutes(s)', 'wp-dbmanager'); ?></option>
531
+ <option value="3600"<?php selected('3600', $backup_options['backup_period']); ?>><?php _e('Hour(s)', 'wp-dbmanager'); ?></option>
532
+ <option value="86400"<?php selected('86400', $backup_options['backup_period']); ?>><?php _e('Day(s)', 'wp-dbmanager'); ?></option>
533
+ <option value="604800"<?php selected('604800', $backup_options['backup_period']); ?>><?php _e('Week(s)', 'wp-dbmanager'); ?></option>
534
+ <option value="18144000"<?php selected('18144000', $backup_options['backup_period']); ?>><?php _e('Month(s)', 'wp-dbmanager'); ?></option>
535
+ </select>&nbsp;&nbsp;&nbsp;
536
+ <?php _e('Gzip', 'wp-dbmanager'); ?>
537
+ <select name="db_backup_gzip" size="1">
538
+ <option value="0"<?php selected('0', $backup_options['backup_gzip']); ?>><?php _e('No', 'wp-dbmanager'); ?></option>
539
+ <option value="1"<?php selected('1', $backup_options['backup_gzip']); ?>><?php _e('Yes', 'wp-dbmanager'); ?></option>
540
+ </select>
541
+ </p>
542
+ <p><?php _e('E-mail backup to:', 'wp-dbmanager'); ?> <input type="text" name="db_backup_email" size="30" maxlength="50" value="<?php echo stripslashes($backup_options['backup_email']) ?>" dir="ltr" />&nbsp;&nbsp;&nbsp;<?php _e('(Leave blank to disable this feature)', 'wp-dbmanager'); ?></p>
543
+ <p><?php _e('WP-DBManager can automatically backup your database after a certain period.', 'wp-dbmanager'); ?></p>
544
+ </td>
545
+ </tr>
546
+ <tr>
547
+ <td valign="top"><strong><?php _e('Automatic Optimizing Of DB:', 'wp-dbmanager'); ?></strong></td>
548
+ <td>
549
+ <?php
550
+ _e('Next optimize date: ', 'wp-dbmanager');
551
+ if(wp_next_scheduled('dbmanager_cron_optimize')) {
552
+ echo '<strong>'.mysql2date(sprintf(__('%s @ %s', 'wp-dbmanager'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', (wp_next_scheduled('dbmanager_cron_optimize') + (get_option('gmt_offset') * 3600)))).'</strong>';
553
+ } else {
554
+ _e('N/A', 'wp-dbmanager');
555
+ }
556
+ ?>
557
+ <p>
558
+ <?php _e('Every', 'wp-dbmanager'); ?>&nbsp;<input type="text" name="db_optimize" size="3" maxlength="5" value="<?php echo intval($backup_options['optimize']); ?>" />&nbsp;
559
+ <select name="db_optimize_period" size="1">
560
+ <option value="0"<?php selected('0', $backup_options['optimize_period']); ?>><?php _e('Disable', 'wp-dbmanager'); ?></option>
561
+ <option value="60"<?php selected('60', $backup_options['optimize_period']); ?>><?php _e('Minutes(s)', 'wp-dbmanager'); ?></option>
562
+ <option value="3600"<?php selected('3600', $backup_options['optimize_period']); ?>><?php _e('Hour(s)', 'wp-dbmanager'); ?></option>
563
+ <option value="86400"<?php selected('86400', $backup_options['optimize_period']); ?>><?php _e('Day(s)', 'wp-dbmanager'); ?></option>
564
+ <option value="604800"<?php selected('604800', $backup_options['optimize_period']); ?>><?php _e('Week(s)', 'wp-dbmanager'); ?></option>
565
+ <option value="18144000"<?php selected('18144000', $backup_options['optimize_period']); ?>><?php _e('Month(s)', 'wp-dbmanager'); ?></option>
566
+ </select>
567
+ </p>
568
+ <p><?php _e('WP-DBManager can automatically optimize your database after a certain period.', 'wp-dbmanager'); ?></p>
569
+ </td>
570
+ </tr>
571
+ <tr>
572
+ <td valign="top"><strong><?php _e('Automatic Repairing Of DB:', 'wp-dbmanager'); ?></strong></td>
573
+ <td>
574
+ <?php
575
+ _e('Next repair date: ', 'wp-dbmanager');
576
+ if(wp_next_scheduled('dbmanager_cron_repair')) {
577
+ echo '<strong>'.mysql2date(sprintf(__('%s @ %s', 'wp-dbmanager'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', (wp_next_scheduled('dbmanager_cron_repair') + (get_option('gmt_offset') * 3600)))).'</strong>';
578
+ } else {
579
+ _e('N/A', 'wp-dbmanager');
580
+ }
581
+ ?>
582
+ <p>
583
+ <?php _e('Every', 'wp-dbmanager'); ?>&nbsp;<input type="text" name="db_repair" size="3" maxlength="5" value="<?php echo intval($backup_options['repair']); ?>" />&nbsp;
584
+ <select name="db_repair_period" size="1">
585
+ <option value="0"<?php selected('0', $backup_options['repair_period']); ?>><?php _e('Disable', 'wp-dbmanager'); ?></option>
586
+ <option value="60"<?php selected('60', $backup_options['repair_period']); ?>><?php _e('Minutes(s)', 'wp-dbmanager'); ?></option>
587
+ <option value="3600"<?php selected('3600', $backup_options['repair_period']); ?>><?php _e('Hour(s)', 'wp-dbmanager'); ?></option>
588
+ <option value="86400"<?php selected('86400', $backup_options['repair_period']); ?>><?php _e('Day(s)', 'wp-dbmanager'); ?></option>
589
+ <option value="604800"<?php selected('604800', $backup_options['repair_period']); ?>><?php _e('Week(s)', 'wp-dbmanager'); ?></option>
590
+ <option value="18144000"<?php selected('18144000', $backup_options['repair_period']); ?>><?php _e('Month(s)', 'wp-dbmanager'); ?></option>
591
+ </select>
592
+ </p>
593
+ <p><?php _e('WP-DBManager can automatically repair your database after a certain period.', 'wp-dbmanager'); ?></p>
594
+ </td>
595
+ </tr>
596
+ </table>
597
+ <p class="submit">
598
+ <input type="submit" name="Submit" class="button" value="<?php _e('Save Changes', 'wp-dbmanager'); ?>" />
599
+ </p>
600
+ </div>
601
+ </form>
602
+ <?php
603
+ }
604
  ?>
wp-dbmanager.pot DELETED
@@ -1,884 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: WP-DBManager 2.50\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2009-06-27 19:57+0800\n"
6
- "PO-Revision-Date: 2009-06-27 19:57+0800\n"
7
- "Last-Translator: Lester Chan <lesterchan@gmail.com>\n"
8
- "Language-Team: Lester Chan <lesterchan@gmail.com>\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Poedit-Language: English\n"
13
- "X-Poedit-Country: SINGAPORE\n"
14
- "X-Poedit-KeywordsList: __;_e;__n:1,2;__ngettext_noop:1,2\n"
15
- "X-Poedit-Basepath: .\n"
16
- "Plural-Forms: nplurals=2; plural=n != 1;\n"
17
- "X-Poedit-SearchPath-0: .\n"
18
-
19
- #: database-backup.php:29
20
- #: database-backup.php:186
21
- #: database-manage.php:41
22
- #: database-manage.php:175
23
- #: wp-dbmanager.php:76
24
- #: wp-dbmanager.php:97
25
- #: wp-dbmanager.php:467
26
- #: wp-dbmanager.php:498
27
- #, php-format
28
- msgid "%s @ %s"
29
- msgstr ""
30
-
31
- #: database-backup.php:42
32
- #: database-backup.php:205
33
- msgid "Backup"
34
- msgstr ""
35
-
36
- #: database-backup.php:56
37
- #, php-format
38
- msgid "Database Failed To Backup On '%s'. Backup Folder Not Writable."
39
- msgstr ""
40
-
41
- #: database-backup.php:59
42
- #, php-format
43
- msgid "Database Failed To Backup On '%s'. Backup File Size Is 0KB."
44
- msgstr ""
45
-
46
- #: database-backup.php:61
47
- #, php-format
48
- msgid "Database Failed To Backup On '%s'. Invalid Backup File Path."
49
- msgstr ""
50
-
51
- #: database-backup.php:63
52
- #, php-format
53
- msgid "Database Failed To Backup On '%s'."
54
- msgstr ""
55
-
56
- #: database-backup.php:65
57
- #, php-format
58
- msgid "Database Backed Up Successfully On '%s'."
59
- msgstr ""
60
-
61
- #: database-backup.php:84
62
- #: database-backup.php:167
63
- msgid "Backup Database"
64
- msgstr ""
65
-
66
- #: database-backup.php:85
67
- msgid "Checking Backup Status"
68
- msgstr ""
69
-
70
- #: database-backup.php:87
71
- msgid "Checking Backup Folder"
72
- msgstr ""
73
-
74
- #: database-backup.php:90
75
- msgid "Backup folder exists"
76
- msgstr ""
77
-
78
- #: database-backup.php:93
79
- #, php-format
80
- msgid "Backup folder does NOT exist. Please create 'backup-db' folder in '%s' folder and CHMOD it to '777' or change the location of the backup folder under DB Option."
81
- msgstr ""
82
-
83
- #: database-backup.php:96
84
- msgid "Backup folder is writable"
85
- msgstr ""
86
-
87
- #: database-backup.php:99
88
- msgid "Backup folder is NOT writable. Please CHMOD it to '777'."
89
- msgstr ""
90
-
91
- #: database-backup.php:106
92
- #: database-backup.php:110
93
- msgid "Checking MYSQL Dump Path"
94
- msgstr ""
95
-
96
- #: database-backup.php:107
97
- msgid "MYSQL dump path exists."
98
- msgstr ""
99
-
100
- #: database-backup.php:111
101
- msgid "MYSQL dump path does NOT exist. Please check your mysqldump path under DB Options. If uncertain, contact your server administrator."
102
- msgstr ""
103
-
104
- #: database-backup.php:118
105
- #: database-backup.php:122
106
- msgid "Checking MYSQL Path"
107
- msgstr ""
108
-
109
- #: database-backup.php:119
110
- msgid "MYSQL path exists."
111
- msgstr ""
112
-
113
- #: database-backup.php:123
114
- msgid "MYSQL path does NOT exist. Please check your mysql path under DB Options. If uncertain, contact your server administrator."
115
- msgstr ""
116
-
117
- #: database-backup.php:128
118
- msgid "Checking PHP Functions"
119
- msgstr ""
120
-
121
- #: database-backup.php:128
122
- msgid "and"
123
- msgstr ""
124
-
125
- #: database-backup.php:131
126
- #: database-backup.php:138
127
- #: database-backup.php:144
128
- msgid "enabled"
129
- msgstr ""
130
-
131
- #: database-backup.php:134
132
- #: database-backup.php:140
133
- #: database-backup.php:146
134
- msgid "disabled"
135
- msgstr ""
136
-
137
- #: database-backup.php:154
138
- msgid "Excellent. You Are Good To Go."
139
- msgstr ""
140
-
141
- #: database-backup.php:156
142
- msgid "I'm sorry, your server administrator has disabled passthru(), system() and exec(), thus you cannot use this backup script. You may consider using the default WordPress database backup script instead."
143
- msgstr ""
144
-
145
- #: database-backup.php:158
146
- msgid "Please Rectify The Error Highlighted In Red Before Proceeding On."
147
- msgstr ""
148
-
149
- #: database-backup.php:162
150
- msgid "Note: The checking of backup status is still undergoing testing, it may not be accurate."
151
- msgstr ""
152
-
153
- #: database-backup.php:172
154
- msgid "Option"
155
- msgstr ""
156
-
157
- #: database-backup.php:173
158
- #: database-manager.php:51
159
- msgid "Value"
160
- msgstr ""
161
-
162
- #: database-backup.php:177
163
- msgid "Database Name:"
164
- msgstr ""
165
-
166
- #: database-backup.php:181
167
- msgid "Database Backup To:"
168
- msgstr ""
169
-
170
- #: database-backup.php:185
171
- msgid "Database Backup Date:"
172
- msgstr ""
173
-
174
- #: database-backup.php:189
175
- msgid "Database Backup File Name:"
176
- msgstr ""
177
-
178
- #: database-backup.php:193
179
- msgid "Database Backup Type:"
180
- msgstr ""
181
-
182
- #: database-backup.php:194
183
- msgid "Full (Structure and Data)"
184
- msgstr ""
185
-
186
- #: database-backup.php:197
187
- msgid "MYSQL Dump Location:"
188
- msgstr ""
189
-
190
- #: database-backup.php:201
191
- msgid "GZIP Database Backup File?"
192
- msgstr ""
193
-
194
- #: database-backup.php:202
195
- #: database-optimize.php:88
196
- #: database-repair.php:88
197
- #: database-uninstall.php:126
198
- #: wp-dbmanager.php:485
199
- msgid "Yes"
200
- msgstr ""
201
-
202
- #: database-backup.php:202
203
- #: database-optimize.php:88
204
- #: database-repair.php:88
205
- #: wp-dbmanager.php:484
206
- msgid "No"
207
- msgstr ""
208
-
209
- #: database-backup.php:205
210
- #: database-empty.php:112
211
- #: database-manage.php:207
212
- #: database-optimize.php:95
213
- #: database-repair.php:92
214
- #: database-run.php:98
215
- msgid "Cancel"
216
- msgstr ""
217
-
218
- #: database-empty.php:44
219
- #: database-empty.php:112
220
- msgid "Empty/Drop"
221
- msgstr ""
222
-
223
- #: database-empty.php:55
224
- msgid "No Tables Selected."
225
- msgstr ""
226
-
227
- #: database-empty.php:61
228
- #, php-format
229
- msgid "Table '%s' Emptied"
230
- msgstr ""
231
-
232
- #: database-empty.php:66
233
- #, php-format
234
- msgid "Table(s) '%s' Dropped"
235
- msgstr ""
236
-
237
- #: database-empty.php:81
238
- #: wp-dbmanager.php:49
239
- msgid "Empty/Drop Tables"
240
- msgstr ""
241
-
242
- #: database-empty.php:86
243
- #: database-manager.php:85
244
- #: database-optimize.php:75
245
- #: database-repair.php:75
246
- msgid "Tables"
247
- msgstr ""
248
-
249
- #: database-empty.php:87
250
- #: database-empty.php:100
251
- msgid "Empty"
252
- msgstr ""
253
-
254
- #: database-empty.php:87
255
- msgid "1"
256
- msgstr ""
257
-
258
- #: database-empty.php:88
259
- #: database-empty.php:101
260
- msgid "Drop"
261
- msgstr ""
262
-
263
- #: database-empty.php:88
264
- msgid "2"
265
- msgstr ""
266
-
267
- #: database-empty.php:106
268
- msgid "1. EMPTYING a table means all the rows in the table will be deleted. This action is not REVERSIBLE."
269
- msgstr ""
270
-
271
- #: database-empty.php:108
272
- msgid "2. DROPPING a table means deleting the table. This action is not REVERSIBLE."
273
- msgstr ""
274
-
275
- #: database-empty.php:112
276
- msgid ""
277
- "You Are About To Empty Or Drop The Selected Databases.\\n"
278
- "This Action Is Not Reversible.\\n"
279
- "\\n"
280
- " Choose [Cancel] to stop, [Ok] to delete."
281
- msgstr ""
282
-
283
- #: database-manage.php:45
284
- #: database-manage.php:205
285
- msgid "Restore"
286
- msgstr ""
287
-
288
- #: database-manage.php:55
289
- #, php-format
290
- msgid "Database On '%s' Failed To Restore"
291
- msgstr ""
292
-
293
- #: database-manage.php:57
294
- #, php-format
295
- msgid "Database On '%s' Restored Successfully"
296
- msgstr ""
297
-
298
- #: database-manage.php:60
299
- #: database-manage.php:113
300
- #: database-manage.php:118
301
- #: database-manage.php:133
302
- msgid "No Backup Database File Selected"
303
- msgstr ""
304
-
305
- #: database-manage.php:63
306
- #: database-manage.php:200
307
- msgid "E-Mail"
308
- msgstr ""
309
-
310
- #: database-manage.php:79
311
- #: wp-dbmanager.php:103
312
- #, php-format
313
- msgid "%s Database Backup File For %s"
314
- msgstr ""
315
-
316
- #: database-manage.php:88
317
- #: wp-dbmanager.php:112
318
- msgid "Website Name:"
319
- msgstr ""
320
-
321
- #: database-manage.php:89
322
- #: wp-dbmanager.php:113
323
- msgid "Website URL:"
324
- msgstr ""
325
-
326
- #: database-manage.php:90
327
- #: wp-dbmanager.php:114
328
- msgid "Backup File Name:"
329
- msgstr ""
330
-
331
- #: database-manage.php:91
332
- #: wp-dbmanager.php:115
333
- msgid "Backup File Date:"
334
- msgstr ""
335
-
336
- #: database-manage.php:92
337
- #: wp-dbmanager.php:116
338
- msgid "Backup File Size:"
339
- msgstr ""
340
-
341
- #: database-manage.php:93
342
- #: wp-dbmanager.php:117
343
- msgid "With Regards,"
344
- msgstr ""
345
-
346
- #: database-manage.php:94
347
- #: wp-dbmanager.php:118
348
- msgid "Administrator"
349
- msgstr ""
350
-
351
- #: database-manage.php:108
352
- #, php-format
353
- msgid "Database Backup File For '%s' Successfully E-Mailed To '%s'"
354
- msgstr ""
355
-
356
- #: database-manage.php:110
357
- #, php-format
358
- msgid "Unable To E-Mail Database Backup File For '%s' To '%s'"
359
- msgstr ""
360
-
361
- #: database-manage.php:116
362
- #: database-manage.php:204
363
- #: wp-dbmanager.php:328
364
- msgid "Download"
365
- msgstr ""
366
-
367
- #: database-manage.php:121
368
- #: database-manage.php:206
369
- msgid "Delete"
370
- msgstr ""
371
-
372
- #: database-manage.php:125
373
- #, php-format
374
- msgid "Unable To Delete Database Backup File On '%s'"
375
- msgstr ""
376
-
377
- #: database-manage.php:127
378
- #, php-format
379
- msgid "Database Backup File On '%s' Deleted Successfully"
380
- msgstr ""
381
-
382
- #: database-manage.php:130
383
- #, php-format
384
- msgid "Invalid Database Backup File On '%s'"
385
- msgstr ""
386
-
387
- #: database-manage.php:144
388
- msgid "Manage Backup Database"
389
- msgstr ""
390
-
391
- #: database-manage.php:145
392
- msgid "Choose A Backup Date To E-Mail, Restore, Download Or Delete"
393
- msgstr ""
394
-
395
- #: database-manage.php:149
396
- #: database-manager.php:84
397
- msgid "No."
398
- msgstr ""
399
-
400
- #: database-manage.php:150
401
- msgid "Database File"
402
- msgstr ""
403
-
404
- #: database-manage.php:151
405
- msgid "Date/Time"
406
- msgstr ""
407
-
408
- #: database-manage.php:152
409
- msgid "Size"
410
- msgstr ""
411
-
412
- #: database-manage.php:153
413
- msgid "Select"
414
- msgstr ""
415
-
416
- #: database-manage.php:186
417
- #: database-manage.php:189
418
- msgid "There Are No Database Backup Files Available."
419
- msgstr ""
420
-
421
- #: database-manage.php:200
422
- msgid "E-mail database backup file to:"
423
- msgstr ""
424
-
425
- #: database-manage.php:205
426
- msgid ""
427
- "You Are About To Restore A Database.\\n"
428
- "This Action Is Not Reversible.\\n"
429
- "Any Data Inserted After The Backup Date Will Be Gone.\\n"
430
- "\\n"
431
- " Choose [Cancel] to stop, [Ok] to restore."
432
- msgstr ""
433
-
434
- #: database-manage.php:206
435
- msgid ""
436
- "You Are About To Delete The Selected Database Backup Files.\\n"
437
- "This Action Is Not Reversible.\\n"
438
- "\\n"
439
- " Choose [Cancel] to stop, [Ok] to delete."
440
- msgstr ""
441
-
442
- #: database-manager.php:44
443
- #: wp-dbmanager.php:42
444
- msgid "Database"
445
- msgstr ""
446
-
447
- #: database-manager.php:45
448
- msgid "Database Information"
449
- msgstr ""
450
-
451
- #: database-manager.php:50
452
- msgid "Setting"
453
- msgstr ""
454
-
455
- #: database-manager.php:55
456
- msgid "Database Host"
457
- msgstr ""
458
-
459
- #: database-manager.php:59
460
- msgid "Database Name"
461
- msgstr ""
462
-
463
- #: database-manager.php:63
464
- msgid "Database User"
465
- msgstr ""
466
-
467
- #: database-manager.php:67
468
- msgid "Database Type"
469
- msgstr ""
470
-
471
- #: database-manager.php:71
472
- msgid "Database Version"
473
- msgstr ""
474
-
475
- #: database-manager.php:79
476
- msgid "Tables Information"
477
- msgstr ""
478
-
479
- #: database-manager.php:86
480
- msgid "Records"
481
- msgstr ""
482
-
483
- #: database-manager.php:87
484
- msgid "Data Usage"
485
- msgstr ""
486
-
487
- #: database-manager.php:88
488
- msgid "Index Usage"
489
- msgstr ""
490
-
491
- #: database-manager.php:89
492
- msgid "Overhead"
493
- msgstr ""
494
-
495
- #: database-manager.php:117
496
- msgid "Total:"
497
- msgstr ""
498
-
499
- #: database-manager.php:125
500
- msgid "Could Not Show Table Status Due To Your MYSQL Version Is Lower Than 3.23."
501
- msgstr ""
502
-
503
- #: database-optimize.php:37
504
- #: database-optimize.php:95
505
- msgid "Optimize"
506
- msgstr ""
507
-
508
- #: database-optimize.php:45
509
- #: database-repair.php:45
510
- msgid "No Tables Selected"
511
- msgstr ""
512
-
513
- #: database-optimize.php:52
514
- #, php-format
515
- msgid "Table(s) '%s' NOT Optimized"
516
- msgstr ""
517
-
518
- #: database-optimize.php:54
519
- #, php-format
520
- msgid "Table(s) '%s' Optimized"
521
- msgstr ""
522
-
523
- #: database-optimize.php:70
524
- msgid "Optimize Database"
525
- msgstr ""
526
-
527
- #: database-optimize.php:76
528
- #: database-repair.php:76
529
- msgid "Options"
530
- msgstr ""
531
-
532
- #: database-optimize.php:92
533
- msgid "Database should be optimize once every month."
534
- msgstr ""
535
-
536
- #: database-repair.php:52
537
- #, php-format
538
- msgid "Table(s) '%s' NOT Repaired"
539
- msgstr ""
540
-
541
- #: database-repair.php:54
542
- #, php-format
543
- msgid "Table(s) '%s' Repaired"
544
- msgstr ""
545
-
546
- #: database-repair.php:70
547
- msgid "Repair Database"
548
- msgstr ""
549
-
550
- #: database-repair.php:92
551
- msgid "Repair"
552
- msgstr ""
553
-
554
- #: database-run.php:41
555
- #: database-run.php:98
556
- msgid "Run"
557
- msgstr ""
558
-
559
- #: database-run.php:71
560
- msgid "Query(s) Executed Successfully"
561
- msgstr ""
562
-
563
- #: database-run.php:73
564
- #: database-run.php:76
565
- msgid "Empty Query"
566
- msgstr ""
567
-
568
- #: database-run.php:87
569
- #: wp-dbmanager.php:50
570
- msgid "Run SQL Query"
571
- msgstr ""
572
-
573
- #: database-run.php:90
574
- msgid "Seperate Multiple Queries With A New Line"
575
- msgstr ""
576
-
577
- #: database-run.php:91
578
- msgid "Use Only INSERT, UPDATE, REPLACE, DELETE, CREATE and ALTER statements."
579
- msgstr ""
580
-
581
- #: database-run.php:102
582
- msgid "1. CREATE statement will return an error, which is perfectly normal due to the database class. To confirm that your table has been created check the Manage Database page."
583
- msgstr ""
584
-
585
- #: database-run.php:103
586
- msgid "2. UPDATE statement may return an error sometimes due to the newly updated value being the same as the previous value."
587
- msgstr ""
588
-
589
- #: database-run.php:104
590
- msgid "3. ALTER statement will return an error because there is no value returned."
591
- msgstr ""
592
-
593
- #: database-uninstall.php:39
594
- #: database-uninstall.php:127
595
- msgid "UNINSTALL WP-DBManager"
596
- msgstr ""
597
-
598
- #: database-uninstall.php:47
599
- #, php-format
600
- msgid "Setting Key '%s' has been deleted."
601
- msgstr ""
602
-
603
- #: database-uninstall.php:51
604
- #, php-format
605
- msgid "Error deleting Setting Key '%s'."
606
- msgstr ""
607
-
608
- #: database-uninstall.php:57
609
- #: database-uninstall.php:100
610
- msgid "The database backup files generated by WP-DBManager <strong>WILL NOT</strong> be deleted. You will have to delete it manually."
611
- msgstr ""
612
-
613
- #: database-uninstall.php:59
614
- #: database-uninstall.php:101
615
- #, php-format
616
- msgid "The path to the backup folder is <strong>'%s'</strong>."
617
- msgstr ""
618
-
619
- #: database-uninstall.php:79
620
- #: database-uninstall.php:90
621
- #: wp-dbmanager.php:52
622
- msgid "Uninstall WP-DBManager"
623
- msgstr ""
624
-
625
- #: database-uninstall.php:80
626
- #, php-format
627
- msgid "<a href=\"%s\">Click Here</a> To Finish The Uninstallation And WP-DBManager Will Be Deactivated Automatically."
628
- msgstr ""
629
-
630
- #: database-uninstall.php:92
631
- msgid "Deactivating WP-DBManager plugin does not remove any data that may have been created, such as the database options. To completely remove this plugin, you can uninstall it here."
632
- msgstr ""
633
-
634
- #: database-uninstall.php:95
635
- msgid "WARNING:"
636
- msgstr ""
637
-
638
- #: database-uninstall.php:96
639
- msgid "Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first."
640
- msgstr ""
641
-
642
- #: database-uninstall.php:99
643
- msgid "NOTE:"
644
- msgstr ""
645
-
646
- #: database-uninstall.php:104
647
- msgid "The following WordPress Options will be DELETED:"
648
- msgstr ""
649
-
650
- #: database-uninstall.php:109
651
- msgid "WordPress Options"
652
- msgstr ""
653
-
654
- #: database-uninstall.php:127
655
- msgid ""
656
- "You Are About To Uninstall WP-DBManager From WordPress.\\n"
657
- "This Action Is Not Reversible.\\n"
658
- "\\n"
659
- " Choose [Cancel] To Stop, [OK] To Uninstall."
660
- msgstr ""
661
-
662
- #: wp-dbmanager.php:45
663
- msgid "Backup DB"
664
- msgstr ""
665
-
666
- #: wp-dbmanager.php:46
667
- msgid "Manage Backup DB"
668
- msgstr ""
669
-
670
- #: wp-dbmanager.php:47
671
- msgid "Optimize DB"
672
- msgstr ""
673
-
674
- #: wp-dbmanager.php:48
675
- msgid "Repair DB"
676
- msgstr ""
677
-
678
- #: wp-dbmanager.php:51
679
- msgid "DB Options"
680
- msgstr ""
681
-
682
- #: wp-dbmanager.php:161
683
- msgid "WP-DBManager Backup Schedule"
684
- msgstr ""
685
-
686
- #: wp-dbmanager.php:162
687
- msgid "WP-DBManager Optimize Schedule"
688
- msgstr ""
689
-
690
- #: wp-dbmanager.php:172
691
- msgid "Your backup folder MIGHT be visible to the public"
692
- msgstr ""
693
-
694
- #: wp-dbmanager.php:172
695
- #, php-format
696
- msgid "To correct this issue, move the <strong>.htaccess</strong> file from <strong>wp-content/plugins/wp-dbmanager</strong> to <strong>%s</strong>"
697
- msgstr ""
698
-
699
- #: wp-dbmanager.php:227
700
- msgid "GiB"
701
- msgstr ""
702
-
703
- #: wp-dbmanager.php:229
704
- msgid "MiB"
705
- msgstr ""
706
-
707
- #: wp-dbmanager.php:231
708
- msgid "KiB"
709
- msgstr ""
710
-
711
- #: wp-dbmanager.php:233
712
- msgid "bytes"
713
- msgstr ""
714
-
715
- #: wp-dbmanager.php:367
716
- msgid "Database Options Updated"
717
- msgstr ""
718
-
719
- #: wp-dbmanager.php:370
720
- msgid "No Database Option Updated"
721
- msgstr ""
722
-
723
- #: wp-dbmanager.php:402
724
- msgid "Database Options"
725
- msgstr ""
726
-
727
- #: wp-dbmanager.php:403
728
- msgid "Paths"
729
- msgstr ""
730
-
731
- #: wp-dbmanager.php:406
732
- msgid "Path To mysqldump:"
733
- msgstr ""
734
-
735
- #: wp-dbmanager.php:408
736
- #: wp-dbmanager.php:415
737
- msgid "Auto Detect"
738
- msgstr ""
739
-
740
- #: wp-dbmanager.php:409
741
- msgid "The absolute path to mysqldump without trailing slash. If unsure, please email your server administrator about this."
742
- msgstr ""
743
-
744
- #: wp-dbmanager.php:413
745
- msgid "Path To mysql:"
746
- msgstr ""
747
-
748
- #: wp-dbmanager.php:416
749
- msgid "The absolute path to mysql without trailing slash. If unsure, please email your server administrator about this."
750
- msgstr ""
751
-
752
- #: wp-dbmanager.php:420
753
- msgid "Path To Backup:"
754
- msgstr ""
755
-
756
- #: wp-dbmanager.php:423
757
- msgid "The absolute path to your database backup folder without trailing slash. Make sure the folder is writable."
758
- msgstr ""
759
-
760
- #: wp-dbmanager.php:427
761
- msgid "Maximum Backup Files:"
762
- msgstr ""
763
-
764
- #: wp-dbmanager.php:430
765
- msgid "The maximum number of database backup files that is allowed in the backup folder as stated above. The oldest database backup file is always deleted in order to maintain this value. This is to prevent the backup folder from getting too large."
766
- msgstr ""
767
-
768
- #: wp-dbmanager.php:435
769
- #: wp-dbmanager.php:453
770
- msgid "Note"
771
- msgstr ""
772
-
773
- #: wp-dbmanager.php:439
774
- msgid "Windows Server"
775
- msgstr ""
776
-
777
- #: wp-dbmanager.php:440
778
- msgid "For mysqldump path, you can try '<strong>mysqldump.exe</strong>'."
779
- msgstr ""
780
-
781
- #: wp-dbmanager.php:441
782
- msgid "For mysql path, you can try '<strong>mysql.exe</strong>'."
783
- msgstr ""
784
-
785
- #: wp-dbmanager.php:446
786
- msgid "Linux Server"
787
- msgstr ""
788
-
789
- #: wp-dbmanager.php:447
790
- msgid "For mysqldump path, normally is just '<strong>mysqldump</strong>'."
791
- msgstr ""
792
-
793
- #: wp-dbmanager.php:448
794
- msgid "For mysql path, normally is just '<strong>mysql</strong>'."
795
- msgstr ""
796
-
797
- #: wp-dbmanager.php:454
798
- msgid "The 'Auto Detect' function does not work for some servers. If it does not work for you, please contact your server administrator for the MYSQL and MYSQL DUMP paths."
799
- msgstr ""
800
-
801
- #: wp-dbmanager.php:459
802
- msgid "Automatic Scheduling"
803
- msgstr ""
804
-
805
- #: wp-dbmanager.php:462
806
- msgid "Automatic Backing Up Of DB:"
807
- msgstr ""
808
-
809
- #: wp-dbmanager.php:465
810
- msgid "Next backup date: "
811
- msgstr ""
812
-
813
- #: wp-dbmanager.php:469
814
- #: wp-dbmanager.php:500
815
- msgid "N/A"
816
- msgstr ""
817
-
818
- #: wp-dbmanager.php:473
819
- #: wp-dbmanager.php:504
820
- msgid "Every"
821
- msgstr ""
822
-
823
- #: wp-dbmanager.php:475
824
- #: wp-dbmanager.php:506
825
- msgid "Disable"
826
- msgstr ""
827
-
828
- #: wp-dbmanager.php:476
829
- #: wp-dbmanager.php:507
830
- msgid "Minutes(s)"
831
- msgstr ""
832
-
833
- #: wp-dbmanager.php:477
834
- #: wp-dbmanager.php:508
835
- msgid "Hour(s)"
836
- msgstr ""
837
-
838
- #: wp-dbmanager.php:478
839
- #: wp-dbmanager.php:509
840
- msgid "Day(s)"
841
- msgstr ""
842
-
843
- #: wp-dbmanager.php:479
844
- #: wp-dbmanager.php:510
845
- msgid "Week(s)"
846
- msgstr ""
847
-
848
- #: wp-dbmanager.php:480
849
- #: wp-dbmanager.php:511
850
- msgid "Month(s)"
851
- msgstr ""
852
-
853
- #: wp-dbmanager.php:482
854
- msgid "Gzip"
855
- msgstr ""
856
-
857
- #: wp-dbmanager.php:488
858
- msgid "E-mail backup to:"
859
- msgstr ""
860
-
861
- #: wp-dbmanager.php:488
862
- msgid "(Leave blank to disable this feature)"
863
- msgstr ""
864
-
865
- #: wp-dbmanager.php:489
866
- msgid "WP-DBManager can automatically backup your database after a certain period."
867
- msgstr ""
868
-
869
- #: wp-dbmanager.php:493
870
- msgid "Automatic Optimizing Of DB:"
871
- msgstr ""
872
-
873
- #: wp-dbmanager.php:496
874
- msgid "Next optimize date: "
875
- msgstr ""
876
-
877
- #: wp-dbmanager.php:514
878
- msgid "WP-DBManager can automatically optimize your database after a certain period."
879
- msgstr ""
880
-
881
- #: wp-dbmanager.php:519
882
- msgid "Save Changes"
883
- msgstr ""
884
-