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 | 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 +14 -4
- advanced-db-cleaner-admin.php +0 -15
- advanced-db-cleaner.php +1 -1
- css/style.css +51 -9
- images/db_clean.png +0 -0
- images/db_not_clean.png +0 -0
- images/info.png +0 -0
- images/warning.png +0 -0
- includes/clean-db.php +216 -119
- includes/functions.php +46 -45
- includes/optimize-db.php +68 -53
- includes/reset-db.php +16 -19
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
- screenshot-4.png +0 -0
- screenshot-5.png +0 -0
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.
|
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.
|
37 |
-
2.
|
38 |
-
3.
|
|
|
|
|
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.
|
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:
|
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 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
<
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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(
|
51 |
global $wpdb;
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
|
|
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 |
-
<
|
2 |
-
<
|
3 |
-
<
|
4 |
-
<
|
5 |
-
<
|
6 |
-
<
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
<
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
-
<
|
13 |
-
|
14 |
-
<
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
</
|
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
|