Version Description
- 2019/08/13
- WebFactory took over development
- minor improvements in GUI and messaging
- fixed a nasty bug related to admin user ID not being 1
- 70k installations; 665,500 downloads
Download this release
Release Info
Developer | WebFactory |
Plugin | WordPress Database Reset |
Version | 3.1 |
Comparing to | |
See all releases |
Code changes from version 3.0.2 to 3.1
- assets/css/database-reset.css +63 -8
- assets/images/donate.png +0 -0
- assets/images/wp-reset-icon.png +0 -0
- assets/images/wp-reset-logo.png +0 -0
- assets/js/database-reset.js +69 -1
- class-db-reset-admin.php +180 -3
- class-db-resetter.php +14 -2
- languages/wordpress-database-reset.pot +0 -73
- license.txt +280 -0
- readme.txt +48 -18
- screenshot-1.png +0 -0
- views/index.php +21 -2
- views/partials/disclaimer.php +0 -3
- views/partials/donate.php +0 -7
- views/partials/notice.php +6 -0
- views/partials/security-code.php +2 -2
- views/partials/select-tables.php +11 -5
- wp-reset.php +10 -9
assets/css/database-reset.css
CHANGED
@@ -1,3 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
#select-container {
|
2 |
width: 290px;
|
3 |
}
|
@@ -11,6 +19,14 @@
|
|
11 |
font-weight: bold;
|
12 |
display: inline-block;
|
13 |
margin-left: 3px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
}
|
15 |
|
16 |
#loader {
|
@@ -19,14 +35,53 @@
|
|
19 |
width: 28px;
|
20 |
}
|
21 |
|
22 |
-
#
|
23 |
-
|
|
|
|
|
24 |
}
|
25 |
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
p {
|
2 |
+
font-size: 14px;
|
3 |
+
}
|
4 |
+
|
5 |
+
.wrap h1 {
|
6 |
+
margin-bottom: 20px;
|
7 |
+
}
|
8 |
+
|
9 |
#select-container {
|
10 |
width: 290px;
|
11 |
}
|
19 |
font-weight: bold;
|
20 |
display: inline-block;
|
21 |
margin-left: 3px;
|
22 |
+
padding: 3px 5px 2px 5px;
|
23 |
+
background: #eaeaea;
|
24 |
+
}
|
25 |
+
|
26 |
+
.code, code {
|
27 |
+
font-family: Consolas,Monaco,monospace;
|
28 |
+
direction: ltr;
|
29 |
+
unicode-bidi: embed;
|
30 |
}
|
31 |
|
32 |
#loader {
|
35 |
width: 28px;
|
36 |
}
|
37 |
|
38 |
+
#wp-reset-ad img {
|
39 |
+
float: left;
|
40 |
+
margin-right: 20px;
|
41 |
+
width: 100px;
|
42 |
}
|
43 |
|
44 |
+
/* wpr upsell dialog */
|
45 |
+
.wpr-upsell-dialog .ui-dialog-titlebar {
|
46 |
+
background: #ccc;
|
47 |
+
text-align: center;
|
48 |
+
height: 55px;
|
49 |
+
}
|
50 |
+
.wpr-upsell-dialog .ui-dialog-titlebar img {
|
51 |
+
height: 32px;
|
52 |
+
display: inline-block;
|
53 |
+
margin: 11px 0 0 0;
|
54 |
+
}
|
55 |
+
.wpr-upsell-dialog .ui-dialog-titlebar-close {
|
56 |
+
color: #515151;
|
57 |
+
height: 55px;
|
58 |
}
|
59 |
+
.wpr-upsell-dialog .ui-dialog-titlebar-close:hover {
|
60 |
+
color: #333;
|
61 |
+
}
|
62 |
+
.wpr-upsell-dialog .ui-dialog-content {
|
63 |
+
padding: 0;
|
64 |
+
}
|
65 |
+
.wpr-upsell-dialog .ui-tabs-nav {
|
66 |
+
text-align: center;
|
67 |
+
}
|
68 |
+
.wpr-upsell-dialog .ui-tabs .upsell-tab {
|
69 |
+
padding: 20px 15px;
|
70 |
+
text-align: center;
|
71 |
+
}
|
72 |
+
.wpr-upsell-dialog a {
|
73 |
+
color: #333;
|
74 |
+
}
|
75 |
+
.wpr-upsell-dialog a:hover {
|
76 |
+
color: #000;
|
77 |
+
}
|
78 |
+
.wpr-upsell-dialog ul {
|
79 |
+
list-style: disc;
|
80 |
+
list-style-position: inside;
|
81 |
+
}
|
82 |
+
.wpr-upsell-dialog .upsell-footer {
|
83 |
+
text-align: center;
|
84 |
+
margin-top: 20px;
|
85 |
+
}
|
86 |
+
|
87 |
+
/* wpr upsell dialog */
|
assets/images/donate.png
DELETED
Binary file
|
assets/images/wp-reset-icon.png
ADDED
Binary file
|
assets/images/wp-reset-logo.png
ADDED
Binary file
|
assets/js/database-reset.js
CHANGED
@@ -27,17 +27,85 @@
|
|
27 |
$( '#db-reset-submit' ).prop( 'disabled', $( this ).val() !== $( "#security-code" ).text() );
|
28 |
});
|
29 |
|
30 |
-
$( '#db-reset-submit' ).on('click', function(e) {
|
31 |
e.preventDefault();
|
32 |
|
|
|
|
|
|
|
|
|
|
|
33 |
if ( confirm( dbReset.confirmAlert ) ) {
|
34 |
$( '#db-reset-form' ).submit();
|
35 |
$( '#loader' ).show();
|
|
|
36 |
}
|
37 |
});
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
$.fn.showIfSelected = function( selectValue ) {
|
40 |
$( this ).toggle( $( "option[value='" + selectValue + "']:selected", tables ).length > 0 );
|
41 |
}
|
42 |
|
43 |
})( jQuery );
|
|
|
|
|
|
|
|
|
|
|
|
27 |
$( '#db-reset-submit' ).prop( 'disabled', $( this ).val() !== $( "#security-code" ).text() );
|
28 |
});
|
29 |
|
30 |
+
$( '#db-reset-submit' ).on( 'click', function(e) {
|
31 |
e.preventDefault();
|
32 |
|
33 |
+
if ( !$( '#wp-tables' ).val() ) {
|
34 |
+
alert( dbReset.selectOneTable );
|
35 |
+
return false;
|
36 |
+
}
|
37 |
+
|
38 |
if ( confirm( dbReset.confirmAlert ) ) {
|
39 |
$( '#db-reset-form' ).submit();
|
40 |
$( '#loader' ).show();
|
41 |
+
$( '#db-reset-form' ).css( 'pointer-events', 'none' );
|
42 |
}
|
43 |
});
|
44 |
|
45 |
+
if ( !localStorage.getItem( 'rate-plugin-notice-dismiss' ) ) {
|
46 |
+
$( '#rate-plugin-notice' ).show();
|
47 |
+
}
|
48 |
+
|
49 |
+
$( '.tools_page_database-reset' ).on( 'click', '#rate-plugin-notice .notice-dismiss', function( e ) {
|
50 |
+
localStorage.setItem( 'rate-plugin-notice-dismiss', true );
|
51 |
+
|
52 |
+
return false;
|
53 |
+
});
|
54 |
+
|
55 |
+
|
56 |
+
$( '.tools_page_database-reset' ).on( 'click', '.open-wpr-upsell', function( e ) {
|
57 |
+
e.preventDefault();
|
58 |
+
$( this ).blur();
|
59 |
+
|
60 |
+
$( '#wpr-upsell-dialog' ).dialog( 'open' );
|
61 |
+
|
62 |
+
return false;
|
63 |
+
});
|
64 |
+
|
65 |
+
|
66 |
+
// upsell dialog init
|
67 |
+
$( '#wpr-upsell-dialog' ).dialog( { 'dialogClass': 'wp-dialog wpr-upsell-dialog',
|
68 |
+
'modal': 1,
|
69 |
+
'resizable': false,
|
70 |
+
'title': 'Develop & Debug in WordPress Faster',
|
71 |
+
'zIndex': 9999,
|
72 |
+
'width': 550,
|
73 |
+
'height': 'auto',
|
74 |
+
'show': 'fade',
|
75 |
+
'hide': 'fade',
|
76 |
+
'open': function( event, ui ) {
|
77 |
+
wpr_fix_dialog_close( event, ui );
|
78 |
+
$( this ).siblings().find( 'span.ui-dialog-title' ).html( dbReset.wprDialogTitle );
|
79 |
+
},
|
80 |
+
'close': function( event, ui ) { },
|
81 |
+
'autoOpen': false,
|
82 |
+
'closeOnEscape': true
|
83 |
+
});
|
84 |
+
|
85 |
+
|
86 |
+
$( window ).resize( function(e) {
|
87 |
+
$( '#wpr-upsell-dialog' ).dialog( 'option', 'position', { my: 'center', at: 'center', of: window } );
|
88 |
+
});
|
89 |
+
|
90 |
+
|
91 |
+
$( '.install-wpr' ).on( 'click', function(e) {
|
92 |
+
$( '#wpr-upsell-dialog' ).dialog( 'close' );
|
93 |
+
$( 'body' ).append( '<div style="width:550px;height:450px; position:fixed;top:10%;left:50%;margin-left:-275px; color:#444; background-color: #fbfbfb;border:1px solid #DDD; border-radius:4px;box-shadow: 0px 0px 0px 4000px rgba(0, 0, 0, 0.85);z-index: 9999999;"><iframe src="' + dbReset.wprInstallUrl + '" style="width:100%;height:100%;border:none;" /></div>' );
|
94 |
+
$( '#wpwrap' ).css( 'pointer-events', 'none' );
|
95 |
+
|
96 |
+
e.preventDefault();
|
97 |
+
return false;
|
98 |
+
});
|
99 |
+
|
100 |
+
|
101 |
$.fn.showIfSelected = function( selectValue ) {
|
102 |
$( this ).toggle( $( "option[value='" + selectValue + "']:selected", tables ).length > 0 );
|
103 |
}
|
104 |
|
105 |
})( jQuery );
|
106 |
+
|
107 |
+
function wpr_fix_dialog_close(event, ui) {
|
108 |
+
jQuery( '.ui-widget-overlay' ).bind( 'click', function() {
|
109 |
+
jQuery( '#' + event.target.id ).dialog( 'close' );
|
110 |
+
});
|
111 |
+
} // wpr_fix_dialog_close
|
class-db-reset-admin.php
CHANGED
@@ -44,14 +44,185 @@ if ( ! class_exists( 'DB_Reset_Admin' ) ) :
|
|
44 |
}
|
45 |
|
46 |
private function generate_code( $length = 5 ) {
|
47 |
-
return substr( md5( time() ), 1, $length );
|
48 |
}
|
49 |
|
50 |
public function run() {
|
51 |
add_action( 'admin_init', array( $this, 'reset' ) );
|
52 |
add_action( 'admin_menu', array( $this, 'add_tools_menu' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
}
|
54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
public function reset() {
|
56 |
if ( $this->form_is_safe_to_submit() ) {
|
57 |
try {
|
@@ -164,6 +335,9 @@ if ( ! class_exists( 'DB_Reset_Admin' ) ) :
|
|
164 |
true
|
165 |
);
|
166 |
|
|
|
|
|
|
|
167 |
wp_localize_script(
|
168 |
'database-reset',
|
169 |
'dbReset',
|
@@ -173,8 +347,11 @@ if ( ! class_exists( 'DB_Reset_Admin' ) ) :
|
|
173 |
|
174 |
private function load_javascript_vars() {
|
175 |
return array(
|
176 |
-
'confirmAlert' => __( 'Are you sure you want to continue?', 'wordpress-database-reset' ),
|
177 |
-
'selectTable' => __( 'Select Tables', 'wordpress-database-reset' )
|
|
|
|
|
|
|
178 |
);
|
179 |
}
|
180 |
|
44 |
}
|
45 |
|
46 |
private function generate_code( $length = 5 ) {
|
47 |
+
return strtoupper( substr( md5( time() ), 1, $length ) );
|
48 |
}
|
49 |
|
50 |
public function run() {
|
51 |
add_action( 'admin_init', array( $this, 'reset' ) );
|
52 |
add_action( 'admin_menu', array( $this, 'add_tools_menu' ) );
|
53 |
+
add_action( 'admin_action_install_wpr', array( $this, 'install_wpr' ) );
|
54 |
+
|
55 |
+
add_filter( 'install_plugins_table_api_args_featured', array( $this, 'featured_plugins_tab' ) );
|
56 |
+
add_filter( 'plugin_action_links_' . plugin_basename( DB_RESET_FILE ), array($this, 'plugin_action_links' ) );
|
57 |
+
add_filter( 'plugin_row_meta', array( $this, 'plugin_meta_links' ), 10, 2 );
|
58 |
+
add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ) );
|
59 |
}
|
60 |
|
61 |
+
|
62 |
+
// additional powered by text in admin footer; only on plugin's page
|
63 |
+
static function admin_footer_text($text) {
|
64 |
+
$current_screen = get_current_screen();
|
65 |
+
|
66 |
+
if ( $current_screen->id != 'tools_page_database-reset' ) {
|
67 |
+
return $text;
|
68 |
+
}
|
69 |
+
|
70 |
+
$text = '<i><a href="https://wordpress.org/plugins/wordpress-database-reset/" target="_blank">WP Database Reset</a> v' . DB_RESET_VERSION . ' by <a href="https://www.webfactoryltd.com/" title="' . __( 'Visit our site to get more great plugins', 'wordpress-database-reset' ) . '" target="_blank">' . __( 'WebFactory Ltd', 'wordpress-database-reset' ) . '</a>. Please <a href="https://wordpress.org/support/plugin/wordpress-database-reset/reviews/#new-post" target="_blank">rate the plugin ★★★★★</a>. Thank you!</i> '. $text;
|
71 |
+
|
72 |
+
return $text;
|
73 |
+
} // admin_footer_text
|
74 |
+
|
75 |
+
|
76 |
+
// add settings link to plugins page
|
77 |
+
function plugin_action_links($links) {
|
78 |
+
$settings_link = '<a href="' . admin_url('tools.php?page=database-reset') . '" title="' . __('Reset Database', 'wordpress-database-reset') . '">' . __('Reset Database', 'wordpress-database-reset') . '</a>';
|
79 |
+
|
80 |
+
array_unshift( $links, $settings_link );
|
81 |
+
|
82 |
+
return $links;
|
83 |
+
} // plugin_action_links
|
84 |
+
|
85 |
+
|
86 |
+
// add links to plugin's description in plugins table
|
87 |
+
function plugin_meta_links($links, $file) {
|
88 |
+
$support_link = '<a target="_blank" href="https://wordpress.org/support/plugin/wordpress-database-reset" title="' . __('Get help', 'wordpress-database-reset') . '">' . __('Support', 'wordpress-database-reset') . '</a>';
|
89 |
+
|
90 |
+
|
91 |
+
if ( $file == plugin_basename( DB_RESET_FILE ) ) {
|
92 |
+
$links[] = $support_link;
|
93 |
+
}
|
94 |
+
|
95 |
+
return $links;
|
96 |
+
} // plugin_meta_links
|
97 |
+
|
98 |
+
|
99 |
+
// helper function for adding plugins to fav list
|
100 |
+
function featured_plugins_tab($args) {
|
101 |
+
add_filter( 'plugins_api_result', array( $this, 'plugins_api_result'), 10, 3 );
|
102 |
+
|
103 |
+
return $args;
|
104 |
+
} // featured_plugins_tab
|
105 |
+
|
106 |
+
|
107 |
+
// add our plugins to recommended list
|
108 |
+
function plugins_api_result($res, $action, $args) {
|
109 |
+
remove_filter( 'plugins_api_result', array( $this , 'plugins_api_result' ), 10, 3 );
|
110 |
+
|
111 |
+
$res = $this->add_plugin_favs( 'eps-301-redirects', $res );
|
112 |
+
$res = $this->add_plugin_favs( 'wp-htaccess-editor', $res );
|
113 |
+
$res = $this->add_plugin_favs( 'under-construction-page', $res );
|
114 |
+
|
115 |
+
return $res;
|
116 |
+
} // plugins_api_result
|
117 |
+
|
118 |
+
|
119 |
+
// add single plugin to list of favs
|
120 |
+
function add_plugin_favs($plugin_slug, $res) {
|
121 |
+
if (!empty($res->plugins) && is_array($res->plugins)) {
|
122 |
+
foreach ($res->plugins as $plugin) {
|
123 |
+
if (is_object($plugin) && !empty($plugin->slug) && $plugin->slug == $plugin_slug) {
|
124 |
+
return $res;
|
125 |
+
}
|
126 |
+
} // foreach
|
127 |
+
}
|
128 |
+
|
129 |
+
if ($plugin_info = get_transient('wf-plugin-info-' . $plugin_slug)) {
|
130 |
+
array_unshift($res->plugins, $plugin_info);
|
131 |
+
} else {
|
132 |
+
$plugin_info = plugins_api('plugin_information', array(
|
133 |
+
'slug' => $plugin_slug,
|
134 |
+
'is_ssl' => is_ssl(),
|
135 |
+
'fields' => array(
|
136 |
+
'banners' => true,
|
137 |
+
'reviews' => true,
|
138 |
+
'downloaded' => true,
|
139 |
+
'active_installs' => true,
|
140 |
+
'icons' => true,
|
141 |
+
'short_description' => true,
|
142 |
+
)
|
143 |
+
));
|
144 |
+
if (!is_wp_error($plugin_info)) {
|
145 |
+
$res->plugins[] = $plugin_info;
|
146 |
+
set_transient('wf-plugin-info-' . $plugin_slug, $plugin_info, DAY_IN_SECONDS * 7);
|
147 |
+
}
|
148 |
+
}
|
149 |
+
|
150 |
+
return $res;
|
151 |
+
} // add_plugin_favs
|
152 |
+
|
153 |
+
|
154 |
+
// auto download / install / activate WPR plugin
|
155 |
+
function install_wpr() {
|
156 |
+
if (false === current_user_can('administrator')) {
|
157 |
+
wp_die('Sorry, you have to be an admin to run this action.');
|
158 |
+
}
|
159 |
+
|
160 |
+
$plugin_slug = 'wp-reset/wp-reset.php';
|
161 |
+
$plugin_zip = 'https://downloads.wordpress.org/plugin/wp-reset.latest-stable.zip';
|
162 |
+
|
163 |
+
@include_once ABSPATH . 'wp-admin/includes/plugin.php';
|
164 |
+
@include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
165 |
+
@include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
|
166 |
+
@include_once ABSPATH . 'wp-admin/includes/file.php';
|
167 |
+
@include_once ABSPATH . 'wp-admin/includes/misc.php';
|
168 |
+
echo '<style>
|
169 |
+
body{
|
170 |
+
font-family: sans-serif;
|
171 |
+
font-size: 14px;
|
172 |
+
line-height: 1.5;
|
173 |
+
color: #444;
|
174 |
+
}
|
175 |
+
</style>';
|
176 |
+
|
177 |
+
echo '<div style="margin: 20px; color:#444;">';
|
178 |
+
echo 'If things are not done in a minute <a target="_parent" href="' . admin_url('plugin-install.php?s=wp-reset&tab=search&type=term') .'">install the plugin manually via Plugins page</a><br><br>';
|
179 |
+
echo 'Starting ...<br><br>';
|
180 |
+
|
181 |
+
wp_cache_flush();
|
182 |
+
$upgrader = new Plugin_Upgrader();
|
183 |
+
echo 'Check if WP Reset is already installed ... <br />';
|
184 |
+
if ($this->is_plugin_installed($plugin_slug)) {
|
185 |
+
echo 'WP Reset is already installed! <br /><br />Making sure it\'s the latest version.<br />';
|
186 |
+
$upgrader->upgrade($plugin_slug);
|
187 |
+
$installed = true;
|
188 |
+
} else {
|
189 |
+
echo 'Installing WP Reset.<br />';
|
190 |
+
$installed = $upgrader->install($plugin_zip);
|
191 |
+
}
|
192 |
+
wp_cache_flush();
|
193 |
+
|
194 |
+
if (!is_wp_error($installed) && $installed) {
|
195 |
+
echo 'Activating WP Reset.<br />';
|
196 |
+
$activate = activate_plugin($plugin_slug);
|
197 |
+
|
198 |
+
if (is_null($activate)) {
|
199 |
+
echo 'WP Reset Activated.<br />';
|
200 |
+
|
201 |
+
echo '<script>setTimeout(function() { top.location = "tools.php?page=wp-reset"; }, 1000);</script>';
|
202 |
+
echo '<br>If you are not redirected in a few seconds - <a href="tools.php?page=wp-reset" target="_parent">click here</a>.';
|
203 |
+
}
|
204 |
+
} else {
|
205 |
+
echo 'Could not install WP Reset. You\'ll have to <a target="_parent" href="' . admin_url('plugin-install.php?s=wp-reset&tab=search&type=term') .'">download and install manually</a>.';
|
206 |
+
}
|
207 |
+
|
208 |
+
echo '</div>';
|
209 |
+
} // install_wpr
|
210 |
+
|
211 |
+
|
212 |
+
function is_plugin_installed($slug) {
|
213 |
+
if ( !function_exists( 'get_plugins' ) ) {
|
214 |
+
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
215 |
+
}
|
216 |
+
$all_plugins = get_plugins();
|
217 |
+
|
218 |
+
if ( !empty( $all_plugins[$slug] ) ) {
|
219 |
+
return true;
|
220 |
+
} else {
|
221 |
+
return false;
|
222 |
+
}
|
223 |
+
} // is_plugin_installed
|
224 |
+
|
225 |
+
|
226 |
public function reset() {
|
227 |
if ( $this->form_is_safe_to_submit() ) {
|
228 |
try {
|
335 |
true
|
336 |
);
|
337 |
|
338 |
+
wp_enqueue_script( 'jquery-ui-dialog' );
|
339 |
+
wp_enqueue_style( 'wp-jquery-ui-dialog' );
|
340 |
+
|
341 |
wp_localize_script(
|
342 |
'database-reset',
|
343 |
'dbReset',
|
347 |
|
348 |
private function load_javascript_vars() {
|
349 |
return array(
|
350 |
+
'confirmAlert' => __( 'Are you sure you want to continue? There is NO UNDO!', 'wordpress-database-reset' ),
|
351 |
+
'selectTable' => __( 'Select Tables', 'wordpress-database-reset' ),
|
352 |
+
'selectOneTable' => __( 'Please select at least one table to reset.', 'wordpress-database-reset' ),
|
353 |
+
'wprInstallUrl' => add_query_arg(array('action' => 'install_wpr'), admin_url('admin.php')),
|
354 |
+
'wprDialogTitle' => '<img alt="WP Reset" title="WP Reset" src="' . plugins_url( 'assets/images/wp-reset-logo.png', DB_RESET_FILE ) . '">',
|
355 |
);
|
356 |
}
|
357 |
|
class-db-resetter.php
CHANGED
@@ -13,13 +13,18 @@ if ( ! class_exists( 'DB_Resetter' ) ) :
|
|
13 |
private $reactivate;
|
14 |
private $user;
|
15 |
private $wp_tables;
|
|
|
16 |
|
17 |
public function __construct() {
|
18 |
$this->set_wp_tables();
|
19 |
$this->set_user();
|
20 |
}
|
21 |
|
22 |
-
public function reset( array $tables ) {
|
|
|
|
|
|
|
|
|
23 |
$this->validate_selected( $tables );
|
24 |
$this->set_backup();
|
25 |
$this->reinstall();
|
@@ -115,14 +120,21 @@ if ( ! class_exists( 'DB_Resetter' ) ) :
|
|
115 |
private function update_user_settings() {
|
116 |
global $wpdb;
|
117 |
|
|
|
|
|
118 |
$wpdb->query(
|
119 |
$wpdb->prepare(
|
120 |
"UPDATE $wpdb->users
|
121 |
SET user_pass = '%s', user_activation_key = ''
|
122 |
WHERE ID = '%d'",
|
123 |
-
$this->user->user_pass, $
|
124 |
)
|
125 |
);
|
|
|
|
|
|
|
|
|
|
|
126 |
}
|
127 |
|
128 |
private function restore_backup() {
|
13 |
private $reactivate;
|
14 |
private $user;
|
15 |
private $wp_tables;
|
16 |
+
private $reset_users = false;
|
17 |
|
18 |
public function __construct() {
|
19 |
$this->set_wp_tables();
|
20 |
$this->set_user();
|
21 |
}
|
22 |
|
23 |
+
public function reset( array $tables ) {
|
24 |
+
if ( in_array('users', $tables ) ) {
|
25 |
+
$this->reset_users = true;
|
26 |
+
}
|
27 |
+
|
28 |
$this->validate_selected( $tables );
|
29 |
$this->set_backup();
|
30 |
$this->reinstall();
|
120 |
private function update_user_settings() {
|
121 |
global $wpdb;
|
122 |
|
123 |
+
$user_id = $this->reset_users? 1: $this->user->ID;
|
124 |
+
|
125 |
$wpdb->query(
|
126 |
$wpdb->prepare(
|
127 |
"UPDATE $wpdb->users
|
128 |
SET user_pass = '%s', user_activation_key = ''
|
129 |
WHERE ID = '%d'",
|
130 |
+
$this->user->user_pass, $user_id
|
131 |
)
|
132 |
);
|
133 |
+
|
134 |
+
if ( $this->reset_users ) {
|
135 |
+
wp_clear_auth_cookie();
|
136 |
+
wp_set_auth_cookie( true );
|
137 |
+
}
|
138 |
}
|
139 |
|
140 |
private function restore_backup() {
|
languages/wordpress-database-reset.pot
DELETED
@@ -1,73 +0,0 @@
|
|
1 |
-
msgid ""
|
2 |
-
msgstr ""
|
3 |
-
"Project-Id-Version: \n"
|
4 |
-
"POT-Creation-Date: 2015-09-26 08:45-0400\n"
|
5 |
-
"PO-Revision-Date: 2015-09-26 08:47-0400\n"
|
6 |
-
"Last-Translator: \n"
|
7 |
-
"Language-Team: \n"
|
8 |
-
"Language: en_CA\n"
|
9 |
-
"MIME-Version: 1.0\n"
|
10 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
-
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"X-Generator: Poedit 1.8.4\n"
|
13 |
-
"X-Poedit-Basepath: ..\n"
|
14 |
-
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
15 |
-
"X-Poedit-KeywordsList: e_;__\n"
|
16 |
-
"X-Poedit-SearchPath-0: .\n"
|
17 |
-
|
18 |
-
#: class-db-reset-admin.php:85 class-db-reset-command.php:92
|
19 |
-
msgid "The selected tables were reset"
|
20 |
-
msgstr ""
|
21 |
-
|
22 |
-
#: class-db-reset-admin.php:104
|
23 |
-
msgid "You entered the wrong security code"
|
24 |
-
msgstr ""
|
25 |
-
|
26 |
-
#: class-db-reset-admin.php:113 class-db-reset-admin.php:114
|
27 |
-
msgid "Database Reset"
|
28 |
-
msgstr ""
|
29 |
-
|
30 |
-
#: class-db-reset-admin.php:182
|
31 |
-
msgid "Are you sure you want to continue?"
|
32 |
-
msgstr ""
|
33 |
-
|
34 |
-
#: class-db-reset-admin.php:183
|
35 |
-
msgid "Select Tables"
|
36 |
-
msgstr ""
|
37 |
-
|
38 |
-
#: class-db-reset-command.php:95
|
39 |
-
msgid "The current theme and plugins were reactivated"
|
40 |
-
msgstr ""
|
41 |
-
|
42 |
-
#: class-db-resetter.php:34
|
43 |
-
msgid "You did not select any database tables"
|
44 |
-
msgstr ""
|
45 |
-
|
46 |
-
#: lib/helpers.php:29
|
47 |
-
msgid "The WordPress Database Reset plugin requires at least PHP 5.3!"
|
48 |
-
msgstr ""
|
49 |
-
|
50 |
-
#: lib/helpers.php:33
|
51 |
-
msgid "The WordPress Database Reset plugin requires at least WordPress 3.0!"
|
52 |
-
msgstr ""
|
53 |
-
|
54 |
-
#: lib/helpers.php:111
|
55 |
-
msgid ""
|
56 |
-
"<strong><em>Note that password</em></strong> carefully! It is a <em>random</"
|
57 |
-
"em> password that was generated just for you."
|
58 |
-
msgstr ""
|
59 |
-
|
60 |
-
#: lib/helpers.php:117
|
61 |
-
msgid "Your chosen password."
|
62 |
-
msgstr ""
|
63 |
-
|
64 |
-
#: lib/helpers.php:120
|
65 |
-
msgid "User already exists. Password inherited."
|
66 |
-
msgstr ""
|
67 |
-
|
68 |
-
#: views/partials/disclaimer.php:2
|
69 |
-
#, php-format
|
70 |
-
msgid ""
|
71 |
-
"You selected the users table. Only the <strong><u>%s</u></strong> user will "
|
72 |
-
"be restored"
|
73 |
-
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
license.txt
ADDED
@@ -0,0 +1,280 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
GNU GENERAL PUBLIC LICENSE
|
2 |
+
Version 2, June 1991
|
3 |
+
|
4 |
+
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
5 |
+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
6 |
+
Everyone is permitted to copy and distribute verbatim copies
|
7 |
+
of this license document, but changing it is not allowed.
|
8 |
+
|
9 |
+
Preamble
|
10 |
+
|
11 |
+
The licenses for most software are designed to take away your
|
12 |
+
freedom to share and change it. By contrast, the GNU General Public
|
13 |
+
License is intended to guarantee your freedom to share and change free
|
14 |
+
software--to make sure the software is free for all its users. This
|
15 |
+
General Public License applies to most of the Free Software
|
16 |
+
Foundation's software and to any other program whose authors commit to
|
17 |
+
using it. (Some other Free Software Foundation software is covered by
|
18 |
+
the GNU Lesser General Public License instead.) You can apply it to
|
19 |
+
your programs, too.
|
20 |
+
|
21 |
+
When we speak of free software, we are referring to freedom, not
|
22 |
+
price. Our General Public Licenses are designed to make sure that you
|
23 |
+
have the freedom to distribute copies of free software (and charge for
|
24 |
+
this service if you wish), that you receive source code or can get it
|
25 |
+
if you want it, that you can change the software or use pieces of it
|
26 |
+
in new free programs; and that you know you can do these things.
|
27 |
+
|
28 |
+
To protect your rights, we need to make restrictions that forbid
|
29 |
+
anyone to deny you these rights or to ask you to surrender the rights.
|
30 |
+
These restrictions translate to certain responsibilities for you if you
|
31 |
+
distribute copies of the software, or if you modify it.
|
32 |
+
|
33 |
+
For example, if you distribute copies of such a program, whether
|
34 |
+
gratis or for a fee, you must give the recipients all the rights that
|
35 |
+
you have. You must make sure that they, too, receive or can get the
|
36 |
+
source code. And you must show them these terms so they know their
|
37 |
+
rights.
|
38 |
+
|
39 |
+
We protect your rights with two steps: (1) copyright the software, and
|
40 |
+
(2) offer you this license which gives you legal permission to copy,
|
41 |
+
distribute and/or modify the software.
|
42 |
+
|
43 |
+
Also, for each author's protection and ours, we want to make certain
|
44 |
+
that everyone understands that there is no warranty for this free
|
45 |
+
software. If the software is modified by someone else and passed on, we
|
46 |
+
want its recipients to know that what they have is not the original, so
|
47 |
+
that any problems introduced by others will not reflect on the original
|
48 |
+
authors' reputations.
|
49 |
+
|
50 |
+
Finally, any free program is threatened constantly by software
|
51 |
+
patents. We wish to avoid the danger that redistributors of a free
|
52 |
+
program will individually obtain patent licenses, in effect making the
|
53 |
+
program proprietary. To prevent this, we have made it clear that any
|
54 |
+
patent must be licensed for everyone's free use or not licensed at all.
|
55 |
+
|
56 |
+
The precise terms and conditions for copying, distribution and
|
57 |
+
modification follow.
|
58 |
+
|
59 |
+
GNU GENERAL PUBLIC LICENSE
|
60 |
+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
61 |
+
|
62 |
+
0. This License applies to any program or other work which contains
|
63 |
+
a notice placed by the copyright holder saying it may be distributed
|
64 |
+
under the terms of this General Public License. The "Program", below,
|
65 |
+
refers to any such program or work, and a "work based on the Program"
|
66 |
+
means either the Program or any derivative work under copyright law:
|
67 |
+
that is to say, a work containing the Program or a portion of it,
|
68 |
+
either verbatim or with modifications and/or translated into another
|
69 |
+
language. (Hereinafter, translation is included without limitation in
|
70 |
+
the term "modification".) Each licensee is addressed as "you".
|
71 |
+
|
72 |
+
Activities other than copying, distribution and modification are not
|
73 |
+
covered by this License; they are outside its scope. The act of
|
74 |
+
running the Program is not restricted, and the output from the Program
|
75 |
+
is covered only if its contents constitute a work based on the
|
76 |
+
Program (independent of having been made by running the Program).
|
77 |
+
Whether that is true depends on what the Program does.
|
78 |
+
|
79 |
+
1. You may copy and distribute verbatim copies of the Program's
|
80 |
+
source code as you receive it, in any medium, provided that you
|
81 |
+
conspicuously and appropriately publish on each copy an appropriate
|
82 |
+
copyright notice and disclaimer of warranty; keep intact all the
|
83 |
+
notices that refer to this License and to the absence of any warranty;
|
84 |
+
and give any other recipients of the Program a copy of this License
|
85 |
+
along with the Program.
|
86 |
+
|
87 |
+
You may charge a fee for the physical act of transferring a copy, and
|
88 |
+
you may at your option offer warranty protection in exchange for a fee.
|
89 |
+
|
90 |
+
2. You may modify your copy or copies of the Program or any portion
|
91 |
+
of it, thus forming a work based on the Program, and copy and
|
92 |
+
distribute such modifications or work under the terms of Section 1
|
93 |
+
above, provided that you also meet all of these conditions:
|
94 |
+
|
95 |
+
a) You must cause the modified files to carry prominent notices
|
96 |
+
stating that you changed the files and the date of any change.
|
97 |
+
|
98 |
+
b) You must cause any work that you distribute or publish, that in
|
99 |
+
whole or in part contains or is derived from the Program or any
|
100 |
+
part thereof, to be licensed as a whole at no charge to all third
|
101 |
+
parties under the terms of this License.
|
102 |
+
|
103 |
+
c) If the modified program normally reads commands interactively
|
104 |
+
when run, you must cause it, when started running for such
|
105 |
+
interactive use in the most ordinary way, to print or display an
|
106 |
+
announcement including an appropriate copyright notice and a
|
107 |
+
notice that there is no warranty (or else, saying that you provide
|
108 |
+
a warranty) and that users may redistribute the program under
|
109 |
+
these conditions, and telling the user how to view a copy of this
|
110 |
+
License. (Exception: if the Program itself is interactive but
|
111 |
+
does not normally print such an announcement, your work based on
|
112 |
+
the Program is not required to print an announcement.)
|
113 |
+
|
114 |
+
These requirements apply to the modified work as a whole. If
|
115 |
+
identifiable sections of that work are not derived from the Program,
|
116 |
+
and can be reasonably considered independent and separate works in
|
117 |
+
themselves, then this License, and its terms, do not apply to those
|
118 |
+
sections when you distribute them as separate works. But when you
|
119 |
+
distribute the same sections as part of a whole which is a work based
|
120 |
+
on the Program, the distribution of the whole must be on the terms of
|
121 |
+
this License, whose permissions for other licensees extend to the
|
122 |
+
entire whole, and thus to each and every part regardless of who wrote it.
|
123 |
+
|
124 |
+
Thus, it is not the intent of this section to claim rights or contest
|
125 |
+
your rights to work written entirely by you; rather, the intent is to
|
126 |
+
exercise the right to control the distribution of derivative or
|
127 |
+
collective works based on the Program.
|
128 |
+
|
129 |
+
In addition, mere aggregation of another work not based on the Program
|
130 |
+
with the Program (or with a work based on the Program) on a volume of
|
131 |
+
a storage or distribution medium does not bring the other work under
|
132 |
+
the scope of this License.
|
133 |
+
|
134 |
+
3. You may copy and distribute the Program (or a work based on it,
|
135 |
+
under Section 2) in object code or executable form under the terms of
|
136 |
+
Sections 1 and 2 above provided that you also do one of the following:
|
137 |
+
|
138 |
+
a) Accompany it with the complete corresponding machine-readable
|
139 |
+
source code, which must be distributed under the terms of Sections
|
140 |
+
1 and 2 above on a medium customarily used for software interchange; or,
|
141 |
+
|
142 |
+
b) Accompany it with a written offer, valid for at least three
|
143 |
+
years, to give any third party, for a charge no more than your
|
144 |
+
cost of physically performing source distribution, a complete
|
145 |
+
machine-readable copy of the corresponding source code, to be
|
146 |
+
distributed under the terms of Sections 1 and 2 above on a medium
|
147 |
+
customarily used for software interchange; or,
|
148 |
+
|
149 |
+
c) Accompany it with the information you received as to the offer
|
150 |
+
to distribute corresponding source code. (This alternative is
|
151 |
+
allowed only for noncommercial distribution and only if you
|
152 |
+
received the program in object code or executable form with such
|
153 |
+
an offer, in accord with Subsection b above.)
|
154 |
+
|
155 |
+
The source code for a work means the preferred form of the work for
|
156 |
+
making modifications to it. For an executable work, complete source
|
157 |
+
code means all the source code for all modules it contains, plus any
|
158 |
+
associated interface definition files, plus the scripts used to
|
159 |
+
control compilation and installation of the executable. However, as a
|
160 |
+
special exception, the source code distributed need not include
|
161 |
+
anything that is normally distributed (in either source or binary
|
162 |
+
form) with the major components (compiler, kernel, and so on) of the
|
163 |
+
operating system on which the executable runs, unless that component
|
164 |
+
itself accompanies the executable.
|
165 |
+
|
166 |
+
If distribution of executable or object code is made by offering
|
167 |
+
access to copy from a designated place, then offering equivalent
|
168 |
+
access to copy the source code from the same place counts as
|
169 |
+
distribution of the source code, even though third parties are not
|
170 |
+
compelled to copy the source along with the object code.
|
171 |
+
|
172 |
+
4. You may not copy, modify, sublicense, or distribute the Program
|
173 |
+
except as expressly provided under this License. Any attempt
|
174 |
+
otherwise to copy, modify, sublicense or distribute the Program is
|
175 |
+
void, and will automatically terminate your rights under this License.
|
176 |
+
However, parties who have received copies, or rights, from you under
|
177 |
+
this License will not have their licenses terminated so long as such
|
178 |
+
parties remain in full compliance.
|
179 |
+
|
180 |
+
5. You are not required to accept this License, since you have not
|
181 |
+
signed it. However, nothing else grants you permission to modify or
|
182 |
+
distribute the Program or its derivative works. These actions are
|
183 |
+
prohibited by law if you do not accept this License. Therefore, by
|
184 |
+
modifying or distributing the Program (or any work based on the
|
185 |
+
Program), you indicate your acceptance of this License to do so, and
|
186 |
+
all its terms and conditions for copying, distributing or modifying
|
187 |
+
the Program or works based on it.
|
188 |
+
|
189 |
+
6. Each time you redistribute the Program (or any work based on the
|
190 |
+
Program), the recipient automatically receives a license from the
|
191 |
+
original licensor to copy, distribute or modify the Program subject to
|
192 |
+
these terms and conditions. You may not impose any further
|
193 |
+
restrictions on the recipients' exercise of the rights granted herein.
|
194 |
+
You are not responsible for enforcing compliance by third parties to
|
195 |
+
this License.
|
196 |
+
|
197 |
+
7. If, as a consequence of a court judgment or allegation of patent
|
198 |
+
infringement or for any other reason (not limited to patent issues),
|
199 |
+
conditions are imposed on you (whether by court order, agreement or
|
200 |
+
otherwise) that contradict the conditions of this License, they do not
|
201 |
+
excuse you from the conditions of this License. If you cannot
|
202 |
+
distribute so as to satisfy simultaneously your obligations under this
|
203 |
+
License and any other pertinent obligations, then as a consequence you
|
204 |
+
may not distribute the Program at all. For example, if a patent
|
205 |
+
license would not permit royalty-free redistribution of the Program by
|
206 |
+
all those who receive copies directly or indirectly through you, then
|
207 |
+
the only way you could satisfy both it and this License would be to
|
208 |
+
refrain entirely from distribution of the Program.
|
209 |
+
|
210 |
+
If any portion of this section is held invalid or unenforceable under
|
211 |
+
any particular circumstance, the balance of the section is intended to
|
212 |
+
apply and the section as a whole is intended to apply in other
|
213 |
+
circumstances.
|
214 |
+
|
215 |
+
It is not the purpose of this section to induce you to infringe any
|
216 |
+
patents or other property right claims or to contest validity of any
|
217 |
+
such claims; this section has the sole purpose of protecting the
|
218 |
+
integrity of the free software distribution system, which is
|
219 |
+
implemented by public license practices. Many people have made
|
220 |
+
generous contributions to the wide range of software distributed
|
221 |
+
through that system in reliance on consistent application of that
|
222 |
+
system; it is up to the author/donor to decide if he or she is willing
|
223 |
+
to distribute software through any other system and a licensee cannot
|
224 |
+
impose that choice.
|
225 |
+
|
226 |
+
This section is intended to make thoroughly clear what is believed to
|
227 |
+
be a consequence of the rest of this License.
|
228 |
+
|
229 |
+
8. If the distribution and/or use of the Program is restricted in
|
230 |
+
certain countries either by patents or by copyrighted interfaces, the
|
231 |
+
original copyright holder who places the Program under this License
|
232 |
+
may add an explicit geographical distribution limitation excluding
|
233 |
+
those countries, so that distribution is permitted only in or among
|
234 |
+
countries not thus excluded. In such case, this License incorporates
|
235 |
+
the limitation as if written in the body of this License.
|
236 |
+
|
237 |
+
9. The Free Software Foundation may publish revised and/or new versions
|
238 |
+
of the General Public License from time to time. Such new versions will
|
239 |
+
be similar in spirit to the present version, but may differ in detail to
|
240 |
+
address new problems or concerns.
|
241 |
+
|
242 |
+
Each version is given a distinguishing version number. If the Program
|
243 |
+
specifies a version number of this License which applies to it and "any
|
244 |
+
later version", you have the option of following the terms and conditions
|
245 |
+
either of that version or of any later version published by the Free
|
246 |
+
Software Foundation. If the Program does not specify a version number of
|
247 |
+
this License, you may choose any version ever published by the Free Software
|
248 |
+
Foundation.
|
249 |
+
|
250 |
+
10. If you wish to incorporate parts of the Program into other free
|
251 |
+
programs whose distribution conditions are different, write to the author
|
252 |
+
to ask for permission. For software which is copyrighted by the Free
|
253 |
+
Software Foundation, write to the Free Software Foundation; we sometimes
|
254 |
+
make exceptions for this. Our decision will be guided by the two goals
|
255 |
+
of preserving the free status of all derivatives of our free software and
|
256 |
+
of promoting the sharing and reuse of software generally.
|
257 |
+
|
258 |
+
NO WARRANTY
|
259 |
+
|
260 |
+
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
261 |
+
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
262 |
+
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
263 |
+
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
264 |
+
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
265 |
+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
266 |
+
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
267 |
+
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
268 |
+
REPAIR OR CORRECTION.
|
269 |
+
|
270 |
+
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
271 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
272 |
+
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
273 |
+
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
274 |
+
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
275 |
+
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
276 |
+
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
277 |
+
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
278 |
+
POSSIBILITY OF SUCH DAMAGES.
|
279 |
+
|
280 |
+
END OF TERMS AND CONDITIONS
|
readme.txt
CHANGED
@@ -1,48 +1,77 @@
|
|
1 |
-
===
|
2 |
-
|
3 |
-
|
4 |
-
Tags: wordpress, database, reset, restore, setup, developer, theme, default, secure
|
5 |
-
License: GPL2
|
6 |
Requires at least: 4.2
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
9 |
|
10 |
-
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
**Overview**
|
15 |
|
16 |
-
The WordPress Database Reset plugin allows you to reset the database back to its default settings without having to go through the WordPress 5 minute installation.
|
17 |
|
18 |
**Features**
|
19 |
|
20 |
-
* Extremely fast one click process to reset the WordPress database
|
21 |
* Choose to reset the entire database or specific database tables
|
22 |
* Secure and super simple to use
|
|
|
23 |
* Prefer the command line? Reset the database in one command
|
24 |
* Excellent for theme and plugin developers who need to clean the database of any unnecessary content
|
25 |
|
26 |
**Command Line**
|
27 |
|
28 |
-
Once activated, you can use the WordPress Database Reset plugin with [WordPress CLI](http://wp-cli.org/).
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
-
|
|
|
|
|
|
|
32 |
|
33 |
Create a new post in the [WordPress Database Reset support forum](https://wordpress.org/support/plugin/wordpress-database-reset).
|
34 |
|
35 |
**Want to help out?**
|
36 |
|
37 |
-
* Provide new
|
38 |
-
* Help develop the plugin by forking [the code repository](https://github.com/chrisberthe/wordpress-database-reset) on GitHub.
|
39 |
* Want to help others that might be having issues? [Answer questions on the support forum](https://wordpress.org/support/plugin/wordpress-database-reset).
|
40 |
-
*
|
|
|
|
|
|
|
|
|
41 |
|
42 |
== Screenshots ==
|
43 |
-
1. The
|
44 |
|
45 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
= 3.0.2 =
|
47 |
* Fix for plugin page not showing up in tools menu (on some hosting providers)
|
48 |
* Update how session tokens were being restored
|
@@ -103,7 +132,7 @@ Create a new post in the [WordPress Database Reset support forum](https://wordpr
|
|
103 |
|
104 |
= 1.4 =
|
105 |
* Made quite a few changes to the translation files
|
106 |
-
* Renamed
|
107 |
* Optimized (until potential version 2.0)
|
108 |
|
109 |
= 1.3 =
|
@@ -119,3 +148,4 @@ Create a new post in the [WordPress Database Reset support forum](https://wordpr
|
|
119 |
|
120 |
= 1.0 =
|
121 |
* First version
|
|
1 |
+
=== WP Database Reset ===
|
2 |
+
Contributors: WebFactory, wpreset, underconstructionpage, googlemapswidget
|
3 |
+
Tags: database, reset, restore, database reset, wp reset, developer, development
|
|
|
|
|
4 |
Requires at least: 4.2
|
5 |
+
Requires PHP: 5.2
|
6 |
+
Tested up to: 5.2
|
7 |
+
Stable tag: 3.1
|
8 |
+
License: GPLv2 or later
|
9 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
+
Skip reinstalling WP to reset it & reset the WordPress database back to its original state with 1-click.
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
**Overview**
|
16 |
|
17 |
+
The WordPress Database Reset plugin allows you to reset the database (all tables or the ones you choose) back to its default settings without having to go through the WordPress 5 minute installation or having to modify any files.
|
18 |
|
19 |
**Features**
|
20 |
|
21 |
+
* Extremely fast one click process to reset the WordPress database tables
|
22 |
* Choose to reset the entire database or specific database tables
|
23 |
* Secure and super simple to use
|
24 |
+
* Safe - it's not possible to accidentally click reset
|
25 |
* Prefer the command line? Reset the database in one command
|
26 |
* Excellent for theme and plugin developers who need to clean the database of any unnecessary content
|
27 |
|
28 |
**Command Line**
|
29 |
|
30 |
+
Once activated, you can use the WordPress Database Reset plugin with [WordPress CLI](http://wp-cli.org/). List of WP-CLI commands:
|
31 |
+
|
32 |
+
Reset all tables:
|
33 |
+
|
34 |
+
`wp reset database`
|
35 |
+
|
36 |
+
Specify a list of tables to reset:
|
37 |
+
|
38 |
+
`wp reset database --tables='users, posts, comments, options'`
|
39 |
+
|
40 |
+
The current theme and plugins will be reactivated by default. You can disable them like so:
|
41 |
+
|
42 |
+
`wp reset database --no-reactivate`
|
43 |
+
|
44 |
+
List table names:
|
45 |
|
46 |
+
`wp reset list`
|
47 |
+
|
48 |
+
|
49 |
+
**Support**
|
50 |
|
51 |
Create a new post in the [WordPress Database Reset support forum](https://wordpress.org/support/plugin/wordpress-database-reset).
|
52 |
|
53 |
**Want to help out?**
|
54 |
|
55 |
+
* Provide new <a href="https://translate.wordpress.org/projects/wp-plugins/wordpress-database-reset">language translations</a>
|
|
|
56 |
* Want to help others that might be having issues? [Answer questions on the support forum](https://wordpress.org/support/plugin/wordpress-database-reset).
|
57 |
+
* Rate the plugin - <a href="https://wordpress.org/support/plugin/wordpress-database-reset/reviews/#new-post">rate it</a>
|
58 |
+
|
59 |
+
|
60 |
+
WP Database Reset was originally developed in October 2011 by <a href="https://github.com/chrisberthe">Chris Berthe</a>. Please do not send him any support questions. If you need assistance the <a href="https://wordpress.org/support/plugin/wordpress-database-reset/">official forum</a> is the best and fastest way to get it.
|
61 |
+
|
62 |
|
63 |
== Screenshots ==
|
64 |
+
1. The WP Database Reset plugin page
|
65 |
|
66 |
== Changelog ==
|
67 |
+
|
68 |
+
= 3.1 =
|
69 |
+
* 2019/08/13
|
70 |
+
* WebFactory took over development
|
71 |
+
* minor improvements in GUI and messaging
|
72 |
+
* fixed a nasty bug related to admin user ID not being 1
|
73 |
+
* 70k installations; 665,500 downloads
|
74 |
+
|
75 |
= 3.0.2 =
|
76 |
* Fix for plugin page not showing up in tools menu (on some hosting providers)
|
77 |
* Update how session tokens were being restored
|
132 |
|
133 |
= 1.4 =
|
134 |
* Made quite a few changes to the translation files
|
135 |
+
* Renamed French translation file for plugin format, not theme format
|
136 |
* Optimized (until potential version 2.0)
|
137 |
|
138 |
= 1.3 =
|
148 |
|
149 |
= 1.0 =
|
150 |
* First version
|
151 |
+
* 2011-10-04
|
screenshot-1.png
DELETED
Binary file
|
views/index.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<div class="wrap card">
|
2 |
-
<
|
3 |
|
4 |
<?php include( 'partials/notice.php' ) ?>
|
5 |
|
@@ -9,5 +9,24 @@
|
|
9 |
<?php include( 'partials/submit-button.php' ) ?>
|
10 |
</form>
|
11 |
|
12 |
-
<?php include( 'partials/donate.php' ) ?>
|
13 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<div class="wrap card">
|
2 |
+
<h1><?php _e( 'Database Reset', 'wordpress-database-reset' ) ?></h1>
|
3 |
|
4 |
<?php include( 'partials/notice.php' ) ?>
|
5 |
|
9 |
<?php include( 'partials/submit-button.php' ) ?>
|
10 |
</form>
|
11 |
|
|
|
12 |
</div>
|
13 |
+
|
14 |
+
<div class="wrap card" id="wp-reset-ad">
|
15 |
+
<a href="#" class="open-wpr-upsell"><img src="<?php echo plugins_url( 'assets/images/wp-reset-icon.png', DB_RESET_FILE ); ?>" alt="WP Reset - used on +180,000 sites" title="WP Reset - used on +180,000 sites"></a>
|
16 |
+
<p>Need more control? Reset theme options, media files, transients or <em>.htaccess</em> file? Delete all uploads, plugins and themes? Or create database snapshots and restore them with one click? <a href="#" class="open-wpr-upsell">Install the free WP Reset plugin</a>. It's used on <b>+180,000 sites daily</b>!</p>
|
17 |
+
</div>
|
18 |
+
|
19 |
+
<div id="wpr-upsell-dialog" style="display: none;" title="WP Reset">
|
20 |
+
<span class="ui-helper-hidden-accessible"><input type="text"/></span>
|
21 |
+
<div style="padding: 20px; font-size: 15px;">
|
22 |
+
<ul>
|
23 |
+
<li>Free plugin used on +180,000 sites</li>
|
24 |
+
<li>Simple & easy to use with clear instructions</li>
|
25 |
+
<li>Use it to quickly reset any data in WordPress</li>
|
26 |
+
<li>Extremely usefull for cleaning demo data from themes & plugins</li>
|
27 |
+
<li>Create Database Snapshot to revert WP to previous states with 1 click</li>
|
28 |
+
<li>Compare current & previous snapshots to see changes done by plugins</li>
|
29 |
+
</ul>
|
30 |
+
<p class="upsell-footer"><a class="button button-primary install-wpr">Install & Activate WP Reset</a></p>
|
31 |
+
</div>
|
32 |
+
</div>
|
views/partials/disclaimer.php
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
<p id="disclaimer" style="display: none">
|
2 |
-
<em><?php printf( __( 'You selected the users table. Only the <strong><u>%s</u></strong> user will be restored', 'wordpress-database-reset' ), $this->user->user_login ) ?>.</em>
|
3 |
-
</p>
|
|
|
|
|
|
views/partials/donate.php
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
|
2 |
-
<input type="hidden" name="cmd" value="_s-xclick">
|
3 |
-
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----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-----END PKCS7-----
|
4 |
-
">
|
5 |
-
<input type="image" src="<?php echo plugins_url( 'assets/images/donate.png', dirname( __DIR__ ) ) ?>" border="0" name="submit" id="donate-button" alt="PayPal - The safer, easier way to pay online!">
|
6 |
-
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
|
7 |
-
</form>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
views/partials/notice.php
CHANGED
@@ -7,3 +7,9 @@
|
|
7 |
<p><strong><?php echo $this->notice_error ?>.</strong></p>
|
8 |
</div>
|
9 |
<?php endif ?>
|
|
|
|
|
|
|
|
|
|
|
|
7 |
<p><strong><?php echo $this->notice_error ?>.</strong></p>
|
8 |
</div>
|
9 |
<?php endif ?>
|
10 |
+
|
11 |
+
<?php if ( $this->notice_success ) : ?>
|
12 |
+
<div class="notice-info notice is-dismissible" id="rate-plugin-notice" style="display: none;">
|
13 |
+
<p><strong>Please <a href="https://wordpress.org/support/plugin/wordpress-database-reset/reviews/#new-post" target="_blank">rate the plugin ★★★★★</a>. It's what keeps it free & maintained. Thank you!</strong></p>
|
14 |
+
</div>
|
15 |
+
<?php endif ?>
|
views/partials/security-code.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<p>
|
2 |
-
|
3 |
<span id="security-code"><?php echo $this->code ?></span>
|
4 |
</p>
|
5 |
|
6 |
<input type="hidden" name="db-reset-code" value="<?php echo $this->code ?>" />
|
7 |
-
<input type="text" name="db-reset-code-confirm" id="db-reset-code-confirm" value="" placeholder="
|
1 |
<p>
|
2 |
+
<b>3.</b> <?php _e( 'Enter the security code into the text box below', 'wordpress-database-reset' ) ?>:
|
3 |
<span id="security-code"><?php echo $this->code ?></span>
|
4 |
</p>
|
5 |
|
6 |
<input type="hidden" name="db-reset-code" value="<?php echo $this->code ?>" />
|
7 |
+
<input type="text" name="db-reset-code-confirm" id="db-reset-code-confirm" value="" placeholder="" />
|
views/partials/select-tables.php
CHANGED
@@ -1,7 +1,11 @@
|
|
1 |
-
<p>
|
|
|
|
|
|
|
|
|
2 |
|
3 |
<div id="select-container">
|
4 |
-
<a href='#' id="select-all"><?php _e( 'Select All', 'wordpress-database-reset' ) ?></a>
|
5 |
<select id="wp-tables" multiple="multiple" name="db-reset-tables[]">
|
6 |
<?php foreach ( $this->wp_tables as $key => $value ) : ?>
|
7 |
<option value="<?php echo $key ?>"><?php echo $key ?></option>
|
@@ -9,13 +13,15 @@
|
|
9 |
</select>
|
10 |
</div>
|
11 |
|
12 |
-
<p id="reactivate" style="display: none"
|
13 |
<label for="db-reset-reactivate-theme-data">
|
14 |
<input type="checkbox" name="db-reset-reactivate-theme-data" id="db-reset-reactivate-theme-data" checked="checked" value="true" />
|
15 |
-
|
16 |
</label>
|
17 |
</p>
|
18 |
|
19 |
-
|
|
|
|
|
20 |
|
21 |
<hr>
|
1 |
+
<p>
|
2 |
+
<b>1.</b> The plugin DOES NOT create backups. Please create backups before resetting any tables. There is NO UNDO. If something is not clear open a ticket on the official <a target="_blank" href="https://wordpress.org/support/plugin/wordpress-database-reset/">support forum</a>. All tickets are answered within a few hours.
|
3 |
+
</p>
|
4 |
+
|
5 |
+
<p><b>2.</b> <?php _e( 'Select the database table(s) you would like to reset', 'wordpress-database-reset' ) ?>:</p>
|
6 |
|
7 |
<div id="select-container">
|
8 |
+
<a href='#' id="select-all"><?php _e( 'Select All Tables', 'wordpress-database-reset' ) ?></a>
|
9 |
<select id="wp-tables" multiple="multiple" name="db-reset-tables[]">
|
10 |
<?php foreach ( $this->wp_tables as $key => $value ) : ?>
|
11 |
<option value="<?php echo $key ?>"><?php echo $key ?></option>
|
13 |
</select>
|
14 |
</div>
|
15 |
|
16 |
+
<p id="reactivate" style="display: none;">•
|
17 |
<label for="db-reset-reactivate-theme-data">
|
18 |
<input type="checkbox" name="db-reset-reactivate-theme-data" id="db-reset-reactivate-theme-data" checked="checked" value="true" />
|
19 |
+
<em><?php _e( 'You selected the options table. Reactivate current theme and plugins after reset?', 'wordpress-database-reset' ) ?></em>
|
20 |
</label>
|
21 |
</p>
|
22 |
|
23 |
+
<p id="disclaimer" style="display: none;">•
|
24 |
+
<em><?php printf( __( 'You selected the users table. Only the <strong><u>%s</u></strong> user will be restored', 'wordpress-database-reset' ), $this->user->user_login ) ?>.</em>
|
25 |
+
</p>
|
26 |
|
27 |
<hr>
|
wp-reset.php
CHANGED
@@ -1,25 +1,26 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Plugin Name:
|
4 |
-
Plugin URI: https://
|
5 |
-
Description:
|
6 |
-
Version: 3.
|
7 |
-
Author:
|
8 |
-
Author URI: https://
|
9 |
License: GNU General Public License
|
10 |
-
Text-domain:
|
11 |
*/
|
12 |
|
13 |
-
define( 'DB_RESET_VERSION', '3.
|
14 |
define( 'DB_RESET_PATH', dirname( __FILE__ ) );
|
15 |
define( 'DB_RESET_NAME', basename( DB_RESET_PATH ) );
|
|
|
16 |
define( 'AUTOLOADER', DB_RESET_PATH . '/lib/class-plugin-autoloader.php' );
|
17 |
|
18 |
require_once( DB_RESET_PATH . '/lib/helpers.php' );
|
19 |
|
20 |
register_activation_hook( __FILE__, 'db_reset_activate' );
|
21 |
|
22 |
-
load_plugin_textdomain( 'wordpress-database-reset'
|
23 |
|
24 |
if ( file_exists( AUTOLOADER ) ) {
|
25 |
require_once( AUTOLOADER );
|
1 |
<?php
|
2 |
/*
|
3 |
+
Plugin Name: WP Database Reset
|
4 |
+
Plugin URI: https://wordpress.org/plugins/wordpress-database-reset/
|
5 |
+
Description: Reset all or some WP database tables back to their original state.
|
6 |
+
Version: 3.1
|
7 |
+
Author: WebFactory Ltd
|
8 |
+
Author URI: https://www.webfactoryltd.com/
|
9 |
License: GNU General Public License
|
10 |
+
Text-domain: wordpress-database-reset
|
11 |
*/
|
12 |
|
13 |
+
define( 'DB_RESET_VERSION', '3.1' );
|
14 |
define( 'DB_RESET_PATH', dirname( __FILE__ ) );
|
15 |
define( 'DB_RESET_NAME', basename( DB_RESET_PATH ) );
|
16 |
+
define( 'DB_RESET_FILE', __FILE__ );
|
17 |
define( 'AUTOLOADER', DB_RESET_PATH . '/lib/class-plugin-autoloader.php' );
|
18 |
|
19 |
require_once( DB_RESET_PATH . '/lib/helpers.php' );
|
20 |
|
21 |
register_activation_hook( __FILE__, 'db_reset_activate' );
|
22 |
|
23 |
+
load_plugin_textdomain( 'wordpress-database-reset' );
|
24 |
|
25 |
if ( file_exists( AUTOLOADER ) ) {
|
26 |
require_once( AUTOLOADER );
|