WP Reset – Fastest WordPress Reset Plugin - Version 1.95

Version Description

Download this release

Release Info

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

Code changes from version 1.93 to 1.95

css/font/fontello.svg CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0" standalone="no"?>
2
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
  <svg xmlns="http://www.w3.org/2000/svg">
4
- <metadata>Copyright (C) 2021 by original authors @ fontello.com</metadata>
5
  <defs>
6
  <font id="fontello" horiz-adv-x="1000" >
7
  <font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
1
  <?xml version="1.0" standalone="no"?>
2
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
  <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Copyright (C) 2022 by original authors @ fontello.com</metadata>
5
  <defs>
6
  <font id="fontello" horiz-adv-x="1000" >
7
  <font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
css/wp-reset.css CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * WP Reset
3
  * https://wpreset.com/
4
- * (c) WebFactory Ltd, 2017-2021
5
  */
6
 
7
  body.tools_page_wp-reset {
@@ -29,8 +29,7 @@ body.tools_page_wp-reset {
29
  }
30
 
31
  .tools_page_wp-reset #loading-tabs {
32
- padding-top: 80px;
33
- text-align: center;
34
  }
35
 
36
  .tools_page_wp-reset #loading-tabs img {
@@ -48,7 +47,7 @@ body.tools_page_wp-reset {
48
  }
49
 
50
  .wpr-container {
51
- margin: 0 auto;
52
  max-width: 100%;
53
  width: 910px;
54
  }
@@ -60,14 +59,17 @@ body.tools_page_wp-reset {
60
 
61
  .tools_page_wp-reset nav {
62
  background: #ffffff;
63
- padding: 0;
64
- margin: 0 0 35px 0;
65
- border-top: 1px solid #e5e5e5;
66
- border-bottom: 1px solid #e5e5e5;
 
 
67
  }
68
 
69
  #wpr-content {
70
- padding: 0 0 35px 0;
 
71
  }
72
 
73
  #wpfooter {
@@ -333,6 +335,10 @@ body.tools_page_wp-reset {
333
  animation: spin 1.5s linear infinite;
334
  }
335
 
 
 
 
 
336
  .tools_page_wp-reset .notice-error {
337
  border-top-color: #dd3036;
338
  border-top-width: 3px;
@@ -678,6 +684,7 @@ body.tools_page_wp-reset {
678
  padding-bottom: 0;
679
  width: 100%;
680
  box-sizing: border-box;
 
681
  }
682
 
683
  .tools_page_wp-reset .ui-state-hover a,
@@ -1090,3 +1097,42 @@ li .pro-feature {
1090
  transform: rotate(360deg);
1091
  }
1092
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  /**
2
  * WP Reset
3
  * https://wpreset.com/
4
+ * (c) WebFactory Ltd, 2017-2022
5
  */
6
 
7
  body.tools_page_wp-reset {
29
  }
30
 
31
  .tools_page_wp-reset #loading-tabs {
32
+ padding: 80px 0 0 450px;
 
33
  }
34
 
35
  .tools_page_wp-reset #loading-tabs img {
47
  }
48
 
49
  .wpr-container {
50
+ margin: 0 20px;
51
  max-width: 100%;
52
  width: 910px;
53
  }
59
 
60
  .tools_page_wp-reset nav {
61
  background: #ffffff;
62
+ padding: 0 20px;
63
+ margin: 0 20px;
64
+ border: none;
65
+ max-width: 100%;
66
+ width: 910px;
67
+ box-sizing: border-box;
68
  }
69
 
70
  #wpr-content {
71
+ padding: 20px;
72
+ background: white;
73
  }
74
 
75
  #wpfooter {
335
  animation: spin 1.5s linear infinite;
336
  }
337
 
338
+ .notice-wrapper {
339
+ margin-top: 35px;
340
+ }
341
+
342
  .tools_page_wp-reset .notice-error {
343
  border-top-color: #dd3036;
344
  border-top-width: 3px;
684
  padding-bottom: 0;
685
  width: 100%;
686
  box-sizing: border-box;
687
+ margin-left: -20px;
688
  }
689
 
690
  .tools_page_wp-reset .ui-state-hover a,
1097
  transform: rotate(360deg);
1098
  }
1099
  }
1100
+
1101
+ #wpfssl-ad {
1102
+ border: 3px solid #42982e;
1103
+ min-width: 280px;
1104
+ max-width: 400px;
1105
+ padding: 10px 20px;
1106
+ background: white;
1107
+ position: absolute;
1108
+ top: 75px;
1109
+ left: 950px;
1110
+ }
1111
+
1112
+ @media screen and (max-width: 1460px) {
1113
+ #wpfssl-ad {
1114
+ display: none !important;
1115
+ }
1116
+ }
1117
+
1118
+ #wpfssl-ad a.button {
1119
+ padding: 11px 20px;
1120
+ color: white;
1121
+ background: #42982e;
1122
+ font-weight: 600;
1123
+ border: none;
1124
+ line-height: 1.5;
1125
+ height: auto;
1126
+ margin-bottom: 10px;
1127
+ white-space: normal;
1128
+ max-width: 90%;
1129
+ }
1130
+
1131
+ #wpfssl-ad a.button:hover,
1132
+ #wpfssl-ad a.button:active,
1133
+ #wpfssl-ad a.button:focus {
1134
+ box-shadow: 0px 0px 10px 0px rgb(50 138 210 / 52%);
1135
+ background: #42982e;
1136
+ color: white;
1137
+ border: none;
1138
+ }
img/wp-force-ssl-logo.png ADDED
Binary file
js/wp-reset-pointers.js CHANGED
@@ -1,7 +1,7 @@
1
  /*
2
  * WP Reset
3
  * Backend GUI pointers
4
- * (c) Web factory Ltd, 2017 - 2021
5
  */
6
 
7
  jQuery(document).ready(function($){
1
  /*
2
  * WP Reset
3
  * Backend GUI pointers
4
+ * (c) Web factory Ltd, 2017 - 2022
5
  */
6
 
7
  jQuery(document).ready(function($){
js/wp-reset.js CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * WP Reset
3
  * https://wpreset.com/
4
- * (c) WebFactory Ltd, 2017-2021
5
  */
6
 
7
  jQuery(document).ready(function ($) {
@@ -9,7 +9,7 @@ jQuery(document).ready(function ($) {
9
  $('#wp-reset-tabs')
10
  .tabs({
11
  create: function () {
12
- $('#loading-tabs').remove();
13
  },
14
  activate: function (event, ui) {
15
  localStorage.setItem('wp-reset-tabs', $('#wp-reset-tabs').tabs('option', 'active'));
@@ -1337,6 +1337,31 @@ jQuery(document).ready(function ($) {
1337
  },
1338
  });
1339
  } //run collection ajax
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1340
  }); // onload
1341
 
1342
  function wpr_clear_local(clear_cookies, clear_storage) {
1
  /**
2
  * WP Reset
3
  * https://wpreset.com/
4
+ * (c) WebFactory Ltd, 2017-2022
5
  */
6
 
7
  jQuery(document).ready(function ($) {
9
  $('#wp-reset-tabs')
10
  .tabs({
11
  create: function () {
12
+ $('#loading-tabs').remove();
13
  },
14
  activate: function (event, ui) {
15
  localStorage.setItem('wp-reset-tabs', $('#wp-reset-tabs').tabs('option', 'active'));
1337
  },
1338
  });
1339
  } //run collection ajax
1340
+
1341
+ function wpr_position_wpfssl_ad() {
1342
+ pos_left = Math.round($('#wp_reset_form nav').width()) + 80;
1343
+ pos_top = Math.round($('#wp_reset_form nav').offset().top) - 30;
1344
+
1345
+ $('#wpfssl-ad').css('top', pos_top + 'px').css('left', pos_left + 'px');
1346
+ $('#wpfssl-ad').show();
1347
+ } // wpr_position_wpfssl_ad
1348
+
1349
+ wpr_position_wpfssl_ad();
1350
+ $(window).on('resize', function() {
1351
+ wpr_position_wpfssl_ad();
1352
+ })
1353
+
1354
+ $('.install-wpfssl').on('click',function(e){
1355
+ if (!confirm('The free WP Force SSL plugin will be installed & activated from the official WordPress repository.')) {
1356
+ return;
1357
+ }
1358
+
1359
+ jQuery('body').append('<div style="width:550px;height:450px; position:fixed;top:10%;left:50%;margin-left:-275px; color:#444; background-color: #fbfbfb;border:1px solid #DDD; border-radius:4px;box-shadow: 0px 0px 0px 4000px rgba(0, 0, 0, 0.85);z-index: 9999999;"><iframe src="' + wp_reset.wpfssl_install_url + '" style="width:100%;height:100%;border:none;" /></div>');
1360
+ jQuery('#wpwrap').css('pointer-events', 'none');
1361
+
1362
+ e.preventDefault();
1363
+ return false;
1364
+ });
1365
  }); // onload
1366
 
1367
  function wpr_clear_local(clear_cookies, clear_storage) {
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
- === WP Reset - Most Advanced Reset Tool for WordPress ===
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, backup, database backup
3
  Contributors: WebFactory
4
  Requires at least: 4.0
5
  Requires PHP: 5.2
6
- Tested up to: 5.8
7
- Stable tag: 1.93
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -12,7 +12,7 @@ WP Reset resets the entire site or selected parts using advanced reset options t
12
 
13
  == Description ==
14
 
15
- <a href="https://wpreset.com/">WP Reset</a> quickly resets the site's database to the default installation values without modifying any files. It deletes all customizations and content, or just chosen parts like theme settings. WP Reset is fast and safe to use thanks to the built-in snapshots which provide 1-click restore functionality. It has multiple fail-safe mechanisms so you can never accidentally lose data. WP Reset is extremely helpful for plugin and theme developers. It **speeds up testing & debugging** by providing a quick way to reset settings and re-test code. It's the only WP development tool for non-developers that enables advanced reset.
16
 
17
  https://youtu.be/qMnkCW2PFoI?rel=0
18
 
@@ -87,6 +87,7 @@ WP Reset has yet to be completely tested with multisite! Please be careful when
87
 
88
  * French - <a href="https://www.infrenchtranslation.com/">Jeff Inho</a>
89
 
 
90
 
91
  == Installation ==
92
 
@@ -115,6 +116,12 @@ Or if needed, upload manually;
115
 
116
  == Changelog ==
117
 
 
 
 
 
 
 
118
  = v1.93 =
119
  * 2021/08/01
120
  * reactivate plugins fix
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, backup, database backup
3
  Contributors: WebFactory
4
  Requires at least: 4.0
5
  Requires PHP: 5.2
6
+ Tested up to: 6.1
7
+ Stable tag: 1.95
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
12
 
13
  == Description ==
14
 
15
+ <a href="https://wpreset.com/">WP Reset</a> quickly resets the site's database to the default installation values without modifying any files. It deletes all customizations and content, or just chosen parts like theme settings. WordPress Reset is fast and safe to use thanks to the built-in snapshots which provide 1-click restore functionality. It has multiple fail-safe mechanisms so you can never accidentally lose data. WP Reset is extremely helpful for plugin and theme developers. It **speeds up testing & debugging** by providing a quick way to reset settings and re-test code. It's the only WP development tool for non-developers that enables advanced reset.
16
 
17
  https://youtu.be/qMnkCW2PFoI?rel=0
18
 
87
 
88
  * French - <a href="https://www.infrenchtranslation.com/">Jeff Inho</a>
89
 
90
+ If you're having problems with SSL or HTTPS try our free <a href="https://wordpress.org/plugins/wp-force-ssl/">WP Force SSL</a> plugin. It's a great plugin to enable SSL or install SSL.
91
 
92
  == Installation ==
93
 
116
 
117
  == Changelog ==
118
 
119
+ = v1.95 =
120
+ * 2022/01/06
121
+ * security fixes
122
+ * fixed a CLI bug
123
+ * added ad for our WP Force SSL plugin
124
+
125
  = v1.93 =
126
  * 2021/08/01
127
  * reactivate plugins fix
wf-flyout/config.php CHANGED
@@ -13,6 +13,7 @@ $config['custom_css'] = '#wf-flyout .ucp-icon .wff-icon img { max-width: 70%; }
13
 
14
  $config['menu_items'] = array(
15
  array('href' => 'https://wpreset.com/?ref=wff-wp-reset', 'target' => '_blank', 'label' => 'Get WP Reset PRO with 50% off', 'icon' => 'wp-reset.png'),
 
16
  array('href' => 'https://wp301redirects.com/?ref=wff-wp-reset&coupon=50off', 'label' => 'Get WP 301 Redirects PRO with 50% off', 'icon' => '301-logo.png', 'class' => 'wp301-icon'),
17
  array('href' => 'https://underconstructionpage.com/?ref=wff-wp-reset&coupon=welcome', 'target' => '_blank', 'label' => 'Create the perfect Under Construction Page', 'icon' => 'ucp.png', 'class' => 'ucp-icon'),
18
  array('href' => 'https://wpsticky.com/?ref=wff-wp-reset', 'target' => '_blank', 'label' => 'Make any element sticky with WP Sticky', 'icon' => 'dashicons-admin-post'),
13
 
14
  $config['menu_items'] = array(
15
  array('href' => 'https://wpreset.com/?ref=wff-wp-reset', 'target' => '_blank', 'label' => 'Get WP Reset PRO with 50% off', 'icon' => 'wp-reset.png'),
16
+ array('href' => 'https://wpforcessl.com/?ref=wff-wp-reset', 'label' => 'Fix all SSL problems &amp; monitor site in real-time', 'icon' => 'wp-ssl.png', 'class' => 'wpfssl-icon'),
17
  array('href' => 'https://wp301redirects.com/?ref=wff-wp-reset&coupon=50off', 'label' => 'Get WP 301 Redirects PRO with 50% off', 'icon' => '301-logo.png', 'class' => 'wp301-icon'),
18
  array('href' => 'https://underconstructionpage.com/?ref=wff-wp-reset&coupon=welcome', 'target' => '_blank', 'label' => 'Create the perfect Under Construction Page', 'icon' => 'ucp.png', 'class' => 'ucp-icon'),
19
  array('href' => 'https://wpsticky.com/?ref=wff-wp-reset', 'target' => '_blank', 'label' => 'Make any element sticky with WP Sticky', 'icon' => 'dashicons-admin-post'),
wf-flyout/icons/wp-ssl.png ADDED
Binary file
wf-flyout/wf-flyout.css CHANGED
@@ -1,6 +1,6 @@
1
  /**
2
  * Universal fly-out menu for WebFactory plugins
3
- * (c) WebFactory Ltd, 2021
4
  */
5
 
6
  #wf-flyout {
1
  /**
2
  * Universal fly-out menu for WebFactory plugins
3
+ * (c) WebFactory Ltd, 2022
4
  */
5
 
6
  #wf-flyout {
wf-flyout/wf-flyout.js CHANGED
@@ -1,6 +1,6 @@
1
  /**
2
  * Universal fly-out menu for WebFactory plugins
3
- * (c) WebFactory Ltd, 2021
4
  */
5
 
6
  jQuery(document).ready(function ($) {
1
  /**
2
  * Universal fly-out menu for WebFactory plugins
3
+ * (c) WebFactory Ltd, 2022
4
  */
5
 
6
  jQuery(document).ready(function ($) {
wf-flyout/wf-flyout.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Universal fly-out menu for WebFactory plugins
4
- * (c) WebFactory Ltd, 2021
5
  */
6
 
7
 
@@ -111,7 +111,7 @@ if (false == class_exists('wf_flyout')) {
111
  $out .= sanitize_text_field($this->config['custom_css']);
112
  $out .= '</style>';
113
 
114
- echo $out;
115
  } // admin_head
116
 
117
 
@@ -160,7 +160,7 @@ if (false == class_exists('wf_flyout')) {
160
 
161
  $out .= '</div>'; // #wf-flyout
162
 
163
- echo $out;
164
  } // admin_footer
165
  } // wf_flyout
166
  } // if class exists
1
  <?php
2
  /**
3
  * Universal fly-out menu for WebFactory plugins
4
+ * (c) WebFactory Ltd, 2022
5
  */
6
 
7
 
111
  $out .= sanitize_text_field($this->config['custom_css']);
112
  $out .= '</style>';
113
 
114
+ WP_Reset_Utility::wp_kses_wf($out);
115
  } // admin_head
116
 
117
 
160
 
161
  $out .= '</div>'; // #wf-flyout
162
 
163
+ WP_Reset_Utility::wp_kses_wf($out);
164
  } // admin_footer
165
  } // wf_flyout
166
  } // if class exists
wp-reset-cli.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * WP Reset
5
  * https://wpreset.com/
6
- * (c) WebFactory Ltd, 2017-2021
7
  */
8
 
9
 
@@ -240,7 +240,7 @@ class WP_Reset_CLI extends WP_CLI_Command
240
  } else {
241
  $tmp['info'] .= 'no custom tables';
242
  }
243
- $tmp['info'] .= ' totaling ' . $wp_reset->format_size($ss['tbl_size']) . ' in ' . number_format($ss['tbl_rows']) . ' rows';
244
 
245
  $table[] = $tmp;
246
  } // foreach
3
  /**
4
  * WP Reset
5
  * https://wpreset.com/
6
+ * (c) WebFactory Ltd, 2017-2022
7
  */
8
 
9
 
240
  } else {
241
  $tmp['info'] .= 'no custom tables';
242
  }
243
+ $tmp['info'] .= ' totaling ' . WP_Reset_Utility::format_size($ss['tbl_size']) . ' in ' . number_format($ss['tbl_rows']) . ' rows';
244
 
245
  $table[] = $tmp;
246
  } // foreach
wp-reset-utility.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * WP Reset
4
  * Utility & Helper functions
5
- * (c) WebFactory Ltd, 2015 - 2021
6
  */
7
 
8
  // include only file
@@ -77,7 +77,7 @@ class WP_Reset_Utility
77
  }
78
 
79
  if ($output) {
80
- echo $out;
81
  } else {
82
  return $out;
83
  }
@@ -118,4 +118,283 @@ class WP_Reset_Utility
118
  return ' totaling ' . self::format_size($tbl_size) . ' in ' . number_format($tbl_rows) . ' rows.';
119
  } // get_table_details
120
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  } // WP_Reset_Utility
2
  /*
3
  * WP Reset
4
  * Utility & Helper functions
5
+ * (c) WebFactory Ltd, 2015 - 2022
6
  */
7
 
8
  // include only file
77
  }
78
 
79
  if ($output) {
80
+ WP_Reset_Utility::wp_kses_wf($out);
81
  } else {
82
  return $out;
83
  }
118
  return ' totaling ' . self::format_size($tbl_size) . ' in ' . number_format($tbl_rows) . ' rows.';
119
  } // get_table_details
120
 
121
+ static function wp_kses_wf($html)
122
+ {
123
+ add_filter('safe_style_css', function ($styles) {
124
+ $styles_wf = array(
125
+ 'text-align',
126
+ 'margin',
127
+ 'color',
128
+ 'float',
129
+ 'border',
130
+ 'background',
131
+ 'background-color',
132
+ 'border-bottom',
133
+ 'border-bottom-color',
134
+ 'border-bottom-style',
135
+ 'border-bottom-width',
136
+ 'border-collapse',
137
+ 'border-color',
138
+ 'border-left',
139
+ 'border-left-color',
140
+ 'border-left-style',
141
+ 'border-left-width',
142
+ 'border-right',
143
+ 'border-right-color',
144
+ 'border-right-style',
145
+ 'border-right-width',
146
+ 'border-spacing',
147
+ 'border-style',
148
+ 'border-top',
149
+ 'border-top-color',
150
+ 'border-top-style',
151
+ 'border-top-width',
152
+ 'border-width',
153
+ 'caption-side',
154
+ 'clear',
155
+ 'cursor',
156
+ 'direction',
157
+ 'font',
158
+ 'font-family',
159
+ 'font-size',
160
+ 'font-style',
161
+ 'font-variant',
162
+ 'font-weight',
163
+ 'height',
164
+ 'letter-spacing',
165
+ 'line-height',
166
+ 'margin-bottom',
167
+ 'margin-left',
168
+ 'margin-right',
169
+ 'margin-top',
170
+ 'overflow',
171
+ 'padding',
172
+ 'padding-bottom',
173
+ 'padding-left',
174
+ 'padding-right',
175
+ 'padding-top',
176
+ 'text-decoration',
177
+ 'text-indent',
178
+ 'vertical-align',
179
+ 'width',
180
+ 'display',
181
+ );
182
+
183
+ foreach ($styles_wf as $style_wf) {
184
+ $styles[] = $style_wf;
185
+ }
186
+ return $styles;
187
+ });
188
+
189
+ $allowed_tags = wp_kses_allowed_html('post');
190
+ $allowed_tags['input'] = array(
191
+ 'type' => true,
192
+ 'style' => true,
193
+ 'class' => true,
194
+ 'id' => true,
195
+ 'checked' => true,
196
+ 'disabled' => true,
197
+ 'name' => true,
198
+ 'size' => true,
199
+ 'placeholder' => true,
200
+ 'value' => true,
201
+ 'data-*' => true,
202
+ 'size' => true,
203
+ 'disabled' => true
204
+ );
205
+
206
+ $allowed_tags['textarea'] = array(
207
+ 'type' => true,
208
+ 'style' => true,
209
+ 'class' => true,
210
+ 'id' => true,
211
+ 'checked' => true,
212
+ 'disabled' => true,
213
+ 'name' => true,
214
+ 'size' => true,
215
+ 'placeholder' => true,
216
+ 'value' => true,
217
+ 'data-*' => true,
218
+ 'cols' => true,
219
+ 'rows' => true,
220
+ 'disabled' => true
221
+ );
222
+
223
+ $allowed_tags['select'] = array(
224
+ 'type' => true,
225
+ 'style' => true,
226
+ 'class' => true,
227
+ 'id' => true,
228
+ 'checked' => true,
229
+ 'disabled' => true,
230
+ 'name' => true,
231
+ 'size' => true,
232
+ 'placeholder' => true,
233
+ 'value' => true,
234
+ 'data-*' => true,
235
+ 'multiple' => true,
236
+ 'disabled' => true
237
+ );
238
+
239
+ $allowed_tags['option'] = array(
240
+ 'type' => true,
241
+ 'style' => true,
242
+ 'class' => true,
243
+ 'id' => true,
244
+ 'checked' => true,
245
+ 'disabled' => true,
246
+ 'name' => true,
247
+ 'size' => true,
248
+ 'placeholder' => true,
249
+ 'value' => true,
250
+ 'selected' => true,
251
+ 'data-*' => true
252
+ );
253
+ $allowed_tags['optgroup'] = array(
254
+ 'type' => true,
255
+ 'style' => true,
256
+ 'class' => true,
257
+ 'id' => true,
258
+ 'checked' => true,
259
+ 'disabled' => true,
260
+ 'name' => true,
261
+ 'size' => true,
262
+ 'placeholder' => true,
263
+ 'value' => true,
264
+ 'selected' => true,
265
+ 'data-*' => true,
266
+ 'label' => true
267
+ );
268
+
269
+ $allowed_tags['a'] = array(
270
+ 'href' => true,
271
+ 'data-*' => true,
272
+ 'class' => true,
273
+ 'style' => true,
274
+ 'id' => true,
275
+ 'target' => true,
276
+ 'data-*' => true,
277
+ 'role' => true,
278
+ 'aria-controls' => true,
279
+ 'aria-selected' => true,
280
+ 'disabled' => true
281
+ );
282
+
283
+ $allowed_tags['div'] = array(
284
+ 'style' => true,
285
+ 'class' => true,
286
+ 'id' => true,
287
+ 'data-*' => true,
288
+ 'role' => true,
289
+ 'aria-labelledby' => true,
290
+ 'value' => true,
291
+ 'aria-modal' => true,
292
+ 'tabindex' => true
293
+ );
294
+
295
+ $allowed_tags['li'] = array(
296
+ 'style' => true,
297
+ 'class' => true,
298
+ 'id' => true,
299
+ 'data-*' => true,
300
+ 'role' => true,
301
+ 'aria-labelledby' => true,
302
+ 'value' => true,
303
+ 'aria-modal' => true,
304
+ 'tabindex' => true
305
+ );
306
+
307
+ $allowed_tags['span'] = array(
308
+ 'style' => true,
309
+ 'class' => true,
310
+ 'id' => true,
311
+ 'data-*' => true,
312
+ 'aria-hidden' => true
313
+ );
314
+
315
+ $allowed_tags['style'] = array(
316
+ 'class' => true,
317
+ 'id' => true,
318
+ 'type' => true
319
+ );
320
+
321
+ $allowed_tags['form'] = array(
322
+ 'style' => true,
323
+ 'class' => true,
324
+ 'id' => true,
325
+ 'method' => true,
326
+ 'action' => true,
327
+ 'data-*' => true
328
+ );
329
+
330
+ echo wp_kses($html, $allowed_tags);
331
+
332
+ add_filter('safe_style_css', function ($styles) {
333
+ $styles_wf = array(
334
+ 'text-align',
335
+ 'margin',
336
+ 'color',
337
+ 'float',
338
+ 'border',
339
+ 'background',
340
+ 'background-color',
341
+ 'border-bottom',
342
+ 'border-bottom-color',
343
+ 'border-bottom-style',
344
+ 'border-bottom-width',
345
+ 'border-collapse',
346
+ 'border-color',
347
+ 'border-left',
348
+ 'border-left-color',
349
+ 'border-left-style',
350
+ 'border-left-width',
351
+ 'border-right',
352
+ 'border-right-color',
353
+ 'border-right-style',
354
+ 'border-right-width',
355
+ 'border-spacing',
356
+ 'border-style',
357
+ 'border-top',
358
+ 'border-top-color',
359
+ 'border-top-style',
360
+ 'border-top-width',
361
+ 'border-width',
362
+ 'caption-side',
363
+ 'clear',
364
+ 'cursor',
365
+ 'direction',
366
+ 'font',
367
+ 'font-family',
368
+ 'font-size',
369
+ 'font-style',
370
+ 'font-variant',
371
+ 'font-weight',
372
+ 'height',
373
+ 'letter-spacing',
374
+ 'line-height',
375
+ 'margin-bottom',
376
+ 'margin-left',
377
+ 'margin-right',
378
+ 'margin-top',
379
+ 'overflow',
380
+ 'padding',
381
+ 'padding-bottom',
382
+ 'padding-left',
383
+ 'padding-right',
384
+ 'padding-top',
385
+ 'text-decoration',
386
+ 'text-indent',
387
+ 'vertical-align',
388
+ 'width'
389
+ );
390
+
391
+ foreach ($styles_wf as $style_wf) {
392
+ if (($key = array_search($style_wf, $styles)) !== false) {
393
+ unset($styles[$key]);
394
+ }
395
+ }
396
+ return $styles;
397
+ });
398
+ }
399
+
400
  } // WP_Reset_Utility
wp-reset.php CHANGED
@@ -3,15 +3,15 @@
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.93
7
  Requires at least: 4.0
8
  Requires PHP: 5.2
9
- Tested up to: 5.8
10
  Author: WebFactory Ltd
11
  Author URI: https://www.webfactoryltd.com/
12
  Text Domain: wp-reset
13
 
14
- Copyright 2015 - 2021 WebFactory Ltd (email: wpreset@webfactoryltd.com)
15
 
16
  This program is free software; you can redistribute it and/or modify
17
  it under the terms of the GNU General Public License, version 2, as
@@ -106,6 +106,7 @@ class WP_Reset
106
  add_action('wp_ajax_wp_reset_dismiss_notice', array($this, 'ajax_dismiss_notice'));
107
  add_action('wp_ajax_wp_reset_run_tool', array($this, 'ajax_run_tool'));
108
  add_action('admin_print_scripts', array($this, 'remove_admin_notices'));
 
109
 
110
  add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'plugin_action_links'));
111
  add_filter('plugin_row_meta', array($this, 'plugin_meta_links'), 10, 2);
@@ -370,6 +371,7 @@ class WP_Reset
370
  'documented_error' => __('An error has occurred.', 'wp-reset'),
371
  'plugin_name' => __('WP Reset', 'wp-reset'),
372
  'settings_url' => admin_url('tools.php?page=wp-reset'),
 
373
  'icon_url' => $this->plugin_url . 'img/wp-reset-icon.png',
374
  'invalid_confirmation' => __('Please type "reset" in the confirmation field.', 'wp-reset'),
375
  'invalid_confirmation_title' => __('Invalid confirmation', 'wp-reset'),
@@ -1109,7 +1111,7 @@ class WP_Reset
1109
  wp_clear_auth_cookie();
1110
  wp_set_auth_cookie($user_id);
1111
 
1112
- wp_redirect(admin_url() . '?wp-reset=success');
1113
  exit;
1114
  }
1115
  } // do_reinstall
@@ -1467,6 +1469,15 @@ class WP_Reset
1467
  echo '</div>'; // wp-reset-tabs
1468
 
1469
  echo '</form>';
 
 
 
 
 
 
 
 
 
1470
  echo '</div>'; // wrap
1471
  } // plugin_page
1472
 
@@ -1532,7 +1543,7 @@ class WP_Reset
1532
  global $current_user, $wpdb;
1533
 
1534
  echo '<div class="card">';
1535
- echo $this->get_card_header(__('Please read carefully before proceeding', 'wp-reset'), 'reset-description', array('collapse_button' => true));
1536
  echo '<div class="card-body">';
1537
  echo '<p>The following table details what data will be deleted (reset or destroyed) when a selected reset tool is run. Please read it! ';
1538
  echo 'If something is not clear <a href="#" class="change-tab" data-tab="4">contact support</a> before running any tools. It\'s better to ask than to be sorry!';
@@ -1573,7 +1584,9 @@ class WP_Reset
1573
 
1574
  foreach ($rows as $tool => $opt) {
1575
  echo '<tr>';
1576
- echo '<td>' . nl2br(esc_html($tool)) . '</td>';
 
 
1577
  if (empty($opt[0])) {
1578
  echo '<td><i class="dashicons dashicons-yes tooltip" title="Data will NOT be deleted, reset or modified"></i></td>';
1579
  } else {
@@ -1626,21 +1639,21 @@ class WP_Reset
1626
 
1627
  // options reset
1628
  echo '<div class="card">';
1629
- echo $this->get_card_header(__('Options Reset', 'wp-reset'), 'tool-options-reset', array('collapse_button' => true, 'pro' => true));
1630
  echo '<div class="card-body">';
1631
  echo '<p>Options table will be reset to default values meaning all WP core settings, widgets, theme settings and customizations, and plugin settings will be gone. Other content and files will not be touched including posts, pages, custom post types, comments and other data stored in separate tables. Site URL and name will be kept as well. Please see the <a href="#reset-details" class="scrollto">table above</a> for details.</p>';
1632
 
1633
- echo $this->get_tool_icons(false, true);
1634
 
1635
  echo '<p><br><label for="reset-options-reactivate-theme"><input type="checkbox" id="reset-options-reactivate-theme" value="1"> ' . __('Reactivate current theme', 'wp-reset') . ' - ' . esc_html($theme_name) . '</label></p>';
1636
- echo '<p><label for="reset-options-reactivate-plugins"><input type="checkbox" id="reset-options-reactivate-plugins" value="1"> Reactivate ' . sizeof($active_plugins) . ' currently active plugin' . (sizeof($active_plugins) != 1 ? 's' : '') . ' (WP Reset will reactivate by default)</label></p>';
1637
 
1638
  echo '<p class="mb0"><a class="button button-delete button-pro-feature" href="#">Reset all options - <span data-feature="tool-options-reset" class="pro-feature"><span class="pro">PRO</span> tool</span></a></p>';
1639
  echo '</div>';
1640
  echo '</div>'; // options reset
1641
 
1642
  echo '<div class="card">';
1643
- echo $this->get_card_header(__('Site Reset', 'wp-reset'), 'tool-site-reset', array('collapse_button' => true));
1644
  echo '<div class="card-body">';
1645
  echo '<p><label for="reactivate-theme"><input name="wpr-post-reset[reactivate_theme]" type="checkbox" id="reactivate-theme" value="1"> ' . __('Reactivate current theme', 'wp-reset') . ' - ' . esc_html($theme->get('Name')) . '</label></p>';
1646
  echo '<p><label for="reactivate-wpreset"><input name="wpr-post-reset[reactivate_wpreset]" type="checkbox" id="reactivate-wpreset" value="1" checked> ' . __('Reactivate WP Reset plugin', 'wp-reset') . '</label></p>';
@@ -1650,17 +1663,19 @@ class WP_Reset
1650
 
1651
  wp_nonce_field('wp-reset');
1652
  echo '<p class="mb0"><input id="wp_reset_confirm" type="text" name="wp_reset_confirm" placeholder="' . esc_attr(sprintf(__('Type in: %s', 'wp-reset'), '"reset"')) . '" value="" autocomplete="off"> &nbsp;';
1653
- echo '<a id="wp_reset_submit" class="button button-delete">' . __('Reset Site', 'wp-reset') . '</a>' . $this->get_snapshot_button('reset-wordpress', 'Before resetting the site') . '</p>';
 
 
1654
  echo '</div>';
1655
  echo '</div>'; // card reset
1656
 
1657
  // nuclear reset
1658
  echo '<div class="card">';
1659
- echo $this->get_card_header(__('Nuclear Site Reset', 'wp-reset'), 'tool-nuclear-reset', array('collapse_button' => true, 'pro' => true));
1660
  echo '<div class="card-body">';
1661
  echo '<p>All data will be deleted or reset (see the <a href="#reset-details" class="scrollto">explanation table</a> for details). All data stored in the database including custom tables with <code>' . esc_html($wpdb->prefix) . '</code> prefix, as well as all files in wp-content, themes and plugins folders. The only thing restored after reset will be your user account so you can log in again, and the basic WP settings like site URL. Please see the <a href="#reset-details" class="scrollto">table above</a> for details.</p>';
1662
 
1663
- echo $this->get_tool_icons(true, true);
1664
 
1665
  if (is_multisite()) {
1666
  echo '<p class="mb0 wpmu-error">This tool is <b>not compatible</b> with WP multisite (WPMU). Using it would delete files shared by multiple sites in the WP network.</p>';
@@ -1705,7 +1720,7 @@ class WP_Reset
1705
  );
1706
 
1707
  echo '<div class="card">';
1708
- echo $this->get_card_header(__('Index of Tools', 'wp-reset'), 'iot', array('collapse_button' => true));
1709
  echo '<div class="card-body">';
1710
  $i = 0;
1711
  $tools_nb = sizeof($tools);
@@ -1737,58 +1752,60 @@ class WP_Reset
1737
  echo '</div>';
1738
 
1739
  echo '<div class="card">';
1740
- echo $this->get_card_header(__('Reset Theme Options', 'wp-reset'), 'tool-reset-theme-options', array('iot_button' => true, 'collapse_button' => true));
1741
  echo '<div class="card-body">';
1742
  echo '<p>' . __('All options (mods) for all themes will be reset; not just for the active theme. The tool works only for themes that use the <a href="https://codex.wordpress.org/Theme_Modification_API" target="_blank">WordPress theme modification API</a>. If options are saved in some other, custom way they won\'t be reset.<br> Always <a href="#" class="create-new-snapshot" data-description="Before resetting theme options">create a snapshot</a> before using this tool if you want to be able to undo its actions.', 'wp-reset') . '</p>';
1743
- echo $this->get_tool_icons(false, true);
1744
- echo '<p class="mb0"><a data-confirm-title="Are you sure you want to reset all theme options?" data-btn-confirm="Reset theme options" data-text-wait="Resetting theme options. Please wait." data-text-confirm="All options (mods) for all themes will be reset. Always ' . esc_attr('<a data-description="Before resetting theme options" href="#" class="create-new-snapshot">create a snapshot</a> if you want to be able to undo') . '." data-text-done="Options for %n themes have been reset." data-text-done-singular="Options for one theme have been reset." class="button button-delete" href="#" id="reset-theme-options">Reset theme options</a>' . $this->get_snapshot_button('reset-theme-options', 'Before resetting theme options') . '</p>';
 
1745
  echo '</div>';
1746
  echo '</div>'; // reset theme options
1747
 
1748
  echo '<div class="card default-collapsed">';
1749
- echo $this->get_card_header(__('Reset User Roles', 'wp-reset'), 'tool-reset-user-roles', array('collapse_button' => true, 'iot_button' => true, 'pro' => true));
1750
  echo '<div class="card-body">';
1751
  echo '<p>Default user roles\' capatibilities will be reset to their default values. All custom roles will be deleted.<br>Users that had custom roles will not be assigned any default ones and might not be able to log in. Roles have to be (re)assigned to them manually.</p>';
1752
- echo $this->get_tool_icons(false, true);
1753
  echo '<p class="mb0"><a class="button button-delete button-pro-feature" href="#">Reset user roles - <span data-feature="tool-reset-user-roles" class="pro-feature"><span class="pro">PRO</span> tool</span></a>';
1754
- echo $this->get_snapshot_button('reset-user-roles', 'Before resetting user roles') . '</p>';
1755
  echo '</div>';
1756
  echo '</div>'; // reset user roles
1757
 
1758
  echo '<div class="card">';
1759
- echo $this->get_card_header(__('Delete Transients', 'wp-reset'), 'tool-delete-transients', array('iot_button' => true, 'collapse_button' => true));
1760
  echo '<div class="card-body">';
1761
  echo '<p>All transient related database entries will be deleted. Including expired and non-expired transients, and orphaned transient timeout entries.<br>Always <a href="#" data-description="Before deleting transients" class="create-new-snapshot">create a snapshot</a> before using this tool if you want to be able to undo its actions.</p>';
1762
- echo $this->get_tool_icons(false, true);
1763
- echo '<p class="mb0"><a data-confirm-title="Are you sure you want to delete all transients?" data-btn-confirm="Delete all transients" data-text-wait="Deleting transients. Please wait." data-text-confirm="All database entries related to transients will be deleted. Always ' . esc_attr('<a data-description="Before deleting transients" href="#" class="create-new-snapshot">create a snapshot</a> if you want to be able to undo') . '." data-text-done="%n transient database entries have been deleted." data-text-done-singular="One transient database entry has been deleted." class="button button-delete" href="#" id="delete-transients">Delete all transients</a>' . $this->get_snapshot_button('delete-transients', 'Before deleting transients') . '</p>';
 
1764
  echo '</div>';
1765
  echo '</div>'; // delete transients
1766
 
1767
  echo '<div class="card">';
1768
- echo $this->get_card_header(__('Purge Cache', 'wp-reset'), 'tool-purge-cache', array('collapse_button' => true, 'iot_button' => true));
1769
  echo '<div class="card-body">';
1770
  echo '<p>All cache objects stored in both files and the database will be deleted. Along with WP object cache and transients, cache from the following plugins will be purged: W3 Total Cache, WP Cache, LiteSpeed Cache, Endurance Page Cache, SiteGround Optimizer, WP Fastest Cache and Swift Performance.</p>';
1771
- echo $this->get_tool_icons(true, true);
1772
  echo '<p class="mb0"><a data-confirm-title="Are you sure you want to purge all cache?" data-btn-confirm="Purge cache" data-text-wait="Purging cache. Please wait." data-text-confirm="All cache objects will be deleted. There is NO UNDO. WP Reset does not make any file backups." data-text-done="Cache has been purged." data-text-done-singular="Cache has been purged." class="button button-delete" href="#" id="purge-cache">Purge cache</a></p>';
1773
  echo '</div>';
1774
  echo '</div>'; // purge cache
1775
 
1776
  echo '<div class="card">';
1777
- echo $this->get_card_header(__('Delete Local Data', 'wp-reset'), 'tool-delete-local-data', array('collapse_button' => true, 'iot_button' => true));
1778
  echo '<div class="card-body">';
1779
  echo '<p>All local storage and session storage data will be deleted. Cookies without a custom set path will be deleted as well. WP cookies are not touched, with Delete Local Data button.<br>Deleting all WordPress cookies (including authentication cookies) will delete all WP related cookies and user (you) will be logged out on the next page reload.
1780
  </p>';
1781
- echo $this->get_tool_icons(false, false);
1782
  echo '<p class="mb0"><a data-confirm-title="Are you sure you want to delete all local data?" data-btn-confirm="Delete local data" data-text-wait="Deleting local data. Please wait." data-text-confirm="All local data; cookies, local storage and local session will be deleted. There is NO UNDO. WP Reset does not make backups of local data." data-text-done="%n local data objects have been deleted." data-text-done-singular="One local data object has been deleted." class="button button-delete" href="#" id="delete-local-data">Delete local data</a><a data-confirm-title="Are you sure you want to delete all WP related cookies?" data-btn-confirm="Delete all WordPress cookies" data-text-wait="Deleting WP cookies. Please wait." data-text-confirm="All WP cookies including authentication ones will be deleted. You will have to log in again. There is NO UNDO. WP Reset does not make backups of cookies." data-text-done="All WP cookies have been deleted. Reload the page to login again." data-text-done-singular="All WP cookies have been deleted. Reload the page to login again." class="button button-delete" href="#" id="delete-wp-cookies">Delete all WordPress cookies</a></p>';
1783
  echo '</div>';
1784
  echo '</div>'; // delete local data
1785
 
1786
  echo '<div class="card default-collapsed">';
1787
- echo $this->get_card_header(__('Delete Content', 'wp-reset'), 'tool-delete-content', array('collapse_button' => true, 'iot_button' => true, 'pro' => true));
1788
  echo '<div class="card-body">';
1789
  echo '<p>Besides content, all linked or child records (for selected content) will be deleted to prevent creating orphaned rows in the database. For instance, for posts that\'s posts, post meta, and comments related to posts. Delete process does not call any WP hooks such as <i>before_delete_post</i>. Choosing a post type or taxonomy does not delete that parent object it deletes the child objects. Parent objects are defined in code. If you want to remove them, remove their code definition. When media is deleted, files are left in the uploads folder. To delete files use the <a class="scrollto" href="#tool-delete-uploads">Clean uploads Folder</a> tool. Deleting users does not affect the current, logged in user account. All orphaned objects will be reassigned to him.</p>';
1790
 
1791
- echo $this->get_tool_icons(false, true);
1792
 
1793
  $post_types = get_post_types('', false, 'and');
1794
  $taxonomies = get_taxonomies('', false, 'and');
@@ -1816,11 +1833,11 @@ class WP_Reset
1816
  echo '</div>'; // delete content
1817
 
1818
  echo '<div class="card default-collapsed">';
1819
- echo $this->get_card_header(__('Delete Widgets', 'wp-reset'), 'tool-delete-widgets', array('collapse_button' => true, 'iot_button' => true, 'pro' => true));
1820
  echo '<div class="card-body">';
1821
  echo '<p>All widgets, orphaned, active and inactive ones, as well as widgets in active and inactive sidebars will be deleted including their settings. After deleting, WordPress will automatically recreate default, empty database entries related to widgets. So, no matter how many times users run the tool it will never return "no data deleted". That\'s expected and normal.</p>';
1822
 
1823
- echo $this->get_tool_icons(false, true);
1824
 
1825
  echo '<p class="mb0"><a class="button button-delete button-pro-feature" href="#">Delete widgets - <span data-feature="tool-delete-widgets" class="pro-feature"><span class="pro">PRO</span> tool</span></a></p>';
1826
  echo '</div>';
@@ -1829,25 +1846,25 @@ class WP_Reset
1829
  $theme = wp_get_theme();
1830
 
1831
  echo '<div class="card">';
1832
- echo $this->get_card_header(__('Delete Themes', 'wp-reset'), 'tool-delete-themes', array('iot_button' => true, 'collapse_button' => true));
1833
  echo '<div class="card-body">';
1834
  echo '<p>' . __('All themes will be deleted. Including the currently active theme - ' . esc_html($theme->get('Name')) . '.<br><b>There is NO UNDO. WP Reset does not make any file backups.</b>', 'wp-reset') . '</p>';
1835
- echo $this->get_tool_icons(true, true);
1836
  echo '<p class="mb0"><a data-confirm-title="Are you sure you want to delete all themes?" data-btn-confirm="Delete all themes" data-text-wait="Deleting all themes. Please wait." data-text-confirm="All themes will be deleted. There is NO UNDO. WP Reset does not make any file backups." data-text-done="%n themes have been deleted." data-text-done-singular="One theme has been deleted." class="button button-delete" href="#" id="delete-themes">Delete all themes</a></p>';
1837
  echo '</div>';
1838
  echo '</div>'; // delete themes
1839
 
1840
  echo '<div class="card">';
1841
- echo $this->get_card_header(__('Delete Plugins', 'wp-reset'), 'tool-delete-plugins', array('iot_button' => true, 'collapse_button' => true));
1842
  echo '<div class="card-body">';
1843
  echo '<p>' . __('All plugins will be deleted except for WP Reset which will remain active.<br><b>There is NO UNDO. WP Reset does not make any file backups.</b>', 'wp-reset') . '</p>';
1844
- echo $this->get_tool_icons(true, true);
1845
  echo '<p class="mb0"><a data-confirm-title="Are you sure you want to delete all plugins?" data-btn-confirm="Delete plugins" data-text-wait="Deleting plugins. Please wait." data-text-confirm="All plugins except WP Reset will be deleted. There is NO UNDO. WP Reset does not make any file backups." data-text-done="%n plugins have been deleted." data-text-done-singular="One plugin has been deleted." class="button button-delete" href="#" id="delete-plugins">Delete plugins</a></p>';
1846
  echo '</div>';
1847
  echo '</div>'; // delete plugins
1848
 
1849
  echo '<div class="card default-collapsed">';
1850
- echo $this->get_card_header(__('Delete MU Plugins & Drop-ins', 'wp-reset'), 'tool-delete-mu-plugins-dropins', array('collapse_button' => true, 'iot_button' => true, 'pro' => true));
1851
  echo '<div class="card-body">';
1852
  echo '<p>MU Plugins are located in <code>/wp-content/mu-plugins/</code> and are, as the name suggests, must-use plugins that are automatically activated by WP and can\'t be deactiavated via the <a href="' . esc_url(admin_url('plugins.php?plugin_status=mustuse')) . '" target="_blank">plugins interface</a>, although if any are used, they are listed in the "Must Use" tab.<br>';
1853
  echo 'Drop-ins are pieces of code found in <code>/wp-content/</code> that replace default, built-in WordPress functionality. Most often used are <code>db.php</code> and <code>advanced-cache.php</code> that implement custom DB and cache functionality. They can\'t be deactivated via the <a href="' . esc_url(admin_url('plugins.php?plugin_status=dropins')) . '" target="_blank">plugins interface</a> but if any are present are listed in the "Drop-in" tab.</p>';
@@ -1855,7 +1872,7 @@ class WP_Reset
1855
  if (is_multisite()) {
1856
  echo '<p class="mb0 wpmu-error">This tool is <b>not compatible</b> with WP multisite (WPMU). Using it would delete plugins for all sites in the network since they all share the same plugin files.</p>';
1857
  } else {
1858
- echo $this->get_tool_icons(true, false, true);
1859
  echo '<p class="mb0"><a class="button button-delete button-pro-feature" href="#">Delete must use plugins - <span data-feature="tool-delete-mu-plugins" class="pro-feature"><span class="pro">PRO</span> tool</span></a><a class="button button-delete button-pro-feature" href="#">Delete drop-ins - <span data-feature="tool-delete-dropins" class="pro-feature"><span class="pro">PRO</span> tool</span></a></p>';
1860
  }
1861
  echo '</div>';
@@ -1865,10 +1882,10 @@ class WP_Reset
1865
  $upload_dir['basedir'] = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $upload_dir['basedir']);
1866
 
1867
  echo '<div class="card">';
1868
- echo $this->get_card_header(__('Clean uploads Folder', 'wp-reset'), 'tool-delete-uploads', array('iot_button' => true, 'collapse_button' => true));
1869
  echo '<div class="card-body">';
1870
  echo '<p>' . __('All files in <code>' . esc_html($upload_dir['basedir']) . '</code> folder will be deleted. Including folders and subfolders, and files in subfolders. Files associated with <a href="' . esc_url(admin_url('upload.php')) . '">media</a> entries will be deleted too.<br><b>There is NO UNDO. WP Reset does not make any file backups.</b>', 'wp-reset') . '</p>';
1871
- echo $this->get_tool_icons(true, false);
1872
  if (false != $upload_dir['error']) {
1873
  echo '<p class="mb0"><span style="color:#dd3036;"><b>Tool is not available.</b></span> Folder is not writeable by WordPress. Please check file and folder access rights.</p>';
1874
  } else {
@@ -1878,10 +1895,10 @@ class WP_Reset
1878
  echo '</div>'; // clean uploads folder
1879
 
1880
  echo '<div class="card default-collapsed">';
1881
- echo $this->get_card_header(__('Clean wp-content Folder', 'wp-reset'), 'tool-delete-wp-content', array('collapse_button' => true, 'iot_button' => true, 'pro' => true));
1882
  echo '<div class="card-body">';
1883
  echo '<p>All folders and their content in <code>wp-content</code> folder except the following ones will be deleted: <code>mu-plugins</code>, <code>plugins</code>, <code>themes</code>, <code>uploads</code>, <code>wp-reset-autosnapshots</code>, <code>wp-reset-snapshots-export</code>.</p>';
1884
- echo $this->get_tool_icons(true, false);
1885
  if (false === is_writable(trailingslashit(WP_CONTENT_DIR))) {
1886
  echo '<p class="mb0"><span style="color:#dd3036;"><b>Tool is not available.</b></span> Folder is not writeable by WordPress. Please check file and folder access rights.</p>';
1887
  } else {
@@ -1893,7 +1910,7 @@ class WP_Reset
1893
  $custom_tables = $this->get_custom_tables();
1894
 
1895
  echo '<div class="card">';
1896
- echo $this->get_card_header(__('Empty or Delete Custom Tables', 'wp-reset'), 'tool-empty-delete-custom-tables', array('iot_button' => true, 'collapse_button' => true));
1897
  echo '<div class="card-body">';
1898
  echo '<p>' . __('This action affects only custom tables with <code>' . esc_html($wpdb->prefix) . '</code> prefix. Core WP tables and other tables in the database that do not have that prefix will not be deleted/emptied. Deleting (dropping) tables completely removes them from the database. Emptying (truncating) removes all content from them, but keeps the structure intact.<br>Always <a href="#" class="create-new-snapshot" data-description="Before deleting custom tables">create a snapshot</a> before using this tool if you want to be able to undo its actions.</p>', 'wp-reset');
1899
  if ($custom_tables) {
@@ -1910,20 +1927,22 @@ class WP_Reset
1910
  echo '<p>' . __('There are no custom tables. There\'s nothing for this tool to empty or delete.', 'wp-reset') . '</p>';
1911
  $custom_tables_btns = ' disabled';
1912
  }
1913
- echo $this->get_tool_icons(false, true, true);
1914
  echo '<p class="mb0"><a data-confirm-title="Are you sure you want to empty all custom tables?" data-btn-confirm="Empty custom tables" data-text-wait="Emptying custom tables. Please wait." data-text-confirm="All custom tables with prefix <code>' . esc_attr($wpdb->prefix) . '</code> will be emptied. Always ' . esc_attr('<a href="#" class="create-new-snapshot" data-description="Before emptying custom tables">create a snapshot</a> if you want to be able to undo') . '." data-text-done="%n custom tables have been emptied." data-text-done-singular="One custom table has been emptied." class="button button-delete' . esc_attr($custom_tables_btns) . '" href="#" id="truncate-custom-tables">Empty (truncate) custom tables</a>';
1915
- echo '<a data-confirm-title="Are you sure you want to delete all custom tables?" data-btn-confirm="Delete custom tables" data-text-wait="Deleting custom tables. Please wait." data-text-confirm="All custom tables with prefix <code>' . esc_attr($wpdb->prefix) . '</code> will be deleted. Always ' . esc_attr('<a href="#" class="create-new-snapshot" data-description="Before deleting custom tables">create a snapshot</a> if you want to be able to undo') . '." data-text-done="%n custom tables have been deleted." data-text-done-singular="One custom table has been deleted." class="button button-delete' . esc_attr($custom_tables_btns) . '" href="#" id="drop-custom-tables">Delete (drop) custom tables</a>' . $this->get_snapshot_button('drop-custom-tables', 'Before deleting custom tables') . '</p>';
 
 
1916
  echo '</div>';
1917
  echo '</div>'; // empty custom tables
1918
 
1919
  echo '<div class="card default-collapsed">';
1920
- echo $this->get_card_header(__('Switch WP Version', 'wp-reset'), 'tool-switch-wp-version', array('collapse_button' => true, 'iot_button' => true, 'pro' => true));
1921
  echo '<div class="card-body">';
1922
  if (is_multisite()) {
1923
  echo '<p class="mb0 wpmu-error">This tool is <b>not compatible</b> with WP multisite (WPMU). Using it would change the WP version for all sites in the network since they all share the same core files.</p>';
1924
  } else {
1925
  echo '<p>Replace current WordPress version with the selected new version. Switching from a previous version, to a newer version is mostly supported and properly handled by the WP installer. Reverting WordPress, rolling back WordPress to a previous version is not supported. Results may vary!</p>';
1926
- echo $this->get_tool_icons(true, true);
1927
 
1928
  $wp_versions = WP_Reset_Utility::get_wordpress_versions();
1929
  echo '<p><label for="select-wp-version">Select the WordPress version to switch to:</label> ';
@@ -1935,7 +1954,7 @@ class WP_Reset
1935
  } elseif ($release_date == 'point') {
1936
  echo '<option value="point-' . esc_attr(substr($version, 0, 3)) . '">WordPress v' . esc_html($version) . ' (Point release nightly)' . ($wp_version == $version ? ' - installed' : '') . '</option>';
1937
  } else {
1938
- echo '<option value="' . esc_attr($version) . '">WordPress v' . esc_html($version) . ' (' . date('Y-m-d', $release_date) . ')' . ($wp_version == $version ? ' - installed' : '') . '</option>';
1939
  }
1940
  }
1941
  echo '</select></p>';
@@ -1948,12 +1967,12 @@ class WP_Reset
1948
  echo '</div>'; // switch WP version
1949
 
1950
  echo '<div class="card">';
1951
- echo $this->get_card_header(__('Delete .htaccess File', 'wp-reset'), 'tool-delete-htaccess', array('iot_button' => true, 'collapse_button' => true));
1952
  echo '<div class="card-body">';
1953
  echo '<p>' . __('This action deletes the .htaccess file located in <code>' . esc_html($this->get_htaccess_path()) . '</code><br><b>There is NO UNDO. WP Reset does not make any file backups.</b></p>', 'wp-reset');
1954
 
1955
  echo '<p>If you need to edit .htaccess, install our free <a href="' . esc_url(admin_url('plugin-install.php?tab=plugin-information&plugin=wp-htaccess-editor&TB_iframe=true&width=600&height=550')) . '" class="thickbox open-plugin-details-modal">WP Htaccess Editor</a> plugin. It automatically creates backups when you edit .htaccess as well as checks for syntax errors. To create the default .htaccess file open <a href="' . esc_url(admin_url('options-permalink.php')) . '">Settings - Permalinks</a> and re-save settings. WordPress will recreate the file.</p>';
1956
- echo $this->get_tool_icons(true, false);
1957
  echo '<p class="mb0"><a data-confirm-title="Are you sure you want to delete the .htaccess file?" data-btn-confirm="Delete .htaccess file" data-text-wait="Deleting .htaccess file. Please wait." data-text-confirm="Htaccess file will be deleted. There is NO UNDO. WP Reset does not make any file backups." data-text-done="Htaccess file has been deleted." data-text-done-singular="Htaccess file has been deleted." class="button button-delete" href="#" id="delete-htaccess">Delete .htaccess file</a></p>';
1958
 
1959
  echo '</div>';
@@ -1969,7 +1988,7 @@ class WP_Reset
1969
  private function tab_collections()
1970
  {
1971
  echo '<div class="card">';
1972
- echo $this->get_card_header('What are Plugin & Theme Collections?', 'collections-info', array('collapse_button' => false));
1973
  echo '<div class="card-body">';
1974
  echo '<p>' . __('Have a set of plugins (and themes) that you install and activate after every reset? Or on every fresh WordPress 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.</p><p>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>';
1975
  echo '<p><a class="button button-secondary button-pro-feature" href="#">Add a new collection - <span data-feature="collections" class="pro-feature"><span class="pro">PRO</span> feature</span></a> &nbsp; <a class="button button-secondary button-pro-feature" href="#">Reload my saved collections from the cloud - <span data-feature="collections" class="pro-feature"><span class="pro">PRO</span> feature</span></a></p>';
@@ -1985,7 +2004,7 @@ class WP_Reset
1985
  $plugins['wp-external-links'] = array('name' => 'WP External Links', 'desc' => 'Manage all external & internal links. Control icons, nofollow, noopener, UGC, sponsored and if links open in new window or new tab.');
1986
 
1987
  echo '<div class="card" data-collection-id="1">';
1988
- echo $this->get_card_header('Must Have WordPress Plugins', 'collection-id-1', array('collapse_button' => false));
1989
  echo '<div class="card-body"><div class="thirdx2"><p class="_mb0"></p><div class="dropdown dropdown-right">
1990
  <a class="button dropdown-toggle" href="#">Install collection</a>
1991
  <div class="dropdown-menu">
@@ -2025,14 +2044,14 @@ class WP_Reset
2025
  private function tab_support()
2026
  {
2027
  echo '<div class="card">';
2028
- echo $this->get_card_header(__('Documentation', 'wp-reset'), 'support-documentation', array('collapse_button' => false));
2029
  echo '<div class="card-body">';
2030
  echo '<p class="mb0">' . __('All tools and features are explained in detail in <a href="' . esc_url($this->generate_web_link('support-tab', '/documentation/')) . '" target="_blank">the documentation</a>. We did our best to describe how things work on both the code level and an "average user" level.', 'wp-reset') . '</p>';
2031
  echo '</div>';
2032
  echo '</div>'; // documentation
2033
 
2034
  echo '<div class="card">';
2035
- echo $this->get_card_header('Emergency Recovery Script', 'support-ers', array('collapse_button' => false, 'pro' => true));
2036
  echo '<div class="card-body">';
2037
  echo '<p>Emergency Recovery Script is a standalone, single-file, WordPress independent PHP script created to <b>recover WordPress sites from the most difficult situations</b>. When access to the admin is not possible when core files are compromised (accidental delete or malware related situations), when you get the white screen of death, can\'t log in for whatever reason or a plugin has killed your site - emergency recovery script can fix the problem! Some of the things ERS can do;</p>';
2038
  echo '<ul class="plain-list">';
@@ -2049,21 +2068,21 @@ class WP_Reset
2049
  echo '</div>'; // emergency recovery script
2050
 
2051
  echo '<div class="card">';
2052
- echo $this->get_card_header(__('Public Support Forum', 'wp-reset'), 'support-forum', array('collapse_button' => false));
2053
  echo '<div class="card-body">';
2054
  echo '<p>' . __('We are very active on the <a href="https://wordpress.org/support/plugin/wp-reset" target="_blank">official WP Reset support forum</a>. If you found a bug, have a feature idea or just want to say hi - please drop by. We love to hear back from our users.', 'wp-reset') . '</p>';
2055
  echo '</div>';
2056
  echo '</div>'; // forum
2057
 
2058
  echo '<div class="card">';
2059
- echo $this->get_card_header(__('Premium Email Support', 'wp-reset'), 'support-email', array('collapse_button' => false, 'pro' => true));
2060
  echo '<div class="card-body">';
2061
  echo '<p class="mb0">Need urgent support? Have one of our devs personally help you with your issue. All PRO license holders have access to premium email support. Get <span class="pro-feature pro-feature-text" data-feature="support-email">WP Reset <span>PRO</span></span> now.</p>';
2062
  echo '</div>';
2063
  echo '</div>'; // email support
2064
 
2065
  echo '<div class="card">';
2066
- echo $this->get_card_header(__('Care to Help Out?', 'wp-reset'), 'support-help-out', array('collapse_button' => false));
2067
  echo '<div class="card-body">';
2068
  echo '<p class="mb0">' . __('No need for donations :) If you can give us a <a href="https://wordpress.org/support/plugin/wp-reset/reviews/#new-post" target="_blank">five star rating</a> you\'ll help out more than you can imagine. A public mention <a href="https://twitter.com/webfactoryltd" target="_blank">@webfactoryltd</a> also does wonders. Thank you!', 'wp-reset') . '</p>';
2069
  echo '</div>';
@@ -2078,8 +2097,12 @@ class WP_Reset
2078
  */
2079
  private function tab_pro()
2080
  {
 
 
 
 
2081
  echo '<div class="card">';
2082
- echo $this->get_card_header(__('WP Reset PRO', 'wp-reset'), 'pro-features', array('collapse_button' => false));
2083
  echo '<div class="card-body">';
2084
  echo '<p>More ways to reset your site, more tools, automatic snapshots, collections, email support and the emergency recover script - that\'s WP Reset PRO in a nutshell. The same <b>quality and easy-of-use</b> you experienced in the free version is very much a part of the PRO one, but extended and upgraded with more tools that will save you even more time.</p>';
2085
  echo '<p>WP Reset PRO is aimed towards <b>webmasters, agencies, and everyone who buildsa a lot of WordPress sites</b>. It\'s much, much more than a "reset" tool. It\'s an easy way to start a new site, to test changes and to get out of the thickest jams. And thanks to its cloud features and the Dashboard it\'ll give you access to collections and snapshots on all the sites you\'re working on - instantly, without dragging any files along.</p>';
@@ -2089,16 +2112,23 @@ class WP_Reset
2089
  echo '</div>';
2090
 
2091
  echo '<div class="card">';
2092
- echo $this->get_card_header(__('Pricing', 'wp-reset'), 'pro-pricing', array('collapse_button' => false));
2093
  echo '<div class="card-body">';
2094
 
2095
  echo '<table id="pricing-table" class="mb0">';
2096
  echo '<tr>';
2097
  echo '<th>&nbsp;</th>';
2098
- echo '<th nowrap>WP Reset <span>PRO</span><br><b>Agency</b></th>';
2099
- echo '<th nowrap>WP Reset <span>PRO</span><br><b>Team</b></th>';
2100
- echo '<th nowrap>WP Reset <span>PRO</span><br><b>Personal</b></th>';
2101
  echo '<th nowrap>WP Reset<br>Free</th>';
 
 
 
 
 
 
 
 
 
 
2102
  echo '</tr>';
2103
 
2104
  $rows = array();
@@ -2114,18 +2144,15 @@ class WP_Reset
2114
  $rows['Plugins & Themes Collections'] = array(false, true, true, true);
2115
  $rows['Emergency Recovery Script'] = array(false, true, true, true);
2116
  $rows['Email Support'] = array(false, true, true, true);
2117
- $rows['WP Reset Dashboard'] = array(false, true, true, true);
2118
- $rows['License Manager'] = array(false, true, true, true);
2119
- $rows['White-Label'] = array(false, false, false, true);
2120
- $rows['Manage Snapshots for all sites in Dashboard'] = array(false, true, true, true);
2121
- $rows['Manage Collections for all sites in Dashboard'] = array(false, true, true, true);
2122
  $rows['Number of sites included in the license (localhosts are not counted & you can change sites)'] = array('&infin;', 1, 5, 100);
2123
  $rows['Number of WP Reset Cloud site licenses with 2GB storage per site (localhosts are not counted & you can change sites)'] = array(0, 1, 5, 20);
2124
 
2125
  foreach ($rows as $feature => $details) {
2126
  echo '<tr>';
2127
  echo '<td>' . esc_html($feature) . '</td>';
2128
- $details = array_reverse($details);
2129
  foreach ($details as $tmp) {
2130
  echo '<td>';
2131
  if ($tmp === true) {
@@ -2133,28 +2160,18 @@ class WP_Reset
2133
  } elseif ($tmp === false) {
2134
  echo '<i class="dashicons dashicons-no red tooltip" title="Feature is not available"></i>';
2135
  } else {
2136
- echo $tmp;
2137
  }
2138
  echo '</td>';
2139
  } // foreach column
2140
  echo '</tr>';
2141
  } // foreach $rows
2142
 
2143
- $agency = $this->generate_web_link('pricing-table', '/buy/', array('p' => 'wp-reset-pro-agency-launch'));
2144
- $team = $this->generate_web_link('pricing-table', '/buy/', array('p' => 'wp-reset-pro-team-launch'));
2145
- $team_lifetime = $this->generate_web_link('pricing-table', '/buy/', array('p' => 'wp-reset-pro-team-lifetime-launch'));
2146
- $personal = $this->generate_web_link('pricing-table', '/buy/', array('p' => 'wp-reset-pro-personal-launch'));
2147
- echo '<tr class="pricing"><td>Yearly Price</td>';
2148
- echo '<td><del>&nbsp;$299/y&nbsp;</del><br><b>50% OFF</b><br>$149 <small>/y</small><br><a href="' . esc_url($agency) . '" class="button" target="_blank">BUY NOW</a></td>';
2149
- echo '<td><del>&nbsp;$158/y&nbsp;</del><br><b>50% OFF</b><br>$79 <small>/y</small><br><a href="' . esc_url($team) . '" class="button" target="_blank">BUY NOW</a></td>';
2150
- echo '<td><del>&nbsp;$79 <small>/y</small>&nbsp;</del><br><b>50% OFF</b><br>$39 <small>/y</small><br><a href="' . esc_url($personal) . '" class="button" target="_blank">BUY NOW</a></td>';
2151
- echo '<td>free</td>';
2152
- echo '</tr>';
2153
  echo '<tr class="pricing"><td>Lifetime Price</td>';
2154
- echo '<td><i>n/a</i></td>';
2155
- echo '<td><del>&nbsp;$319&nbsp;</del><br><b>one-time payment<br>50% OFF</b><br>$159<br><a href="' . esc_url($team_lifetime) . '" class="button button-primary" target="_blank">BUY NOW</a></td>';
2156
- echo '<td><i>n/a</i></td>';
2157
  echo '<td>free</td>';
 
 
 
2158
  echo '</tr>';
2159
  echo '</table>';
2160
 
@@ -2162,7 +2179,7 @@ class WP_Reset
2162
  echo '</div>';
2163
 
2164
  echo '<div class="card">';
2165
- echo $this->get_card_header(__('Activate PRO License', 'wp-reset'), 'pro-activate', array('collapse_button' => false));
2166
  echo '<div class="card-body">';
2167
 
2168
  echo '<p>License key is visible on the confirmation screen, right after purchasing. You can also find it in the confirmation email sent to the email address provided on purchase. Or use keys created with the <a href="https://dashboard.wpreset.com/licenses/" target="_blank">license manager</a>.</p>
@@ -2264,7 +2281,7 @@ class WP_Reset
2264
 
2265
  echo '<p class="mb0"><b>Currently used WordPress tables</b>, prefixed with <i>' . esc_html($wpdb->prefix) . '</i>, consist of ' . esc_html($tbl_core) . ' standard and ';
2266
  if ($tbl_custom) {
2267
- echo $tbl_custom . ' custom table' . ($tbl_custom == 1 ? '' : 's');
2268
  } else {
2269
  echo 'no custom tables';
2270
  }
@@ -2277,7 +2294,7 @@ class WP_Reset
2277
  echo '</div>';
2278
 
2279
  echo '<div class="card">';
2280
- echo $this->get_card_header('User Created Snapshots', 'snapshots-user', array('collapse_button' => 1, 'create_snapshot' => true, 'snapshot_actions' => true));
2281
  echo '<div class="card-body">';
2282
  if ($snapshots = $this->get_snapshots()) {
2283
  $snapshots = array_reverse($snapshots);
@@ -2293,9 +2310,9 @@ class WP_Reset
2293
 
2294
  echo '<td>';
2295
  if (current_time('timestamp') - strtotime($ss['timestamp']) > 12 * HOUR_IN_SECONDS) {
2296
- echo date(get_option('date_format'), strtotime($ss['timestamp'])) . '<br>@ ' . date(get_option('time_format'), strtotime($ss['timestamp']));
2297
  } else {
2298
- echo human_time_diff(strtotime($ss['timestamp']), current_time('timestamp')) . ' ago';
2299
  }
2300
  echo '</td>';
2301
 
@@ -2303,14 +2320,14 @@ class WP_Reset
2303
  if (!empty($ss['name'])) {
2304
  echo '<b>' . esc_html($ss['name']) . '</b><br>';
2305
  }
2306
- echo $ss['tbl_core'] . ' standard &amp; ';
2307
  if ($ss['tbl_custom']) {
2308
- echo $ss['tbl_custom'] . ' custom table' . ($ss['tbl_custom'] == 1 ? '' : 's');
2309
  } else {
2310
  echo 'no custom tables';
2311
  }
2312
- echo ' totaling ' . number_format($ss['tbl_rows']) . ' rows</td>';
2313
- echo '<td class="ss-size">' . WP_Reset_Utility::format_size($ss['tbl_size']) . '</td>';
2314
  echo '<td>';
2315
  echo '<div class="dropdown">
2316
  <a class="button dropdown-toggle" href="#">Actions</a>
@@ -2333,7 +2350,7 @@ class WP_Reset
2333
  echo '</div>';
2334
 
2335
  echo '<div class="card">';
2336
- echo $this->get_card_header('Automatic Snapshots', 'snapshots-auto', array('collapse_button' => false, 'pro' => true));
2337
  echo '<div class="card-body">';
2338
  echo '<p><span class="pro-feature pro-feature-text" data-feature="snapshots-auto">WP Reset <span>PRO</span></span> creates automatic snapshots before significant events occur on your site that can cause it to stop working correctly. Plugin, theme and core updates, plugin and theme activations and deactivations all of those can happen in the background without your knowledge. With automatic snapshots, you can roll back any update with a single click. Snapshots can be uploaded to the WP Reset Cloud, Dropbox, Google Drive or pCloud, giving you an extra layer of security.<br>
2339
  Upgrade to <span class="pro-feature pro-feature-text" data-feature="snapshots-auto">WP Reset <span>PRO</span></span> to enable automatic snapshots and give your site an extra layer of safety.</p>';
@@ -2467,7 +2484,7 @@ class WP_Reset
2467
  } else {
2468
  $tbl_custom++;
2469
  }
2470
-
2471
  $wpdb->query("OPTIMIZE TABLE {$table->Name}");
2472
  $wpdb->query("CREATE TABLE {$uid}_{$table->Name} LIKE {$table->Name}");
2473
  $wpdb->query("INSERT {$uid}_{$table->Name} SELECT * FROM {$table->Name}");
@@ -2927,6 +2944,66 @@ class WP_Reset
2927
  } // generate_snapshot_uid
2928
 
2929
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2930
  /**
2931
  * Clean up on uninstall; no action on deactive at the moment
2932
  *
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.95
7
  Requires at least: 4.0
8
  Requires PHP: 5.2
9
+ Tested up to: 6.0
10
  Author: WebFactory Ltd
11
  Author URI: https://www.webfactoryltd.com/
12
  Text Domain: wp-reset
13
 
14
+ Copyright 2015 - 2022 WebFactory Ltd (email: wpreset@webfactoryltd.com)
15
 
16
  This program is free software; you can redistribute it and/or modify
17
  it under the terms of the GNU General Public License, version 2, as
106
  add_action('wp_ajax_wp_reset_dismiss_notice', array($this, 'ajax_dismiss_notice'));
107
  add_action('wp_ajax_wp_reset_run_tool', array($this, 'ajax_run_tool'));
108
  add_action('admin_print_scripts', array($this, 'remove_admin_notices'));
109
+ add_action('admin_action_wpr_install_wpfssl', array($this, 'install_wpfssl'));
110
 
111
  add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'plugin_action_links'));
112
  add_filter('plugin_row_meta', array($this, 'plugin_meta_links'), 10, 2);
371
  'documented_error' => __('An error has occurred.', 'wp-reset'),
372
  'plugin_name' => __('WP Reset', 'wp-reset'),
373
  'settings_url' => admin_url('tools.php?page=wp-reset'),
374
+ 'wpfssl_install_url' => add_query_arg(array('action' => 'wpr_install_wpfssl', '_wpnonce' => wp_create_nonce('install_wpfssl'), 'rnd' => rand()), admin_url('admin.php')),
375
  'icon_url' => $this->plugin_url . 'img/wp-reset-icon.png',
376
  'invalid_confirmation' => __('Please type "reset" in the confirmation field.', 'wp-reset'),
377
  'invalid_confirmation_title' => __('Invalid confirmation', 'wp-reset'),
1111
  wp_clear_auth_cookie();
1112
  wp_set_auth_cookie($user_id);
1113
 
1114
+ wp_safe_redirect(admin_url() . '?wp-reset=success');
1115
  exit;
1116
  }
1117
  } // do_reinstall
1469
  echo '</div>'; // wp-reset-tabs
1470
 
1471
  echo '</form>';
1472
+
1473
+ if (!defined('WPFSSL_OPTIONS_KEY')) {
1474
+ echo '<div id="wpfssl-ad">';
1475
+ echo '<h3 class="textcenter"><b>Problems with SSL certificate?<br>Moving a site from HTTP to HTTPS?<br>Mixed content giving you troubles?<br><br><u>Fix all SSL problems with one plugin!</u></b></h3>';
1476
+ echo '<p class="textcenter"><a href="#" class="textcenter install-wpfssl"><img style="max-width: 90%;" src="' . esc_url($this->plugin_url) . '/img/wp-force-ssl-logo.png" alt="WP Force SSL" title="WP Force SSL"></a></p>';
1477
+ echo '<p class="textcenter"><br><a href="#" class="install-wpfssl button button-primary">Install &amp; activate the free WP Force SSL plugin</a></p><p><a href="https://wordpress.org/plugins/wp-force-ssl/" target="_blank">WP Force SSL</a> is a free WP plugin maintained by the same team as this Maintenance plugin. It has <b>+150,000 users, 5-star rating</b>, and is hosted on the official WP repository.</p>';
1478
+ echo '</div>';
1479
+ }
1480
+
1481
  echo '</div>'; // wrap
1482
  } // plugin_page
1483
 
1543
  global $current_user, $wpdb;
1544
 
1545
  echo '<div class="card">';
1546
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Please read carefully before proceeding', 'wp-reset'), 'reset-description', array('collapse_button' => true)));
1547
  echo '<div class="card-body">';
1548
  echo '<p>The following table details what data will be deleted (reset or destroyed) when a selected reset tool is run. Please read it! ';
1549
  echo 'If something is not clear <a href="#" class="change-tab" data-tab="4">contact support</a> before running any tools. It\'s better to ask than to be sorry!';
1584
 
1585
  foreach ($rows as $tool => $opt) {
1586
  echo '<tr>';
1587
+ echo '<td>';
1588
+ WP_Reset_Utility::wp_kses_wf(nl2br(esc_html($tool)));
1589
+ echo '</td>';
1590
  if (empty($opt[0])) {
1591
  echo '<td><i class="dashicons dashicons-yes tooltip" title="Data will NOT be deleted, reset or modified"></i></td>';
1592
  } else {
1639
 
1640
  // options reset
1641
  echo '<div class="card">';
1642
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Options Reset', 'wp-reset'), 'tool-options-reset', array('collapse_button' => true, 'pro' => true)));
1643
  echo '<div class="card-body">';
1644
  echo '<p>Options table will be reset to default values meaning all WP core settings, widgets, theme settings and customizations, and plugin settings will be gone. Other content and files will not be touched including posts, pages, custom post types, comments and other data stored in separate tables. Site URL and name will be kept as well. Please see the <a href="#reset-details" class="scrollto">table above</a> for details.</p>';
1645
 
1646
+ WP_Reset_Utility::wp_kses_wf($this->get_tool_icons(false, true));
1647
 
1648
  echo '<p><br><label for="reset-options-reactivate-theme"><input type="checkbox" id="reset-options-reactivate-theme" value="1"> ' . __('Reactivate current theme', 'wp-reset') . ' - ' . esc_html($theme_name) . '</label></p>';
1649
+ echo '<p><label for="reset-options-reactivate-plugins"><input type="checkbox" id="reset-options-reactivate-plugins" value="1"> Reactivate ' . esc_attr(sizeof($active_plugins)) . ' currently active plugin' . (sizeof($active_plugins) != 1 ? 's' : '') . ' (WP Reset will reactivate by default)</label></p>';
1650
 
1651
  echo '<p class="mb0"><a class="button button-delete button-pro-feature" href="#">Reset all options - <span data-feature="tool-options-reset" class="pro-feature"><span class="pro">PRO</span> tool</span></a></p>';
1652
  echo '</div>';
1653
  echo '</div>'; // options reset
1654
 
1655
  echo '<div class="card">';
1656
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Site Reset', 'wp-reset'), 'tool-site-reset', array('collapse_button' => true)));
1657
  echo '<div class="card-body">';
1658
  echo '<p><label for="reactivate-theme"><input name="wpr-post-reset[reactivate_theme]" type="checkbox" id="reactivate-theme" value="1"> ' . __('Reactivate current theme', 'wp-reset') . ' - ' . esc_html($theme->get('Name')) . '</label></p>';
1659
  echo '<p><label for="reactivate-wpreset"><input name="wpr-post-reset[reactivate_wpreset]" type="checkbox" id="reactivate-wpreset" value="1" checked> ' . __('Reactivate WP Reset plugin', 'wp-reset') . '</label></p>';
1663
 
1664
  wp_nonce_field('wp-reset');
1665
  echo '<p class="mb0"><input id="wp_reset_confirm" type="text" name="wp_reset_confirm" placeholder="' . esc_attr(sprintf(__('Type in: %s', 'wp-reset'), '"reset"')) . '" value="" autocomplete="off"> &nbsp;';
1666
+ echo '<a id="wp_reset_submit" class="button button-delete">' . __('Reset Site', 'wp-reset') . '</a>';
1667
+ WP_Reset_Utility::wp_kses_wf($this->get_snapshot_button('reset-wordpress', 'Before resetting the site'));
1668
+ echo '</p>';
1669
  echo '</div>';
1670
  echo '</div>'; // card reset
1671
 
1672
  // nuclear reset
1673
  echo '<div class="card">';
1674
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Nuclear Site Reset', 'wp-reset'), 'tool-nuclear-reset', array('collapse_button' => true, 'pro' => true)));
1675
  echo '<div class="card-body">';
1676
  echo '<p>All data will be deleted or reset (see the <a href="#reset-details" class="scrollto">explanation table</a> for details). All data stored in the database including custom tables with <code>' . esc_html($wpdb->prefix) . '</code> prefix, as well as all files in wp-content, themes and plugins folders. The only thing restored after reset will be your user account so you can log in again, and the basic WP settings like site URL. Please see the <a href="#reset-details" class="scrollto">table above</a> for details.</p>';
1677
 
1678
+ WP_Reset_Utility::wp_kses_wf($this->get_tool_icons(true, true));
1679
 
1680
  if (is_multisite()) {
1681
  echo '<p class="mb0 wpmu-error">This tool is <b>not compatible</b> with WP multisite (WPMU). Using it would delete files shared by multiple sites in the WP network.</p>';
1720
  );
1721
 
1722
  echo '<div class="card">';
1723
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Index of Tools', 'wp-reset'), 'iot', array('collapse_button' => true)));
1724
  echo '<div class="card-body">';
1725
  $i = 0;
1726
  $tools_nb = sizeof($tools);
1752
  echo '</div>';
1753
 
1754
  echo '<div class="card">';
1755
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Reset Theme Options', 'wp-reset'), 'tool-reset-theme-options', array('iot_button' => true, 'collapse_button' => true)));
1756
  echo '<div class="card-body">';
1757
  echo '<p>' . __('All options (mods) for all themes will be reset; not just for the active theme. The tool works only for themes that use the <a href="https://codex.wordpress.org/Theme_Modification_API" target="_blank">WordPress theme modification API</a>. If options are saved in some other, custom way they won\'t be reset.<br> Always <a href="#" class="create-new-snapshot" data-description="Before resetting theme options">create a snapshot</a> before using this tool if you want to be able to undo its actions.', 'wp-reset') . '</p>';
1758
+ WP_Reset_Utility::wp_kses_wf($this->get_tool_icons(false, true));
1759
+ echo '<p class="mb0"><a data-confirm-title="Are you sure you want to reset all theme options?" data-btn-confirm="Reset theme options" data-text-wait="Resetting theme options. Please wait." data-text-confirm="All options (mods) for all themes will be reset. Always ' . esc_attr('<a data-description="Before resetting theme options" href="#" class="create-new-snapshot">create a snapshot</a> if you want to be able to undo') . '." data-text-done="Options for %n themes have been reset." data-text-done-singular="Options for one theme have been reset." class="button button-delete" href="#" id="reset-theme-options">Reset theme options</a>';
1760
+ WP_Reset_Utility::wp_kses_wf($this->get_snapshot_button('reset-theme-options', 'Before resetting theme options') . '</p>');
1761
  echo '</div>';
1762
  echo '</div>'; // reset theme options
1763
 
1764
  echo '<div class="card default-collapsed">';
1765
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Reset User Roles', 'wp-reset'), 'tool-reset-user-roles', array('collapse_button' => true, 'iot_button' => true, 'pro' => true)));
1766
  echo '<div class="card-body">';
1767
  echo '<p>Default user roles\' capatibilities will be reset to their default values. All custom roles will be deleted.<br>Users that had custom roles will not be assigned any default ones and might not be able to log in. Roles have to be (re)assigned to them manually.</p>';
1768
+ WP_Reset_Utility::wp_kses_wf($this->get_tool_icons(false, true));
1769
  echo '<p class="mb0"><a class="button button-delete button-pro-feature" href="#">Reset user roles - <span data-feature="tool-reset-user-roles" class="pro-feature"><span class="pro">PRO</span> tool</span></a>';
1770
+ WP_Reset_Utility::wp_kses_wf($this->get_snapshot_button('reset-user-roles', 'Before resetting user roles') . '</p>');
1771
  echo '</div>';
1772
  echo '</div>'; // reset user roles
1773
 
1774
  echo '<div class="card">';
1775
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Delete Transients', 'wp-reset'), 'tool-delete-transients', array('iot_button' => true, 'collapse_button' => true)));
1776
  echo '<div class="card-body">';
1777
  echo '<p>All transient related database entries will be deleted. Including expired and non-expired transients, and orphaned transient timeout entries.<br>Always <a href="#" data-description="Before deleting transients" class="create-new-snapshot">create a snapshot</a> before using this tool if you want to be able to undo its actions.</p>';
1778
+ WP_Reset_Utility::wp_kses_wf($this->get_tool_icons(false, true));
1779
+ echo '<p class="mb0"><a data-confirm-title="Are you sure you want to delete all transients?" data-btn-confirm="Delete all transients" data-text-wait="Deleting transients. Please wait." data-text-confirm="All database entries related to transients will be deleted. Always ' . esc_attr('<a data-description="Before deleting transients" href="#" class="create-new-snapshot">create a snapshot</a> if you want to be able to undo') . '." data-text-done="%n transient database entries have been deleted." data-text-done-singular="One transient database entry has been deleted." class="button button-delete" href="#" id="delete-transients">Delete all transients</a>';
1780
+ WP_Reset_Utility::wp_kses_wf($this->get_snapshot_button('delete-transients', 'Before deleting transients') . '</p>');
1781
  echo '</div>';
1782
  echo '</div>'; // delete transients
1783
 
1784
  echo '<div class="card">';
1785
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Purge Cache', 'wp-reset'), 'tool-purge-cache', array('collapse_button' => true, 'iot_button' => true)));
1786
  echo '<div class="card-body">';
1787
  echo '<p>All cache objects stored in both files and the database will be deleted. Along with WP object cache and transients, cache from the following plugins will be purged: W3 Total Cache, WP Cache, LiteSpeed Cache, Endurance Page Cache, SiteGround Optimizer, WP Fastest Cache and Swift Performance.</p>';
1788
+ WP_Reset_Utility::wp_kses_wf($this->get_tool_icons(true, true));
1789
  echo '<p class="mb0"><a data-confirm-title="Are you sure you want to purge all cache?" data-btn-confirm="Purge cache" data-text-wait="Purging cache. Please wait." data-text-confirm="All cache objects will be deleted. There is NO UNDO. WP Reset does not make any file backups." data-text-done="Cache has been purged." data-text-done-singular="Cache has been purged." class="button button-delete" href="#" id="purge-cache">Purge cache</a></p>';
1790
  echo '</div>';
1791
  echo '</div>'; // purge cache
1792
 
1793
  echo '<div class="card">';
1794
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Delete Local Data', 'wp-reset'), 'tool-delete-local-data', array('collapse_button' => true, 'iot_button' => true)));
1795
  echo '<div class="card-body">';
1796
  echo '<p>All local storage and session storage data will be deleted. Cookies without a custom set path will be deleted as well. WP cookies are not touched, with Delete Local Data button.<br>Deleting all WordPress cookies (including authentication cookies) will delete all WP related cookies and user (you) will be logged out on the next page reload.
1797
  </p>';
1798
+ WP_Reset_Utility::wp_kses_wf($this->get_tool_icons(false, false));
1799
  echo '<p class="mb0"><a data-confirm-title="Are you sure you want to delete all local data?" data-btn-confirm="Delete local data" data-text-wait="Deleting local data. Please wait." data-text-confirm="All local data; cookies, local storage and local session will be deleted. There is NO UNDO. WP Reset does not make backups of local data." data-text-done="%n local data objects have been deleted." data-text-done-singular="One local data object has been deleted." class="button button-delete" href="#" id="delete-local-data">Delete local data</a><a data-confirm-title="Are you sure you want to delete all WP related cookies?" data-btn-confirm="Delete all WordPress cookies" data-text-wait="Deleting WP cookies. Please wait." data-text-confirm="All WP cookies including authentication ones will be deleted. You will have to log in again. There is NO UNDO. WP Reset does not make backups of cookies." data-text-done="All WP cookies have been deleted. Reload the page to login again." data-text-done-singular="All WP cookies have been deleted. Reload the page to login again." class="button button-delete" href="#" id="delete-wp-cookies">Delete all WordPress cookies</a></p>';
1800
  echo '</div>';
1801
  echo '</div>'; // delete local data
1802
 
1803
  echo '<div class="card default-collapsed">';
1804
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Delete Content', 'wp-reset'), 'tool-delete-content', array('collapse_button' => true, 'iot_button' => true, 'pro' => true)));
1805
  echo '<div class="card-body">';
1806
  echo '<p>Besides content, all linked or child records (for selected content) will be deleted to prevent creating orphaned rows in the database. For instance, for posts that\'s posts, post meta, and comments related to posts. Delete process does not call any WP hooks such as <i>before_delete_post</i>. Choosing a post type or taxonomy does not delete that parent object it deletes the child objects. Parent objects are defined in code. If you want to remove them, remove their code definition. When media is deleted, files are left in the uploads folder. To delete files use the <a class="scrollto" href="#tool-delete-uploads">Clean uploads Folder</a> tool. Deleting users does not affect the current, logged in user account. All orphaned objects will be reassigned to him.</p>';
1807
 
1808
+ WP_Reset_Utility::wp_kses_wf($this->get_tool_icons(false, true));
1809
 
1810
  $post_types = get_post_types('', false, 'and');
1811
  $taxonomies = get_taxonomies('', false, 'and');
1833
  echo '</div>'; // delete content
1834
 
1835
  echo '<div class="card default-collapsed">';
1836
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Delete Widgets', 'wp-reset'), 'tool-delete-widgets', array('collapse_button' => true, 'iot_button' => true, 'pro' => true)));
1837
  echo '<div class="card-body">';
1838
  echo '<p>All widgets, orphaned, active and inactive ones, as well as widgets in active and inactive sidebars will be deleted including their settings. After deleting, WordPress will automatically recreate default, empty database entries related to widgets. So, no matter how many times users run the tool it will never return "no data deleted". That\'s expected and normal.</p>';
1839
 
1840
+ WP_Reset_Utility::wp_kses_wf($this->get_tool_icons(false, true));
1841
 
1842
  echo '<p class="mb0"><a class="button button-delete button-pro-feature" href="#">Delete widgets - <span data-feature="tool-delete-widgets" class="pro-feature"><span class="pro">PRO</span> tool</span></a></p>';
1843
  echo '</div>';
1846
  $theme = wp_get_theme();
1847
 
1848
  echo '<div class="card">';
1849
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Delete Themes', 'wp-reset'), 'tool-delete-themes', array('iot_button' => true, 'collapse_button' => true)));
1850
  echo '<div class="card-body">';
1851
  echo '<p>' . __('All themes will be deleted. Including the currently active theme - ' . esc_html($theme->get('Name')) . '.<br><b>There is NO UNDO. WP Reset does not make any file backups.</b>', 'wp-reset') . '</p>';
1852
+ WP_Reset_Utility::wp_kses_wf($this->get_tool_icons(true, true));
1853
  echo '<p class="mb0"><a data-confirm-title="Are you sure you want to delete all themes?" data-btn-confirm="Delete all themes" data-text-wait="Deleting all themes. Please wait." data-text-confirm="All themes will be deleted. There is NO UNDO. WP Reset does not make any file backups." data-text-done="%n themes have been deleted." data-text-done-singular="One theme has been deleted." class="button button-delete" href="#" id="delete-themes">Delete all themes</a></p>';
1854
  echo '</div>';
1855
  echo '</div>'; // delete themes
1856
 
1857
  echo '<div class="card">';
1858
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Delete Plugins', 'wp-reset'), 'tool-delete-plugins', array('iot_button' => true, 'collapse_button' => true)));
1859
  echo '<div class="card-body">';
1860
  echo '<p>' . __('All plugins will be deleted except for WP Reset which will remain active.<br><b>There is NO UNDO. WP Reset does not make any file backups.</b>', 'wp-reset') . '</p>';
1861
+ WP_Reset_Utility::wp_kses_wf($this->get_tool_icons(true, true));
1862
  echo '<p class="mb0"><a data-confirm-title="Are you sure you want to delete all plugins?" data-btn-confirm="Delete plugins" data-text-wait="Deleting plugins. Please wait." data-text-confirm="All plugins except WP Reset will be deleted. There is NO UNDO. WP Reset does not make any file backups." data-text-done="%n plugins have been deleted." data-text-done-singular="One plugin has been deleted." class="button button-delete" href="#" id="delete-plugins">Delete plugins</a></p>';
1863
  echo '</div>';
1864
  echo '</div>'; // delete plugins
1865
 
1866
  echo '<div class="card default-collapsed">';
1867
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Delete MU Plugins & Drop-ins', 'wp-reset'), 'tool-delete-mu-plugins-dropins', array('collapse_button' => true, 'iot_button' => true, 'pro' => true)));
1868
  echo '<div class="card-body">';
1869
  echo '<p>MU Plugins are located in <code>/wp-content/mu-plugins/</code> and are, as the name suggests, must-use plugins that are automatically activated by WP and can\'t be deactiavated via the <a href="' . esc_url(admin_url('plugins.php?plugin_status=mustuse')) . '" target="_blank">plugins interface</a>, although if any are used, they are listed in the "Must Use" tab.<br>';
1870
  echo 'Drop-ins are pieces of code found in <code>/wp-content/</code> that replace default, built-in WordPress functionality. Most often used are <code>db.php</code> and <code>advanced-cache.php</code> that implement custom DB and cache functionality. They can\'t be deactivated via the <a href="' . esc_url(admin_url('plugins.php?plugin_status=dropins')) . '" target="_blank">plugins interface</a> but if any are present are listed in the "Drop-in" tab.</p>';
1872
  if (is_multisite()) {
1873
  echo '<p class="mb0 wpmu-error">This tool is <b>not compatible</b> with WP multisite (WPMU). Using it would delete plugins for all sites in the network since they all share the same plugin files.</p>';
1874
  } else {
1875
+ WP_Reset_Utility::wp_kses_wf($this->get_tool_icons(true, false, true));
1876
  echo '<p class="mb0"><a class="button button-delete button-pro-feature" href="#">Delete must use plugins - <span data-feature="tool-delete-mu-plugins" class="pro-feature"><span class="pro">PRO</span> tool</span></a><a class="button button-delete button-pro-feature" href="#">Delete drop-ins - <span data-feature="tool-delete-dropins" class="pro-feature"><span class="pro">PRO</span> tool</span></a></p>';
1877
  }
1878
  echo '</div>';
1882
  $upload_dir['basedir'] = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $upload_dir['basedir']);
1883
 
1884
  echo '<div class="card">';
1885
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Clean uploads Folder', 'wp-reset'), 'tool-delete-uploads', array('iot_button' => true, 'collapse_button' => true)));
1886
  echo '<div class="card-body">';
1887
  echo '<p>' . __('All files in <code>' . esc_html($upload_dir['basedir']) . '</code> folder will be deleted. Including folders and subfolders, and files in subfolders. Files associated with <a href="' . esc_url(admin_url('upload.php')) . '">media</a> entries will be deleted too.<br><b>There is NO UNDO. WP Reset does not make any file backups.</b>', 'wp-reset') . '</p>';
1888
+ WP_Reset_Utility::wp_kses_wf($this->get_tool_icons(true, false));
1889
  if (false != $upload_dir['error']) {
1890
  echo '<p class="mb0"><span style="color:#dd3036;"><b>Tool is not available.</b></span> Folder is not writeable by WordPress. Please check file and folder access rights.</p>';
1891
  } else {
1895
  echo '</div>'; // clean uploads folder
1896
 
1897
  echo '<div class="card default-collapsed">';
1898
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Clean wp-content Folder', 'wp-reset'), 'tool-delete-wp-content', array('collapse_button' => true, 'iot_button' => true, 'pro' => true)));
1899
  echo '<div class="card-body">';
1900
  echo '<p>All folders and their content in <code>wp-content</code> folder except the following ones will be deleted: <code>mu-plugins</code>, <code>plugins</code>, <code>themes</code>, <code>uploads</code>, <code>wp-reset-autosnapshots</code>, <code>wp-reset-snapshots-export</code>.</p>';
1901
+ WP_Reset_Utility::wp_kses_wf($this->get_tool_icons(true, false));
1902
  if (false === is_writable(trailingslashit(WP_CONTENT_DIR))) {
1903
  echo '<p class="mb0"><span style="color:#dd3036;"><b>Tool is not available.</b></span> Folder is not writeable by WordPress. Please check file and folder access rights.</p>';
1904
  } else {
1910
  $custom_tables = $this->get_custom_tables();
1911
 
1912
  echo '<div class="card">';
1913
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Empty or Delete Custom Tables', 'wp-reset'), 'tool-empty-delete-custom-tables', array('iot_button' => true, 'collapse_button' => true)));
1914
  echo '<div class="card-body">';
1915
  echo '<p>' . __('This action affects only custom tables with <code>' . esc_html($wpdb->prefix) . '</code> prefix. Core WP tables and other tables in the database that do not have that prefix will not be deleted/emptied. Deleting (dropping) tables completely removes them from the database. Emptying (truncating) removes all content from them, but keeps the structure intact.<br>Always <a href="#" class="create-new-snapshot" data-description="Before deleting custom tables">create a snapshot</a> before using this tool if you want to be able to undo its actions.</p>', 'wp-reset');
1916
  if ($custom_tables) {
1927
  echo '<p>' . __('There are no custom tables. There\'s nothing for this tool to empty or delete.', 'wp-reset') . '</p>';
1928
  $custom_tables_btns = ' disabled';
1929
  }
1930
+ WP_Reset_Utility::wp_kses_wf($this->get_tool_icons(false, true, true));
1931
  echo '<p class="mb0"><a data-confirm-title="Are you sure you want to empty all custom tables?" data-btn-confirm="Empty custom tables" data-text-wait="Emptying custom tables. Please wait." data-text-confirm="All custom tables with prefix <code>' . esc_attr($wpdb->prefix) . '</code> will be emptied. Always ' . esc_attr('<a href="#" class="create-new-snapshot" data-description="Before emptying custom tables">create a snapshot</a> if you want to be able to undo') . '." data-text-done="%n custom tables have been emptied." data-text-done-singular="One custom table has been emptied." class="button button-delete' . esc_attr($custom_tables_btns) . '" href="#" id="truncate-custom-tables">Empty (truncate) custom tables</a>';
1932
+ echo '<a data-confirm-title="Are you sure you want to delete all custom tables?" data-btn-confirm="Delete custom tables" data-text-wait="Deleting custom tables. Please wait." data-text-confirm="All custom tables with prefix <code>' . esc_attr($wpdb->prefix) . '</code> will be deleted. Always ' . esc_attr('<a href="#" class="create-new-snapshot" data-description="Before deleting custom tables">create a snapshot</a> if you want to be able to undo') . '." data-text-done="%n custom tables have been deleted." data-text-done-singular="One custom table has been deleted." class="button button-delete' . esc_attr($custom_tables_btns) . '" href="#" id="drop-custom-tables">Delete (drop) custom tables</a>';
1933
+ WP_Reset_Utility::wp_kses_wf($this->get_snapshot_button('drop-custom-tables', 'Before deleting custom tables'));
1934
+ echo '</p>';
1935
  echo '</div>';
1936
  echo '</div>'; // empty custom tables
1937
 
1938
  echo '<div class="card default-collapsed">';
1939
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Switch WP Version', 'wp-reset'), 'tool-switch-wp-version', array('collapse_button' => true, 'iot_button' => true, 'pro' => true)));
1940
  echo '<div class="card-body">';
1941
  if (is_multisite()) {
1942
  echo '<p class="mb0 wpmu-error">This tool is <b>not compatible</b> with WP multisite (WPMU). Using it would change the WP version for all sites in the network since they all share the same core files.</p>';
1943
  } else {
1944
  echo '<p>Replace current WordPress version with the selected new version. Switching from a previous version, to a newer version is mostly supported and properly handled by the WP installer. Reverting WordPress, rolling back WordPress to a previous version is not supported. Results may vary!</p>';
1945
+ WP_Reset_Utility::wp_kses_wf($this->get_tool_icons(true, true));
1946
 
1947
  $wp_versions = WP_Reset_Utility::get_wordpress_versions();
1948
  echo '<p><label for="select-wp-version">Select the WordPress version to switch to:</label> ';
1954
  } elseif ($release_date == 'point') {
1955
  echo '<option value="point-' . esc_attr(substr($version, 0, 3)) . '">WordPress v' . esc_html($version) . ' (Point release nightly)' . ($wp_version == $version ? ' - installed' : '') . '</option>';
1956
  } else {
1957
+ echo '<option value="' . esc_attr($version) . '">WordPress v' . esc_html($version) . ' (' . esc_attr(date('Y-m-d', $release_date)) . ')' . ($wp_version == $version ? ' - installed' : '') . '</option>';
1958
  }
1959
  }
1960
  echo '</select></p>';
1967
  echo '</div>'; // switch WP version
1968
 
1969
  echo '<div class="card">';
1970
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Delete .htaccess File', 'wp-reset'), 'tool-delete-htaccess', array('iot_button' => true, 'collapse_button' => true)));
1971
  echo '<div class="card-body">';
1972
  echo '<p>' . __('This action deletes the .htaccess file located in <code>' . esc_html($this->get_htaccess_path()) . '</code><br><b>There is NO UNDO. WP Reset does not make any file backups.</b></p>', 'wp-reset');
1973
 
1974
  echo '<p>If you need to edit .htaccess, install our free <a href="' . esc_url(admin_url('plugin-install.php?tab=plugin-information&plugin=wp-htaccess-editor&TB_iframe=true&width=600&height=550')) . '" class="thickbox open-plugin-details-modal">WP Htaccess Editor</a> plugin. It automatically creates backups when you edit .htaccess as well as checks for syntax errors. To create the default .htaccess file open <a href="' . esc_url(admin_url('options-permalink.php')) . '">Settings - Permalinks</a> and re-save settings. WordPress will recreate the file.</p>';
1975
+ WP_Reset_Utility::wp_kses_wf($this->get_tool_icons(true, false));
1976
  echo '<p class="mb0"><a data-confirm-title="Are you sure you want to delete the .htaccess file?" data-btn-confirm="Delete .htaccess file" data-text-wait="Deleting .htaccess file. Please wait." data-text-confirm="Htaccess file will be deleted. There is NO UNDO. WP Reset does not make any file backups." data-text-done="Htaccess file has been deleted." data-text-done-singular="Htaccess file has been deleted." class="button button-delete" href="#" id="delete-htaccess">Delete .htaccess file</a></p>';
1977
 
1978
  echo '</div>';
1988
  private function tab_collections()
1989
  {
1990
  echo '<div class="card">';
1991
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header('What are Plugin & Theme Collections?', 'collections-info', array('collapse_button' => false)));
1992
  echo '<div class="card-body">';
1993
  echo '<p>' . __('Have a set of plugins (and themes) that you install and activate after every reset? Or on every fresh WordPress 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.</p><p>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>';
1994
  echo '<p><a class="button button-secondary button-pro-feature" href="#">Add a new collection - <span data-feature="collections" class="pro-feature"><span class="pro">PRO</span> feature</span></a> &nbsp; <a class="button button-secondary button-pro-feature" href="#">Reload my saved collections from the cloud - <span data-feature="collections" class="pro-feature"><span class="pro">PRO</span> feature</span></a></p>';
2004
  $plugins['wp-external-links'] = array('name' => 'WP External Links', 'desc' => 'Manage all external & internal links. Control icons, nofollow, noopener, UGC, sponsored and if links open in new window or new tab.');
2005
 
2006
  echo '<div class="card" data-collection-id="1">';
2007
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header('Must Have WordPress Plugins', 'collection-id-1', array('collapse_button' => false)));
2008
  echo '<div class="card-body"><div class="thirdx2"><p class="_mb0"></p><div class="dropdown dropdown-right">
2009
  <a class="button dropdown-toggle" href="#">Install collection</a>
2010
  <div class="dropdown-menu">
2044
  private function tab_support()
2045
  {
2046
  echo '<div class="card">';
2047
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Documentation', 'wp-reset'), 'support-documentation', array('collapse_button' => false)));
2048
  echo '<div class="card-body">';
2049
  echo '<p class="mb0">' . __('All tools and features are explained in detail in <a href="' . esc_url($this->generate_web_link('support-tab', '/documentation/')) . '" target="_blank">the documentation</a>. We did our best to describe how things work on both the code level and an "average user" level.', 'wp-reset') . '</p>';
2050
  echo '</div>';
2051
  echo '</div>'; // documentation
2052
 
2053
  echo '<div class="card">';
2054
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header('Emergency Recovery Script', 'support-ers', array('collapse_button' => false, 'pro' => true)));
2055
  echo '<div class="card-body">';
2056
  echo '<p>Emergency Recovery Script is a standalone, single-file, WordPress independent PHP script created to <b>recover WordPress sites from the most difficult situations</b>. When access to the admin is not possible when core files are compromised (accidental delete or malware related situations), when you get the white screen of death, can\'t log in for whatever reason or a plugin has killed your site - emergency recovery script can fix the problem! Some of the things ERS can do;</p>';
2057
  echo '<ul class="plain-list">';
2068
  echo '</div>'; // emergency recovery script
2069
 
2070
  echo '<div class="card">';
2071
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Public Support Forum', 'wp-reset'), 'support-forum', array('collapse_button' => false)));
2072
  echo '<div class="card-body">';
2073
  echo '<p>' . __('We are very active on the <a href="https://wordpress.org/support/plugin/wp-reset" target="_blank">official WP Reset support forum</a>. If you found a bug, have a feature idea or just want to say hi - please drop by. We love to hear back from our users.', 'wp-reset') . '</p>';
2074
  echo '</div>';
2075
  echo '</div>'; // forum
2076
 
2077
  echo '<div class="card">';
2078
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Premium Email Support', 'wp-reset'), 'support-email', array('collapse_button' => false, 'pro' => true)));
2079
  echo '<div class="card-body">';
2080
  echo '<p class="mb0">Need urgent support? Have one of our devs personally help you with your issue. All PRO license holders have access to premium email support. Get <span class="pro-feature pro-feature-text" data-feature="support-email">WP Reset <span>PRO</span></span> now.</p>';
2081
  echo '</div>';
2082
  echo '</div>'; // email support
2083
 
2084
  echo '<div class="card">';
2085
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Care to Help Out?', 'wp-reset'), 'support-help-out', array('collapse_button' => false)));
2086
  echo '<div class="card-body">';
2087
  echo '<p class="mb0">' . __('No need for donations :) If you can give us a <a href="https://wordpress.org/support/plugin/wp-reset/reviews/#new-post" target="_blank">five star rating</a> you\'ll help out more than you can imagine. A public mention <a href="https://twitter.com/webfactoryltd" target="_blank">@webfactoryltd</a> also does wonders. Thank you!', 'wp-reset') . '</p>';
2088
  echo '</div>';
2097
  */
2098
  private function tab_pro()
2099
  {
2100
+ $agency_lifetime = $this->generate_web_link('pricing-table', '/buy/', array('p' => 'wp-reset-pro-agency-ltd-launch'));
2101
+ $team_lifetime = $this->generate_web_link('pricing-table', '/', array(), 'pricing');
2102
+ $personal_lifetime = $this->generate_web_link('pricing-table', '/buy/', array('p' => 'wp-reset-pro-personal-ltd-launch'));
2103
+
2104
  echo '<div class="card">';
2105
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('WP Reset PRO', 'wp-reset'), 'pro-features', array('collapse_button' => false)));
2106
  echo '<div class="card-body">';
2107
  echo '<p>More ways to reset your site, more tools, automatic snapshots, collections, email support and the emergency recover script - that\'s WP Reset PRO in a nutshell. The same <b>quality and easy-of-use</b> you experienced in the free version is very much a part of the PRO one, but extended and upgraded with more tools that will save you even more time.</p>';
2108
  echo '<p>WP Reset PRO is aimed towards <b>webmasters, agencies, and everyone who buildsa a lot of WordPress sites</b>. It\'s much, much more than a "reset" tool. It\'s an easy way to start a new site, to test changes and to get out of the thickest jams. And thanks to its cloud features and the Dashboard it\'ll give you access to collections and snapshots on all the sites you\'re working on - instantly, without dragging any files along.</p>';
2112
  echo '</div>';
2113
 
2114
  echo '<div class="card">';
2115
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Pricing', 'wp-reset'), 'pro-pricing', array('collapse_button' => false)));
2116
  echo '<div class="card-body">';
2117
 
2118
  echo '<table id="pricing-table" class="mb0">';
2119
  echo '<tr>';
2120
  echo '<th>&nbsp;</th>';
 
 
 
2121
  echo '<th nowrap>WP Reset<br>Free</th>';
2122
+ echo '<th nowrap>WP Reset <span>PRO</span><br><b>Personal</b></th>';
2123
+ echo '<th nowrap>WP Reset <span>PRO</span><br><b>Team</b></th>';
2124
+ echo '<th nowrap>WP Reset <span>PRO</span><br><b>Agency</b></th>';
2125
+ echo '</tr>';
2126
+
2127
+ echo '<tr class="pricing"><td>Lifetime Price</td>';
2128
+ echo '<td>free</td>';
2129
+ echo '<td>one-time payment<br><del>&nbsp;$99&nbsp;</del> <b>$49</b><br><a href="' . esc_url($personal_lifetime) . '" class="button button-primary" target="_blank">BUY NOW</a></td>';
2130
+ echo '<td>one-time payment<br><del>&nbsp;$159&nbsp;</del> <b>$59</b><br><a href="' . esc_url($team_lifetime) . '" class="button button-primary" target="_blank">BUY NOW</a></td>';
2131
+ echo '<td>one-time payment<br><del>&nbsp;$399&nbsp;</del> <b>$199</b><br><a href="' . esc_url($agency_lifetime) . '" class="button button-primary" target="_blank">BUY NOW</a></td>';
2132
  echo '</tr>';
2133
 
2134
  $rows = array();
2144
  $rows['Plugins & Themes Collections'] = array(false, true, true, true);
2145
  $rows['Emergency Recovery Script'] = array(false, true, true, true);
2146
  $rows['Email Support'] = array(false, true, true, true);
2147
+ $rows['WP Reset Dashboard with License Manager'] = array(false, true, true, true);
2148
+ $rows['White-Label & Rebranding'] = array(false, false, false, true);
2149
+ $rows['Manage Snapshots & Collections for all sites in Dashboard'] = array(false, true, true, true);
 
 
2150
  $rows['Number of sites included in the license (localhosts are not counted & you can change sites)'] = array('&infin;', 1, 5, 100);
2151
  $rows['Number of WP Reset Cloud site licenses with 2GB storage per site (localhosts are not counted & you can change sites)'] = array(0, 1, 5, 20);
2152
 
2153
  foreach ($rows as $feature => $details) {
2154
  echo '<tr>';
2155
  echo '<td>' . esc_html($feature) . '</td>';
 
2156
  foreach ($details as $tmp) {
2157
  echo '<td>';
2158
  if ($tmp === true) {
2160
  } elseif ($tmp === false) {
2161
  echo '<i class="dashicons dashicons-no red tooltip" title="Feature is not available"></i>';
2162
  } else {
2163
+ WP_Reset_Utility::wp_kses_wf($tmp);
2164
  }
2165
  echo '</td>';
2166
  } // foreach column
2167
  echo '</tr>';
2168
  } // foreach $rows
2169
 
 
 
 
 
 
 
 
 
 
 
2170
  echo '<tr class="pricing"><td>Lifetime Price</td>';
 
 
 
2171
  echo '<td>free</td>';
2172
+ echo '<td>one-time payment<br><del>&nbsp;$99&nbsp;</del> <b>$49</b><br><a href="' . esc_url($personal_lifetime) . '" class="button button-primary" target="_blank">BUY NOW</a></td>';
2173
+ echo '<td>one-time payment<br><del>&nbsp;$159&nbsp;</del> <b>$59</b><br><a href="' . esc_url($team_lifetime) . '" class="button button-primary" target="_blank">BUY NOW</a></td>';
2174
+ echo '<td>one-time payment<br><del>&nbsp;$399&nbsp;</del> <b>$199</b><br><a href="' . esc_url($agency_lifetime) . '" class="button button-primary" target="_blank">BUY NOW</a></td>';
2175
  echo '</tr>';
2176
  echo '</table>';
2177
 
2179
  echo '</div>';
2180
 
2181
  echo '<div class="card">';
2182
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header(__('Activate PRO License', 'wp-reset'), 'pro-activate', array('collapse_button' => false)));
2183
  echo '<div class="card-body">';
2184
 
2185
  echo '<p>License key is visible on the confirmation screen, right after purchasing. You can also find it in the confirmation email sent to the email address provided on purchase. Or use keys created with the <a href="https://dashboard.wpreset.com/licenses/" target="_blank">license manager</a>.</p>
2281
 
2282
  echo '<p class="mb0"><b>Currently used WordPress tables</b>, prefixed with <i>' . esc_html($wpdb->prefix) . '</i>, consist of ' . esc_html($tbl_core) . ' standard and ';
2283
  if ($tbl_custom) {
2284
+ echo esc_attr($tbl_custom) . ' custom table' . ($tbl_custom == 1 ? '' : 's');
2285
  } else {
2286
  echo 'no custom tables';
2287
  }
2294
  echo '</div>';
2295
 
2296
  echo '<div class="card">';
2297
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header('User Created Snapshots', 'snapshots-user', array('collapse_button' => 1, 'create_snapshot' => true, 'snapshot_actions' => true)));
2298
  echo '<div class="card-body">';
2299
  if ($snapshots = $this->get_snapshots()) {
2300
  $snapshots = array_reverse($snapshots);
2310
 
2311
  echo '<td>';
2312
  if (current_time('timestamp') - strtotime($ss['timestamp']) > 12 * HOUR_IN_SECONDS) {
2313
+ echo esc_attr(date(get_option('date_format'), strtotime($ss['timestamp']))) . '<br>@ ' . esc_attr(date(get_option('time_format'), strtotime($ss['timestamp'])));
2314
  } else {
2315
+ echo esc_attr(human_time_diff(strtotime($ss['timestamp']), current_time('timestamp'))) . ' ago';
2316
  }
2317
  echo '</td>';
2318
 
2320
  if (!empty($ss['name'])) {
2321
  echo '<b>' . esc_html($ss['name']) . '</b><br>';
2322
  }
2323
+ echo esc_attr($ss['tbl_core']) . ' standard &amp; ';
2324
  if ($ss['tbl_custom']) {
2325
+ echo esc_attr($ss['tbl_custom']) . ' custom table' . ($ss['tbl_custom'] == 1 ? '' : 's');
2326
  } else {
2327
  echo 'no custom tables';
2328
  }
2329
+ echo ' totaling ' . esc_attr(number_format($ss['tbl_rows'])) . ' rows</td>';
2330
+ echo '<td class="ss-size">' . esc_attr(WP_Reset_Utility::format_size($ss['tbl_size'])) . '</td>';
2331
  echo '<td>';
2332
  echo '<div class="dropdown">
2333
  <a class="button dropdown-toggle" href="#">Actions</a>
2350
  echo '</div>';
2351
 
2352
  echo '<div class="card">';
2353
+ WP_Reset_Utility::wp_kses_wf($this->get_card_header('Automatic Snapshots', 'snapshots-auto', array('collapse_button' => false, 'pro' => true)));
2354
  echo '<div class="card-body">';
2355
  echo '<p><span class="pro-feature pro-feature-text" data-feature="snapshots-auto">WP Reset <span>PRO</span></span> creates automatic snapshots before significant events occur on your site that can cause it to stop working correctly. Plugin, theme and core updates, plugin and theme activations and deactivations all of those can happen in the background without your knowledge. With automatic snapshots, you can roll back any update with a single click. Snapshots can be uploaded to the WP Reset Cloud, Dropbox, Google Drive or pCloud, giving you an extra layer of security.<br>
2356
  Upgrade to <span class="pro-feature pro-feature-text" data-feature="snapshots-auto">WP Reset <span>PRO</span></span> to enable automatic snapshots and give your site an extra layer of safety.</p>';
2484
  } else {
2485
  $tbl_custom++;
2486
  }
2487
+
2488
  $wpdb->query("OPTIMIZE TABLE {$table->Name}");
2489
  $wpdb->query("CREATE TABLE {$uid}_{$table->Name} LIKE {$table->Name}");
2490
  $wpdb->query("INSERT {$uid}_{$table->Name} SELECT * FROM {$table->Name}");
2944
  } // generate_snapshot_uid
2945
 
2946
 
2947
+ // auto download / install / activate WP Force SSL plugin
2948
+ function install_wpfssl() {
2949
+ check_ajax_referer('install_wpfssl');
2950
+
2951
+ if (false === current_user_can('administrator')) {
2952
+ wp_die('Sorry, you have to be an admin to run this action.');
2953
+ }
2954
+
2955
+ $plugin_slug = 'wp-force-ssl/wp-force-ssl.php';
2956
+ $plugin_zip = 'https://downloads.wordpress.org/plugin/wp-force-ssl.latest-stable.zip';
2957
+
2958
+ @include_once ABSPATH . 'wp-admin/includes/plugin.php';
2959
+ @include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
2960
+ @include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
2961
+ @include_once ABSPATH . 'wp-admin/includes/file.php';
2962
+ @include_once ABSPATH . 'wp-admin/includes/misc.php';
2963
+ echo '<style>
2964
+ body{
2965
+ font-family: sans-serif;
2966
+ font-size: 14px;
2967
+ line-height: 1.5;
2968
+ color: #444;
2969
+ }
2970
+ </style>';
2971
+
2972
+ echo '<div style="margin: 20px; color:#444;">';
2973
+ echo 'If things are not done in a minute <a target="_parent" href="' . admin_url('plugin-install.php?s=force%20ssl%20webfactory&tab=search&type=term') .'">install the plugin manually via Plugins page</a><br><br>';
2974
+ echo 'Starting ...<br><br>';
2975
+
2976
+ wp_cache_flush();
2977
+ $upgrader = new Plugin_Upgrader();
2978
+ echo 'Check if WP Force SSL is already installed ... <br />';
2979
+ if ($this->is_plugin_installed($plugin_slug)) {
2980
+ echo 'WP Force SSL is already installed! <br /><br />Making sure it\'s the latest version.<br />';
2981
+ $upgrader->upgrade($plugin_slug);
2982
+ $installed = true;
2983
+ } else {
2984
+ echo 'Installing WP Force SSL.<br />';
2985
+ $installed = $upgrader->install($plugin_zip);
2986
+ }
2987
+ wp_cache_flush();
2988
+
2989
+ if (!is_wp_error($installed) && $installed) {
2990
+ echo 'Activating WP Force SSL.<br />';
2991
+ $activate = activate_plugin($plugin_slug);
2992
+
2993
+ if (is_null($activate)) {
2994
+ echo 'WP Force SSL Activated.<br />';
2995
+
2996
+ echo '<script>setTimeout(function() { top.location = "tools.php?page=wp-reset"; }, 1000);</script>';
2997
+ echo '<br>If you are not redirected in a few seconds - <a href="tools.php?page=wp-reset" target="_parent">click here</a>.';
2998
+ }
2999
+ } else {
3000
+ echo 'Could not install WP Force SSL. You\'ll have to <a target="_parent" href="' . admin_url('plugin-install.php?s=force%20ssl%20webfactory&tab=search&type=term') .'">download and install manually</a>.';
3001
+ }
3002
+
3003
+ echo '</div>';
3004
+ } // install_wpfssl
3005
+
3006
+
3007
  /**
3008
  * Clean up on uninstall; no action on deactive at the moment
3009
  *