WP Reset – Fastest WordPress Reset Plugin - Version 1.77

Version Description

Download this release

Release Info

Developer WebFactory
Plugin Icon 128x128 WP Reset – Fastest WordPress Reset Plugin
Version 1.77
Comparing to
See all releases

Code changes from version 1.75 to 1.77

Files changed (8) hide show
  1. css/index.php +2 -0
  2. css/wp-reset.css +4 -0
  3. img/index.php +2 -0
  4. js/index.php +2 -0
  5. libs/index.php +2 -0
  6. readme.txt +8 -4
  7. wp-reset-cli.php +1 -1
  8. wp-reset.php +59 -12
css/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden
css/wp-reset.css CHANGED
@@ -193,6 +193,10 @@
193
  background: #ffffff;
194
  }
195
 
 
 
 
 
196
  .tools_page_wp-reset .plain-list {
197
  margin-top: 10px;
198
  list-style-type: circle;
193
  background: #ffffff;
194
  }
195
 
196
+ .tools_page_wp-reset input {
197
+ border-radius: 0;
198
+ }
199
+
200
  .tools_page_wp-reset .plain-list {
201
  margin-top: 10px;
202
  list-style-type: circle;
img/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden
js/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden
libs/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden
readme.txt CHANGED
@@ -1,14 +1,14 @@
1
- === WP Reset - Best WordPress Reset Plugin ===
2
  Tags: wordpress reset, reset database, reset wordpress database, reset, advanced wordpress reset, restart wordpress, clean wordpress, default wp, default wordpress, reset wp, wp reset, developer, wp-cli, webhooks, backup, database backup
3
  Contributors: WebFactory, wpreset, googlemapswidget, underconstructionpage
4
  Requires at least: 4.0
5
  Requires PHP: 5.2
6
- Tested up to: 5.3
7
- Stable tag: 1.75
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- WP Reset resets the whole site, or just the chosen parts, to the default values. It's safe to use with a built-in restore function.
12
 
13
  == Description ==
14
 
@@ -118,6 +118,10 @@ Or if needed, upload manually;
118
 
119
  == Changelog ==
120
 
 
 
 
 
121
  = v1.75 =
122
  * 2019/11/12
123
  * bug fixes
1
+ === WP Reset - Most Advanced WordPress Reset Tool ===
2
  Tags: wordpress reset, reset database, reset wordpress database, reset, advanced wordpress reset, restart wordpress, clean wordpress, default wp, default wordpress, reset wp, wp reset, developer, wp-cli, webhooks, backup, database backup
3
  Contributors: WebFactory, wpreset, googlemapswidget, underconstructionpage
4
  Requires at least: 4.0
5
  Requires PHP: 5.2
6
+ Tested up to: 5.4
7
+ Stable tag: 1.77
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ WP Reset resets the entire site or selected parts using advanced reset options to default values. 100% safe to use with built-in restore function.
12
 
13
  == Description ==
14
 
118
 
119
  == Changelog ==
120
 
121
+ = v1.77 =
122
+ * 2019/12/25
123
+ * minor bug fixes
124
+
125
  = v1.75 =
126
  * 2019/11/12
127
  * bug fixes
wp-reset-cli.php CHANGED
@@ -9,7 +9,7 @@
9
 
10
  // include only file
11
  if (!defined('ABSPATH')) {
12
- wp_die(__('Do not open this file directly.', 'wp-error'));
13
  }
14
 
15
 
9
 
10
  // include only file
11
  if (!defined('ABSPATH')) {
12
+ die('Do not open this file directly.');
13
  }
14
 
15
 
wp-reset.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Reset
4
  Plugin URI: https://wpreset.com/
5
  Description: Reset the entire site or just selected parts while reserving the option to undo by using snapshots.
6
- Version: 1.75
7
  Author: WebFactory Ltd
8
  Author URI: https://www.webfactoryltd.com/
9
  Text Domain: wp-reset
@@ -26,7 +26,7 @@
26
 
27
  // include only file
28
  if (!defined('ABSPATH')) {
29
- wp_die(__('Do not open this file directly.', 'wp-reset'));
30
  }
31
 
32
 
@@ -79,6 +79,7 @@ class WP_Reset
79
  add_action('admin_menu', array($this, 'admin_menu'));
80
  add_action('admin_init', array($this, 'do_all_actions'));
81
  add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
 
82
  add_action('wp_ajax_wp_reset_dismiss_notice', array($this, 'ajax_dismiss_notice'));
83
  add_action('wp_ajax_wp_reset_run_tool', array($this, 'ajax_run_tool'));
84
  add_action('wp_ajax_wp_reset_submit_survey', array($this, 'ajax_submit_survey'));
@@ -247,6 +248,35 @@ class WP_Reset
247
  } // ajax_dismiss_notice
248
 
249
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
250
  /**
251
  * Dismiss notice by adding it to dismissed_notices options array
252
  *
@@ -804,6 +834,7 @@ class WP_Reset
804
  $custom_tables = $this->get_custom_tables();
805
 
806
  foreach ($custom_tables as $tbl) {
 
807
  $wpdb->query('TRUNCATE TABLE ' . $tbl['name']);
808
  } // foreach
809
 
@@ -824,6 +855,7 @@ class WP_Reset
824
  $custom_tables = $this->get_custom_tables();
825
 
826
  foreach ($custom_tables as $tbl) {
 
827
  $wpdb->query('DROP TABLE IF EXISTS ' . $tbl['name']);
828
  } // foreach
829
 
@@ -1111,7 +1143,7 @@ class WP_Reset
1111
  return;
1112
  }
1113
 
1114
- if (!empty($_GET['wp-reset']) && stristr($_SERVER['HTTP_REFERER'], 'wp-reset')) {
1115
  add_action('admin_notices', array($this, 'notice_successful_reset'));
1116
  }
1117
 
@@ -1241,7 +1273,19 @@ class WP_Reset
1241
  {
1242
  global $current_user;
1243
 
1244
- echo '<div id="message" class="updated fade"><p>' . sprintf(__('<b>Site has been reset</b> to default settings. User "%s" was restored with the password unchanged. Open <a href="%s">WP Reset</a> to do another reset.', 'wp-reset'), $current_user->user_login, admin_url('tools.php?page=wp-reset')) . '</p></div>';
 
 
 
 
 
 
 
 
 
 
 
 
1245
  } // notice_successful_reset
1246
 
1247
 
@@ -1510,7 +1554,7 @@ class WP_Reset
1510
  echo '<div class="card notice-wrapper notice-info">';
1511
  echo '<h2>' . __('Please help us spread the word &amp; keep the plugin up-to-date', 'wp-reset') . '</h2>';
1512
  echo '<p>' . __('If you use &amp; enjoy WP Reset, <b>please rate it on WordPress.org</b>. It only takes a second and helps us keep the plugin maintained. Thank you!', 'wp-reset') . '</p>';
1513
- echo '<p><a class="button-primary button" title="' . __('Rate WP Reset', 'wp-reset') . '" target="_blank" href="https://wordpress.org/support/plugin/wp-reset/reviews/#new-post">' . __('Rate the plugin ★★★★★', 'wp-reset') . '</a> <a href="#" class="wpr-dismiss-notice dismiss-notice-rate" data-notice="rate">' . __('I\'ve already rated it', 'wp-reset') . '</a></p>';
1514
  echo '</div>';
1515
  $notice_shown = true;
1516
  }
@@ -1761,7 +1805,7 @@ class WP_Reset
1761
  echo '<div class="card">';
1762
  echo '<h4>' . __('What are Plugin &amp; Theme Collections?', 'wp-reset') . '</h4>';
1763
  echo '<p>' . __('A tool that\'s coming with WP Reset PRO that will <b>save hours &amp; hours of your precious time</b>! Have a set of plugins (and themes) that you install and activate after every reset? Or on every fresh WP installation? Well, no more clicking install &amp; active for ten minutes! Build the collection once and install it with one click as many times as needed.<br>WP Reset stores collections in the cloud so they\'re accessible on every site you build. You can use free plugins and themes from the official repo, and PRO ones by uploading a ZIP file. We\'ll safely store your license keys too, so you have everything in one place.', 'wp-reset') . '</p>';
1764
- echo '<p><b>Interested in collections and other PRO features?</b> Ping us <a href="https://twitter.com/webfactoryltd" target="_blank">@webfactoryltd</a> and be among the first users who will get PRO in early January 2020.</p>';
1765
  echo '</div>';
1766
  } // tab_collections
1767
 
@@ -2592,8 +2636,9 @@ class WP_Reset
2592
  *
2593
  * @return null
2594
  */
2595
- private function __clone()
2596
- { }
 
2597
 
2598
 
2599
  /**
@@ -2601,8 +2646,9 @@ class WP_Reset
2601
  *
2602
  * @return null
2603
  */
2604
- private function __sleep()
2605
- { }
 
2606
 
2607
 
2608
  /**
@@ -2610,8 +2656,9 @@ class WP_Reset
2610
  *
2611
  * @return null
2612
  */
2613
- private function __wakeup()
2614
- { }
 
2615
  } // WP_Reset class
2616
 
2617
 
3
  Plugin Name: WP Reset
4
  Plugin URI: https://wpreset.com/
5
  Description: Reset the entire site or just selected parts while reserving the option to undo by using snapshots.
6
+ Version: 1.77
7
  Author: WebFactory Ltd
8
  Author URI: https://www.webfactoryltd.com/
9
  Text Domain: wp-reset
26
 
27
  // include only file
28
  if (!defined('ABSPATH')) {
29
+ die('Do not open this file directly.');
30
  }
31
 
32
 
79
  add_action('admin_menu', array($this, 'admin_menu'));
80
  add_action('admin_init', array($this, 'do_all_actions'));
81
  add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
82
+ add_action('admin_action_wpr_dismiss_notice', array($this, 'action_dismiss_notice'));
83
  add_action('wp_ajax_wp_reset_dismiss_notice', array($this, 'ajax_dismiss_notice'));
84
  add_action('wp_ajax_wp_reset_run_tool', array($this, 'ajax_run_tool'));
85
  add_action('wp_ajax_wp_reset_submit_survey', array($this, 'ajax_submit_survey'));
248
  } // ajax_dismiss_notice
249
 
250
 
251
+ /**
252
+ * Dismiss notice via admin action
253
+ *
254
+ * @return null
255
+ */
256
+ function action_dismiss_notice()
257
+ {
258
+ if (false == wp_verify_nonce(@$_GET['_wpnonce'], 'wpr_dismiss_notice')) {
259
+ wp_die('Please reload the page and try again.');
260
+ }
261
+
262
+ if (empty($_GET['notice'])) {
263
+ wp_safe_redirect(admin_url());
264
+ exit;
265
+ }
266
+
267
+ $notice_name = trim(@$_GET['notice']);
268
+ $this->dismiss_notice($notice_name);
269
+
270
+ if (!empty($_GET['redirect'])) {
271
+ wp_safe_redirect($_GET['redirect']);
272
+ } else {
273
+ wp_safe_redirect(admin_url());
274
+ }
275
+
276
+ exit;
277
+ } // action_dismiss_notice
278
+
279
+
280
  /**
281
  * Dismiss notice by adding it to dismissed_notices options array
282
  *
834
  $custom_tables = $this->get_custom_tables();
835
 
836
  foreach ($custom_tables as $tbl) {
837
+ $wpdb->query('SET foreign_key_checks = 0');
838
  $wpdb->query('TRUNCATE TABLE ' . $tbl['name']);
839
  } // foreach
840
 
855
  $custom_tables = $this->get_custom_tables();
856
 
857
  foreach ($custom_tables as $tbl) {
858
+ $wpdb->query('SET foreign_key_checks = 0');
859
  $wpdb->query('DROP TABLE IF EXISTS ' . $tbl['name']);
860
  } // foreach
861
 
1143
  return;
1144
  }
1145
 
1146
+ if (!empty($_GET['wp-reset']) && $_GET['wp-reset'] == 'success') {
1147
  add_action('admin_notices', array($this, 'notice_successful_reset'));
1148
  }
1149
 
1273
  {
1274
  global $current_user;
1275
 
1276
+ echo '<div style="padding: 15px; display: inline-block; font-size: 14px;" id="message" class="updated"><p style="font-size: 14px;">' . sprintf(__('<b>Site has been successfully reset to default settings.</b><br>User "%s" was restored with the password unchanged. Open <a href="%s">WP Reset</a> to do another reset.', 'wp-reset'), $current_user->user_login, admin_url('tools.php?page=wp-reset')) . '</p>';
1277
+
1278
+ if (false == $this->get_dismissed_notices('rate')) {
1279
+ $dismiss_url = add_query_arg(array('action' => 'wpr_dismiss_notice', 'notice' => 'rate', 'redirect' => urlencode($_SERVER['REQUEST_URI'])), admin_url('admin.php'));
1280
+ $dismiss_url = wp_nonce_url($dismiss_url, 'wpr_dismiss_notice');
1281
+
1282
+ echo '<p style="font-size: 14px;">';
1283
+ echo 'If WP Reset helped you please rate it so we can continue supporting it and helping others. Thank you!<br>';
1284
+ echo '<a style="margin-top: 5px;" class="button button-secondary" href="https://wordpress.org/support/plugin/wp-reset/reviews/?filter=5#new-post" target="_blank">You deserve it, I\'ll rate it!</a> &nbsp; &nbsp; <a href="' . $dismiss_url . '">I already rated it</a>';
1285
+ echo '</p>';
1286
+ }
1287
+
1288
+ echo '</div>';
1289
  } // notice_successful_reset
1290
 
1291
 
1554
  echo '<div class="card notice-wrapper notice-info">';
1555
  echo '<h2>' . __('Please help us spread the word &amp; keep the plugin up-to-date', 'wp-reset') . '</h2>';
1556
  echo '<p>' . __('If you use &amp; enjoy WP Reset, <b>please rate it on WordPress.org</b>. It only takes a second and helps us keep the plugin maintained. Thank you!', 'wp-reset') . '</p>';
1557
+ echo '<p><a class="button-primary button" title="' . __('Rate WP Reset', 'wp-reset') . '" target="_blank" href="https://wordpress.org/support/plugin/wp-reset/reviews/?filter=5#new-post">' . __('Rate the plugin ★★★★★', 'wp-reset') . '</a> <a href="#" class="wpr-dismiss-notice dismiss-notice-rate" data-notice="rate">' . __('I\'ve already rated it', 'wp-reset') . '</a></p>';
1558
  echo '</div>';
1559
  $notice_shown = true;
1560
  }
1805
  echo '<div class="card">';
1806
  echo '<h4>' . __('What are Plugin &amp; Theme Collections?', 'wp-reset') . '</h4>';
1807
  echo '<p>' . __('A tool that\'s coming with WP Reset PRO that will <b>save hours &amp; hours of your precious time</b>! Have a set of plugins (and themes) that you install and activate after every reset? Or on every fresh WP installation? Well, no more clicking install &amp; active for ten minutes! Build the collection once and install it with one click as many times as needed.<br>WP Reset stores collections in the cloud so they\'re accessible on every site you build. You can use free plugins and themes from the official repo, and PRO ones by uploading a ZIP file. We\'ll safely store your license keys too, so you have everything in one place.', 'wp-reset') . '</p>';
1808
+ echo '<p class="textcenter"><a class="button button-primary" href="https://wpreset.com/ltd-sale-martech-wise/" target="_blank"><b>Reserve your copy of WP Reset PRO! It launches on January 13th!</b></a></p>';
1809
  echo '</div>';
1810
  } // tab_collections
1811
 
2636
  *
2637
  * @return null
2638
  */
2639
+ function __clone()
2640
+ {
2641
+ }
2642
 
2643
 
2644
  /**
2646
  *
2647
  * @return null
2648
  */
2649
+ function __sleep()
2650
+ {
2651
+ }
2652
 
2653
 
2654
  /**
2656
  *
2657
  * @return null
2658
  */
2659
+ function __wakeup()
2660
+ {
2661
+ }
2662
  } // WP_Reset class
2663
 
2664