Version Description
- First release: Hello world!
=
Download this release
Release Info
Developer | symptote |
Plugin | Advanced WordPress Reset |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- README.txt +68 -0
- advanced-wp-reset.php +110 -0
- css/admin.css +114 -0
- css/index.php +3 -0
- images/donate.gif +0 -0
- images/info.png +0 -0
- images/rate.png +0 -0
- images/warning.png +0 -0
- includes/functions.php +46 -0
- includes/reset.php +71 -0
- includes/sidebar.php +42 -0
- index.php +3 -0
- js/admin.js +28 -0
- languages/advanced-wp-reset.pot +106 -0
- screenshot-1.png +0 -0
README.txt
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Advanced WordPress Reset ===
|
2 |
+
Contributors: symptote
|
3 |
+
Donate Link: http://www.sigmaplugin.com/donation
|
4 |
+
Tags: plugin, plugins, plugin wordpress, wordpress, database, database reset, reset database, reset, wordpress reset, reset wordpress, wp reset, reset wp, fresh, installation, clean database, database clean, clean, clean-up, clean up, cleanup, cleaner, admin, default, developer, restore, status, setup, wp-admin
|
5 |
+
Requires at least: 3.0
|
6 |
+
Tested up to: 4.5
|
7 |
+
Stable tag: 1.0.0
|
8 |
+
License: GPLv2 or later
|
9 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
+
|
11 |
+
Reset your WordPress database back to its first original status, just like if you make a fresh installation.
|
12 |
+
|
13 |
+
== Description ==
|
14 |
+
|
15 |
+
'Advanced WordPress reset' plugin will reset you WordPress Database back to its first original status in order to make a fresh installation without going through WordPress traditional installation. This plugin will help you saving time especially if you are a developer and you have to install WordPress from scratch each time.
|
16 |
+
|
17 |
+
= Main Features =
|
18 |
+
* Make a fresh installation without going through the 5 minutes WordPress installation
|
19 |
+
* Resets the database without deleting or modifying any of your files (all your WordPress, plugins and themes files are kept)
|
20 |
+
* Deletes all database customizations made by plugins and themes.
|
21 |
+
* Deletes all content including post, pages, options, etc.
|
22 |
+
* Detects the Admin user and recreate it with its saved password
|
23 |
+
* Keeps the blog name after the reset
|
24 |
+
* Quick and convenient
|
25 |
+
|
26 |
+
= Multisite Support =
|
27 |
+
* Actually the plugin does not support Multisite installation. We will add it as soon as possible.
|
28 |
+
|
29 |
+
= Our other plugins =
|
30 |
+
* <a href="https://wordpress.org/plugins/advanced-database-cleaner" target="_blank">Advanced Database Cleaner</a>
|
31 |
+
|
32 |
+
== Installation ==
|
33 |
+
|
34 |
+
This section describes how to install the plugin and get it working.
|
35 |
+
|
36 |
+
= Single site installation =
|
37 |
+
* After extraction, upload the Plugin to your `/wp-content/plugins/` directory
|
38 |
+
* Go to "Dashboard" » "Plugins" and choose 'Activate'
|
39 |
+
* The plugin page can be accessed via "Dashboard" » "Tools" » "Advanced WP reset"
|
40 |
+
|
41 |
+
== Screenshots ==
|
42 |
+
|
43 |
+
1. Admin page of the plugin
|
44 |
+
|
45 |
+
== Changelog ==
|
46 |
+
|
47 |
+
= 1.0.0 =
|
48 |
+
* First release: Hello world!
|
49 |
+
|
50 |
+
== Frequently Asked Questions ==
|
51 |
+
|
52 |
+
= What does mean "reset my database"? =
|
53 |
+
This option will reset your WordPress database back to its first original status, just like if you make a fresh installation. That is to say, a clean installation without any content or customizations
|
54 |
+
|
55 |
+
= Is it safe to reset my database? =
|
56 |
+
Yes, it is safe since you have no important content to lose. If there are any issues, we will support you :)
|
57 |
+
|
58 |
+
= Is there any files that will be deleted after the reset? =
|
59 |
+
No. All files are kept as they are. The plugin does not delete or modify any of your files.
|
60 |
+
|
61 |
+
= Is there any plugins or themes that will be deleted after the reset? =
|
62 |
+
No. All your plugins and themes will be kept. However you will lose any settings in database of those plugins/themes.
|
63 |
+
|
64 |
+
= Is this plugin compatible with multisite? =
|
65 |
+
No, it is not compatible with multisite. We will try to fix this compatibility as soon as possible.
|
66 |
+
|
67 |
+
= Is this plugin compatible with SharDB, HyperDB or Multi-DB? =
|
68 |
+
Actually the plugin is not supposed to be compatible with SharDB, HyperDB or Multi-DB.
|
advanced-wp-reset.php
ADDED
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH') || !is_main_site()) return;
|
3 |
+
|
4 |
+
/*
|
5 |
+
Plugin Name: Advanced WordPress Reset
|
6 |
+
Plugin URI: http://sigmaplugin.com/downloads/advanced-wordpress-reset
|
7 |
+
Description: Resets your WordPress database back to its first original status, just like if you make a fresh installation.
|
8 |
+
Version: 1.0.0
|
9 |
+
Author: Younes JFR.
|
10 |
+
Author URI: http://www.sigmaplugin.com
|
11 |
+
Contributors: symptote
|
12 |
+
Text Domain: advanced-wp-reset
|
13 |
+
Domain Path: /languages/
|
14 |
+
License: GPLv2 or later
|
15 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
16 |
+
*/
|
17 |
+
|
18 |
+
/********************************************************************
|
19 |
+
* Define common constants
|
20 |
+
********************************************************************/
|
21 |
+
if (!defined("DBR_PLUGIN_VERSION")) define("DBR_PLUGIN_VERSION", "1.0.0");
|
22 |
+
if (!defined("DBR_PLUGIN_DIR_PATH")) define("DBR_PLUGIN_DIR_PATH", plugins_url('' , __FILE__));
|
23 |
+
|
24 |
+
/********************************************************************
|
25 |
+
* Load language
|
26 |
+
********************************************************************/
|
27 |
+
add_action('plugins_loaded', 'DBR_load_textdomain');
|
28 |
+
function DBR_load_textdomain() {
|
29 |
+
load_plugin_textdomain('advanced-wp-reset', false, plugin_basename(dirname(__FILE__)) . '/languages');
|
30 |
+
}
|
31 |
+
|
32 |
+
/********************************************************************
|
33 |
+
* Add sub menu under tools
|
34 |
+
********************************************************************/
|
35 |
+
add_action('admin_menu', 'DBR_add_admin_menu');
|
36 |
+
function DBR_add_admin_menu() {
|
37 |
+
global $DBR_tool_submenu;
|
38 |
+
$DBR_tool_submenu = add_submenu_page('tools.php', 'Advanced WP Reset', 'Advanced WP Reset', 'manage_options', 'advanced_wp_reset', 'DBR_main_page_callback');
|
39 |
+
}
|
40 |
+
|
41 |
+
/********************************************************************
|
42 |
+
* Load CSS and JS
|
43 |
+
********************************************************************/
|
44 |
+
add_action('admin_enqueue_scripts', 'DBR_load_styles_and_scripts');
|
45 |
+
function DBR_load_styles_and_scripts($hook) {
|
46 |
+
// Enqueue our js and css in the plugin pages only
|
47 |
+
global $DBR_tool_submenu;
|
48 |
+
if($hook != $DBR_tool_submenu){
|
49 |
+
return;
|
50 |
+
}
|
51 |
+
wp_enqueue_style('DBR_css', DBR_PLUGIN_DIR_PATH . '/css/admin.css');
|
52 |
+
//wp_enqueue_script('DBR_js', DBR_PLUGIN_DIR_PATH . '/js/admin.js');
|
53 |
+
//wp_enqueue_script('jquery');
|
54 |
+
//wp_enqueue_script('jquery-ui-dialog');
|
55 |
+
//wp_enqueue_style('wp-jquery-ui-dialog');
|
56 |
+
}
|
57 |
+
|
58 |
+
/********************************************************************
|
59 |
+
* Activation of the plugin
|
60 |
+
********************************************************************/
|
61 |
+
register_activation_hook(__FILE__, 'DBR_activate_plugin');
|
62 |
+
function DBR_activate_plugin(){
|
63 |
+
// Anything to do on activation? Maybe later...
|
64 |
+
}
|
65 |
+
|
66 |
+
/********************************************************************
|
67 |
+
* Deactivation of the plugin
|
68 |
+
********************************************************************/
|
69 |
+
register_deactivation_hook(__FILE__, 'DBR_deactivate_plugin');
|
70 |
+
function DBR_deactivate_plugin(){
|
71 |
+
// Anything to do on deactivation? Maybe later...
|
72 |
+
}
|
73 |
+
|
74 |
+
/********************************************************************
|
75 |
+
* UNINSTALL
|
76 |
+
********************************************************************/
|
77 |
+
register_uninstall_hook(__FILE__, 'DBR_uninstall');
|
78 |
+
function DBR_uninstall(){
|
79 |
+
// Anything to do on uninstall? Maybe later...
|
80 |
+
}
|
81 |
+
|
82 |
+
/********************************************************************
|
83 |
+
* The admin page of the plugin
|
84 |
+
********************************************************************/
|
85 |
+
function DBR_main_page_callback(){
|
86 |
+
if(!current_user_can("manage_options")){
|
87 |
+
_e('You do not have sufficient permissions to access this page.','advanced-wp-reset');
|
88 |
+
die();
|
89 |
+
}
|
90 |
+
?>
|
91 |
+
<div class="wrap">
|
92 |
+
<h2>Advanced WordPress Reset</h2>
|
93 |
+
<div class="DBR-margin-r-300">
|
94 |
+
<div class="DBR-tab-box">
|
95 |
+
<div class="DBR-tab-box-div">
|
96 |
+
<?php include_once 'includes/reset.php'; ?>
|
97 |
+
</div>
|
98 |
+
</div>
|
99 |
+
<div class="DBR-sidebar"><?php include_once 'includes/sidebar.php'; ?></div>
|
100 |
+
</div>
|
101 |
+
</div>
|
102 |
+
<?php
|
103 |
+
}
|
104 |
+
|
105 |
+
/***************************************************************
|
106 |
+
* Get functions
|
107 |
+
***************************************************************/
|
108 |
+
include_once 'includes/functions.php';
|
109 |
+
|
110 |
+
?>
|
css/admin.css
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*---------------------------------------------------------------------------------------------
|
2 |
+
* Global styles
|
3 |
+
*---------------------------------------------------------------------------------------------*/
|
4 |
+
html {
|
5 |
+
overflow-y: scroll;
|
6 |
+
}
|
7 |
+
.DBR-margin-r-300 {
|
8 |
+
margin-top: 10px;
|
9 |
+
margin-right: 260px;
|
10 |
+
}
|
11 |
+
.DBR-float-left{
|
12 |
+
float: left;
|
13 |
+
}
|
14 |
+
.DBR-float-right{
|
15 |
+
float: right;
|
16 |
+
}
|
17 |
+
.DBR-button-reset{
|
18 |
+
width: 150px !important;
|
19 |
+
height: 40px !important;
|
20 |
+
text-align: center;
|
21 |
+
}
|
22 |
+
.DBR-jquery-dialog{
|
23 |
+
padding:20px;
|
24 |
+
display:none;
|
25 |
+
}
|
26 |
+
|
27 |
+
/*---------------------------------------------------------------------------------------------
|
28 |
+
* Tabs
|
29 |
+
*---------------------------------------------------------------------------------------------*/
|
30 |
+
.DBR-tab-box {
|
31 |
+
float: left;
|
32 |
+
width: 100%;
|
33 |
+
}
|
34 |
+
.DBR-tab-box-div {
|
35 |
+
min-height: 400px;
|
36 |
+
background: #fff;
|
37 |
+
border: 1px solid #ccc;
|
38 |
+
padding: 30px 20px 20px 20px;
|
39 |
+
border-radius: 5px;
|
40 |
+
-moz-border-radius: 5px;
|
41 |
+
-webkit-border-radius: 5px;
|
42 |
+
}
|
43 |
+
|
44 |
+
/*---------------------------------------------------------------------------------------------
|
45 |
+
* Sidebar
|
46 |
+
*---------------------------------------------------------------------------------------------*/
|
47 |
+
.DBR-sidebar {
|
48 |
+
float: right;
|
49 |
+
border: 1px solid #ccc;
|
50 |
+
background: #FFFFD4;
|
51 |
+
margin-right: -260px;
|
52 |
+
width: 240px;
|
53 |
+
border-radius: 5px 5px 0 0;
|
54 |
+
-moz-border-radius: 5px 5px 0 0;
|
55 |
+
-webkit-border-radius: 5px 5px 0 0;
|
56 |
+
}
|
57 |
+
.DBR-sidebar > div{
|
58 |
+
padding: 15px;
|
59 |
+
}
|
60 |
+
.DBR-sidebar h2{
|
61 |
+
font-size: 16px;
|
62 |
+
text-align: center;
|
63 |
+
color: #888;
|
64 |
+
line-height: 24px;
|
65 |
+
}
|
66 |
+
.DBR-donation-text{
|
67 |
+
text-align:center;
|
68 |
+
color: #555
|
69 |
+
}
|
70 |
+
.DBR-donation-gif{
|
71 |
+
background: url("../images/donate.gif") no-repeat;
|
72 |
+
width: 92px;
|
73 |
+
height: 26px;
|
74 |
+
margin: auto;
|
75 |
+
}
|
76 |
+
.DBR-grey-row{
|
77 |
+
height: 20px;
|
78 |
+
background-color: #fff;
|
79 |
+
}
|
80 |
+
.DBR-white-row{
|
81 |
+
height: 20px;
|
82 |
+
background-color: #fff;
|
83 |
+
}
|
84 |
+
.DBR-row-text{
|
85 |
+
font-size: 13px;
|
86 |
+
color: #555;
|
87 |
+
}
|
88 |
+
.DBR-sidebar-link{
|
89 |
+
text-decoration: none;
|
90 |
+
}
|
91 |
+
.DBR-support-us{
|
92 |
+
background: url("../images/rate.png") no-repeat center right;
|
93 |
+
width: 88px;
|
94 |
+
height: 18px;
|
95 |
+
margin-top: 0px;
|
96 |
+
}
|
97 |
+
|
98 |
+
/*---------------------------------------------------------------------------------------------
|
99 |
+
* Box messages
|
100 |
+
*---------------------------------------------------------------------------------------------*/
|
101 |
+
.DBR-box-warning {
|
102 |
+
background: #fff5cc url("../images/warning.png") no-repeat scroll 8px 50%;
|
103 |
+
border-bottom: 1px dashed orange;
|
104 |
+
color: #404040;
|
105 |
+
padding: 10px 10px 10px 40px;
|
106 |
+
margin-bottom: 20px;
|
107 |
+
}
|
108 |
+
.DBR-box-info {
|
109 |
+
background: #f0f5fa url("../images/info.png") no-repeat scroll 8px 50%;
|
110 |
+
border-bottom: 1px dashed #ccc;
|
111 |
+
color: #404040;
|
112 |
+
padding: 10px 10px 10px 40px;
|
113 |
+
margin-bottom: 20px;
|
114 |
+
}
|
css/index.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
#Silence is golden.
|
3 |
+
?>
|
images/donate.gif
ADDED
Binary file
|
images/info.png
ADDED
Binary file
|
images/rate.png
ADDED
Binary file
|
images/warning.png
ADDED
Binary file
|
includes/functions.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**********************************************************************************
|
3 |
+
* Resets the database back to its initial status just like a fresh installation
|
4 |
+
**********************************************************************************/
|
5 |
+
function DBR_wp_reset(){
|
6 |
+
require_once( ABSPATH . '/wp-admin/includes/upgrade.php' );
|
7 |
+
global $current_user, $wpdb;
|
8 |
+
$blogname = get_option( 'blogname' );
|
9 |
+
$admin_email = get_option( 'admin_email' );
|
10 |
+
$blog_public = get_option( 'blog_public' );
|
11 |
+
if ( $current_user->user_login != 'admin' ){
|
12 |
+
$user = get_user_by( 'login', 'admin' );
|
13 |
+
}
|
14 |
+
if ( empty( $user->user_level ) || $user->user_level < 10 ){
|
15 |
+
$user = $current_user;
|
16 |
+
}
|
17 |
+
$prefix = str_replace( '_', '\_', $wpdb->prefix );
|
18 |
+
$tables = $wpdb->get_col( "SHOW TABLES LIKE '{$prefix}%'" );
|
19 |
+
foreach ( $tables as $table ) {
|
20 |
+
$wpdb->query( "DROP TABLE $table" );
|
21 |
+
}
|
22 |
+
// Install wordpress
|
23 |
+
$result = wp_install( $blogname, $user->user_login, $user->user_email, $blog_public);
|
24 |
+
extract( $result, EXTR_SKIP );
|
25 |
+
// Set user password
|
26 |
+
$query = $wpdb->prepare( "UPDATE $wpdb->users SET user_pass = %s, user_activation_key = '' WHERE ID = %d", $user->user_pass, $user_id );
|
27 |
+
$wpdb->query( $query );
|
28 |
+
// Test for functions
|
29 |
+
$get_user_meta = function_exists( 'get_user_meta' ) ? 'get_user_meta' : 'get_usermeta';
|
30 |
+
$update_user_meta = function_exists( 'update_user_meta' ) ? 'update_user_meta' : 'update_usermeta';
|
31 |
+
// Say to wordpress that we will not use generated password
|
32 |
+
if ( $get_user_meta( $user_id, 'default_password_nag' ) ){
|
33 |
+
$update_user_meta( $user_id, 'default_password_nag', false );
|
34 |
+
}
|
35 |
+
if ( $get_user_meta( $user_id, $wpdb->prefix . 'default_password_nag' ) ){
|
36 |
+
$update_user_meta( $user_id, $wpdb->prefix . 'default_password_nag', false );
|
37 |
+
}
|
38 |
+
// Clear all cookies associated with authentication
|
39 |
+
wp_clear_auth_cookie();
|
40 |
+
// Set the authentication cookies based User ID
|
41 |
+
wp_set_auth_cookie( $user_id );
|
42 |
+
// Redirect user to admin pannel
|
43 |
+
wp_redirect( admin_url());
|
44 |
+
}
|
45 |
+
|
46 |
+
?>
|
includes/reset.php
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// Test if the user has clicked on reset button
|
4 |
+
if(isset($_POST['DBR_reset_button'])){
|
5 |
+
if($_POST['DBR_reset_comfirmation'] == 'reset'){
|
6 |
+
// run a quick security check
|
7 |
+
if(!check_admin_referer('DBR_sample_nonce', 'DBR_sample_nonce')){
|
8 |
+
return; // get out if we didn't click the Reset button
|
9 |
+
}
|
10 |
+
DBR_wp_reset();
|
11 |
+
}else{
|
12 |
+
echo '<div id="DBR_message" class="error notice is-dismissible"><p>';
|
13 |
+
printf(__('Please type the word "<b>%s</b>" correctly in the text box below.','advanced-wp-reset'), "reset");
|
14 |
+
echo '</p></div>';
|
15 |
+
}
|
16 |
+
}
|
17 |
+
|
18 |
+
global $current_user;
|
19 |
+
$DBR_admin = get_user_by('login', 'admin');
|
20 |
+
$DBR_admin_exists = 1;
|
21 |
+
if (!isset($DBR_admin->user_login ) || $DBR_admin->user_level < 10 ){
|
22 |
+
$DBR_admin_exists = 0;
|
23 |
+
} ?>
|
24 |
+
|
25 |
+
<div class="DBR-box-warning">
|
26 |
+
<span style="color:red"><strong><?php _e('WARNING:','advanced-wp-reset'); ?></strong></span>
|
27 |
+
<br/>
|
28 |
+
<?php _e('The reset makes a fresh installation of your database. Therefore, ANY data in your database will be lost.','advanced-wp-reset'); ?>
|
29 |
+
<br/>
|
30 |
+
<?php _e('Please do not use this option if you want to keep your posts and pages.','advanced-wp-reset'); ?>
|
31 |
+
</div>
|
32 |
+
|
33 |
+
<div class="DBR-box-info">
|
34 |
+
<ul>
|
35 |
+
<li><?php _e('The reset does not delete or modify any of your plugins/themes files or server files.','advanced-wp-reset'); ?></li>
|
36 |
+
<li><?php _e('All your plugins will be deactivated (including this one). You should activate them manually after the reset.','advanced-wp-reset'); ?></li>
|
37 |
+
<li>
|
38 |
+
<?php
|
39 |
+
if($DBR_admin_exists){
|
40 |
+
printf(__('The plugin has detected that the <b>%s</b> user exists. It will be recreated with its current password.','advanced-wp-reset'), "admin");
|
41 |
+
}else{
|
42 |
+
printf(__('The <b>%s</b> user does not exist. The user <b>%s</b> will be recreated with its current password with user level 10.','advanced-wp-reset'), "admin", esc_html($current_user->user_login));
|
43 |
+
}?>
|
44 |
+
</li>
|
45 |
+
<li><?php _e('After the reset, you will be redirected to the admin login page.','advanced-wp-reset'); ?></li>
|
46 |
+
</ul>
|
47 |
+
</div>
|
48 |
+
|
49 |
+
<h3 style="padding-top: 10px"><?php _e('Reset database','advanced-wp-reset'); ?></h3>
|
50 |
+
|
51 |
+
<p>
|
52 |
+
<?php
|
53 |
+
printf(__('Please type "<b>%s</b>" in the confirmation field below to confirm the reset and then click the reset button.','advanced-wp-reset'), "reset" );
|
54 |
+
?>
|
55 |
+
</p>
|
56 |
+
<form id="DBR_form" action="" method="post">
|
57 |
+
<?php wp_nonce_field('DBR_sample_nonce', 'DBR_sample_nonce'); ?>
|
58 |
+
<input id="DBR_reset_comfirmation" type="text" name="DBR_reset_comfirmation" value="" style="width:150px"/>
|
59 |
+
<p class="submit">
|
60 |
+
<input id="DBR_reset_button" name="DBR_reset_button" type="submit" class="button-primary DBR-button-reset" value="Reset database"/>
|
61 |
+
</p>
|
62 |
+
</form>
|
63 |
+
|
64 |
+
<div id="DBR_dialog" title="<?php _e('Reset database','advanced-wp-reset'); ?>" class="DBR-jquery-dialog">
|
65 |
+
<p class="DBR-box-warning">
|
66 |
+
<?php _e('You are about to reset your database. Any content will be lost! This operation is irreversible.','advanced-wp-reset'); ?>
|
67 |
+
</p>
|
68 |
+
<p>
|
69 |
+
<?php _e('Are you sure to continue?','advanced-wp-reset'); ?>
|
70 |
+
</p>
|
71 |
+
</div>
|
includes/sidebar.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div>
|
2 |
+
<h2>Advanced WP Reset <?php echo DBR_PLUGIN_VERSION; ?></h2>
|
3 |
+
<p class="DBR-donation-text"><?php _e('By making a donation, you help me supporting this plugin!', 'advanced-wp-reset'); ?></p>
|
4 |
+
<br/><a href="http://www.sigmaplugin.com/donation" target="_blank">
|
5 |
+
<p class="DBR-donation-gif"></p>
|
6 |
+
</a>
|
7 |
+
</div>
|
8 |
+
|
9 |
+
<br/>
|
10 |
+
|
11 |
+
<div class="DBR-grey-row">
|
12 |
+
<div class="DBR-float-left">
|
13 |
+
<span class="DBR-row-text"><?php _e('Please rate us', 'advanced-wp-reset'); ?></span>
|
14 |
+
</div>
|
15 |
+
<div class="DBR-float-right">
|
16 |
+
<a href="https://wordpress.org/support/view/plugin-reviews/advanced-wordpress-reset#postform" target="_blank">
|
17 |
+
<p class="DBR-support-us"></p>
|
18 |
+
</a>
|
19 |
+
</div>
|
20 |
+
</div>
|
21 |
+
|
22 |
+
<div class="DBR-white-row">
|
23 |
+
<div class="DBR-float-left">
|
24 |
+
<span class="DBR-row-text"><?php _e('Having issues?', 'advanced-wp-reset'); ?></span>
|
25 |
+
</div>
|
26 |
+
<div class="DBR-float-right">
|
27 |
+
<a class="DBR-sidebar-link" href="https://wordpress.org/support/plugin/advanced-wordpress-reset" target="_blank">
|
28 |
+
<?php echo __('Create a ticket', 'advanced-wp-reset'); ?>
|
29 |
+
</a>
|
30 |
+
</div>
|
31 |
+
</div>
|
32 |
+
|
33 |
+
<div class="DBR-grey-row">
|
34 |
+
<div class="DBR-float-left">
|
35 |
+
<span class="DBR-row-text"><?php _e('Developed by', 'advanced-wp-reset'); ?></span>
|
36 |
+
</div>
|
37 |
+
<div class="DBR-float-right">
|
38 |
+
<a class="DBR-sidebar-link" href="http://www.sigmaplugin.com" target="_blank">
|
39 |
+
- SigmaPlugin -
|
40 |
+
</a>
|
41 |
+
</div>
|
42 |
+
</div>
|
index.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
#Silence is golden.
|
3 |
+
?>
|
js/admin.js
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(function($) {
|
2 |
+
|
3 |
+
var $reset_warning = $("#DBR_dialog");
|
4 |
+
$reset_warning.dialog({
|
5 |
+
'dialogClass' : 'wp-dialog',
|
6 |
+
'modal' : true,
|
7 |
+
'width' : 500,
|
8 |
+
'autoOpen' : false,
|
9 |
+
'closeOnEscape' : true,
|
10 |
+
'buttons' : {
|
11 |
+
"Close": function() {
|
12 |
+
$(this).dialog('close');
|
13 |
+
},
|
14 |
+
"Continue": function() {
|
15 |
+
$('form[id="DBR_form"]').submit();
|
16 |
+
}
|
17 |
+
}
|
18 |
+
});
|
19 |
+
|
20 |
+
$("#DBR_reset_button").click(function(event) {
|
21 |
+
var $reset_confirmation_text = $('#DBR_reset_comfirmation').attr('value');
|
22 |
+
if($reset_confirmation_text == 'reset'){
|
23 |
+
event.preventDefault();
|
24 |
+
$reset_warning.dialog('open');
|
25 |
+
}
|
26 |
+
});
|
27 |
+
|
28 |
+
});
|
languages/advanced-wp-reset.pot
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: Advanced WordPress Reset\n"
|
4 |
+
"POT-Creation-Date: 2016-03-18 00:33+0000\n"
|
5 |
+
"PO-Revision-Date: 2016-03-18 00:33+0000\n"
|
6 |
+
"Last-Translator: \n"
|
7 |
+
"Language-Team: \n"
|
8 |
+
"Language: en\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.7\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 |
+
#: includes/reset.php:9
|
19 |
+
#, php-format
|
20 |
+
msgid "Please type the word \"<b>%s</b>\" correctly in the text box below."
|
21 |
+
msgstr ""
|
22 |
+
|
23 |
+
#: includes/reset.php:22
|
24 |
+
msgid "WARNING:"
|
25 |
+
msgstr ""
|
26 |
+
|
27 |
+
#: includes/reset.php:24
|
28 |
+
msgid ""
|
29 |
+
"The reset makes a fresh installation of your database. Therefore, ANY data "
|
30 |
+
"in your database will be lost."
|
31 |
+
msgstr ""
|
32 |
+
|
33 |
+
#: includes/reset.php:26
|
34 |
+
msgid "Please do not use this option if you want to keep your posts and pages."
|
35 |
+
msgstr ""
|
36 |
+
|
37 |
+
#: includes/reset.php:31
|
38 |
+
msgid ""
|
39 |
+
"The reset does not delete or modify any of your plugins/themes files or "
|
40 |
+
"server files."
|
41 |
+
msgstr ""
|
42 |
+
|
43 |
+
#: includes/reset.php:32
|
44 |
+
msgid ""
|
45 |
+
"All your plugins will be deactivated (including this one). You should "
|
46 |
+
"activate them manually after the reset."
|
47 |
+
msgstr ""
|
48 |
+
|
49 |
+
#: includes/reset.php:36
|
50 |
+
#, php-format
|
51 |
+
msgid ""
|
52 |
+
"The plugin has detected that the <b>%s</b> user exists. It will be recreated "
|
53 |
+
"with its current password."
|
54 |
+
msgstr ""
|
55 |
+
|
56 |
+
#: includes/reset.php:38
|
57 |
+
#, php-format
|
58 |
+
msgid ""
|
59 |
+
"The <b>%s</b> user does not exist. The user <b>%s</b> will be recreated with "
|
60 |
+
"its current password with user level 10."
|
61 |
+
msgstr ""
|
62 |
+
|
63 |
+
#: includes/reset.php:41
|
64 |
+
msgid "After the reset, you will be redirected to the admin login page."
|
65 |
+
msgstr ""
|
66 |
+
|
67 |
+
#: includes/reset.php:45 includes/reset.php:59
|
68 |
+
msgid "Reset database"
|
69 |
+
msgstr ""
|
70 |
+
|
71 |
+
#: includes/reset.php:49
|
72 |
+
#, php-format
|
73 |
+
msgid ""
|
74 |
+
"Please type \"<b>%s</b>\" in the confirmation field below to confirm the "
|
75 |
+
"reset and then click the reset button."
|
76 |
+
msgstr ""
|
77 |
+
|
78 |
+
#: includes/reset.php:61
|
79 |
+
msgid ""
|
80 |
+
"You are about to reset your database. Any content will be lost! This "
|
81 |
+
"operation is irreversible."
|
82 |
+
msgstr ""
|
83 |
+
|
84 |
+
#: includes/reset.php:64
|
85 |
+
msgid "Are you sure to continue?"
|
86 |
+
msgstr ""
|
87 |
+
|
88 |
+
#: includes/sidebar.php:3
|
89 |
+
msgid "By making a donation, you help me supporting this plugin!"
|
90 |
+
msgstr ""
|
91 |
+
|
92 |
+
#: includes/sidebar.php:13
|
93 |
+
msgid "Please rate us"
|
94 |
+
msgstr ""
|
95 |
+
|
96 |
+
#: includes/sidebar.php:24
|
97 |
+
msgid "Having issues?"
|
98 |
+
msgstr ""
|
99 |
+
|
100 |
+
#: includes/sidebar.php:28
|
101 |
+
msgid "Create a ticket"
|
102 |
+
msgstr ""
|
103 |
+
|
104 |
+
#: includes/sidebar.php:35
|
105 |
+
msgid "Developed by"
|
106 |
+
msgstr ""
|
screenshot-1.png
ADDED
Binary file
|