Advanced Database Cleaner - Version 1.2.1

Version Description

  • Some optimizations and style modifications
  • "Clean database" tab shows now only elements that should be cleaned instead of listing all elements.
  • "Clean database" tab shows now an icon that indicates the state of your database.
  • "Optimize database" tab shows now only tables that should be optimized instead of listing all tables.
  • "Optimize database" tab shows now an icon that indicates the state of your tables.
  • "Reset database" shows now a warning before resetting the database.
Download this release

Release Info

Developer symptote
Plugin Icon 128x128 Advanced Database Cleaner
Version 1.2.1
Comparing to
See all releases

Code changes from version 1.2.0 to 1.2.1

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate Link: https://www.paypal.com/us/cgi-bin/webscr?cmd=_flow&SESSION=Azq_P8u-
4
Tags: plugin, plugins, plugin wordpress, wordpress, database cleaner, clean database, database clean, database, clean, cleaner, delete orphan data, orphan data, delete revisions, revision, delete draft, draft, delete trash, trash, delete spam, spam, delete auto drfat, auto draft, delete postmeta, postmeta, delete commentmeta, commentmeta, delete relationships, relationships, delete transient feed, transient feed, optimize database, database optimize, database optimizer, optimize, optimizer, reset database, database reset, reset, admin
5
Requires at least: 2.7
6
Tested up to: 4.3
7
- Stable tag: 1.2.0
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
@@ -33,12 +33,22 @@ This section describes how to install the plugin and get it working.
33
3. Go to "Dashboard" -> "Settings" -> "Database Cleaner"
34
35
== Screenshots ==
36
- 1. "Clean database" admin page screenshot
37
- 2. "Optimize database" admin page screenshot
38
- 3. "Reset database" admin page screenshot
39
40
== Changelog ==
41
42
= 1.2.0 =
43
* Some optimizations and style modifications
44
* New feature: Adding "Reset database"
4
Tags: plugin, plugins, plugin wordpress, wordpress, database cleaner, clean database, database clean, database, clean, cleaner, delete orphan data, orphan data, delete revisions, revision, delete draft, draft, delete trash, trash, delete spam, spam, delete auto drfat, auto draft, delete postmeta, postmeta, delete commentmeta, commentmeta, delete relationships, relationships, delete transient feed, transient feed, optimize database, database optimize, database optimizer, optimize, optimizer, reset database, database reset, reset, admin
5
Requires at least: 2.7
6
Tested up to: 4.3
7
+ Stable tag: 1.2.1
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
33
3. Go to "Dashboard" -> "Settings" -> "Database Cleaner"
34
35
== Screenshots ==
36
+ 1. Example of dirty database
37
+ 2. Example of cleaned database
38
+ 3. Example of dirty tables
39
+ 4. Example of optimized tables
40
+ 5. Reset database" admin page screenshot
41
42
== Changelog ==
43
44
+ = 1.2.1 =
45
+ * Some optimizations and style modifications
46
+ * "Clean database" tab shows now only elements that should be cleaned instead of listing all elements.
47
+ * "Clean database" tab shows now an icon that indicates the state of your database.
48
+ * "Optimize database" tab shows now only tables that should be optimized instead of listing all tables.
49
+ * "Optimize database" tab shows now an icon that indicates the state of your tables.
50
+ * "Reset database" shows now a warning before resetting the database.
51
+
52
= 1.2.0 =
53
* Some optimizations and style modifications
54
* New feature: Adding "Reset database"
advanced-db-cleaner-admin.php CHANGED
@@ -1,23 +1,19 @@
1
<?php
2
add_action('admin_init', 'adv_db_cleaner_register_styles' );
3
add_action('admin_menu', 'adv_db_cleaner_add_admin_menu');
4
-
5
/* --- Add 'DB Cleaner' to Wordpress settings menu ---------- */
6
function adv_db_cleaner_add_admin_menu() {
7
$hook_adv_db_cleaner = add_options_page('Advanced DB Cleaner Options', 'Database Cleaner','manage_options', __FILE__, 'adv_db_cleaner_page');
8
add_action('admin_print_styles-' . $hook_adv_db_cleaner, 'adv_db_cleaner_enqueue_styles');
9
}
10
-
11
/* --- Register stylesheet ---------------------------------- */
12
function adv_db_cleaner_register_styles() {
13
wp_register_style('adv_db_cleaner_css', plugins_url() .'/'. dirname(plugin_basename(__FILE__)) . '/css/style.css');
14
}
15
-
16
/* --- Enqueue stylesheet ----------------------------------- */
17
function adv_db_cleaner_enqueue_styles() {
18
wp_enqueue_style( 'adv_db_cleaner_css' );
19
}
20
-
21
/* --- The admin page content ------------------------------- */
22
function adv_db_cleaner_page(){
23
?>
@@ -48,7 +44,6 @@ function adv_db_cleaner_page(){
48
echo '<div id="adbc_message" class="'. $adv_db_cleaner_message_class .'"><p><strong>' . $adv_db_cleaner_message . '</strong></p></div>';
49
}
50
?>
51
-
52
<div style="margin-right:300px">
53
<div class="tabBox">
54
<?php
@@ -57,7 +52,6 @@ function adv_db_cleaner_page(){
57
array("id"=>"aDBc-optimize","title"=>"Optimize Database"),
58
array("id"=>"aDBc-reset","title"=>"Reset Database")
59
);
60
-
61
foreach ($aDBc_tab_list as $key => $value){
62
$checked = "";
63
if((!isset($_POST["aDBc_clean_form"]) && !isset($_POST["aDBc_optimize_form"]) && !isset($_POST["aDBc_reset_form"]) && $value["id"] == "aDBc-clean")
@@ -70,31 +64,22 @@ function adv_db_cleaner_page(){
70
echo '<label for="'.$value["id"].'">'.$value["title"].'</label>'."\n";
71
}
72
?>
73
-
74
<div class="tab1">
75
<?php include_once 'includes/clean-db.php'; ?>
76
</div>
77
-
78
<div class="tab2">
79
<?php include_once 'includes/optimize-db.php'; ?>
80
</div>
81
-
82
<div class="tab3">
83
<?php include_once 'includes/reset-db.php'; ?>
84
</div>
85
-
86
</div>
87
-
88
<div class="aDBcSidebar">
89
<?php include_once 'includes/sidebar.php'; ?>
90
</div>
91
-
92
</div>
93
-
94
</div>
95
<?php
96
}
97
-
98
include_once 'includes/functions.php';
99
-
100
?>
1
<?php
2
add_action('admin_init', 'adv_db_cleaner_register_styles' );
3
add_action('admin_menu', 'adv_db_cleaner_add_admin_menu');
4
/* --- Add 'DB Cleaner' to Wordpress settings menu ---------- */
5
function adv_db_cleaner_add_admin_menu() {
6
$hook_adv_db_cleaner = add_options_page('Advanced DB Cleaner Options', 'Database Cleaner','manage_options', __FILE__, 'adv_db_cleaner_page');
7
add_action('admin_print_styles-' . $hook_adv_db_cleaner, 'adv_db_cleaner_enqueue_styles');
8
}
9
/* --- Register stylesheet ---------------------------------- */
10
function adv_db_cleaner_register_styles() {
11
wp_register_style('adv_db_cleaner_css', plugins_url() .'/'. dirname(plugin_basename(__FILE__)) . '/css/style.css');
12
}
13
/* --- Enqueue stylesheet ----------------------------------- */
14
function adv_db_cleaner_enqueue_styles() {
15
wp_enqueue_style( 'adv_db_cleaner_css' );
16
}
17
/* --- The admin page content ------------------------------- */
18
function adv_db_cleaner_page(){
19
?>
44
echo '<div id="adbc_message" class="'. $adv_db_cleaner_message_class .'"><p><strong>' . $adv_db_cleaner_message . '</strong></p></div>';
45
}
46
?>
47
<div style="margin-right:300px">
48
<div class="tabBox">
49
<?php
52
array("id"=>"aDBc-optimize","title"=>"Optimize Database"),
53
array("id"=>"aDBc-reset","title"=>"Reset Database")
54
);
55
foreach ($aDBc_tab_list as $key => $value){
56
$checked = "";
57
if((!isset($_POST["aDBc_clean_form"]) && !isset($_POST["aDBc_optimize_form"]) && !isset($_POST["aDBc_reset_form"]) && $value["id"] == "aDBc-clean")
64
echo '<label for="'.$value["id"].'">'.$value["title"].'</label>'."\n";
65
}
66
?>
67
<div class="tab1">
68
<?php include_once 'includes/clean-db.php'; ?>
69
</div>
70
<div class="tab2">
71
<?php include_once 'includes/optimize-db.php'; ?>
72
</div>
73
<div class="tab3">
74
<?php include_once 'includes/reset-db.php'; ?>
75
</div>
76
</div>
77
<div class="aDBcSidebar">
78
<?php include_once 'includes/sidebar.php'; ?>
79
</div>
80
</div>
81
</div>
82
<?php
83
}
84
include_once 'includes/functions.php';
85
?>
advanced-db-cleaner.php CHANGED
@@ -2,7 +2,7 @@
2
/*
3
Plugin Name: Advanced Database Cleaner
4
Description: Clean up your database by deleting unused data such as 'draft', Optimize your database or reset it to its initial state.
5
- Version: 1.2.0
6
Author: Younes JFR.
7
Contributors: symptote
8
Text Domain: advanced-db-cleaner
2
/*
3
Plugin Name: Advanced Database Cleaner
4
Description: Clean up your database by deleting unused data such as 'draft', Optimize your database or reset it to its initial state.
5
+ Version: 1.2.1
6
Author: Younes JFR.
7
Contributors: symptote
8
Text Domain: advanced-db-cleaner
css/style.css CHANGED
@@ -48,25 +48,24 @@
48
49
#aDBc-clean:checked ~ .tab1, #aDBc-optimize:checked ~ .tab2, #aDBc-reset:checked ~ .tab3{
50
display: block;
51
}
52
53
/* style for count numbers */
54
.aDBcCount {
55
- text-align:center;
56
color: #666 !important;
57
}
58
59
-
60
/* Style for check box */
61
input[type=checkbox] {
62
visibility: hidden;
63
}
64
-
65
/* SQUARED FOUR */
66
.squaredFour {
67
position: relative;
68
}
69
-
70
.squaredFour label {
71
cursor: pointer;
72
position: absolute;
@@ -77,7 +76,6 @@ input[type=checkbox] {
77
border: 1px solid #999;
78
background: #fcfff4;
79
}
80
-
81
.squaredFour label:after {
82
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
83
filter: alpha(opacity=0);
@@ -98,13 +96,11 @@ input[type=checkbox] {
98
-ms-transform: rotate(-45deg);
99
transform: rotate(-45deg);
100
}
101
-
102
.squaredFour label:hover::after {
103
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";
104
filter: alpha(opacity=30);
105
opacity: 0.3;
106
}
107
-
108
.squaredFour input[type=checkbox]:checked + label:after {
109
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
110
filter: alpha(opacity=100);
@@ -123,11 +119,57 @@ input[type=checkbox] {
123
-moz-border-radius: 5px 5px 0 0;
124
-webkit-border-radius: 5px 5px 0 0;
125
}
126
-
127
.aDBcSidebar > div{
128
padding: 15px;
129
}
130
-
131
.aDBcSidebar h2{
132
font-size:20px;
133
}
48
49
#aDBc-clean:checked ~ .tab1, #aDBc-optimize:checked ~ .tab2, #aDBc-reset:checked ~ .tab3{
50
display: block;
51
+ min-height: 400px;
52
}
53
54
/* style for count numbers */
55
.aDBcCount {
56
+ text-align: right !important;
57
color: #666 !important;
58
}
59
60
/* Style for check box */
61
input[type=checkbox] {
62
visibility: hidden;
63
}
64
/* SQUARED FOUR */
65
.squaredFour {
66
position: relative;
67
+ text-align: center;
68
}
69
.squaredFour label {
70
cursor: pointer;
71
position: absolute;
76
border: 1px solid #999;
77
background: #fcfff4;
78
}
79
.squaredFour label:after {
80
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
81
filter: alpha(opacity=0);
96
-ms-transform: rotate(-45deg);
97
transform: rotate(-45deg);
98
}
99
.squaredFour label:hover::after {
100
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";
101
filter: alpha(opacity=30);
102
opacity: 0.3;
103
}
104
.squaredFour input[type=checkbox]:checked + label:after {
105
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
106
filter: alpha(opacity=100);
119
-moz-border-radius: 5px 5px 0 0;
120
-webkit-border-radius: 5px 5px 0 0;
121
}
122
.aDBcSidebar > div{
123
padding: 15px;
124
}
125
.aDBcSidebar h2{
126
font-size:20px;
127
}
128
+
129
+ /* Box warning */
130
+ .box-warning {
131
+ border-radius: 5px;
132
+ -moz-border-radius: 5px;
133
+ -webkit-border-radius: 5px;
134
+ background: #fff5cc url("../images/warning.png") no-repeat scroll 8px 50%;
135
+ border-color: #f2dd8c;
136
+ color: #404040;
137
+ padding: 10px 10px 10px 50px;
138
+ margin-top: 20px;
139
+ }
140
+ /* Info box */
141
+ .box-info {
142
+ border-radius: 5px;
143
+ -moz-border-radius: 5px;
144
+ -webkit-border-radius: 5px;
145
+ background: #e1f1ff url("../images/info.png") no-repeat scroll 8px 50%;
146
+ border-color: #a3d4ff;
147
+ color: #404040;
148
+ padding: 10px 10px 10px 60px;
149
+ margin-top: 20px;
150
+ }
151
+
152
+ /* boxes in tab to inform users about the current option */
153
+ .box-notice{
154
+ border-radius: 5px;
155
+ -moz-border-radius: 5px;
156
+ -webkit-border-radius: 5px;
157
+ border: 1px solid #eee;
158
+ margin-top:40px;
159
+ padding:10px;
160
+ background:#F4F4F4;
161
+ width:300px;
162
+ font-size: 12px;
163
+ text-align:justify;
164
+ }
165
+
166
+ /* For Data already cleaned */
167
+ .already-cleaned{
168
+ float: left;
169
+ background:#c4c4c4;
170
+ padding:2px 6px 2px 6px;
171
+ border-radius: 8px;
172
+ color: #fff;
173
+ margin: 2px;
174
+ font-size: 11px;
175
+ }
images/db_clean.png ADDED
Binary file
images/db_not_clean.png ADDED
Binary file
images/info.png ADDED
Binary file
images/warning.png ADDED
Binary file
includes/clean-db.php CHANGED
@@ -1,119 +1,216 @@
1
- <form action="" method="post">
2
- <p>
3
- <table class="widefat" style="width: 400px; border: 0px; box-shadow: 0 1px 0px #ccc;">
4
- <thead>
5
- <tr>
6
- <th scope="col"><b><?php _e('Type','advanced-db-cleaner'); ?></b></th>
7
- <th scope="col"><b><?php _e('Count','advanced-db-cleaner'); ?></b></th>
8
- <th scope="col"><b><?php _e('Select','advanced-db-cleaner'); ?></b></th>
9
- </tr>
10
- </thead>
11
- <tbody id="the-list">
12
- <tr class="alternate">
13
- <td class="column-name"><?php _e('Revision','advanced-db-cleaner'); ?></td>
14
- <td class="column-name aDBcCount"><?php echo adv_db_cleaner_count('revision'); ?></td>
15
- <td class="column-name">
16
- <div class="squaredFour">
17
- <input id="aDBc_check1" type="checkbox" name="adbc_post_type[]" value="revision" />
18
- <label for="aDBc_check1"></label>
19
- </div>
20
- </td>
21
- </tr>
22
- <tr class="alternate">
23
- <td class="column-name"><?php _e('Draft','advanced-db-cleaner'); ?></td>
24
- <td class="column-name aDBcCount"><?php echo adv_db_cleaner_count('draft'); ?></td>
25
- <td class="column-name">
26
- <div class="squaredFour">
27
- <input id="aDBc_check2" type="checkbox" name="adbc_post_type[]" value="draft" />
28
- <label for="aDBc_check2"></label>
29
- </div>
30
- </td>
31
- </tr>
32
- <tr class="alternate">
33
- <td class="column-name"><?php _e('Auto Draft','advanced-db-cleaner'); ?></td>
34
- <td class="column-name aDBcCount"><?php echo adv_db_cleaner_count('autodraft'); ?></td>
35
- <td class="column-name">
36
- <div class="squaredFour">
37
- <input id="aDBc_check3" type="checkbox" name="adbc_post_type[]" value="autodraft" />
38
- <label for="aDBc_check3"></label>
39
- </div>
40
- </td>
41
- </tr>
42
- <tr class="alternate">
43
- <td class="column-name"><?php _e('Moderated Comments','advanced-db-cleaner'); ?></td>
44
- <td class="column-name aDBcCount"><?php echo adv_db_cleaner_count('moderated'); ?></td>
45
- <td class="column-name">
46
- <div class="squaredFour">
47
- <input id="aDBc_check4" type="checkbox" name="adbc_post_type[]" value="moderated" />
48
- <label for="aDBc_check4"></label>
49
- </div>
50
- </td>
51
- </tr>
52
- <tr class="alternate">
53
- <td class="column-name"><?php _e('Spam Comments','advanced-db-cleaner'); ?></td>
54
- <td class="column-name aDBcCount"><?php echo adv_db_cleaner_count('spam'); ?></td>
55
- <td class="column-name">
56
- <div class="squaredFour">
57
- <input id="aDBc_check5" type="checkbox" name="adbc_post_type[]" value="spam" />
58
- <label for="aDBc_check5"></label>
59
- </div>
60
- </td>
61
- </tr>
62
- <tr class="alternate">
63
- <td class="column-name"><?php _e('Trash Comments','advanced-db-cleaner'); ?></td>
64
- <td class="column-name aDBcCount"><?php echo adv_db_cleaner_count('trash'); ?></td>
65
- <td class="column-name">
66
- <div class="squaredFour">
67
- <input id="aDBc_check6" type="checkbox" name="adbc_post_type[]" value="trash" />
68
- <label for="aDBc_check6"></label>
69
- </div>
70
- </td>
71
- </tr>
72
- <tr class="alternate">
73
- <td class="column-name"><?php _e('Orphan Postmeta','advanced-db-cleaner'); ?></td>
74
- <td class="column-name aDBcCount"><?php echo adv_db_cleaner_count('postmeta'); ?></td>
75
- <td class="column-name">
76
- <div class="squaredFour">
77
- <input id="aDBc_check7" type="checkbox" name="adbc_post_type[]" value="postmeta" />
78
- <label for="aDBc_check7"></label>
79
- </div>
80
- </td>
81
- </tr>
82
- <tr class="alternate">
83
- <td class="column-name"><?php _e('Orphan Commentmeta','advanced-db-cleaner'); ?></td>
84
- <td class="column-name aDBcCount"><?php echo adv_db_cleaner_count('commentmeta'); ?></td>
85
- <td class="column-name">
86
- <div class="squaredFour">
87
- <input id="aDBc_check8" type="checkbox" name="adbc_post_type[]" value="commentmeta" />
88
- <label for="aDBc_check8"></label>
89
- </div>
90
- </td>
91
- </tr>
92
- <tr class="alternate">
93
- <td class="column-name"><?php _e('Orphan Relationships','advanced-db-cleaner'); ?></td>
94
- <td class="column-name aDBcCount"><?php echo adv_db_cleaner_count('relationships'); ?></td>
95
- <td class="column-name">
96
- <div class="squaredFour">
97
- <input id="aDBc_check9" type="checkbox" name="adbc_post_type[]" value="relationships" />
98
- <label for="aDBc_check9"></label>
99
- </div>
100
- </td>
101
- </tr>
102
- <tr class="alternate">
103
- <td class="column-name"><?php _e('Dashboard Transient Feed','advanced-db-cleaner'); ?></td>
104
- <td class="column-name aDBcCount"><?php echo adv_db_cleaner_count('feed'); ?></td>
105
- <td class="column-name">
106
- <div class="squaredFour">
107
- <input id="aDBc_check10" type="checkbox" name="adbc_post_type[]" value="feed" />
108
- <label for="aDBc_check10"></label>
109
- </div>
110
- </td>
111
- </tr>
112
- </tbody>
113
- </table>
114
- </p>
115
- <p>
116
- <input type="hidden" name="aDBc_clean_form" value="" />
117
- <input type="submit" class="button-primary" value="<?php _e('Delete selected items','advanced-db-cleaner'); ?>" />
118
- </p>
119
- </form>
1
+ <?php
2
+ /* Get the totals of unused data */
3
+ $aDBc_count_unused = adv_db_cleaner_count();
4
+ ?>
5
+ <div style="color:#888; margin-top:20px;">
6
+ <div style="float: left; margin-right:30px; margin-bottom:40px">
7
+ <form action="" method="post">
8
+ <table class="widefat" style="width: 400px; border: 0px; box-shadow: 0 1px 0px #ccc;">
9
+ <thead style="background:#f0f5fa; border-bottom:1px solid dashed">
10
+ <tr>
11
+ <th scope="col" style="font-size:13px; border-bottom: 1px dashed #ccc; border-top: 1px solid #eee"><?php _e('Elements to clean','advanced-db-cleaner'); ?></th>
12
+ <th scope="col" style="text-align: right; width: 80px; font-size:13px; border-bottom: 1px dashed #ccc; border-top: 1px solid #eee"><?php _e('Count','advanced-db-cleaner'); ?></th>
13
+ <th scope="col" style="text-align: right; width: 80px; font-size:13px; border-bottom: 1px dashed #ccc; border-top: 1px solid #eee"><?php _e('Select','advanced-db-cleaner'); ?></th>
14
+ </tr>
15
+ </thead>
16
+ <tbody id="the-list">
17
+ <?php
18
+ if($aDBc_count_unused["total"] == 0){ ?>
19
+ <tr class="alternate">
20
+ <td class="column-name" style="color: #999"><?php _e('Nothing to do!','advanced-db-cleaner'); ?></td>
21
+ <td class="column-name"></td>
22
+ <td class="column-name"></td>
23
+ </tr>
24
+ <?php
25
+ } else {
26
+ if($aDBc_count_unused["revision"] > 0){ ?>
27
+ <tr class="alternate">
28
+ <td class="column-name"><?php _e('Revision','advanced-db-cleaner'); ?></td>
29
+ <td class="column-name aDBcCount"><?php echo $aDBc_count_unused["revision"]; ?></td>
30
+ <td class="column-name">
31
+ <div class="squaredFour">
32
+ <input id="aDBc_check1" type="checkbox" name="adbc_post_type[]" value="revision" />
33
+ <label for="aDBc_check1"></label>
34
+ </div>
35
+ </td>
36
+ </tr>
37
+ <?php
38
+ }
39
+ if($aDBc_count_unused["draft"] > 0){ ?>
40
+ <tr class="alternate">
41
+ <td class="column-name"><?php _e('Draft','advanced-db-cleaner'); ?></td>
42
+ <td class="column-name aDBcCount"><?php echo $aDBc_count_unused["draft"]; ?></td>
43
+ <td class="column-name">
44
+ <div class="squaredFour">
45
+ <input id="aDBc_check2" type="checkbox" name="adbc_post_type[]" value="draft" />
46
+ <label for="aDBc_check2"></label>
47
+ </div>
48
+ </td>
49
+ </tr>
50
+ <?php
51
+ }
52
+ if($aDBc_count_unused["autodraft"] > 0){ ?>
53
+ <tr class="alternate">
54
+ <td class="column-name"><?php _e('Auto Draft','advanced-db-cleaner'); ?></td>
55
+ <td class="column-name aDBcCount"><?php echo $aDBc_count_unused["autodraft"]; ?></td>
56
+ <td class="column-name">
57
+ <div class="squaredFour">
58
+ <input id="aDBc_check3" type="checkbox" name="adbc_post_type[]" value="autodraft" />
59
+ <label for="aDBc_check3"></label>
60
+ </div>
61
+ </td>
62
+ </tr>
63
+ <?php
64
+ }
65
+ if($aDBc_count_unused["moderated"] > 0){ ?>
66
+ <tr class="alternate">
67
+ <td class="column-name"><?php _e('Moderated Comments','advanced-db-cleaner'); ?></td>
68
+ <td class="column-name aDBcCount"><?php echo $aDBc_count_unused["moderated"]; ?></td>
69
+ <td class="column-name">
70
+ <div class="squaredFour">
71
+ <input id="aDBc_check4" type="checkbox" name="adbc_post_type[]" value="moderated" />
72
+ <label for="aDBc_check4"></label>
73
+ </div>
74
+ </td>
75
+ </tr>
76
+ <?php
77
+ }
78
+ if($aDBc_count_unused["spam"] > 0){ ?>
79
+ <tr class="alternate">
80
+ <td class="column-name"><?php _e('Spam Comments','advanced-db-cleaner'); ?></td>
81
+ <td class="column-name aDBcCount"><?php echo $aDBc_count_unused["spam"]; ?></td>
82
+ <td class="column-name">
83
+ <div class="squaredFour">
84
+ <input id="aDBc_check5" type="checkbox" name="adbc_post_type[]" value="spam" />
85
+ <label for="aDBc_check5"></label>
86
+ </div>
87
+ </td>
88
+ </tr>
89
+ <?php
90
+ }
91
+ if($aDBc_count_unused["trash"] > 0){ ?>
92
+ <tr class="alternate">
93
+ <td class="column-name"><?php _e('Trash Comments','advanced-db-cleaner'); ?></td>
94
+ <td class="column-name aDBcCount"><?php echo $aDBc_count_unused["trash"]; ?></td>
95
+ <td class="column-name">
96
+ <div class="squaredFour">
97
+ <input id="aDBc_check6" type="checkbox" name="adbc_post_type[]" value="trash" />
98
+ <label for="aDBc_check6"></label>
99
+ </div>
100
+ </td>
101
+ </tr>
102
+ <?php
103
+ }
104
+
105
+ if($aDBc_count_unused["postmeta"] > 0){ ?>
106
+ <tr class="alternate">
107
+ <td class="column-name"><?php _e('Orphan Postmeta','advanced-db-cleaner'); ?></td>
108
+ <td class="column-name aDBcCount"><?php echo $aDBc_count_unused["postmeta"]; ?></td>
109
+ <td class="column-name">
110
+ <div class="squaredFour">
111
+ <input id="aDBc_check7" type="checkbox" name="adbc_post_type[]" value="postmeta" />
112
+ <label for="aDBc_check7"></label>
113
+ </div>
114
+ </td>
115
+ </tr>
116
+ <?php
117
+ }
118
+ if($aDBc_count_unused["commentmeta"] > 0){ ?>
119
+ <tr class="alternate">
120
+ <td class="column-name"><?php _e('Orphan Commentmeta','advanced-db-cleaner'); ?></td>
121
+ <td class="column-name aDBcCount"><?php echo $aDBc_count_unused["commentmeta"]; ?></td>
122
+ <td class="column-name">
123
+ <div class="squaredFour">
124
+ <input id="aDBc_check8" type="checkbox" name="adbc_post_type[]" value="commentmeta" />
125
+ <label for="aDBc_check8"></label>
126
+ </div>
127
+ </td>
128
+ </tr>
129
+ <?php
130
+ }
131
+ if($aDBc_count_unused["relationships"] > 0){ ?>
132
+ <tr class="alternate">
133
+ <td class="column-name"><?php _e('Orphan Relationships','advanced-db-cleaner'); ?></td>
134
+ <td class="column-name aDBcCount"><?php echo $aDBc_count_unused["relationships"]; ?></td>
135
+ <td class="column-name">
136
+ <div class="squaredFour">
137
+ <input id="aDBc_check9" type="checkbox" name="adbc_post_type[]" value="relationships" />
138
+ <label for="aDBc_check9"></label>
139
+ </div>
140
+ </td>
141
+ </tr>
142
+ <?php
143
+ }
144
+ if($aDBc_count_unused["feed"] > 0){ ?>
145
+ <tr class="alternate">
146
+ <td class="column-name"><?php _e('Dashboard Transient Feed','advanced-db-cleaner'); ?></td>
147
+ <td class="column-name aDBcCount"><?php echo $aDBc_count_unused["feed"]; ?></td>
148
+ <td class="column-name">
149
+ <div class="squaredFour">
150
+ <input id="aDBc_check10" type="checkbox" name="adbc_post_type[]" value="feed" />
151
+ <label for="aDBc_check10"></label>
152
+ </div>
153
+ </td>
154
+ </tr>
155
+ <?php
156
+ }
157
+ } ?>
158
+ </tbody>
159
+ <tfoot style="background:#f0f5fa">
160
+ <tr>
161
+ <th scope="col" style="font-size:13px; border-top: 1px dashed #ccc"><?php _e('Total','advanced-db-cleaner'); ?></th>
162
+ <th scope="col" class="aDBcCount" style="border-top: 1px dashed #ccc"><b><?php echo $aDBc_count_unused["total"]; ?></b></th>
163
+ <th scope="col" style="border-top: 1px dashed #ccc"></th>
164
+ </tr>
165
+ </tfoot>
166
+ </table>
167
+ <p>
168
+ <input type="hidden" name="aDBc_clean_form" value="" />
169
+ <input type="submit" class="button-primary" value="<?php _e('Clean selected items','advanced-db-cleaner'); ?>" <?php echo $aDBc_count_unused["total"] == 0 ? 'disabled' : ''; ?> />
170
+ </p>
171
+ </form>
172
+ </div>
173
+ <div style="float:left; padding-left:20px; border-left: 1px dashed #ccc; ">
174
+ <div style="text-align:center;">
175
+ <?php if($aDBc_count_unused["total"] == 0){ ?>
176
+ <img src="<?php echo plugins_url() .'/'. dirname(dirname(plugin_basename(__FILE__))) . '/images/db_clean.png'?>"/>
177
+ <div style="font-color:#ccc; color: #999; font-family: tahoma">Your database is clean!</div>
178
+ <?php } else { ?>
179
+ <img src="<?php echo plugins_url() .'/'. dirname(dirname(plugin_basename(__FILE__))) . '/images/db_not_clean.png'?>"/>
180
+ <div style="font-color:#ccc; color: #999; font-family: tahoma"><b><?php echo $aDBc_count_unused["total"]; ?></b> element(s) <br/>should be cleaned!</div>
181
+ <?php } ?>
182
+ </div>
183
+ <div class="box-notice">
184
+ Cleaning your database helps you saving space by removing unused data. The plugin has detected that the following items are already cleaned:
185
+ <div style="margin-top:15px">
186
+ <?php
187
+ if($aDBc_count_unused["revision"] == 0)
188
+ echo "<div class='already-cleaned'>". __('Revision','advanced-db-cleaner') ."</div>";
189
+ if($aDBc_count_unused["draft"] == 0)
190
+ echo "<div class='already-cleaned'>". __('Draft','advanced-db-cleaner') ."</div>";
191
+ if($aDBc_count_unused["autodraft"] == 0)
192
+ echo "<div class='already-cleaned'>". __('Auto Draft','advanced-db-cleaner') ."</div>";
193
+ if($aDBc_count_unused["postmeta"] == 0)
194
+ echo "<div class='already-cleaned'>". __('Postmeta','advanced-db-cleaner') ."</div>";
195
+ if($aDBc_count_unused["moderated"] == 0)
196
+ echo "<div class='already-cleaned'>". __('Moderated Comments','advanced-db-cleaner') ."</div>";
197
+ if($aDBc_count_unused["spam"] == 0)
198
+ echo "<div class='already-cleaned'>". __('Spam Comments','advanced-db-cleaner') ."</div>";
199
+ if($aDBc_count_unused["trash"] == 0)
200
+ echo "<div class='already-cleaned'>". __('Trash Comments','advanced-db-cleaner') ."</div>";
201
+ if($aDBc_count_unused["commentmeta"] == 0)
202
+ echo "<div class='already-cleaned'>". __('Commentmeta','advanced-db-cleaner') ."</div>";
203
+ if($aDBc_count_unused["relationships"] == 0)
204
+ echo "<div class='already-cleaned'>". __('Relationships','advanced-db-cleaner') ."</div>";
205
+ if($aDBc_count_unused["feed"] == 0)
206
+ echo "<div class='already-cleaned'>". __('Dashboard Transient Feed','advanced-db-cleaner') ."</div>";
207
+ ?>
208
+ <div style="clear:both"></div>
209
+ </div>
210
+ </div>
211
+ </div>
212
+ </div>
213
+ <?php
214
+ //Once we have displayed counts, delete the array to optimize usage of memory.
215
+ unset($aDBc_count_unused);
216
+ ?>
includes/functions.php CHANGED
@@ -47,52 +47,53 @@ function adv_db_cleaner($type){
47
}
48
}
49
50
- function adv_db_cleaner_count($type){
51
global $wpdb;
52
- switch($type){
53
- case "revision":
54
- $adbc_sql = "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'revision'";
55
- $count = $wpdb->get_var($adbc_sql);
56
- break;
57
- case "draft":
58
- $adbc_sql = "SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'draft'";
59
- $count = $wpdb->get_var($adbc_sql);
60
- break;
61
- case "autodraft":
62
- $adbc_sql = "SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'auto-draft'";
63
- $count = $wpdb->get_var($adbc_sql);
64
- break;
65
- case "moderated":
66
- $adbc_sql = "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'";
67
- $count = $wpdb->get_var($adbc_sql);
68
- break;
69
- case "spam":
70
- $adbc_sql = "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = 'spam'";
71
- $count = $wpdb->get_var($adbc_sql);
72
- break;
73
- case "trash":
74
- $adbc_sql = "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = 'trash'";
75
- $count = $wpdb->get_var($adbc_sql);
76
- break;
77
- case "postmeta":
78
- $adbc_sql = "SELECT COUNT(*) FROM $wpdb->postmeta pm LEFT JOIN $wpdb->posts wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL";
79
- //$adbc_sql = "SELECT COUNT(*) FROM $wpdb->postmeta WHERE NOT EXISTS ( SELECT * FROM $wpdb->posts WHERE $wpdb->postmeta.post_id = $wpdb->posts.ID )";
80
- $count = $wpdb->get_var($adbc_sql);
81
- break;
82
- case "commentmeta":
83
- $adbc_sql = "SELECT COUNT(*) FROM $wpdb->commentmeta WHERE comment_id NOT IN (SELECT comment_id FROM $wpdb->comments)";
84
- $count = $wpdb->get_var($adbc_sql);
85
- break;
86
- case "relationships":
87
- $adbc_sql = "SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id=1 AND object_id NOT IN (SELECT id FROM $wpdb->posts)";
88
- $count = $wpdb->get_var($adbc_sql);
89
- break;
90
- case "feed":
91
- $adbc_sql = "SELECT COUNT(*) FROM $wpdb->options WHERE option_name LIKE '_site_transient_browser_%' OR option_name LIKE '_site_transient_timeout_browser_%' OR option_name LIKE '_transient_feed_%' OR option_name LIKE '_transient_timeout_feed_%'";
92
- $count = $wpdb->get_var($adbc_sql);
93
- break;
94
- }
95
- return $count;
96
}
97
98
function adv_db_cleaner_optimize(){
47
}
48
}
49
50
+ function adv_db_cleaner_count(){
51
global $wpdb;
52
+ $aDBc_count_total_unused = 0;
53
+
54
+ $adbc_sql = "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'revision'";
55
+ $aDBc_count_unused["revision"] = $wpdb->get_var($adbc_sql);
56
+ $aDBc_count_total_unused += $aDBc_count_unused["revision"];
57
+
58
+ $adbc_sql = "SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'draft'";
59
+ $aDBc_count_unused["draft"] = $wpdb->get_var($adbc_sql);
60
+ $aDBc_count_total_unused += $aDBc_count_unused["draft"];
61
+
62
+ $adbc_sql = "SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'auto-draft'";
63
+ $aDBc_count_unused["autodraft"] = $wpdb->get_var($adbc_sql);
64
+ $aDBc_count_total_unused += $aDBc_count_unused["autodraft"];
65
+
66
+ $adbc_sql = "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'";
67
+ $aDBc_count_unused["moderated"] = $wpdb->get_var($adbc_sql);
68
+ $aDBc_count_total_unused += $aDBc_count_unused["moderated"];
69
+
70
+ $adbc_sql = "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = 'spam'";
71
+ $aDBc_count_unused["spam"] = $wpdb->get_var($adbc_sql);
72
+ $aDBc_count_total_unused += $aDBc_count_unused["spam"];
73
+
74
+ $adbc_sql = "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = 'trash'";
75
+ $aDBc_count_unused["trash"] = $wpdb->get_var($adbc_sql);
76
+ $aDBc_count_total_unused += $aDBc_count_unused["trash"];
77
+
78
+ $adbc_sql = "SELECT COUNT(*) FROM $wpdb->postmeta pm LEFT JOIN $wpdb->posts wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL";
79
+ //$adbc_sql = "SELECT COUNT(*) FROM $wpdb->postmeta WHERE NOT EXISTS ( SELECT * FROM $wpdb->posts WHERE $wpdb->postmeta.post_id = $wpdb->posts.ID )";
80
+ $aDBc_count_unused["postmeta"] = $wpdb->get_var($adbc_sql);
81
+ $aDBc_count_total_unused += $aDBc_count_unused["postmeta"];
82
+
83
+ $adbc_sql = "SELECT COUNT(*) FROM $wpdb->commentmeta WHERE comment_id NOT IN (SELECT comment_id FROM $wpdb->comments)";
84
+ $aDBc_count_unused["commentmeta"] = $wpdb->get_var($adbc_sql);
85
+ $aDBc_count_total_unused += $aDBc_count_unused["commentmeta"];
86
+
87
+ $adbc_sql = "SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id=1 AND object_id NOT IN (SELECT id FROM $wpdb->posts)";
88
+ $aDBc_count_unused["relationships"] = $wpdb->get_var($adbc_sql);
89
+ $aDBc_count_total_unused += $aDBc_count_unused["relationships"];
90
+
91
+ $adbc_sql = "SELECT COUNT(*) FROM $wpdb->options WHERE option_name LIKE '_site_transient_browser_%' OR option_name LIKE '_site_transient_timeout_browser_%' OR option_name LIKE '_transient_feed_%' OR option_name LIKE '_transient_timeout_feed_%'";
92
+ $aDBc_count_unused["feed"] = $wpdb->get_var($adbc_sql);
93
+ $aDBc_count_total_unused += $aDBc_count_unused["feed"];
94
+
95
+ $aDBc_count_unused["total"] = $aDBc_count_total_unused;
96
+ return $aDBc_count_unused;
97
}
98
99
function adv_db_cleaner_optimize(){
includes/optimize-db.php CHANGED
@@ -1,53 +1,68 @@
1
- <form action="" method="post">
2
- <p>
3
- <table class="widefat" style="width: 600px; border: 0px; box-shadow: 0 1px 0px #ccc;">
4
- <thead>
5
- <tr>
6
- <th scope="col"><b><?php _e('#','advanced-db-cleaner'); ?></b></th>
7
- <th scope="col"><b><?php _e('Table','advanced-db-cleaner'); ?></b></th>
8
- <th scope="col" style="text-align:right; width:80px"><b><?php _e('Rows','advanced-db-cleaner'); ?></b></th>
9
- <th scope="col" style="text-align:right; width:100px"><b><?php _e('Size','advanced-db-cleaner'); ?></b></th>
10
- <th scope="col" style="text-align:right; width:80px"><b><?php _e('Lost','advanced-db-cleaner'); ?></b></th>
11
- </tr>
12
- </thead>
13
- <tbody id="the-list">
14
- <?php
15
- global $wpdb;
16
- $aDBc_tableID = 0;
17
- $total_rows = 0;
18
- $total_size = 0;
19
- $total_lost = 0;
20
- $adbc_sql = 'SHOW TABLE STATUS FROM `'.DB_NAME.'`';
21
- $result = $wpdb->get_results($adbc_sql);
22
- foreach($result as $row){
23
- $aDBc_tableID += 1;
24
- $total_rows += $row->Rows;
25
- $table_size = ($row->Data_length + $row->Index_length) / 1024;
26
- $total_size += $table_size;
27
- $total_lost += $row->Data_free;
28
- echo "<tr class='alternate'>
29
- <td class='column-name' style='width:30px'>". $aDBc_tableID ."</td>
30
- <td class='column-name'>". $row->Name ."</td>
31
- <td class='column-name' style='text-align:right'>". $row->Rows ."</td>
32
- <td class='column-name' style='text-align:right'>". sprintf("%0.2f", $table_size) ." KB</td>
33
- <td class='column-name' style='text-align:right'>". ($row->Data_free > 0 ? $row->Data_free . ' o' : '--') ."</td>
34
- </tr>\n";
35
- }
36
- ?>
37
- </tbody>
38
- <tfoot>
39
- <tr class="alternate">
40
- <th scope="col" style="font-size:12px"><?php _e('Total','advanced-db-cleaner'); ?></th>
41
- <th scope="col" style="text-align:left"><b><?php echo $aDBc_tableID; ?></b></th>
42
- <th scope="col" style="text-align:right"><b><?php echo $total_rows; ?></b></th>
43
- <th scope="col" style="text-align:right"><b><?php echo sprintf("%0.2f", $total_size).'</b> KB'; ?></th>
44
- <th scope="col" style="text-align:right"><b><?php echo $total_lost .'</b> o'; ?></th>
45
- </tr>
46
- </tfoot>
47
- </table>
48
- </p>
49
- <p>
50
- <input type="hidden" name="aDBc_optimize_form" value="" />
51
- <input type="submit" class="button-primary" value="<?php _e('Optimize database','advanced-db-cleaner'); ?>" />
52
- </p>
53
- </form>
1
+ <div style="color:#888; margin-top:20px;">
2
+ <div style="float: left; margin-right:30px; margin-bottom:40px">
3
+ <form action="" method="post">
4
+ <table class="widefat" style="width: 400px; border: 0px; box-shadow: 0 1px 0px #ccc;">
5
+ <thead style="background:#f0f5fa; border-bottom:1px solid dashed">
6
+ <tr>
7
+ <th scope="col" style="font-size:13px; border-bottom: 1px dashed #ccc; border-top: 1px solid #eee"><?php _e('Tables to optimize','advanced-db-cleaner'); ?></th>
8
+ <th scope="col" style="text-align: right; width: 80px; font-size:13px; border-bottom: 1px dashed #ccc; border-top: 1px solid #eee"><?php _e('Lost space','advanced-db-cleaner'); ?></th>
9
+ </tr>
10
+ </thead>
11
+ <tbody id="the-list">
12
+ <?php
13
+ global $wpdb;
14
+ $total_tables_to_optimize = 0;
15
+ $total_lost = 0;
16
+ $adbc_sql = 'SHOW TABLE STATUS FROM `'.DB_NAME.'`';
17
+ $result = $wpdb->get_results($adbc_sql);
18
+ foreach($result as $row){
19
+ $table_size = ($row->Data_length + $row->Index_length) / 1024;
20
+ if($row->Data_free > 0){
21
+ $total_tables_to_optimize += 1;
22
+ $total_lost += $row->Data_free;
23
+ echo "<tr class='alternate'>
24
+ <td class='column-name'>". $row->Name ."</td>
25
+ <td class='column-name' style='text-align:right'>". $row->Data_free . ' o' ."</td>
26
+ </tr>\n";
27
+ }
28
+ }
29
+
30
+ if($total_lost == 0){
31
+ echo "<tr class='alternate'>
32
+ <td class='column-name' style='color: #999'>". __('Nothing to do!','advanced-db-cleaner') ."</td>
33
+ <td class='column-name'></td></tr>";
34
+ }
35
+ ?>
36
+ </tbody>
37
+ <tfoot style="background:#f0f5fa">
38
+ <tr>
39
+ <th scope="col" style="font-size:13px; border-top: 1px dashed #ccc"><?php _e('Total','advanced-db-cleaner'); ?></th>
40
+ <th scope="col" class="aDBcCount" style="border-top: 1px dashed #ccc"><b><?php echo $total_lost .'</b> o'; ?></th>
41
+ </tr>
42
+ </tfoot>
43
+ </table>
44
+ <p>
45
+ <input type="hidden" name="aDBc_optimize_form" value="" />
46
+ <input type="submit" class="button-primary" value="<?php _e('Optimize database','advanced-db-cleaner'); ?>" <?php echo $total_lost == 0 ? 'disabled' : ''; ?> />
47
+ </p>
48
+ </form>
49
+ </div>
50
+ <div style="float:left; padding-left:20px; border-left: 1px dashed #ccc; ">
51
+ <div style="text-align:center;">
52
+ <?php if($total_lost == 0){ ?>
53
+ <img src="<?php echo plugins_url() .'/'. dirname(dirname(plugin_basename(__FILE__))) . '/images/db_clean.png'?>"/>
54
+ <div style="font-color:#ccc; color: #999; font-family: tahoma">Your database is optimized!</div>
55
+ <?php } else { ?>
56
+ <img src="<?php echo plugins_url() .'/'. dirname(dirname(plugin_basename(__FILE__))) . '/images/db_not_clean.png'?>"/>
57
+ <div style="font-color:#ccc; color: #999; font-family: tahoma"><b><?php echo $total_tables_to_optimize; ?></b> table(s) <br/>should be optimized!</div>
58
+ <?php } ?>
59
+ </div>
60
+ <div class="box-notice">
61
+ <ul style="list-style: square outside none; padding:0px 10px 0px 10px">
62
+ <li>"Optimizing" reduces storage space and improves efficiency when accessing your tables.</li>
63
+ <li>Except tables listed in the table above, all your other tables are already optimized.</li>
64
+ <li>Please note that is not necessary to run the optimization frequently, just do it from time to time.</li>
65
+ </ul>
66
+ </div>
67
+ </div>
68
+ </div>
includes/reset-db.php CHANGED
@@ -6,26 +6,23 @@ if (!isset($aDBc_admin->user_login ) || $aDBc_admin->user_level < 10 ){
6
$aDBc_admin_exists = 0;
7
}
8
?>
9
-
10
-
11
-
12
- <h4 style="color:#32373c; font-size:15px">Details about the reset:</h4>
13
-
14
- <ul style="list-style: square outside none; margin-left:40px;">
15
- <li><font color="red"><b>ANY</b></font> data in your database will be lost. The reset makes a fresh installation of your database.</li>
16
- <li>The reset does not delete or modify any of your plugins files or server files.</li>
17
- <li>All your plugins will be deactivated (including this one). You should activate them manually after the reset.</li>
18
- <?php if ($aDBc_admin_exists) { ?>
19
- <li>The '<strong>admin</strong>' user exists and will be recreated with its <strong>current password</strong>.</li>
20
- <?php } else {?>
21
- <li>The 'admin' user does not exist. The user '<strong><?php echo esc_html( $current_user->user_login ); ?></strong>' will be recreated with its <strong>current password</strong> with user level 10.</li>
22
- <?php } ?>
23
- <li>After the reset, you will be redirected to the admin login page.</li>
24
- </ul>
25
- <br/>
26
- <h3 style="color:#32373c">Go reset</h3>
27
<p>Type '<strong>reset</strong>' in the confirmation field below to confirm the reset and then click the reset button.</p>
28
-
29
<form id="wordpress_reset_form" action="" method="post">
30
<input type="hidden" name="aDBc_reset_form" value="" />
31
<input type="text" name="aDBc_reset_comfirmation" value="" />
6
$aDBc_admin_exists = 0;
7
}
8
?>
9
+ <div class="box-warning">
10
+ <span style="color: #EA823A; font-weight:bold">WARNING:</span> The reset makes a fresh installation of your database. Therefore, ANY data in your database will be lost. This option is used primarily by developers who are testing their websites and who do not want to install wordpress after each test. Please do not use this option if you want to keep your posts and pages.
11
+ </div>
12
+ <div class="box-info">
13
+ <ul style="list-style: disc outside none;">
14
+ <li>The reset does not delete or modify any of your plugins files or server files.</li>
15
+ <li>All your plugins will be deactivated (including this one). You should activate them manually after the reset.</li>
16
+ <?php if ($aDBc_admin_exists) { ?>
17
+ <li>The '<strong>admin</strong>' user exists and will be recreated with its <strong>current password</strong>.</li>
18
+ <?php } else {?>
19
+ <li>The 'admin' user does not exist. The user '<strong><?php echo esc_html( $current_user->user_login ); ?></strong>' will be recreated with its <strong>current password</strong> with user level 10.</li>
20
+ <?php } ?>
21
+ <li>After the reset, you will be redirected to the admin login page.</li>
22
+ </ul>
23
+ </div>
24
+ <h3 style="color:#32373c; padding-top: 10px">Reset database</h3>
25
<p>Type '<strong>reset</strong>' in the confirmation field below to confirm the reset and then click the reset button.</p>
26
<form id="wordpress_reset_form" action="" method="post">
27
<input type="hidden" name="aDBc_reset_form" value="" />
28
<input type="text" name="aDBc_reset_comfirmation" value="" />
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file
screenshot-3.png CHANGED
Binary file
screenshot-4.png ADDED
Binary file
screenshot-5.png ADDED
Binary file