WordPress Reset - Version 1.3.2

Version Description

Support PHP versions below 5.3.0, by not using lambda function creation in add_action for admin_notices

Download this release

Release Info

Developer sivel
Plugin Icon WordPress Reset
Version 1.3.2
Comparing to
See all releases

Code changes from version 1.3.1 to 1.3.2

Files changed (2) hide show
  1. readme.txt +10 -1
  2. wordpress-reset.php +11 -8
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate Link: http://sivel.net/donate
4
Tags: wordpress-reset, wordpress, reset, admin
5
Requires at least: 2.8
6
Tested up to: 3.3
7
- Stable tag: 1.3.1
8
9
Resets the WordPress database back to it's defaults. Deletes all customizations and content. Does not modify files only resets the database.
10
@@ -53,12 +53,21 @@ $reactivate_wp_reset_additional = array(
53
54
== Upgrade Notice ==
55
56
= 1.3.1 =
57
58
Fixes a deprecated notice in WordPress 3.3, removed the $auto_reactivate variable, and look for REACTIVATE_WP_RESET to be defined in wp-config.php, as well as the ability to activate additional plugins using a global $reactivate_wp_reset_additional array defined in wp-config.php
59
60
== Changelog ==
61
62
= 1.3.1 (2012-01-29): =
63
* Apparently in a LIKE query, an underscore matches a single character, so we must escape it
64
4
Tags: wordpress-reset, wordpress, reset, admin
5
Requires at least: 2.8
6
Tested up to: 3.3
7
+ Stable tag: 1.3.2
8
9
Resets the WordPress database back to it's defaults. Deletes all customizations and content. Does not modify files only resets the database.
10
53
54
== Upgrade Notice ==
55
56
+ = 1.3.2 =
57
+ Support PHP versions below 5.3.0, by not using lambda function creation in add_action for admin_notices
58
+
59
= 1.3.1 =
60
+ Fix sql query, so that _ isn't being used as a single character match
61
+
62
+ = 1.3 =
63
64
Fixes a deprecated notice in WordPress 3.3, removed the $auto_reactivate variable, and look for REACTIVATE_WP_RESET to be defined in wp-config.php, as well as the ability to activate additional plugins using a global $reactivate_wp_reset_additional array defined in wp-config.php
65
66
== Changelog ==
67
68
+ = 1.3.2 (2012-02-13): =
69
+ * Support PHP versions below 5.3.0, by not using lambda function creation in add_action for admin_notices
70
+
71
= 1.3.1 (2012-01-29): =
72
* Apparently in a LIKE query, an underscore matches a single character, so we must escape it
73
wordpress-reset.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: WordPress Reset
4
Plugin URI: http://sivel.net/wordpress/wordpress-reset/
5
Description: Resets the WordPress database back to it's defaults. Deletes all customizations and content. Does not modify files only resets the database.
6
Author: Matt Martz
7
- Version: 1.3.1
8
Author URI: http://sivel.net/
9
10
Copyright (c) 2009-2012 Matt Martz (http://sivel.net)
@@ -110,13 +110,16 @@ class WordPressReset {
110
exit();
111
}
112
113
- if ( array_key_exists( 'reset', $_GET ) && stristr( $_SERVER['HTTP_REFERER'], 'wordpress-reset' ) ) {
114
- add_action( 'admin_notices', function () {
115
- $user = get_user_by( 'id', 1 );
116
- echo '<div id="message" class="updated fade"><p><strong>WordPress has been reset back to defaults. The user "' . $user->user_login . '" was recreated with its previous password.</strong></p></div>';
117
- do_action( 'wordpress_reset_post', $user );
118
- } );
119
- }
120
}
121
122
// Overwrite the password, because we actually reset it after this email goes out
4
Plugin URI: http://sivel.net/wordpress/wordpress-reset/
5
Description: Resets the WordPress database back to it's defaults. Deletes all customizations and content. Does not modify files only resets the database.
6
Author: Matt Martz
7
+ Version: 1.3.2
8
Author URI: http://sivel.net/
9
10
Copyright (c) 2009-2012 Matt Martz (http://sivel.net)
110
exit();
111
}
112
113
+ if ( array_key_exists( 'reset', $_GET ) && stristr( $_SERVER['HTTP_REFERER'], 'wordpress-reset' ) )
114
+ add_action( 'admin_notices', array( &$this, 'reset_notice' ) );
115
+ }
116
+
117
+ // admin_notices action hook operations
118
+ // Inform the user that WordPress has been successfully reset
119
+ function reset_notice() {
120
+ $user = get_user_by( 'id', 1 );
121
+ echo '<div id="message" class="updated fade"><p><strong>WordPress has been reset back to defaults. The user "' . $user->user_login . '" was recreated with its previous password.</strong></p></div>';
122
+ do_action( 'wordpress_reset_post', $user );
123
}
124
125
// Overwrite the password, because we actually reset it after this email goes out