Version Description
Download this release
Release Info
Developer | GamerZ |
Plugin | WP-DBManager |
Version | 2.05 |
Comparing to | |
See all releases |
Version 2.05
- .htaccess +4 -0
- dbmanager/database-backup.php +195 -0
- dbmanager/database-config.php +76 -0
- dbmanager/database-empty.php +95 -0
- dbmanager/database-manage.php +182 -0
- dbmanager/database-manager.php +106 -0
- dbmanager/database-optimize.php +88 -0
- dbmanager/database-run.php +79 -0
- dbmanager/dbmanager.php +154 -0
- readme.html +329 -0
.htaccess
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<Files ~ ".*\..*">
|
2 |
+
order allow,deny
|
3 |
+
deny from all
|
4 |
+
</Files>
|
dbmanager/database-backup.php
ADDED
@@ -0,0 +1,195 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
+----------------------------------------------------------------+
|
4 |
+
| |
|
5 |
+
| WordPress 2.0 Plugin: WP-DBManager 2.05 |
|
6 |
+
| Copyright (c) 2005 Lester "GaMerZ" Chan |
|
7 |
+
| |
|
8 |
+
| File Written By: |
|
9 |
+
| - Lester "GaMerZ" Chan |
|
10 |
+
| - http://www.lesterchan.net |
|
11 |
+
| |
|
12 |
+
| File Information: |
|
13 |
+
| - Database Backup |
|
14 |
+
| - wp-content/plugins/dbmanager/database-backup.php |
|
15 |
+
| |
|
16 |
+
+----------------------------------------------------------------+
|
17 |
+
*/
|
18 |
+
|
19 |
+
|
20 |
+
### Require Database Config
|
21 |
+
require('database-config.php');
|
22 |
+
|
23 |
+
### Form Processing
|
24 |
+
if($_POST['do']) {
|
25 |
+
// Decide What To Do
|
26 |
+
switch($_POST['do']) {
|
27 |
+
case 'Backup':
|
28 |
+
$gzip = intval($_POST['gzip']);
|
29 |
+
if($gzip == 1) {
|
30 |
+
$backup['filename'] = $backup['date'].'_-_'.DB_NAME.'.sql.gz';
|
31 |
+
$backup['filepath'] = $backup['path'].'/'.$backup['filename'];
|
32 |
+
$backup['command'] = $backup['mysqldumppath'].' --host='.DB_HOST.' --user='.DB_USER.' --password='.DB_PASSWORD.' --add-drop-table '.DB_NAME.' | gzip > '.$backup['filepath'];
|
33 |
+
} else {
|
34 |
+
$backup['filename'] = $backup['date'].'_-_'.DB_NAME.'.sql';
|
35 |
+
$backup['filepath'] = $backup['path'].'/'.$backup['filename'];
|
36 |
+
$backup['command'] = $backup['mysqldumppath'].' --host='.DB_HOST.' --user='.DB_USER.' --password='.DB_PASSWORD.' --add-drop-table '.DB_NAME.' > '.$backup['filepath'];
|
37 |
+
}
|
38 |
+
passthru($backup['command'], $error);
|
39 |
+
if(!is_writable($backup['path'])) {
|
40 |
+
$text = "<font color=\"red\">Database Failed To Backup On '$current_date'. Backup Folder Not Writable.</font>";
|
41 |
+
} elseif(filesize($backup['filepath']) == 0) {
|
42 |
+
unlink($backup['filepath']);
|
43 |
+
$text = "<font color=\"red\">Database Failed To Backup On '$current_date'. Backup File Size Is 0KB.</font>";
|
44 |
+
} elseif(!is_file($backup['filepath'])) {
|
45 |
+
$text = "<font color=\"red\">Database Failed To Backup On '$current_date'. Invalid Backup File Path.</font>";
|
46 |
+
} elseif($error) {
|
47 |
+
$text = "<font color=\"red\">Database Failed To Backup On '$current_date'.</font>";
|
48 |
+
} else {
|
49 |
+
$text = "<font color=\"green\">Database Backed Up Successfully On '$current_date'.</font>";
|
50 |
+
}
|
51 |
+
break;
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
|
56 |
+
### Backup File Name
|
57 |
+
$backup['filename'] = $backup['date'].'_-_'.DB_NAME.'.sql';
|
58 |
+
|
59 |
+
|
60 |
+
### MYSQL Base Dir
|
61 |
+
$mysql_basedir = $wpdb->get_row("SHOW VARIABLES LIKE 'basedir'");
|
62 |
+
$mysql_basedir = $mysql_basedir->Value;
|
63 |
+
if($mysql_basedir == '/') { $mysql_basedir = '/usr/'; }
|
64 |
+
$status_count = 0;
|
65 |
+
$stats_function_disabled = 0;
|
66 |
+
?>
|
67 |
+
<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
|
68 |
+
<!-- Checking Backup Status -->
|
69 |
+
<div class="wrap">
|
70 |
+
<h2>Checking Backup Status</h2>
|
71 |
+
<p>
|
72 |
+
Checking Backup Folder (<b><?php echo stripslashes($backup['path']); ?></b>) ...<br />
|
73 |
+
<?php
|
74 |
+
if(is_dir(stripslashes($backup['path']))) {
|
75 |
+
echo '<font color="green">Backup folder exists</font><br />';
|
76 |
+
$status_count++;
|
77 |
+
} else {
|
78 |
+
echo '<font color="red">Backup folder does NOT exist. Please create \'backup-db\' folder in \'wp-content\' folder and CHMOD it to \'777\' or change the location of the backup folder under DB Option.</font><br />';
|
79 |
+
}
|
80 |
+
if(is_writable(stripslashes($backup['path']))) {
|
81 |
+
echo '<font color="green">Backup folder is writable</font>';
|
82 |
+
$status_count++;
|
83 |
+
} else {
|
84 |
+
echo '<font color="red">Backup folder is NOT writable. Please CHMOD it to \'777\'.</font>';
|
85 |
+
}
|
86 |
+
?>
|
87 |
+
</p>
|
88 |
+
<p>
|
89 |
+
<?php
|
90 |
+
if(file_exists($mysql_basedir.'bin/'.stripslashes($backup['mysqldumppath']))) {
|
91 |
+
echo 'Checking MYSQL Dump Path (<b>'.$mysql_basedir.'bin/'.stripslashes($backup['mysqldumppath']).'</b>) ...<br />';
|
92 |
+
echo '<font color="green">MYSQL dump path exists.</font>';
|
93 |
+
$status_count++;
|
94 |
+
} else if(file_exists(stripslashes($backup['mysqldumppath']))) {
|
95 |
+
echo 'Checking MYSQL Dump Path (<b>'.stripslashes($backup['mysqldumppath']).'</b>) ...<br />';
|
96 |
+
echo '<font color="green">MYSQL dump path exists.</font>';
|
97 |
+
$status_count++;
|
98 |
+
} else {
|
99 |
+
echo 'Checking MYSQL Dump Path ...<br />';
|
100 |
+
echo '<font color="red">MYSQL dump path does NOT exist. Please check your mysqldump path under DB Options. If uncertain, contact your server administrator.</font>';
|
101 |
+
}
|
102 |
+
?>
|
103 |
+
</p>
|
104 |
+
<p>
|
105 |
+
<?php
|
106 |
+
if(file_exists($mysql_basedir.'bin/'.stripslashes($backup['mysqlpath']))) {
|
107 |
+
echo 'Checking MYSQL Path (<b>'.$mysql_basedir.'bin/'.stripslashes($backup['mysqlpath']).'</b>) ...<br />';
|
108 |
+
echo '<font color="green">MYSQL path exists.</font>';
|
109 |
+
$status_count++;
|
110 |
+
} else if(file_exists(stripslashes($backup['mysqlpath']))) {
|
111 |
+
echo 'Checking MYSQL Path (<b>'.stripslashes($backup['mysqlpath']).'</b>) ...<br />';
|
112 |
+
echo '<font color="green">MYSQL path exists.</font>';
|
113 |
+
$status_count++;
|
114 |
+
} else {
|
115 |
+
echo 'Checking MYSQL Path ...<br />';
|
116 |
+
echo '<font color="red">MYSQL path does NOT exist. Please check your mysql path under DB Options. If uncertain, contact your server administrator.</font>';
|
117 |
+
}
|
118 |
+
?>
|
119 |
+
</p>
|
120 |
+
<p>
|
121 |
+
Checking PHP Functions (<b>passthru()</b>, <b>system()</b> and <b>exec()</b>) ...<br />
|
122 |
+
<?php
|
123 |
+
if(function_exists('passthru')) {
|
124 |
+
echo '<font color="green">passthru() enabled.</font><br />';
|
125 |
+
$status_count++;
|
126 |
+
} else {
|
127 |
+
echo '<font color="red">passthru() disabled.</font><br />';
|
128 |
+
$stats_function_disabled++;
|
129 |
+
}
|
130 |
+
if(function_exists('system')) {
|
131 |
+
echo '<font color="green">system() enabled.</font><br />';
|
132 |
+
} else {
|
133 |
+
echo '<font color="red">system() disabled.</font><br />';
|
134 |
+
$stats_function_disabled++;
|
135 |
+
}
|
136 |
+
if(function_exists('exec')) {
|
137 |
+
echo '<font color="green">exec() enabled.</font>';
|
138 |
+
} else {
|
139 |
+
echo '<font color="red">exec() disabled.</font>';
|
140 |
+
$stats_function_disabled++;
|
141 |
+
}
|
142 |
+
?>
|
143 |
+
</p>
|
144 |
+
<p>
|
145 |
+
<?php
|
146 |
+
if($status_count == 5) {
|
147 |
+
echo '<b><font color="green">Excellent. You Are Good To Go.</font></b>';
|
148 |
+
} else if($stats_function_disabled == 3) {
|
149 |
+
echo '<b><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.</font></b>';
|
150 |
+
} else {
|
151 |
+
echo '<b><font color="red">Please Rectify The Error Highlighted In Red Before Proceeding On.</font></b>';
|
152 |
+
}
|
153 |
+
?>
|
154 |
+
</p>
|
155 |
+
<p><i>Note: The checking of backup status is still undergoing testing, if you get a 'Good To Go' status but can't perform the backup or you get some errors but still can perform the backup, please drop me an <a href="mailto:gamerz84@hotmail.com?Subject=WP-DBManager: Checking Of Backup Status">email</a>.</i></p>
|
156 |
+
</div>
|
157 |
+
<!-- Backup Database -->
|
158 |
+
<div class="wrap">
|
159 |
+
<h2>Backup Database</h2>
|
160 |
+
<form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
|
161 |
+
<table width="100%" cellspacing="3" cellpadding="3" border="0">
|
162 |
+
<tr style='background-color: #eee'>
|
163 |
+
<th align="left" scope="row">Database Name:</th>
|
164 |
+
<td><?php echo DB_NAME; ?></td>
|
165 |
+
</tr>
|
166 |
+
<tr style='background-color: none'>
|
167 |
+
<th align="left" scope="row">Database Backup To:</th>
|
168 |
+
<td><?php echo stripslashes($backup['path']); ?></td>
|
169 |
+
</tr>
|
170 |
+
<tr style='background-color: #eee'>
|
171 |
+
<th align="left" scope="row">Database Backup Date:</th>
|
172 |
+
<td><?php echo gmdate('l, jS F Y @ H:i', $backup['date']); ?></td>
|
173 |
+
</tr>
|
174 |
+
<tr style='background-color: none'>
|
175 |
+
<th align="left" scope="row">Database Backup File Name:</th>
|
176 |
+
<td><?php echo $backup['filename']; ?></td>
|
177 |
+
</tr>
|
178 |
+
<tr style='background-color: #eee'>
|
179 |
+
<th align="left" scope="row">Database Backup Type:</th>
|
180 |
+
<td>Full (Structure and Data)</td>
|
181 |
+
</tr>
|
182 |
+
<tr style='background-color: none'>
|
183 |
+
<th align="left" scope="row">MYSQL Dump Location:</th>
|
184 |
+
<td><?php echo stripslashes($backup['mysqldumppath']); ?></td>
|
185 |
+
</tr>
|
186 |
+
<tr style='background-color: #eee'>
|
187 |
+
<th align="left" scope="row">GZIP Database Backup File?</th>
|
188 |
+
<td><input type="radio" name="gzip" value="1" />Yes <input type="radio" name="gzip" value="0" checked="checked" />No</td>
|
189 |
+
</tr>
|
190 |
+
<tr>
|
191 |
+
<td colspan="2" align="center"><input type="submit" name="do" value="Backup" class="button" /> <input type="button" name="cancel" value="<?php _e('Cancel'); ?>" class="button" onclick="javascript:history.go(-1)" /></td>
|
192 |
+
</tr>
|
193 |
+
</table>
|
194 |
+
</form>
|
195 |
+
</div>
|
dbmanager/database-config.php
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
+----------------------------------------------------------------+
|
4 |
+
| |
|
5 |
+
| WordPress 2.0 Plugin: WP-DBManager 2.05 |
|
6 |
+
| Copyright (c) 2005 Lester "GaMerZ" Chan |
|
7 |
+
| |
|
8 |
+
| File Written By: |
|
9 |
+
| - Lester "GaMerZ" Chan |
|
10 |
+
| - http://www.lesterchan.net |
|
11 |
+
| |
|
12 |
+
| File Information: |
|
13 |
+
| - Database Config |
|
14 |
+
| - wp-content/plugins/dbmanager/database-config.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('dbmanager/database-manager.php');
|
28 |
+
$base_page = 'admin.php?page='.$base_name;
|
29 |
+
$current_date = gmdate('l, jS F Y @ H:i', (time() + (get_settings('gmt_offset') * 3600)));
|
30 |
+
$backup = array();
|
31 |
+
$backup_options = get_settings('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 |
+
### Format Bytes Into KB/MB
|
39 |
+
function format_size($rawSize) {
|
40 |
+
if($rawSize / 1073741824 > 1)
|
41 |
+
return round($rawSize/1048576, 1) . ' GB';
|
42 |
+
else if ($rawSize / 1048576 > 1)
|
43 |
+
return round($rawSize/1048576, 1) . ' MB';
|
44 |
+
else if ($rawSize / 1024 > 1)
|
45 |
+
return round($rawSize/1024, 1) . ' KB';
|
46 |
+
else
|
47 |
+
return round($rawSize, 1) . ' bytes';
|
48 |
+
}
|
49 |
+
|
50 |
+
|
51 |
+
### Get File Extension
|
52 |
+
function file_ext($file_name) {
|
53 |
+
return substr(strrchr($file_name, '.'), 1);
|
54 |
+
}
|
55 |
+
|
56 |
+
|
57 |
+
### Check Folder Whether There Is Any File Inside
|
58 |
+
function is_emtpy_folder($folder){
|
59 |
+
if(is_dir($folder) ){
|
60 |
+
$handle = opendir($folder);
|
61 |
+
while( (gettype( $name = readdir($handle)) != 'boolean')){
|
62 |
+
$name_array[] = $name;
|
63 |
+
}
|
64 |
+
foreach($name_array as $temp)
|
65 |
+
$folder_content .= $temp;
|
66 |
+
|
67 |
+
if($folder_content == '...')
|
68 |
+
return true;
|
69 |
+
else
|
70 |
+
return false;
|
71 |
+
closedir($handle);
|
72 |
+
}
|
73 |
+
else
|
74 |
+
return true; // folder doesnt exist
|
75 |
+
}
|
76 |
+
?>
|
dbmanager/database-empty.php
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
+----------------------------------------------------------------+
|
4 |
+
| |
|
5 |
+
| WordPress 2.0 Plugin: WP-DBManager 2.05 |
|
6 |
+
| Copyright (c) 2005 Lester "GaMerZ" Chan |
|
7 |
+
| |
|
8 |
+
| File Written By: |
|
9 |
+
| - Lester "GaMerZ" Chan |
|
10 |
+
| - http://www.lesterchan.net |
|
11 |
+
| |
|
12 |
+
| File Information: |
|
13 |
+
| - Database Empty |
|
14 |
+
| - wp-content/plugins/dbmanager/database-empty.php |
|
15 |
+
| |
|
16 |
+
+----------------------------------------------------------------+
|
17 |
+
*/
|
18 |
+
|
19 |
+
|
20 |
+
### Require Database Config
|
21 |
+
require('database-config.php');
|
22 |
+
|
23 |
+
|
24 |
+
### Form Processing
|
25 |
+
if($_POST['do']) {
|
26 |
+
// Lets Prepare The Variables
|
27 |
+
$emptydrop = $_POST['emptydrop'];
|
28 |
+
|
29 |
+
// Decide What To Do
|
30 |
+
switch($_POST['do']) {
|
31 |
+
case 'Empty/Drop':
|
32 |
+
$empty_tables = array();
|
33 |
+
if(!empty($emptydrop)) {
|
34 |
+
foreach($emptydrop as $key => $value) {
|
35 |
+
if($value == 'empty') {
|
36 |
+
$empty_tables[] = $key;
|
37 |
+
} elseif($value == 'drop') {
|
38 |
+
$drop_tables .= ', '.$key;
|
39 |
+
}
|
40 |
+
}
|
41 |
+
} else {
|
42 |
+
$text = '<font color="red">No Tables Selected</font>';
|
43 |
+
}
|
44 |
+
$drop_tables = substr($drop_tables, 2);
|
45 |
+
if(!empty($empty_tables)) {
|
46 |
+
foreach($empty_tables as $empty_table) {
|
47 |
+
$empty_query = $wpdb->query("TRUNCATE $empty_table");
|
48 |
+
$text .= "<font color=\"green\">Table '$empty_table' Emptied</font><br />";
|
49 |
+
}
|
50 |
+
}
|
51 |
+
if(!empty($drop_tables)) {
|
52 |
+
$drop_query = $wpdb->query("DROP TABLE $drop_tables");
|
53 |
+
$text = "<font color=\"green\">Table(s) '$drop_tables' Dropped</font>";
|
54 |
+
}
|
55 |
+
break;
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
|
60 |
+
### Show Tables
|
61 |
+
$tables = $wpdb->get_col("SHOW TABLES");
|
62 |
+
?>
|
63 |
+
<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
|
64 |
+
<!-- Empty/Drop Tables -->
|
65 |
+
<div class="wrap">
|
66 |
+
<h2>Empty/Drop Tables</h2>
|
67 |
+
<form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
|
68 |
+
<table width="100%" cellspacing="3" cellpadding="3" border="0">
|
69 |
+
<tr>
|
70 |
+
<th align="left" scope="col">Tables</th>
|
71 |
+
<th align="left" scope="col">Empty</th>
|
72 |
+
<th align="left" scope="col">Drop</th>
|
73 |
+
</tr>
|
74 |
+
<?php
|
75 |
+
foreach($tables as $table_name) {
|
76 |
+
if($no%2 == 0) {
|
77 |
+
$style = 'style=\'background-color: #eee\'';
|
78 |
+
} else {
|
79 |
+
$style = 'style=\'background-color: none\'';
|
80 |
+
}
|
81 |
+
$no++;
|
82 |
+
echo "<tr $style><th align=\"left\" scope=\"row\">$table_name</th>\n";
|
83 |
+
echo "<td><input type=\"radio\" name=\"emptydrop[$table_name]\" value=\"empty\" /> Empty</td>";
|
84 |
+
echo "<td><input type=\"radio\" name=\"emptydrop[$table_name]\" value=\"drop\" /> Drop</td></tr>";
|
85 |
+
}
|
86 |
+
?>
|
87 |
+
<tr>
|
88 |
+
<td colspan="3">1. DROPPING a table means deleting the table. This action is not REVERSIBLE.<br />2. EMPTYING a table means all the rows in the table will be deleted. This action is not REVERSIBLE.</td>
|
89 |
+
</tr>
|
90 |
+
<tr>
|
91 |
+
<td colspan="3" align="center"><input type="submit" name="do" value="Empty/Drop" class="button" onclick="return confirm('You Are About To Empty Or Drop The Selected Databases.\nThis Action Is Not Reversible.\n\n Choose \'Cancel\' to stop, \'OK\' to delete.')" /> <input type="button" name="cancel" value="<?php _e('Cancel'); ?>" class="button" onclick="javascript:history.go(-1)" /></td>
|
92 |
+
</tr>
|
93 |
+
</table>
|
94 |
+
</form>
|
95 |
+
</div>
|
dbmanager/database-manage.php
ADDED
@@ -0,0 +1,182 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
+----------------------------------------------------------------+
|
4 |
+
| |
|
5 |
+
| WordPress 2.0 Plugin: WP-DBManager 2.05 |
|
6 |
+
| Copyright (c) 2005 Lester "GaMerZ" Chan |
|
7 |
+
| |
|
8 |
+
| File Written By: |
|
9 |
+
| - Lester "GaMerZ" Chan |
|
10 |
+
| - http://www.lesterchan.net |
|
11 |
+
| |
|
12 |
+
| File Information: |
|
13 |
+
| - Database Restore |
|
14 |
+
| - wp-content/plugins/dbmanager/database-restore.php |
|
15 |
+
| |
|
16 |
+
+----------------------------------------------------------------+
|
17 |
+
*/
|
18 |
+
|
19 |
+
|
20 |
+
### Require Database Config
|
21 |
+
require('database-config.php');
|
22 |
+
|
23 |
+
|
24 |
+
### Form Processing
|
25 |
+
if($_POST['do']) {
|
26 |
+
// Lets Prepare The Variables
|
27 |
+
$database_file = trim($_POST['database_file']);
|
28 |
+
$nice_file_date = gmdate('l, jS F Y @ H:i', substr($database_file, 0, 10));
|
29 |
+
|
30 |
+
// Decide What To Do
|
31 |
+
switch($_POST['do']) {
|
32 |
+
case 'Restore':
|
33 |
+
if(!empty($database_file)) {
|
34 |
+
if(stristr($database_file, '.gz')) {
|
35 |
+
$backup['command'] = 'gunzip < '.$backup['path'].'/'.$database_file.' | '.$backup['mysqlpath'].' --host='.DB_HOST.' --user='.DB_USER.' --password='.DB_PASSWORD.' '.DB_NAME;
|
36 |
+
} else {
|
37 |
+
$backup['command'] = $backup['mysqlpath'].' --host='.DB_HOST.' --user='.DB_USER.' --password='.DB_PASSWORD.' '.DB_NAME.' < '.$backup['path'].'/'.$database_file;
|
38 |
+
}
|
39 |
+
passthru($backup['command'], $error);
|
40 |
+
if($error) {
|
41 |
+
$text = "<font color=\"red\">Database On '$nice_file_date' Failed To Restore</font>";
|
42 |
+
} else {
|
43 |
+
$text = "<font color=\"green\">Database On '$nice_file_date' Restored Successfully</font>";
|
44 |
+
}
|
45 |
+
} else {
|
46 |
+
$text = '<font color="red">No Backup Database File Selected</font>';
|
47 |
+
}
|
48 |
+
break;
|
49 |
+
case 'E-Mail':
|
50 |
+
if(!empty($database_file)) {
|
51 |
+
// Get And Read The Database Backup File
|
52 |
+
$file_path = $backup['path'].'/'.$database_file;
|
53 |
+
$file_size = format_size(filesize($file_path));
|
54 |
+
$file_date = gmdate('l, jS F Y @ H:i', substr($database_file, 0, 10));
|
55 |
+
$file = fopen($file_path,'rb');
|
56 |
+
$file_data = fread($file,filesize($file_path));
|
57 |
+
fclose($file);
|
58 |
+
$file_data = chunk_split(base64_encode($file_data));
|
59 |
+
// Create Mail To, Mail Subject And Mail Header
|
60 |
+
if(!empty($_POST['email_to'])) {
|
61 |
+
$mail_to = trim($_POST['email_to']);
|
62 |
+
} else {
|
63 |
+
$mail_to = get_settings('admin_email');
|
64 |
+
}
|
65 |
+
$mail_subject = get_bloginfo('name').' Database Backup File For '.$file_date;
|
66 |
+
$mail_header = 'From: '.get_bloginfo('name').' Administrator <'.get_settings('admin_email').'>';
|
67 |
+
// MIME Boundary
|
68 |
+
$random_time = md5(time());
|
69 |
+
$mime_boundary = "==WP-DBManager- $random_time";
|
70 |
+
// Create Mail Header And Mail Message
|
71 |
+
$mail_header .= "\nMIME-Version: 1.0\n" .
|
72 |
+
"Content-Type: multipart/mixed;\n" .
|
73 |
+
" boundary=\"{$mime_boundary}\"";
|
74 |
+
$mail_message = "Website Name: ".get_bloginfo('name')."\nWebsite URL: ".get_bloginfo('siteurl')."\nBackup File Name: $database_file\nBackup File Date: $file_date\nBackup File Size: $file_size\n\nWith Regards,\n".get_bloginfo('name')." Administrator\n".get_bloginfo('siteurl');
|
75 |
+
$mail_message = "This is a multi-part message in MIME format.\n\n" .
|
76 |
+
"--{$mime_boundary}\n" .
|
77 |
+
"Content-Type: text/plain; charset=\"utf-8\"\n" .
|
78 |
+
"Content-Transfer-Encoding: 7bit\n\n".$mail_message."\n\n";
|
79 |
+
$mail_message .= "--{$mime_boundary}\n" .
|
80 |
+
"Content-Type: application/octet-stream;\n" .
|
81 |
+
" name=\"$database_file\"\n" .
|
82 |
+
"Content-Disposition: attachment;\n" .
|
83 |
+
" filename=\"$database_file\"\n" .
|
84 |
+
"Content-Transfer-Encoding: base64\n\n" .
|
85 |
+
$file_data."\n\n--{$mime_boundary}--\n";
|
86 |
+
if(mail($mail_to, $mail_subject, $mail_message, $mail_header)) {
|
87 |
+
$text .= "<font color=\"green\">Database Backup File For '$file_date' Successfully E-Mailed To '$mail_to'</font><br />";
|
88 |
+
} else {
|
89 |
+
$text = "<font color=\"red\">Unable To E-Mail Database Backup File For '$file_date' To '$mail_to'</font>";
|
90 |
+
}
|
91 |
+
} else {
|
92 |
+
$text = '<font color="red">No Backup Database File Selected</font>';
|
93 |
+
}
|
94 |
+
break;
|
95 |
+
case 'Download':
|
96 |
+
if(empty($database_file)) {
|
97 |
+
$text = '<font color="red">No Backup Database File Selected</font>';
|
98 |
+
}
|
99 |
+
break;
|
100 |
+
case 'Delete':
|
101 |
+
if(!empty($database_file)) {
|
102 |
+
$nice_file_date = gmdate('l, jS F Y @ H:i', substr($database_file, 0, 10));
|
103 |
+
if(is_file($backup['path'].'/'.$database_file)) {
|
104 |
+
if(!unlink($backup['path'].'/'.$database_file)) {
|
105 |
+
$text .= "<font color=\"red\">Unable To Delete Database Backup File On '$nice_file_date'</font><br />";
|
106 |
+
} else {
|
107 |
+
$text .= "<font color=\"green\">Database Backup File On '$nice_file_date' Deleted Successfully</font><br />";
|
108 |
+
}
|
109 |
+
} else {
|
110 |
+
$text = "<font color=\"red\">Invalid Database Backup File On '$nice_file_date'</font>";
|
111 |
+
}
|
112 |
+
} else {
|
113 |
+
$text = '<font color="red">No Backup Database File Selected</font>';
|
114 |
+
}
|
115 |
+
break;
|
116 |
+
}
|
117 |
+
}
|
118 |
+
?>
|
119 |
+
<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
|
120 |
+
<!-- Manage Backup Database -->
|
121 |
+
<div class="wrap">
|
122 |
+
<h2>Manage Backup Database</h2>
|
123 |
+
<form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
|
124 |
+
<table width="100%" cellspacing="3" cellpadding="3" border="0">
|
125 |
+
<tr>
|
126 |
+
<th align="left" scope="row" colspan="5">Choose A Backup Date To E-Mail, Restore, Download Or Delete</th>
|
127 |
+
</tr>
|
128 |
+
<tr>
|
129 |
+
<th align="left" scope="col">No.</th>
|
130 |
+
<th align="left" scope="col">Database File</th>
|
131 |
+
<th align="left" scope="col">Date/Time</th>
|
132 |
+
<th align="left" scope="col">Size</th>
|
133 |
+
<th align="left" scope="col">Select</th>
|
134 |
+
</tr>
|
135 |
+
<?php
|
136 |
+
if(!is_emtpy_folder($backup['path'])) {
|
137 |
+
if ($handle = opendir($backup['path'])) {
|
138 |
+
$database_files = array();
|
139 |
+
while (false !== ($file = readdir($handle))) {
|
140 |
+
if ($file != '.' && $file != '..' && (file_ext($file) == 'sql' || file_ext($file) == 'gz')) {
|
141 |
+
$database_files[] = $file;
|
142 |
+
}
|
143 |
+
}
|
144 |
+
closedir($handle);
|
145 |
+
for($i = (sizeof($database_files)-1); $i > -1; $i--) {
|
146 |
+
if($no%2 == 0) {
|
147 |
+
$style = 'style=\'background-color: #eee\'';
|
148 |
+
} else {
|
149 |
+
$style = 'style=\'background-color: none\'';
|
150 |
+
}
|
151 |
+
$no++;
|
152 |
+
$database_text = substr($database_files[$i], 13);
|
153 |
+
$date_text = gmdate('l, jS F Y @ H:i', substr($database_files[$i], 0, 10));
|
154 |
+
$size_text = filesize($backup['path'].'/'.$database_files[$i]);
|
155 |
+
echo "<tr $style>\n<td>$no</td>";
|
156 |
+
echo "<td>$database_text</td>";
|
157 |
+
echo "<td>$date_text</td>";
|
158 |
+
echo '<td>'.format_size($size_text).'</td>';
|
159 |
+
echo "<td><input type=\"radio\" name=\"database_file\" value=\"$database_files[$i]\" /></td>\n</tr>\n";
|
160 |
+
$totalsize += $size_text;
|
161 |
+
}
|
162 |
+
} else {
|
163 |
+
echo '<tr><td align="center" colspan="5">There Are No Database Backup Files Available</td></tr>';
|
164 |
+
}
|
165 |
+
} else {
|
166 |
+
echo '<tr><td align="center" colspan="5">There Are No Database Backup Files Available</td></tr>';
|
167 |
+
}
|
168 |
+
?>
|
169 |
+
<tr>
|
170 |
+
<th align="left" colspan="3"><?php echo $no; ?> Backup File(s)</th>
|
171 |
+
<th align="left"><?php echo format_size($totalsize); ?></th>
|
172 |
+
<td> </td>
|
173 |
+
</tr>
|
174 |
+
<tr>
|
175 |
+
<td colspan="5">E-mail database backup file to: <input type="text" name="email_to" size="30" maxlength="50" value="<?php echo get_settings('admin_email'); ?>" /> <input type="submit" name="do" value="E-Mail" class="button" /></td>
|
176 |
+
</tr>
|
177 |
+
<tr>
|
178 |
+
<td colspan="5" align="center"><input type="submit" name="do" value="Download" class="button" /> <input type="submit" name="do" value="Restore" onclick="return confirm('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.')" class="button" /> <input type="submit" class="button" name="do" value="Delete" onclick="return confirm('You Are About To Delete The Selected Database Backup Files.\nThis Action Is Not Reversible.\n\n Choose \'Cancel\' to stop, \'OK\' to delete.')" /> <input type="button" name="cancel" value="<?php _e('Cancel'); ?>" class="button" onclick="javascript:history.go(-1)" /></td>
|
179 |
+
</tr>
|
180 |
+
</table>
|
181 |
+
</form>
|
182 |
+
</div>
|
dbmanager/database-manager.php
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
+----------------------------------------------------------------+
|
4 |
+
| |
|
5 |
+
| WordPress 2.0 Plugin: WP-DBManager 2.04 |
|
6 |
+
| Copyright (c) 2005 Lester "GaMerZ" Chan |
|
7 |
+
| |
|
8 |
+
| File Written By: |
|
9 |
+
| - Lester "GaMerZ" Chan |
|
10 |
+
| - http://www.lesterchan.net |
|
11 |
+
| |
|
12 |
+
| File Information: |
|
13 |
+
| - Database Manager |
|
14 |
+
| - wp-content/plugins/dbmanager/database-manager.php |
|
15 |
+
| |
|
16 |
+
+----------------------------------------------------------------+
|
17 |
+
*/
|
18 |
+
|
19 |
+
|
20 |
+
### Require Database Config
|
21 |
+
require('database-config.php');
|
22 |
+
|
23 |
+
|
24 |
+
### Get MYSQL Version
|
25 |
+
$sqlversion = $wpdb->get_var("SELECT VERSION() AS version");
|
26 |
+
?>
|
27 |
+
<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
|
28 |
+
<!-- Database Information -->
|
29 |
+
<div class="wrap">
|
30 |
+
<h2>Database Information</h2>
|
31 |
+
<table width="100%" cellspacing="3" cellpadding="3" border="0">
|
32 |
+
<tr>
|
33 |
+
<th align="left" scope="col">Setting</th>
|
34 |
+
<th align="left" scope="col">Value</th>
|
35 |
+
</tr>
|
36 |
+
<tr>
|
37 |
+
<td>Database Host</td>
|
38 |
+
<td><?php echo DB_HOST; ?></td>
|
39 |
+
</tr>
|
40 |
+
<tr>
|
41 |
+
<td>Database Name</td>
|
42 |
+
<td><?php echo DB_NAME; ?></td>
|
43 |
+
</tr>
|
44 |
+
<tr>
|
45 |
+
<td>Database User</td>
|
46 |
+
<td><?php echo DB_USER; ?></td>
|
47 |
+
</tr>
|
48 |
+
<tr>
|
49 |
+
<td>Database Type</td>
|
50 |
+
<td>MYSQL</td>
|
51 |
+
</tr>
|
52 |
+
<tr>
|
53 |
+
<td>Database Version</td>
|
54 |
+
<td>v<?php echo $sqlversion; ?></td>
|
55 |
+
</tr>
|
56 |
+
</table>
|
57 |
+
</div>
|
58 |
+
<div class="wrap">
|
59 |
+
<h2>Tables Information</h2>
|
60 |
+
<table width="100%" cellspacing="3" cellpadding="3" border="0">
|
61 |
+
<tr>
|
62 |
+
<th align="left" scope="col">No.</th>
|
63 |
+
<th align="left" scope="col">Tables</th>
|
64 |
+
<th align="left" scope="col">Records</th>
|
65 |
+
<th align="left" scope="col">Data Usage</th>
|
66 |
+
<th align="left" scope="col">Index Usage</th>
|
67 |
+
<th align="left" scope="col">Overhead</th>
|
68 |
+
</tr>
|
69 |
+
<?php
|
70 |
+
// If MYSQL Version More Than 3.23, Get More Info
|
71 |
+
if($sqlversion >= '3.23') {
|
72 |
+
$tablesstatus = $wpdb->get_results("SHOW TABLE STATUS");
|
73 |
+
foreach($tablesstatus as $tablestatus) {
|
74 |
+
if($no%2 == 0) {
|
75 |
+
$style = 'style=\'background-color: #eee\'';
|
76 |
+
} else {
|
77 |
+
$style = 'style=\'background-color: none\'';
|
78 |
+
}
|
79 |
+
$no++;
|
80 |
+
echo "<tr $style>\n";
|
81 |
+
echo "<td>$no</td>\n";
|
82 |
+
echo "<td>$tablestatus->Name</td>\n";
|
83 |
+
echo "<td>".number_format($tablestatus->Rows)."</td>\n";
|
84 |
+
echo "<td>".format_size($tablestatus->Data_length)."</td>\n";
|
85 |
+
echo "<td>".format_size($tablestatus->Index_length)."</td>\n";
|
86 |
+
echo "<td>".format_size($tablestatus->Data_free)."</td>\n";
|
87 |
+
$row_usage += $tablestatus->Rows;
|
88 |
+
$data_usage += $tablestatus->Data_length;
|
89 |
+
$index_usage += $tablestatus->Index_length;
|
90 |
+
$overhead_usage += $tablestatus->Data_free;
|
91 |
+
echo "</tr>\n";
|
92 |
+
}
|
93 |
+
echo "<tr>\n";
|
94 |
+
echo "<th align=\"left\" scope=\"row\">Total:</th>\n";
|
95 |
+
echo "<th align=\"left\" scope=\"row\">$no Tables</th>\n";
|
96 |
+
echo "<th align=\"left\" scope=\"row\">".number_format($row_usage)."</th>\n";
|
97 |
+
echo "<th align=\"left\" scope=\"row\">".format_size($data_usage)."</th>\n";
|
98 |
+
echo "<th align=\"left\" scope=\"row\">".format_size($index_usage)."</th>";
|
99 |
+
echo "<th align=\"left\" scope=\"row\">".format_size($overhead_usage)."</th>";
|
100 |
+
echo "</tr>";
|
101 |
+
} else {
|
102 |
+
echo '<tr><td colspan="6" align="center"><b>Could Not Show Table Status Due To Your MYSQL Version Is Lower Than 3.23.</b></td></tr>';
|
103 |
+
}
|
104 |
+
?>
|
105 |
+
</table>
|
106 |
+
</div>
|
dbmanager/database-optimize.php
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
+----------------------------------------------------------------+
|
4 |
+
| |
|
5 |
+
| WordPress 2.0 Plugin: WP-DBManager 2.05 |
|
6 |
+
| Copyright (c) 2005 Lester "GaMerZ" Chan |
|
7 |
+
| |
|
8 |
+
| File Written By: |
|
9 |
+
| - Lester "GaMerZ" Chan |
|
10 |
+
| - http://www.lesterchan.net |
|
11 |
+
| |
|
12 |
+
| File Information: |
|
13 |
+
| - Database Optimize |
|
14 |
+
| - wp-content/plugins/dbmanager/database-optimize.php |
|
15 |
+
| |
|
16 |
+
+----------------------------------------------------------------+
|
17 |
+
*/
|
18 |
+
|
19 |
+
|
20 |
+
### Require Database Config
|
21 |
+
require('database-config.php');
|
22 |
+
|
23 |
+
|
24 |
+
### Form Processing
|
25 |
+
if($_POST['do']) {
|
26 |
+
// Lets Prepare The Variables
|
27 |
+
$optimize = $_POST['optimize'];
|
28 |
+
|
29 |
+
// Decide What To Do
|
30 |
+
switch($_POST['do']) {
|
31 |
+
case 'Optimize':
|
32 |
+
if(!empty($optimize)) {
|
33 |
+
foreach($optimize as $key => $value) {
|
34 |
+
if($value == 'yes') {
|
35 |
+
$tables_string .= ', '.$key;
|
36 |
+
}
|
37 |
+
}
|
38 |
+
} else {
|
39 |
+
$text = '<font color="red">No Tables Selected</font>';
|
40 |
+
}
|
41 |
+
$selected_tables = substr($tables_string, 2);
|
42 |
+
if(!empty($selected_tables)) {
|
43 |
+
$optimize2 = $wpdb->query("OPTIMIZE TABLE $selected_tables");
|
44 |
+
if(!$optimize2) {
|
45 |
+
$text = "<font color=\"red\">Table(s) '$selected_tables' NOT Optimized</font>";
|
46 |
+
} else {
|
47 |
+
$text = "<font color=\"green\">Table(s) '$selected_tables' Optimized</font>";
|
48 |
+
}
|
49 |
+
}
|
50 |
+
break;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
|
55 |
+
### Show Tables
|
56 |
+
$tables = $wpdb->get_col("SHOW TABLES");
|
57 |
+
?>
|
58 |
+
<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
|
59 |
+
<!-- Optimize Database -->
|
60 |
+
<div class="wrap">
|
61 |
+
<h2>Optimize Database</h2>
|
62 |
+
<form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
|
63 |
+
<table width="100%" cellspacing="3" cellpadding="3" border="0">
|
64 |
+
<tr>
|
65 |
+
<th align="left" scope="col">Tables</th>
|
66 |
+
<th align="left" scope="col">Options</th>
|
67 |
+
</tr>
|
68 |
+
<?php
|
69 |
+
foreach($tables as $table_name) {
|
70 |
+
if($no%2 == 0) {
|
71 |
+
$style = 'style=\'background-color: #eee\'';
|
72 |
+
} else {
|
73 |
+
$style = 'style=\'background-color: none\'';
|
74 |
+
}
|
75 |
+
$no++;
|
76 |
+
echo "<tr $style><th align=\"left\" scope=\"row\">$table_name</th>\n";
|
77 |
+
echo "<td><input type=\"radio\" name=\"optimize[$table_name]\" value=\"no\" />No <input type=\"radio\" name=\"optimize[$table_name]\" value=\"yes\" checked=\"checked\" />Yes</td></tr>";
|
78 |
+
}
|
79 |
+
?>
|
80 |
+
<tr>
|
81 |
+
<td colspan="2" align="center">Database should be optimize once every month.</td>
|
82 |
+
</tr>
|
83 |
+
<tr>
|
84 |
+
<td colspan="2" align="center"><input type="submit" name="do" value="Optimize" class="button" /> <input type="button" name="cancel" value="<?php _e('Cancel'); ?>" class="button" onclick="javascript:history.go(-1)" /></td>
|
85 |
+
</tr>
|
86 |
+
</table>
|
87 |
+
</form>
|
88 |
+
</div>
|
dbmanager/database-run.php
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
+----------------------------------------------------------------+
|
4 |
+
| |
|
5 |
+
| WordPress 2.0 Plugin: WP-DBManager 2.05 |
|
6 |
+
| Copyright (c) 2005 Lester "GaMerZ" Chan |
|
7 |
+
| |
|
8 |
+
| File Written By: |
|
9 |
+
| - Lester "GaMerZ" Chan |
|
10 |
+
| - http://www.lesterchan.net |
|
11 |
+
| |
|
12 |
+
| File Information: |
|
13 |
+
| - Database Run Query |
|
14 |
+
| - wp-content/plugins/dbmanager/database-run.php |
|
15 |
+
| |
|
16 |
+
+----------------------------------------------------------------+
|
17 |
+
*/
|
18 |
+
|
19 |
+
|
20 |
+
### Require Database Config
|
21 |
+
require('database-config.php');
|
22 |
+
|
23 |
+
|
24 |
+
### Form Processing
|
25 |
+
if($_POST['do']) {
|
26 |
+
// Decide What To Do
|
27 |
+
switch($_POST['do']) {
|
28 |
+
case 'Run':
|
29 |
+
$sql_queries2 = trim($_POST['sql_query']);
|
30 |
+
$totalquerycount = 0;
|
31 |
+
$successquery = 0;
|
32 |
+
if($sql_queries2) {
|
33 |
+
$sql_queries = array();
|
34 |
+
$sql_queries2 = explode("\n", $sql_queries2);
|
35 |
+
foreach($sql_queries2 as $sql_query2) {
|
36 |
+
$sql_query2 = trim(stripslashes($sql_query2));
|
37 |
+
$sql_query2 = preg_replace("/[\r\n]+/", '', $sql_query2);
|
38 |
+
if(!empty($sql_query2)) {
|
39 |
+
$sql_queries[] = $sql_query2;
|
40 |
+
}
|
41 |
+
}
|
42 |
+
if($sql_queries) {
|
43 |
+
foreach($sql_queries as $sql_query) {
|
44 |
+
if (preg_match("/^\\s*(insert|update|replace|delete|create|alter) /i",$sql_query)) {
|
45 |
+
$run_query = $wpdb->query($sql_query);
|
46 |
+
if(!$run_query) {
|
47 |
+
$text .= "<font color=\"red\">$sql_query</font><br />";
|
48 |
+
} else {
|
49 |
+
$successquery++;
|
50 |
+
$text .= "<font color=\"green\">$sql_query</font><br />";
|
51 |
+
}
|
52 |
+
$totalquerycount++;
|
53 |
+
} elseif (preg_match("/^\\s*(select|drop|show|grant) /i",$sql_query)) {
|
54 |
+
$text .= "<font color=\"red\">$sql_query</font><br />";
|
55 |
+
$totalquerycount++;
|
56 |
+
}
|
57 |
+
}
|
58 |
+
$text .= "<font color=\"blue\">$successquery/$totalquerycount Query(s) Executed Successfully</font>";
|
59 |
+
} else {
|
60 |
+
$text = "<font color=\"red\">Empty Query</font>";
|
61 |
+
}
|
62 |
+
} else {
|
63 |
+
$text = "<font color=\"red\">Empty Query</font>";
|
64 |
+
}
|
65 |
+
break;
|
66 |
+
}
|
67 |
+
}
|
68 |
+
?>
|
69 |
+
<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
|
70 |
+
<!-- Run SQL Query -->
|
71 |
+
<div class="wrap">
|
72 |
+
<h2>Run SQL Query</h2>
|
73 |
+
<form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
|
74 |
+
<p><b>Seperate Multiple Queries With A New Line</b><br /><font color="green">Use Only INSERT, UPDATE, REPLACE, DELETE, CREATE and ALTER statements.</font></p>
|
75 |
+
<p align="center"><textarea cols="120" rows="30" name="sql_query"></textarea></p>
|
76 |
+
<p align="center"><input type="submit" name="do" value="Run" class="button" /> <input type="button" name="cancel" value="<?php _e('Cancel'); ?>" class="button" onclick="javascript:history.go(-1)" /></p>
|
77 |
+
<p>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.<br />2. UPDATE statement may return an error sometimes due to the newly updated value being the same as the previous value.<br />3. ALTER statement will return an error because there is no value returned.</p>
|
78 |
+
</form>
|
79 |
+
</div>
|
dbmanager/dbmanager.php
ADDED
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: WP-DBManager
|
4 |
+
Plugin URI: http://www.lesterchan.net/portfolio/programming.php
|
5 |
+
Description: Manages your Wordpress database. Allows you to optimizee, backup, restore, delete backup database and run selected queries.
|
6 |
+
Version: 2.05
|
7 |
+
Author: GaMerZ
|
8 |
+
Author URI: http://www.lesterchan.net
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
/* Copyright 2006 Lester Chan (email : gamerz84@hotmail.com)
|
13 |
+
|
14 |
+
This program is free software; you can redistribute it and/or modify
|
15 |
+
it under the terms of the GNU General Public License as published by
|
16 |
+
the Free Software Foundation; either version 2 of the License, or
|
17 |
+
(at your option) any later version.
|
18 |
+
|
19 |
+
This program is distributed in the hope that it will be useful,
|
20 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22 |
+
GNU General Public License for more details.
|
23 |
+
|
24 |
+
You should have received a copy of the GNU General Public License
|
25 |
+
along with this program; if not, write to the Free Software
|
26 |
+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
27 |
+
*/
|
28 |
+
|
29 |
+
|
30 |
+
### Function: Database Manager Menu
|
31 |
+
add_action('admin_menu', 'dbmanager_menu');
|
32 |
+
function dbmanager_menu() {
|
33 |
+
if (function_exists('add_menu_page')) {
|
34 |
+
add_menu_page(__('Database'), __('Database'), 'manage_database', 'dbmanager/database-manager.php');
|
35 |
+
}
|
36 |
+
if (function_exists('add_submenu_page')) {
|
37 |
+
add_submenu_page('dbmanager/database-manager.php', __('Backup DB'), __('Backup DB'), 'manage_database', 'dbmanager/database-backup.php');
|
38 |
+
add_submenu_page('dbmanager/database-manager.php', __('Manage Backup DB'), __('Manage Backup DB'), 'manage_database', 'dbmanager/database-manage.php');
|
39 |
+
add_submenu_page('dbmanager/database-manager.php', __('Optimize DB'), __('Optimize DB'), 'manage_database', 'dbmanager/database-optimize.php');
|
40 |
+
add_submenu_page('dbmanager/database-manager.php', __('Empty/Drop Tables'), __('Empty/Drop Tables'), 'manage_database', 'dbmanager/database-empty.php');
|
41 |
+
add_submenu_page('dbmanager/database-manager.php', __('Run SQL Query'), __('Run SQL Query'), 'manage_database', 'dbmanager/database-run.php');
|
42 |
+
add_submenu_page('dbmanager/database-manager.php', __('DB Options'), __('DB Options'), 'manage_database', 'dbmanager/dbmanager.php', 'dbmanager_options');
|
43 |
+
}
|
44 |
+
}
|
45 |
+
|
46 |
+
|
47 |
+
### Function: Database Manager Role
|
48 |
+
add_action('activate_dbmanager/dbmanager.php', 'dbmanager_init');
|
49 |
+
function dbmanager_init() {
|
50 |
+
// Add Options
|
51 |
+
$backup_options = array();
|
52 |
+
$backup_options['mysqldumppath'] = 'mysqldump';
|
53 |
+
$backup_options['mysqlpath'] = 'mysql';
|
54 |
+
$backup_options['path'] = ABSPATH.'wp-content/backup-db';
|
55 |
+
add_option('dbmanager_options', $backup_options, 'WP-DBManager Options');
|
56 |
+
|
57 |
+
// Create Backup Folder
|
58 |
+
if(!is_dir(ABSPATH.'/wp-content/backup-db')) {
|
59 |
+
mkdir(ABSPATH.'/wp-content/backup-db');
|
60 |
+
}
|
61 |
+
|
62 |
+
// Set 'manage_database' Capabilities To Administrator
|
63 |
+
$role = get_role('administrator');
|
64 |
+
if(!$role->has_cap('manage_database')) {
|
65 |
+
$role->add_cap('manage_database');
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
|
70 |
+
### Function: Download Database
|
71 |
+
add_action('init', 'download_database');
|
72 |
+
function download_database() {
|
73 |
+
if($_POST['do'] == 'Download' && !empty($_POST['database_file'])) {
|
74 |
+
if(strpos($_SERVER['HTTP_REFERER'], get_settings('siteurl').'/wp-admin/admin.php?page=dbmanager/database-manage.php') !== false) {
|
75 |
+
$backup_options = get_settings('dbmanager_options');
|
76 |
+
$file_path = $backup_options['path'].'/'.$_POST['database_file'];
|
77 |
+
header("Pragma: public");
|
78 |
+
header("Expires: 0");
|
79 |
+
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
|
80 |
+
header("Content-Type: application/force-download");
|
81 |
+
header("Content-Type: application/octet-stream");
|
82 |
+
header("Content-Type: application/download");
|
83 |
+
header("Content-Disposition: attachment; filename=".basename($file_path).";");
|
84 |
+
header("Content-Transfer-Encoding: binary");
|
85 |
+
header("Content-Length: ".filesize($file_path));
|
86 |
+
@readfile($file_path);
|
87 |
+
}
|
88 |
+
exit();
|
89 |
+
}
|
90 |
+
}
|
91 |
+
|
92 |
+
|
93 |
+
### Function: Database Options
|
94 |
+
function dbmanager_options() {
|
95 |
+
global $wpdb;
|
96 |
+
$text = '';
|
97 |
+
$backup_options = array();
|
98 |
+
$backup_options = get_settings('dbmanager_options');
|
99 |
+
if($_POST['Submit']) {
|
100 |
+
$backup_options['mysqldumppath'] = trim($_POST['db_mysqldumppath']);
|
101 |
+
$backup_options['mysqlpath'] = trim($_POST['db_mysqlpath']);
|
102 |
+
$backup_options['path'] = trim($_POST['db_path']);
|
103 |
+
$update_db_options = update_option('dbmanager_options', $backup_options);
|
104 |
+
if($update_db_options) {
|
105 |
+
$text = '<font color="green">'.__('DB Options Updated').'</font>';
|
106 |
+
}
|
107 |
+
if(empty($text)) {
|
108 |
+
$text = '<font color="red">'.__('No DB Option Updated').'</font>';
|
109 |
+
}
|
110 |
+
}
|
111 |
+
?>
|
112 |
+
<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
|
113 |
+
<!-- Database Options -->
|
114 |
+
<div class="wrap">
|
115 |
+
<h2>Database Options</h2>
|
116 |
+
<form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
|
117 |
+
<table width="100%" cellspacing="3" cellpadding="3" border="0">
|
118 |
+
<tr>
|
119 |
+
<td valign="top"><b>Path To mysqldump:</b></td>
|
120 |
+
<td>
|
121 |
+
<input type="text" name="db_mysqldumppath" size="100" maxlength="100" value="<?php echo stripslashes($backup_options['mysqldumppath']); ?>" /><br />The absolute path to mysqldump without trailing slash. If unsure, please email your server administrator about this.
|
122 |
+
</td>
|
123 |
+
</tr>
|
124 |
+
<tr>
|
125 |
+
<td valign="top"><b>Path To mysql:</b></td>
|
126 |
+
<td>
|
127 |
+
<input type="text" name="db_mysqlpath" size="100" maxlength="100" value="<?php echo stripslashes($backup_options['mysqlpath']); ?>" /><br />The absolute path to mysql without trailing slash. If unsure, please email your server administrator about this.
|
128 |
+
</td>
|
129 |
+
</tr>
|
130 |
+
<tr>
|
131 |
+
<td valign="top"><b>Path To Backup:</b></td>
|
132 |
+
<td>
|
133 |
+
<input type="text" name="db_path" size="100" maxlength="100" value="<?php echo stripslashes($backup_options['path']); ?>" />
|
134 |
+
<br />The absolute path to your database backup folder without trailing slash. Make sure the folder is writable.
|
135 |
+
</td>
|
136 |
+
</tr>
|
137 |
+
<tr>
|
138 |
+
<td width="100%" colspan="2" align="center"><input type="submit" name="Submit" class="button" value="<?php _e('Update Options'); ?>" /> <input type="button" name="cancel" value="Cancel" class="button" onclick="javascript:history.go(-1)" /></td>
|
139 |
+
</tr>
|
140 |
+
</table>
|
141 |
+
</form>
|
142 |
+
<p>
|
143 |
+
<b>Windows Server</b><br />
|
144 |
+
For mysqldump path, you can try '<b>mysqldump.exe</b>'.<br />
|
145 |
+
For mysql path, you can try '<b>mysql.exe</b>'.<br />
|
146 |
+
<br />
|
147 |
+
<b>Linux Server</b><br />
|
148 |
+
For mysqldump path, normally is just '<b>mysqldump</b>'.<br />
|
149 |
+
For mysql path, normally is just '<b>mysql</b>'.<br />
|
150 |
+
</p>
|
151 |
+
</div>
|
152 |
+
<?php
|
153 |
+
}
|
154 |
+
?>
|
readme.html
ADDED
@@ -0,0 +1,329 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2 |
+
<html>
|
3 |
+
<head>
|
4 |
+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
5 |
+
<title>WP-DBManager 2.05 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 |
+
// Index Page
|
125 |
+
function index() {
|
126 |
+
// Tab
|
127 |
+
document.getElementById('IndexTab').className = 'SelectedTab';
|
128 |
+
document.getElementById('InstallTab').className = 'Tab';
|
129 |
+
document.getElementById('UpgradeTab').className = 'Tab';
|
130 |
+
document.getElementById('UsageTab').className = 'Tab';
|
131 |
+
// Page
|
132 |
+
document.getElementById('Index').style.display= 'block';
|
133 |
+
document.getElementById('IndexTab').className = 'SelectedTab';
|
134 |
+
document.getElementById('Install').style.display = 'none';
|
135 |
+
document.getElementById('Upgrade').style.display = 'none';
|
136 |
+
document.getElementById('Usage').style.display = 'none';
|
137 |
+
}
|
138 |
+
// Installation Page
|
139 |
+
function install() {
|
140 |
+
// Tab
|
141 |
+
document.getElementById('IndexTab').className = 'Tab';
|
142 |
+
document.getElementById('InstallTab').className = 'SelectedTab';
|
143 |
+
document.getElementById('UpgradeTab').className = 'Tab';
|
144 |
+
document.getElementById('UsageTab').className = 'Tab';
|
145 |
+
// Page
|
146 |
+
document.getElementById('Index').style.display= 'none';
|
147 |
+
document.getElementById('Install').style.display = 'block';
|
148 |
+
document.getElementById('Upgrade').style.display = 'none';
|
149 |
+
document.getElementById('Usage').style.display = 'none';
|
150 |
+
}
|
151 |
+
// Upgrade Page
|
152 |
+
function upgrade() {
|
153 |
+
// Tab
|
154 |
+
document.getElementById('IndexTab').className = 'Tab';
|
155 |
+
document.getElementById('InstallTab').className = 'Tab';
|
156 |
+
document.getElementById('UpgradeTab').className = 'SelectedTab';
|
157 |
+
document.getElementById('UpgradeTab').href = 'Tab';
|
158 |
+
document.getElementById('UsageTab').className = 'Tab';
|
159 |
+
// Page
|
160 |
+
document.getElementById('Index').style.display= 'none';
|
161 |
+
document.getElementById('Install').style.display = 'none';
|
162 |
+
document.getElementById('Upgrade').style.display = 'block';
|
163 |
+
document.getElementById('Usage').style.display = 'none';
|
164 |
+
}
|
165 |
+
// Usage Page
|
166 |
+
function usage() {
|
167 |
+
// Tab
|
168 |
+
document.getElementById('IndexTab').className = 'Tab';
|
169 |
+
document.getElementById('InstallTab').className = 'Tab';
|
170 |
+
document.getElementById('UpgradeTab').className = 'Tab';
|
171 |
+
document.getElementById('UsageTab').className = 'SelectedTab';
|
172 |
+
// Page
|
173 |
+
document.getElementById('Index').style.display= 'none';
|
174 |
+
document.getElementById('Install').style.display = 'none';
|
175 |
+
document.getElementById('Upgrade').style.display = 'none';
|
176 |
+
document.getElementById('Usage').style.display = 'block';
|
177 |
+
}
|
178 |
+
</script>
|
179 |
+
</head>
|
180 |
+
<body>
|
181 |
+
<div id="Container">
|
182 |
+
<!-- Title -->
|
183 |
+
<div id="Title">WP-DBManager 2.05 <span style="color: #aaaaaa;">Readme</span></div>
|
184 |
+
|
185 |
+
<!-- Tabs -->
|
186 |
+
<ul id="Tabs">
|
187 |
+
<li id="UsageTab" class="Tab"><a href="#Usage" onclick="usage(); return false;" title="Usage Instructions">Usage</a></li>
|
188 |
+
<li id="UpgradeTab" class="Tab"><a href="#Upgrade" onclick="upgrade(); return false;" title="Upgrade Instructions">Upgrade</a></li>
|
189 |
+
<li id="InstallTab" class="Tab"><a href="#Installation" onclick="install(); return false;" title="Installation Instructions">Installation</a></li>
|
190 |
+
<li id="IndexTab" class="SelectedTab"><a href="#Index" onclick="index(); return false;" title="Index Instructions">Index</a></li>
|
191 |
+
</ul>
|
192 |
+
|
193 |
+
<!-- Content -->
|
194 |
+
<div id="Content">
|
195 |
+
<!-- Index -->
|
196 |
+
<div id="Index">
|
197 |
+
<div class="SubTitle">» Index</div>
|
198 |
+
<div class="SubSubTitle">Plugin Information</div>
|
199 |
+
<p><b>Author</b><br /><b>»</b> Lester 'GaMerZ' Chan</p>
|
200 |
+
<p>
|
201 |
+
<b>EMail:</b><br /><b>»</b>
|
202 |
+
<script type="text/javascript">
|
203 |
+
/* <![CDATA[*/
|
204 |
+
document.write(' <a href="mailto:gamerz84@hotmail.com?Subject=WP-DBManager%202.05%20Support" title="EMail To gamerz84@hotmail.com">gamerz84@hotmail.com</a>');
|
205 |
+
/* ]]> */
|
206 |
+
</script>
|
207 |
+
</p>
|
208 |
+
<p><b>Website:</b><br /><b>»</b> <a href="http://www.lesterchan.net/" title="http://www.lesterchan.net/">http://www.lesterchan.net/</a></p>
|
209 |
+
<p><b>Demo:</b><br /><b>»</b> N/A</p>
|
210 |
+
<p><b>Documentation:</b><br /><b>»</b> <a href="http://dev.wp-plugins.org/wiki/wp-dbmanager" title="http://dev.wp-plugins.org/wiki/wp-dbmanager">http://dev.wp-plugins.org/wiki/wp-dbmanager</a></p>
|
211 |
+
<p><b>Development:</b><br /><b>»</b> <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></p>
|
212 |
+
<p><b>Support Forums:</b><br /><b>»</b> <a href="http://forums.lesterchan.net/viewforum.php?f=14" title="http://forums.lesterchan.net/viewforum.php?f=14">http://forums.lesterchan.net/viewforum.php?f=14</a></p>
|
213 |
+
<p><b>Updated:</b><br /><b>»</b> 1st June 2006</p>
|
214 |
+
<div class="SubSubTitle">Changelog</div>
|
215 |
+
<ul>
|
216 |
+
<li>
|
217 |
+
<b>Version 2.05 (01-06-2006)</b>
|
218 |
+
<ul>
|
219 |
+
<li>FIXED: Database Table Names Not Appearing Correctly</li>
|
220 |
+
<li>NEW: DBManager Administration Panel Is XHTML 1.0 Transitional</li>
|
221 |
+
</ul>
|
222 |
+
</li>
|
223 |
+
<li>
|
224 |
+
<b>Version 2.04 (10-05-2006)</b>
|
225 |
+
<ul>
|
226 |
+
<li>FIXED: Unable To Download Backup DB Due To Header Sent Error</li>
|
227 |
+
<li>FIXED: Some XHTML Code Fixes</li>
|
228 |
+
</ul>
|
229 |
+
</li>
|
230 |
+
<li>
|
231 |
+
<b>Version 2.03 (01-04-2006)</b>
|
232 |
+
<ul>
|
233 |
+
<li>FIXED: Run Query Box Too Big</li>
|
234 |
+
<li>FIXED: Header Sent Error</li>
|
235 |
+
<li>FIXED: Extra Slashes For Mysql/Mysql Dump Path</li>
|
236 |
+
<li>FIXED: Mismatch Date Due To GMT</li>
|
237 |
+
</ul>
|
238 |
+
</li>
|
239 |
+
<li>
|
240 |
+
<b>Version 2.02 (01-03-2006)</b>
|
241 |
+
<ul>
|
242 |
+
<li>NEW: Improved On 'manage_database' Capabilities</li>
|
243 |
+
<li>NEW: Added GigaBytes To File Size</li>
|
244 |
+
<li>NEW: Added ALTER Statement To Allowed Queries</li>
|
245 |
+
<li>NEW: Able To Empty/Drop Tables</li>
|
246 |
+
<li>NEW: Able To EMail Database Backup File</li>
|
247 |
+
<li>NEW: Splitted database-manager.php Into Individual Files</li>
|
248 |
+
<li>NEW: Merge Restore And Delete Backup Database</li>
|
249 |
+
<li>NEW: Included .htaccess File To Protect Backup Folder</li>
|
250 |
+
<li>NEW: Checking Of Backup Status</li>
|
251 |
+
<li>FIXED: Using Old Method To Add Submenu</li>
|
252 |
+
<li>FIXED: PHP Short Tags</li>
|
253 |
+
<li>FIXED: Redirect Back To The Same Page Instead Of Manage Database Page After Submitting Form</li>
|
254 |
+
</ul>
|
255 |
+
</li>
|
256 |
+
<li>
|
257 |
+
<b>Version 2.01 (01-02-2006)</b>
|
258 |
+
<ul>
|
259 |
+
<li>NEW: Added 'manage_database' Capabilities To Administrator Role</li>
|
260 |
+
</ul>
|
261 |
+
</li>
|
262 |
+
<li>
|
263 |
+
<b>Version 2.00 (01-01-2006)</b>
|
264 |
+
<ul>
|
265 |
+
<li>NEW: Compatible With WordPress 2.0 Only</li>
|
266 |
+
<li>NEW: GPL License Added</li>
|
267 |
+
</ul>
|
268 |
+
</li>
|
269 |
+
</ul>
|
270 |
+
</div>
|
271 |
+
|
272 |
+
<!-- Installation Instructions -->
|
273 |
+
<div id="Install" style="display: none;">
|
274 |
+
<div class="SubTitle">» Installation Instructions</div>
|
275 |
+
<ol>
|
276 |
+
<li>
|
277 |
+
Open <b>wp-content/plugins</b> Folder
|
278 |
+
</li>
|
279 |
+
<li>
|
280 |
+
Put:
|
281 |
+
<blockquote>Folder: dbmanager</blockquote>
|
282 |
+
</li>
|
283 |
+
<li>
|
284 |
+
<b>Activate</b> WP-DBManager Plugin
|
285 |
+
</li>
|
286 |
+
<li>
|
287 |
+
Open <b>wp-content/backup-db</b> Folder
|
288 |
+
</li>
|
289 |
+
<li>
|
290 |
+
Put:
|
291 |
+
<blockquote>File: .htaccess</blockquote>
|
292 |
+
<p>The script will automatically create a folder called <b>backup-db</b> in wp-content folder if that folder is writable. If it is not created, please create it and CHMOD it to 777.</p>
|
293 |
+
</li>
|
294 |
+
<li>
|
295 |
+
Refer To <b>Usage</b> For Further Instructions
|
296 |
+
</li>
|
297 |
+
</ol>
|
298 |
+
</div>
|
299 |
+
|
300 |
+
<!-- Upgrade Instructions -->
|
301 |
+
<div id="Upgrade" style="display: none;">
|
302 |
+
<div class="SubTitle">» Upgrade Instructions</div>
|
303 |
+
<div class="SubSubTitle">From v2.0x To v2.05</div>
|
304 |
+
<ol>
|
305 |
+
<li>
|
306 |
+
Open <b>wp-content/plugins</b> Folder
|
307 |
+
</li>
|
308 |
+
<li>
|
309 |
+
Overwrite:
|
310 |
+
<blockquote>Folder: dbmanager</blockquote>
|
311 |
+
</li>
|
312 |
+
</ol>
|
313 |
+
</div>
|
314 |
+
|
315 |
+
<!-- Usage Instructions -->
|
316 |
+
<div id="Usage" style="display: none;">
|
317 |
+
<div class="SubTitle">» Usage Instructions</div>
|
318 |
+
<div class="SubSubTitle">General Usage</div>
|
319 |
+
<ol>
|
320 |
+
<li>
|
321 |
+
You can find DBManager under the <b>Database Tab</b> in the WordPress Administration Panel.
|
322 |
+
</li>
|
323 |
+
</ol>
|
324 |
+
</div>
|
325 |
+
</div>
|
326 |
+
</div>
|
327 |
+
<p id="Copyright">WP-DBManager 2.05<br />Copyright © 2006 Lester 'GaMerZ' Chan. All Rights Reserved.</p>
|
328 |
+
</body>
|
329 |
+
</html>
|