WordPress Database Reset - Version 3.21

Version Description

  • 2021/07/29
  • fix for WP 5.8
Download this release

Release Info

Developer WebFactory
Plugin Icon 128x128 WordPress Database Reset
Version 3.21
Comparing to
See all releases

Code changes from version 3.20 to 3.21

Files changed (4) hide show
  1. class-db-resetter.php +12 -3
  2. lib/helpers.php +3 -0
  3. readme.txt +8 -4
  4. wp-reset.php +3 -3
class-db-resetter.php CHANGED
@@ -139,10 +139,11 @@ if (!class_exists('DB_Resetter')) :
139
 
140
  private function update_user_settings()
141
  {
142
- global $wpdb;
 
143
 
144
  $user_id = $this->reset_users ? 1 : $this->user->ID;
145
-
146
  $wpdb->query(
147
  $wpdb->prepare(
148
  "UPDATE $wpdb->users
@@ -155,7 +156,15 @@ if (!class_exists('DB_Resetter')) :
155
 
156
  if ($this->reset_users) {
157
  wp_clear_auth_cookie();
158
- wp_set_auth_cookie(true);
 
 
 
 
 
 
 
 
159
  }
160
  }
161
 
139
 
140
  private function update_user_settings()
141
  {
142
+ global $wpdb, $current_user;
143
+ $current_user = $this->user;
144
 
145
  $user_id = $this->reset_users ? 1 : $this->user->ID;
146
+
147
  $wpdb->query(
148
  $wpdb->prepare(
149
  "UPDATE $wpdb->users
156
 
157
  if ($this->reset_users) {
158
  wp_clear_auth_cookie();
159
+ wp_set_auth_cookie($user_id);
160
+
161
+ if (get_user_meta($user_id, 'default_password_nag')) {
162
+ update_user_meta($user_id, 'default_password_nag', false);
163
+ }
164
+
165
+ if (get_user_meta($user_id, $wpdb->prefix . 'default_password_nag')) {
166
+ update_user_meta($user_id, $wpdb->prefix . 'default_password_nag', false);
167
+ }
168
  }
169
  }
170
 
lib/helpers.php CHANGED
@@ -82,6 +82,9 @@ function db_reset_install( $blog_title, $user_name, $user_email, $public, $site_
82
  populate_options();
83
  populate_roles();
84
 
 
 
 
85
  update_option( 'blogname', $blog_title );
86
  update_option( 'admin_email', $user_email );
87
  update_option( 'blog_public', $public );
82
  populate_options();
83
  populate_roles();
84
 
85
+ remove_all_actions('update_option_blogname');
86
+ remove_all_actions('update_option_blogdescription');
87
+
88
  update_option( 'blogname', $blog_title );
89
  update_option( 'admin_email', $user_email );
90
  update_option( 'blog_public', $public );
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
- === WP Database Reset ===
2
  Contributors: WebFactory
3
  Tags: database, reset, restore, database reset, wp reset, reset wp, developer, development
4
  Requires at least: 4.2
5
  Requires PHP: 5.2
6
- Tested up to: 5.8
7
- Stable tag: 3.20
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -12,7 +12,7 @@ Skip reinstalling WP to reset it & reset the WordPress database back to its orig
12
 
13
  == Description ==
14
 
15
- This plugin will soon be replaced by the free <a href="https://wordpress.org/plugins/wp-reset/">WP Reset</a> plugin. It has a lot more reset tools to individually reset plugins, themes, transients and media. You can also create database snapshots to restore your WP site with one click if you make a mistake.
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
 
@@ -65,6 +65,10 @@ WP Database Reset was originally developed in October 2011 by <a href="https://g
65
 
66
  == Changelog ==
67
 
 
 
 
 
68
  = 3.20 =
69
  * 2021/04/26
70
  * still trying to warn people that this plugin will soon be discontinued
1
+ === Database Reset ===
2
  Contributors: WebFactory
3
  Tags: database, reset, restore, database reset, wp reset, reset wp, developer, development
4
  Requires at least: 4.2
5
  Requires PHP: 5.2
6
+ Tested up to: 6.1
7
+ Stable tag: 3.21
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
12
 
13
  == Description ==
14
 
15
+ If you need more reset tools install the free, advanced <a href="https://wordpress.org/plugins/wp-reset/">WP Reset</a> plugin. It has a lot more reset tools to individually reset plugins, themes, transients and media. You can also create database snapshots to restore your WP site with one click if you make a mistake.
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
 
65
 
66
  == Changelog ==
67
 
68
+ = 3.21 =
69
+ * 2021/07/29
70
+ * fix for WP 5.8
71
+
72
  = 3.20 =
73
  * 2021/04/26
74
  * still trying to warn people that this plugin will soon be discontinued
wp-reset.php CHANGED
@@ -3,13 +3,13 @@
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.20
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
- Copyright 2011 - 2021 WebFactory Ltd (email: support@webfactoryltd.com)
13
 
14
  This program is free software; you can redistribute it and/or modify
15
  it under the terms of the GNU General Public License, version 2, as
@@ -25,7 +25,7 @@
25
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26
  */
27
 
28
- define( 'DB_RESET_VERSION', '3.20' );
29
  define( 'DB_RESET_PATH', dirname( __FILE__ ) );
30
  define( 'DB_RESET_NAME', basename( DB_RESET_PATH ) );
31
  define( 'DB_RESET_FILE', __FILE__ );
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.21
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
+ Copyright 2011 - 2022 WebFactory Ltd (email: support@webfactoryltd.com)
13
 
14
  This program is free software; you can redistribute it and/or modify
15
  it under the terms of the GNU General Public License, version 2, as
25
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26
  */
27
 
28
+ define( 'DB_RESET_VERSION', '3.21' );
29
  define( 'DB_RESET_PATH', dirname( __FILE__ ) );
30
  define( 'DB_RESET_NAME', basename( DB_RESET_PATH ) );
31
  define( 'DB_RESET_FILE', __FILE__ );