Version Description
January 19, 2016
- Fix compatibility with PHP 7.0
- Internationalization
Download this release
Release Info
| Developer | aristath |
| Plugin | |
| Version | 1.4 |
| Comparing to | |
| See all releases | |
Code changes from version 1.3.3 to 1.4
- readme.txt +9 -3
- wordpress-reset.php +148 -114
readme.txt
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
=== WordPress Reset ===
|
| 2 |
-
Contributors: sivel
|
| 3 |
Donate Link: http://sivel.net/donate
|
| 4 |
Tags: wordpress-reset, wordpress, reset, admin
|
| 5 |
Requires at least: 2.8
|
| 6 |
-
Tested up to:
|
| 7 |
-
Stable tag: 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 |
|
|
@@ -68,6 +68,12 @@ Fixes a deprecated notice in WordPress 3.3, removed the $auto_reactivate variabl
|
|
| 68 |
|
| 69 |
== Changelog ==
|
| 70 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
= 1.3.3 (2013-12-18): =
|
| 72 |
* Fix an issue where a user does not have a user_level
|
| 73 |
|
| 1 |
=== WordPress Reset ===
|
| 2 |
+
Contributors: sivel, aristath
|
| 3 |
Donate Link: http://sivel.net/donate
|
| 4 |
Tags: wordpress-reset, wordpress, reset, admin
|
| 5 |
Requires at least: 2.8
|
| 6 |
+
Tested up to: 4.5
|
| 7 |
+
Stable tag: 1.4
|
| 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 |
|
| 68 |
|
| 69 |
== Changelog ==
|
| 70 |
|
| 71 |
+
= 1.4 =
|
| 72 |
+
January 19, 2016
|
| 73 |
+
|
| 74 |
+
* Fix compatibility with PHP 7.0
|
| 75 |
+
* Internationalization
|
| 76 |
+
|
| 77 |
= 1.3.3 (2013-12-18): =
|
| 78 |
* Fix an issue where a user does not have a user_level
|
| 79 |
|
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.
|
| 8 |
Author URI: http://sivel.net/
|
| 9 |
|
| 10 |
Copyright (c) 2009-2012 Matt Martz (http://sivel.net)
|
|
@@ -13,28 +13,35 @@ Author URI: http://sivel.net/
|
|
| 13 |
*/
|
| 14 |
|
| 15 |
// Only run the code if we are in the admin
|
| 16 |
-
if ( is_admin() ) :
|
| 17 |
-
|
| 18 |
-
class
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
add_action( '
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
| 26 |
}
|
| 27 |
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
|
|
|
|
|
|
| 32 |
return array_merge( $reset, $actions );
|
| 33 |
}
|
| 34 |
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
|
|
|
|
|
|
| 38 |
global $wp_admin_bar;
|
| 39 |
$wp_admin_bar->add_menu(
|
| 40 |
array(
|
|
@@ -46,10 +53,12 @@ class WordPressReset {
|
|
| 46 |
);
|
| 47 |
}
|
| 48 |
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
|
|
|
|
|
|
| 53 |
global $current_user;
|
| 54 |
|
| 55 |
$wordpress_reset = ( isset( $_POST['wordpress_reset'] ) && $_POST['wordpress_reset'] == 'true' ) ? true : false;
|
|
@@ -59,15 +68,17 @@ class WordPressReset {
|
|
| 59 |
if ( $wordpress_reset && $wordpress_reset_confirm && $valid_nonce ) {
|
| 60 |
require_once( ABSPATH . '/wp-admin/includes/upgrade.php' );
|
| 61 |
|
| 62 |
-
$blogname
|
| 63 |
$admin_email = get_option( 'admin_email' );
|
| 64 |
$blog_public = get_option( 'blog_public' );
|
| 65 |
|
| 66 |
-
if ( $current_user->user_login != 'admin' )
|
| 67 |
$user = get_user_by( 'login', 'admin' );
|
|
|
|
| 68 |
|
| 69 |
-
if ( empty( $user->user_level ) || $user->user_level < 10 )
|
| 70 |
$user = $current_user;
|
|
|
|
| 71 |
|
| 72 |
global $wpdb, $reactivate_wp_reset_additional;
|
| 73 |
|
|
@@ -83,23 +94,27 @@ class WordPressReset {
|
|
| 83 |
$query = $wpdb->prepare( "UPDATE $wpdb->users SET user_pass = %s, user_activation_key = '' WHERE ID = %d", $user->user_pass, $user_id );
|
| 84 |
$wpdb->query( $query );
|
| 85 |
|
| 86 |
-
$get_user_meta
|
| 87 |
$update_user_meta = function_exists( 'update_user_meta' ) ? 'update_user_meta' : 'update_usermeta';
|
| 88 |
|
| 89 |
-
if ( $get_user_meta( $user_id, 'default_password_nag' ) )
|
| 90 |
$update_user_meta( $user_id, 'default_password_nag', false );
|
|
|
|
| 91 |
|
| 92 |
-
if ( $get_user_meta( $user_id, $wpdb->prefix . 'default_password_nag' ) )
|
| 93 |
$update_user_meta( $user_id, $wpdb->prefix . 'default_password_nag', false );
|
|
|
|
| 94 |
|
| 95 |
-
if ( defined( 'REACTIVATE_WP_RESET' ) && REACTIVATE_WP_RESET === true )
|
| 96 |
-
|
|
|
|
| 97 |
|
| 98 |
if ( ! empty( $reactivate_wp_reset_additional ) ) {
|
| 99 |
foreach ( $reactivate_wp_reset_additional as $plugin ) {
|
| 100 |
$plugin = plugin_basename( $plugin );
|
| 101 |
-
if ( ! is_wp_error( validate_plugin( $plugin ) ) )
|
| 102 |
-
|
|
|
|
| 103 |
}
|
| 104 |
}
|
| 105 |
|
|
@@ -110,20 +125,25 @@ class WordPressReset {
|
|
| 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 |
-
|
| 118 |
-
|
| 119 |
-
|
|
|
|
|
|
|
| 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 |
-
|
| 126 |
-
|
|
|
|
|
|
|
| 127 |
if ( preg_match( '/Your new WordPress (blog|site) has been successfully set up at/i', $args['message'] ) ) {
|
| 128 |
$args['message'] = str_replace( 'Your new WordPress site has been successfully set up at:', 'Your WordPress site has been successfully reset, and can be accessed at:', $args['message'] );
|
| 129 |
$args['message'] = preg_replace( '/Password:.+/', 'Password: previously specified password', $args['message'] );
|
|
@@ -131,55 +151,63 @@ class WordPressReset {
|
|
| 131 |
return $args;
|
| 132 |
}
|
| 133 |
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
|
|
|
|
|
|
| 137 |
wp_enqueue_script( 'jquery' );
|
| 138 |
}
|
| 139 |
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
} else {
|
| 153 |
-
|
| 154 |
return false;
|
| 155 |
}
|
| 156 |
-
}
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
});
|
| 161 |
-
/* ]]> */
|
| 162 |
-
</script>
|
| 163 |
-
<?php
|
| 164 |
}
|
| 165 |
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
|
|
|
|
|
|
| 169 |
if ( current_user_can( 'level_10' ) && function_exists( 'add_management_page' ) )
|
| 170 |
$hook = add_management_page( 'Reset', 'Reset', 'level_10', 'wordpress-reset', array( &$this, 'admin_page' ) );
|
| 171 |
add_action( "admin_print_scripts-{$hook}", array( &$this, 'admin_js' ) );
|
| 172 |
add_action( "admin_footer-{$hook}", array( &$this, 'footer_js' ) );
|
| 173 |
}
|
| 174 |
|
| 175 |
-
|
| 176 |
-
|
|
|
|
|
|
|
| 177 |
function admin_page() {
|
| 178 |
global $current_user, $reactivate_wp_reset_additional;
|
| 179 |
-
if ( isset( $_POST['wordpress_reset_confirm'] ) && $_POST['wordpress_reset_confirm'] != 'reset' )
|
| 180 |
echo '<div class="error fade"><p><strong>Invalid confirmation word. Please type the word \'reset\' in the confirmation field.</strong></p></div>';
|
| 181 |
-
elseif ( isset( $_POST['_wpnonce'] ) )
|
| 182 |
echo '<div class="error fade"><p><strong>Invalid nonce. Please try again.</strong></p></div>';
|
|
|
|
| 183 |
|
| 184 |
$missing = array();
|
| 185 |
if ( ! empty( $reactivate_wp_reset_additional ) ) {
|
|
@@ -192,54 +220,60 @@ class WordPressReset {
|
|
| 192 |
}
|
| 193 |
|
| 194 |
$will_reactivate = ( defined( 'REACTIVATE_WP_RESET') && REACTIVATE_WP_RESET === true ) ? true : false;
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
<?php
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
<?php
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
<
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 238 |
}
|
| 239 |
}
|
| 240 |
|
| 241 |
// Instantiate the class
|
| 242 |
-
$
|
| 243 |
|
| 244 |
// End if for is_admin
|
| 245 |
-
endif;
|
| 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.4
|
| 8 |
Author URI: http://sivel.net/
|
| 9 |
|
| 10 |
Copyright (c) 2009-2012 Matt Martz (http://sivel.net)
|
| 13 |
*/
|
| 14 |
|
| 15 |
// Only run the code if we are in the admin
|
| 16 |
+
if ( is_admin() && ! class_exists( 'WordPress_Reset' ) ) :
|
| 17 |
+
|
| 18 |
+
class WordPress_Reset {
|
| 19 |
+
/**
|
| 20 |
+
* The class constructor.
|
| 21 |
+
* contains Action/Filter Hooks
|
| 22 |
+
*/
|
| 23 |
+
public function __construct() {
|
| 24 |
+
add_action( 'admin_menu', array( $this, 'add_page' ) );
|
| 25 |
+
add_action( 'admin_init', array( $this, 'admin_init' ) );
|
| 26 |
+
add_filter( 'favorite_actions', array( $this, 'favorites' ), 100 );
|
| 27 |
+
add_action( 'wp_before_admin_bar_render', array( $this, 'admin_bar_link' ) );
|
| 28 |
+
add_filter( 'wp_mail', array( $this, 'hijack_mail' ), 1 );
|
| 29 |
}
|
| 30 |
|
| 31 |
+
/**
|
| 32 |
+
* favorite_actions filter hook operations
|
| 33 |
+
* While this plugin is active put a link to the reset page in the favorites drop down.
|
| 34 |
+
*/
|
| 35 |
+
public function favorites( $actions ) {
|
| 36 |
+
$reset['tools.php?page=wordpress-reset'] = array( esc_html__( 'WordPress Reset' ), 'level_10' );
|
| 37 |
return array_merge( $reset, $actions );
|
| 38 |
}
|
| 39 |
|
| 40 |
+
/**
|
| 41 |
+
* wp_before_admin_bar_render action hook operations
|
| 42 |
+
* While this plugin is active put a link to the reset page in the admin bar under the site title
|
| 43 |
+
*/
|
| 44 |
+
public function admin_bar_link() {
|
| 45 |
global $wp_admin_bar;
|
| 46 |
$wp_admin_bar->add_menu(
|
| 47 |
array(
|
| 53 |
);
|
| 54 |
}
|
| 55 |
|
| 56 |
+
/**
|
| 57 |
+
* admin_init action hook operations
|
| 58 |
+
* Checks for wordpress_reset post value and if there deletes all wp tables
|
| 59 |
+
* and performs an install, populating the users previous password also
|
| 60 |
+
*/
|
| 61 |
+
public function admin_init() {
|
| 62 |
global $current_user;
|
| 63 |
|
| 64 |
$wordpress_reset = ( isset( $_POST['wordpress_reset'] ) && $_POST['wordpress_reset'] == 'true' ) ? true : false;
|
| 68 |
if ( $wordpress_reset && $wordpress_reset_confirm && $valid_nonce ) {
|
| 69 |
require_once( ABSPATH . '/wp-admin/includes/upgrade.php' );
|
| 70 |
|
| 71 |
+
$blogname = get_option( 'blogname' );
|
| 72 |
$admin_email = get_option( 'admin_email' );
|
| 73 |
$blog_public = get_option( 'blog_public' );
|
| 74 |
|
| 75 |
+
if ( $current_user->user_login != 'admin' ) {
|
| 76 |
$user = get_user_by( 'login', 'admin' );
|
| 77 |
+
}
|
| 78 |
|
| 79 |
+
if ( empty( $user->user_level ) || $user->user_level < 10 ) {
|
| 80 |
$user = $current_user;
|
| 81 |
+
}
|
| 82 |
|
| 83 |
global $wpdb, $reactivate_wp_reset_additional;
|
| 84 |
|
| 94 |
$query = $wpdb->prepare( "UPDATE $wpdb->users SET user_pass = %s, user_activation_key = '' WHERE ID = %d", $user->user_pass, $user_id );
|
| 95 |
$wpdb->query( $query );
|
| 96 |
|
| 97 |
+
$get_user_meta = function_exists( 'get_user_meta' ) ? 'get_user_meta' : 'get_usermeta';
|
| 98 |
$update_user_meta = function_exists( 'update_user_meta' ) ? 'update_user_meta' : 'update_usermeta';
|
| 99 |
|
| 100 |
+
if ( $get_user_meta( $user_id, 'default_password_nag' ) ) {
|
| 101 |
$update_user_meta( $user_id, 'default_password_nag', false );
|
| 102 |
+
}
|
| 103 |
|
| 104 |
+
if ( $get_user_meta( $user_id, $wpdb->prefix . 'default_password_nag' ) ) {
|
| 105 |
$update_user_meta( $user_id, $wpdb->prefix . 'default_password_nag', false );
|
| 106 |
+
}
|
| 107 |
|
| 108 |
+
if ( defined( 'REACTIVATE_WP_RESET' ) && REACTIVATE_WP_RESET === true ) {
|
| 109 |
+
activate_plugin( plugin_basename( __FILE__ ) );
|
| 110 |
+
}
|
| 111 |
|
| 112 |
if ( ! empty( $reactivate_wp_reset_additional ) ) {
|
| 113 |
foreach ( $reactivate_wp_reset_additional as $plugin ) {
|
| 114 |
$plugin = plugin_basename( $plugin );
|
| 115 |
+
if ( ! is_wp_error( validate_plugin( $plugin ) ) ) {
|
| 116 |
+
activate_plugin( $plugin );
|
| 117 |
+
}
|
| 118 |
}
|
| 119 |
}
|
| 120 |
|
| 125 |
exit();
|
| 126 |
}
|
| 127 |
|
| 128 |
+
if ( array_key_exists( 'reset', $_GET ) && stristr( $_SERVER['HTTP_REFERER'], 'wordpress-reset' ) ) {
|
| 129 |
add_action( 'admin_notices', array( &$this, 'reset_notice' ) );
|
| 130 |
+
}
|
| 131 |
}
|
| 132 |
|
| 133 |
+
/**
|
| 134 |
+
* admin_notices action hook operations
|
| 135 |
+
* Inform the user that WordPress has been successfully reset
|
| 136 |
+
*/
|
| 137 |
+
public function reset_notice() {
|
| 138 |
$user = get_user_by( 'id', 1 );
|
| 139 |
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>';
|
| 140 |
do_action( 'wordpress_reset_post', $user );
|
| 141 |
}
|
| 142 |
|
| 143 |
+
/**
|
| 144 |
+
* Overwrite the password, because we actually reset it after this email goes out
|
| 145 |
+
*/
|
| 146 |
+
public function hijack_mail( $args ) {
|
| 147 |
if ( preg_match( '/Your new WordPress (blog|site) has been successfully set up at/i', $args['message'] ) ) {
|
| 148 |
$args['message'] = str_replace( 'Your new WordPress site has been successfully set up at:', 'Your WordPress site has been successfully reset, and can be accessed at:', $args['message'] );
|
| 149 |
$args['message'] = preg_replace( '/Password:.+/', 'Password: previously specified password', $args['message'] );
|
| 151 |
return $args;
|
| 152 |
}
|
| 153 |
|
| 154 |
+
/**
|
| 155 |
+
* admin_print_scripts action hook operations
|
| 156 |
+
* Enqueue jQuery to the head
|
| 157 |
+
*/
|
| 158 |
+
public function admin_js() {
|
| 159 |
wp_enqueue_script( 'jquery' );
|
| 160 |
}
|
| 161 |
|
| 162 |
+
/**
|
| 163 |
+
* admin_footer action hook operations
|
| 164 |
+
* Do some jQuery stuff to warn the user before submission
|
| 165 |
+
*/
|
| 166 |
+
public function footer_js() { ?>
|
| 167 |
+
<script type="text/javascript">
|
| 168 |
+
/* <![CDATA[ */
|
| 169 |
+
jQuery('#wordpress_reset_submit').click(function(){
|
| 170 |
+
if ( jQuery('#wordpress_reset_confirm').val() == 'reset' ) {
|
| 171 |
+
var message = 'This action is not reversable.\n\nClicking "OK" will reset your database back to it\'s defaults. Click "Cancel" to abort.'
|
| 172 |
+
var reset = confirm(message);
|
| 173 |
+
if ( reset ) {
|
| 174 |
+
jQuery('#wordpress_reset_form').submit();
|
| 175 |
+
} else {
|
| 176 |
+
jQuery('#wordpress_reset').val('false');
|
| 177 |
+
return false;
|
| 178 |
+
}
|
| 179 |
} else {
|
| 180 |
+
alert('Invalid confirmation word. Please type the word \'reset\' in the confirmation field.');
|
| 181 |
return false;
|
| 182 |
}
|
| 183 |
+
});
|
| 184 |
+
/* ]]> */
|
| 185 |
+
</script>
|
| 186 |
+
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
| 187 |
}
|
| 188 |
|
| 189 |
+
/**
|
| 190 |
+
* admin_menu action hook operations
|
| 191 |
+
* Add the settings page
|
| 192 |
+
*/
|
| 193 |
+
public function add_page() {
|
| 194 |
if ( current_user_can( 'level_10' ) && function_exists( 'add_management_page' ) )
|
| 195 |
$hook = add_management_page( 'Reset', 'Reset', 'level_10', 'wordpress-reset', array( &$this, 'admin_page' ) );
|
| 196 |
add_action( "admin_print_scripts-{$hook}", array( &$this, 'admin_js' ) );
|
| 197 |
add_action( "admin_footer-{$hook}", array( &$this, 'footer_js' ) );
|
| 198 |
}
|
| 199 |
|
| 200 |
+
/**
|
| 201 |
+
* add_option_page callback operations
|
| 202 |
+
* The settings page
|
| 203 |
+
*/
|
| 204 |
function admin_page() {
|
| 205 |
global $current_user, $reactivate_wp_reset_additional;
|
| 206 |
+
if ( isset( $_POST['wordpress_reset_confirm'] ) && $_POST['wordpress_reset_confirm'] != 'reset' ) {
|
| 207 |
echo '<div class="error fade"><p><strong>Invalid confirmation word. Please type the word \'reset\' in the confirmation field.</strong></p></div>';
|
| 208 |
+
} elseif ( isset( $_POST['_wpnonce'] ) ) {
|
| 209 |
echo '<div class="error fade"><p><strong>Invalid nonce. Please try again.</strong></p></div>';
|
| 210 |
+
}
|
| 211 |
|
| 212 |
$missing = array();
|
| 213 |
if ( ! empty( $reactivate_wp_reset_additional ) ) {
|
| 220 |
}
|
| 221 |
|
| 222 |
$will_reactivate = ( defined( 'REACTIVATE_WP_RESET') && REACTIVATE_WP_RESET === true ) ? true : false;
|
| 223 |
+
?>
|
| 224 |
+
<div class="wrap">
|
| 225 |
+
<div id="icon-tools" class="icon32"><br /></div>
|
| 226 |
+
<h1><?php esc_html_e( 'Reset', 'wp-reset' ); ?></h1>
|
| 227 |
+
<h2><?php esc_html_e( 'Details about the reset', 'wp-reset' ); ?></h2>
|
| 228 |
+
<p><strong><?php esc_html_e( 'After completing this reset you will be taken to the dashboard.', 'wp-reset' ); ?></strong></p>
|
| 229 |
+
<?php $admin = get_user_by( 'login', 'admin' ); ?>
|
| 230 |
+
<?php if ( ! isset( $admin->user_login ) || $admin->user_level < 10 ) : $user = $current_user; ?>
|
| 231 |
+
<p><?php printf( esc_html__( 'The "admin" user does not exist. The user %s will be recreated using its current password with user level 10.', 'wp-reset' ), '<strong>' . esc_html( $user->user_login ) . '</strong>' ); ?></p>
|
| 232 |
+
<?php else : ?>
|
| 233 |
+
<p><?php esc_html_e( 'The "admin" user exists and will be recreated with its current password.', 'wp-reset' ); ?></p>
|
| 234 |
+
<?php endif; ?>
|
| 235 |
+
<?php if ( $will_reactivate ) : ?>
|
| 236 |
+
<p><?php _e( 'This plugin <strong>will be automatically reactivated</strong> after the reset.', 'wp-reset' ); ?></p>
|
| 237 |
+
<?php else : ?>
|
| 238 |
+
<p><?php _e( 'This plugin <strong>will not be automatically reactivated</strong> after the reset.', 'wp-reset' ); ?></p>
|
| 239 |
+
<p><?php printf( esc_html__( 'To have this plugin auto-reactivate, add %1s to your %2s file.', 'wp-reset' ), '<span class="code"><code>define( \'REACTIVATE_WP_RESET\', true );</code></span>', '<span class="code">wp-config.php</span>' ); ?></p>
|
| 240 |
+
<?php endif; ?>
|
| 241 |
+
<?php if ( ! empty( $reactivate_wp_reset_additional ) ) : ?>
|
| 242 |
+
<?php esc_html_e( 'The following additional plugins will be reactivated:', 'wp-reset' ); ?>
|
| 243 |
+
<ul style="list-style-type: disc;">
|
| 244 |
+
<?php foreach ( $reactivate_wp_reset_additional as $plugin ) : ?>
|
| 245 |
+
<?php $plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ); ?>
|
| 246 |
+
<li style="margin: 5px 0 0 30px;"><strong><?php echo esc_html( $plugin_data['Name'] ); ?></strong></li>
|
| 247 |
+
<?php endforeach; ?>
|
| 248 |
+
<?php unset( $reactivate_wp_reset_additional, $plugin, $plugin_data ); ?>
|
| 249 |
+
</ul>
|
| 250 |
+
<?php endif; ?>
|
| 251 |
+
<?php if ( ! empty( $missing ) ) : ?>
|
| 252 |
+
<?php esc_html_e( 'The following additional plugins are missing and cannot be reactivated:', 'wp-reset' ); ?>
|
| 253 |
+
<ul style="list-style-type: disc;">
|
| 254 |
+
<?php foreach ( $missing as $plugin ) : ?>
|
| 255 |
+
<li style="margin: 5px 0 0 30px;"><strong><?php echo esc_html( $plugin ); ?></strong></li>
|
| 256 |
+
<?php endforeach; ?>
|
| 257 |
+
<?PHP unset( $missing, $plugin ); ?>
|
| 258 |
+
</ul>
|
| 259 |
+
<?php endif; ?>
|
| 260 |
+
<h3><?php esc_html_e( 'Reset', 'wp-reset' ); ?></h3>
|
| 261 |
+
<p><?php printf( esc_html__( 'Type %s in the confirmation field to confirm the reset and then click the reset button:', 'wp-reset' ), '<strong>reset</strong>' ); ?></p>
|
| 262 |
+
<form id="wordpress_reset_form" action="" method="post">
|
| 263 |
+
<?php wp_nonce_field( 'wordpress_reset' ); ?>
|
| 264 |
+
<input id="wordpress_reset" type="hidden" name="wordpress_reset" value="true" />
|
| 265 |
+
<input id="wordpress_reset_confirm" type="text" name="wordpress_reset_confirm" value="" />
|
| 266 |
+
<p class="submit">
|
| 267 |
+
<input id="wordpress_reset_submit" style="width: 80px;" type="submit" name="Submit" class="button-primary" value="<?php esc_html_e( 'Reset' ); ?>" />
|
| 268 |
+
</p>
|
| 269 |
+
</form>
|
| 270 |
+
</div>
|
| 271 |
+
<?php
|
| 272 |
}
|
| 273 |
}
|
| 274 |
|
| 275 |
// Instantiate the class
|
| 276 |
+
$WordPress_Reset = new WordPress_Reset();
|
| 277 |
|
| 278 |
// End if for is_admin
|
| 279 |
+
endif;
|
