WP Reset – Fastest WordPress Reset Plugin - Version 1.50

Version Description

Download this release

Release Info

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

Code changes from version 1.45 to 1.50

Files changed (6) hide show
  1. css/wp-reset.css +4 -1
  2. js/wp-reset-pointers.js +1 -1
  3. js/wp-reset.js +11 -1
  4. readme.txt +8 -1
  5. wp-reset-cli.php +18 -6
  6. wp-reset.php +105 -20
css/wp-reset.css CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * WP Reset
3
  * https://wpreset.com/
4
- * (c) WebFactory Ltd, 2017-2018
5
  */
6
 
7
  .tools_page_wp-reset #wp_reset_form input {
@@ -65,6 +65,7 @@
65
  .tools_page_wp-reset .button {
66
  box-shadow: none;
67
  text-shadow: none;
 
68
  }
69
 
70
  .tools_page_wp-reset .swal2-container {
@@ -127,6 +128,8 @@
127
  position: absolute;
128
  top: 2em;
129
  right: 2em;
 
 
130
  }
131
 
132
  .tools_page_wp-reset table {
1
  /**
2
  * WP Reset
3
  * https://wpreset.com/
4
+ * (c) WebFactory Ltd, 2017-2019
5
  */
6
 
7
  .tools_page_wp-reset #wp_reset_form input {
65
  .tools_page_wp-reset .button {
66
  box-shadow: none;
67
  text-shadow: none;
68
+ margin-top: 1em;
69
  }
70
 
71
  .tools_page_wp-reset .swal2-container {
128
  position: absolute;
129
  top: 2em;
130
  right: 2em;
131
+ margin: 0;
132
+ box-shadow: none;
133
  }
134
 
135
  .tools_page_wp-reset table {
js/wp-reset-pointers.js CHANGED
@@ -1,7 +1,7 @@
1
  /*
2
  * WP Reset
3
  * Backend GUI pointers
4
- * (c) Web factory Ltd, 2017 - 2018
5
  */
6
 
7
  jQuery(document).ready(function($){
1
  /*
2
  * WP Reset
3
  * Backend GUI pointers
4
+ * (c) Web factory Ltd, 2017 - 2019
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-2018
5
  */
6
 
7
 
@@ -75,6 +75,16 @@ jQuery(document).ready(function($) {
75
  }); // truncate custom tables
76
 
77
 
 
 
 
 
 
 
 
 
 
 
78
  // compare snapshot
79
  $('#wpr-snapshots').on('click', '.compare-snapshot', 'click', function(e) {
80
  e.preventDefault();
1
  /**
2
  * WP Reset
3
  * https://wpreset.com/
4
+ * (c) WebFactory Ltd, 2017-2019
5
  */
6
 
7
 
75
  }); // truncate custom tables
76
 
77
 
78
+ // delete htaccess file
79
+ $('.tools_page_wp-reset').on('click', '#delete-htaccess', 'click', function(e) {
80
+ e.preventDefault();
81
+
82
+ run_tool(this, 'delete_htaccess');
83
+
84
+ return false;
85
+ }); // delete htaccess file
86
+
87
+
88
  // compare snapshot
89
  $('#wpr-snapshots').on('click', '.compare-snapshot', 'click', function(e) {
90
  e.preventDefault();
readme.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: WebFactory, wpreset, googlemapswidget, securityninja, underconstru
4
  Requires at least: 4.0
5
  Requires PHP: 5.2
6
  Tested up to: 5.0
7
- Stable tag: 1.45
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -69,6 +69,7 @@ WP Reset has yet to be completely tested with multisite! Please be careful when
69
  * Delete plugins - deletes all plugins except WP Reset which remains active.
70
  * Delete themes - deletes all themes.
71
  * Empty or delete custom tables - empties (truncates) or deletes (drops) all custom database tables.
 
72
 
73
 
74
  == Installation ==
@@ -96,6 +97,12 @@ Or if needed, upload manually;
96
 
97
  == Changelog ==
98
 
 
 
 
 
 
 
99
  = v1.45 =
100
  * 2018/11/27
101
  * new tool: truncate or drop custom DB tables
4
  Requires at least: 4.0
5
  Requires PHP: 5.2
6
  Tested up to: 5.0
7
+ Stable tag: 1.50
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
69
  * Delete plugins - deletes all plugins except WP Reset which remains active.
70
  * Delete themes - deletes all themes.
71
  * Empty or delete custom tables - empties (truncates) or deletes (drops) all custom database tables.
72
+ * Delete .htaccess file - deletes the .htaccess file. If you need to edit .htaccess without FTP use our free <a href="https://wordpress.org/plugins/wp-htaccess-editor/">WP Htaccess Editor</a> plugin.
73
 
74
 
75
  == Installation ==
97
 
98
  == Changelog ==
99
 
100
+ = v1.50 =
101
+ * 2019/01/08
102
+ * new tool: delete .htaccess file
103
+ * new WP-CLI command: wp reset delete htaccess
104
+ * 90k users hit on 2018/12/12 with 489,100 downloads; 27 days for +10k & 58k downloads
105
+
106
  = v1.45 =
107
  * 2018/11/27
108
  * new tool: truncate or drop custom DB tables
wp-reset-cli.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * WP Reset
4
  * https://wpreset.com/
5
- * (c) WebFactory Ltd, 2017-2018
6
  */
7
 
8
 
@@ -85,7 +85,7 @@ class WP_Reset_CLI extends WP_CLI_Command {
85
  *
86
  * ## OPTIONS
87
  *
88
- * <plugins|themes|transients|uploads|custom-tables>
89
  * : WP objects to delete.
90
  *
91
  * [--yes]
@@ -102,16 +102,19 @@ class WP_Reset_CLI extends WP_CLI_Command {
102
  * $ wp reset delete custom-tables --truncate --yes
103
  * Success: 3 custom tables have been emptied.
104
  *
 
 
 
105
  * @when after_wp_load
106
  */
107
  function delete( $args, $assoc_args ) {
108
  global $wp_reset, $wpdb;
109
 
110
  if ( empty( $args[0] ) ) {
111
- WP_CLI::error( 'Please choose a subcommand: plugins, themes, transients, uploads or custom-tables.' );
112
  return;
113
- } elseif ( false == in_array( $args[0], array( 'themes', 'plugins', 'transients', 'uploads', 'custom-tables' ) ) ) {
114
- WP_CLI::error( 'Unknown subcommand. Please choose from: plugins, themes, transients, uploads or custom tables.' );
115
  } else {
116
  $subcommand = $args[0];
117
  }
@@ -148,9 +151,18 @@ class WP_Reset_CLI extends WP_CLI_Command {
148
  WP_CLI::success( $cnt . ' custom tables have been deleted.' );
149
  }
150
  break;
 
 
 
 
 
 
 
 
 
151
  default:
152
  // should never come to this but can't hurt
153
- WP_CLI::error( 'Unknown subcommand. Please choose from: plugins, themes, transients, uploads or custom-tables.' );
154
  return;
155
  }
156
  } // delete
2
  /**
3
  * WP Reset
4
  * https://wpreset.com/
5
+ * (c) WebFactory Ltd, 2017-2019
6
  */
7
 
8
 
85
  *
86
  * ## OPTIONS
87
  *
88
+ * <plugins|themes|transients|uploads|custom-tables|htaccess>
89
  * : WP objects to delete.
90
  *
91
  * [--yes]
102
  * $ wp reset delete custom-tables --truncate --yes
103
  * Success: 3 custom tables have been emptied.
104
  *
105
+ * $ wp reset delete htaccess --yes
106
+ * Success: Htaccess file has been deleted.
107
+ *
108
  * @when after_wp_load
109
  */
110
  function delete( $args, $assoc_args ) {
111
  global $wp_reset, $wpdb;
112
 
113
  if ( empty( $args[0] ) ) {
114
+ WP_CLI::error( 'Please choose a subcommand: plugins, themes, transients, uploads, htaccess or custom-tables.' );
115
  return;
116
+ } elseif ( false == in_array( $args[0], array( 'themes', 'plugins', 'transients', 'uploads', 'htaccess', 'custom-tables' ) ) ) {
117
+ WP_CLI::error( 'Unknown subcommand. Please choose from: plugins, themes, transients, uploads, htaccess or custom tables.' );
118
  } else {
119
  $subcommand = $args[0];
120
  }
151
  WP_CLI::success( $cnt . ' custom tables have been deleted.' );
152
  }
153
  break;
154
+ case 'htaccess':
155
+ WP_CLI::confirm( 'Are you sure you want to delete the .htaccess file?', $assoc_args );
156
+ $tmp = $wp_reset->do_delete_htaccess();
157
+ if ( !is_wp_error( $tmp ) ) {
158
+ WP_CLI::success( 'Htaccess file has been deleted.' );
159
+ } else {
160
+ WP_CLI::error( 'Htaccess file has not been deleted. ' . $tmp->get_error_message() );
161
+ }
162
+ break;
163
  default:
164
  // should never come to this but can't hurt
165
+ WP_CLI::error( 'Unknown subcommand. Please choose from: plugins, themes, transients, uploads, htaccess or custom-tables.' );
166
  return;
167
  }
168
  } // delete
wp-reset.php CHANGED
@@ -3,12 +3,12 @@
3
  Plugin Name: WP Reset
4
  Plugin URI: https://wpreset.com/
5
  Description: Reset the site to default installation values without modifying any files. Deletes all customizations and content.
6
- Version: 1.45
7
  Author: WebFactory Ltd
8
  Author URI: https://www.webfactoryltd.com/
9
  Text Domain: wp-reset
10
 
11
- Copyright 2015 - 2018 Web factory Ltd (email: wpreset@webfactoryltd.com)
12
 
13
  This program is free software; you can redistribute it and/or modify
14
  it under the terms of the GNU General Public License, version 2, as
@@ -26,7 +26,7 @@
26
 
27
  // include only file
28
  if (!defined('ABSPATH')) {
29
- wp_die(__('Do not open this file directly.', 'wp-error'));
30
  }
31
 
32
 
@@ -216,9 +216,13 @@ class WP_Reset {
216
  function ajax_dismiss_notice() {
217
  check_ajax_referer('wp-reset_dismiss_notice');
218
 
 
 
 
 
219
  $notice_name = trim(@$_GET['notice_name']);
220
  if (!$this->dismiss_notice($notice_name)) {
221
- wp_send_json_error('Notice is already dismissed.');
222
  } else {
223
  wp_send_json_success();
224
  }
@@ -264,7 +268,7 @@ class WP_Reset {
264
  * @return null
265
  */
266
  function admin_enqueue_scripts($hook) {
267
- // welcome pointer is shown on all pages except WPR, untill dismissed
268
  $pointers = $this->get_pointers();
269
  $dismissed_notices = $this->get_dismissed_notices();
270
 
@@ -274,7 +278,7 @@ class WP_Reset {
274
  }
275
  } // foreach
276
 
277
- if (!empty($pointers) && 'tools_page_wp-reset' != $hook) {
278
  $pointers['_nonce_dismiss_pointer'] = wp_create_nonce('wp-reset_dismiss_notice');
279
 
280
  wp_enqueue_style('wp-pointer');
@@ -285,14 +289,14 @@ class WP_Reset {
285
  }
286
 
287
  // exit early if not on WP Reset page
288
- if ('tools_page_wp-reset' != $hook) {
289
  return;
290
  }
291
 
292
  $options = $this->get_options();
293
 
294
- $js_localize = array('undocumented_error' => __('An undocumented error has occured. Please refresh the page and try again.', 'wp-reset'),
295
- 'documented_error' => __('An error has occured.', 'wp-reset'),
296
  'plugin_name' => __('WP Reset', 'wp-reset'),
297
  'settings_url' => admin_url('tools.php?page=wp-reset'),
298
  'icon_url' => $this->plugin_url . 'img/wp-reset-icon.png',
@@ -338,7 +342,7 @@ class WP_Reset {
338
  *
339
  * @return bool
340
  */
341
- function is_cli_running() {
342
  if (defined('WP_CLI') && WP_CLI) {
343
  return true;
344
  } else {
@@ -449,7 +453,14 @@ class WP_Reset {
449
  * @return int Number of deleted themes.
450
  */
451
  function do_delete_themes($keep_default_theme = true) {
452
- $default_theme = 'twentyseventeen';
 
 
 
 
 
 
 
453
  $all_themes = wp_get_themes(array('errors' => null));
454
 
455
  if (true == $keep_default_theme) {
@@ -503,6 +514,58 @@ class WP_Reset {
503
  } // do_drop_custom_tables
504
 
505
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
506
  /**
507
  * Run one tool via AJAX call
508
  *
@@ -511,6 +574,10 @@ class WP_Reset {
511
  function ajax_run_tool() {
512
  check_ajax_referer('wp-reset_run_tool');
513
 
 
 
 
 
514
  $tool = trim(@$_GET['tool']);
515
  $extra_data = trim(@$_GET['extra_data']);
516
 
@@ -526,6 +593,13 @@ class WP_Reset {
526
  } elseif ($tool == 'delete_uploads') {
527
  $cnt = $this->do_delete_uploads();
528
  wp_send_json_success($cnt);
 
 
 
 
 
 
 
529
  } elseif ($tool == 'drop_custom_tables') {
530
  $cnt = $this->do_drop_custom_tables();
531
  wp_send_json_success($cnt);
@@ -612,7 +686,7 @@ class WP_Reset {
612
  if (!$current_user->ID) {
613
  $tmp = get_users(array('role' => 'administrator', 'order' => 'ASC', 'order_by' => 'ID'));
614
  if (empty($tmp[0]->user_login)) {
615
- return new WP_Error('no_user', 'Reset failed. Unable to find any admin users in database.');
616
  }
617
  $current_user = $tmp[0];
618
  }
@@ -1033,6 +1107,16 @@ class WP_Reset {
1033
  echo '<a data-btn-confirm="Delete custom tables" data-text-wait="Deleting custom tables. Please wait." data-text-confirm="All custom tables with prefix <code>' . $wpdb->prefix . '</code> will be deleted. There is NO UNDO. WP Reset will not make any backups." data-text-done="%n custom tables have been deleted." class="button button-delete' . $custom_tables_btns . '" href="#" id="drop-custom-tables">Delete (drop) custom tables</a></p>';
1034
 
1035
  echo '</div>';
 
 
 
 
 
 
 
 
 
 
1036
  } // tab_tools
1037
 
1038
 
@@ -1767,7 +1851,7 @@ class WP_Reset {
1767
  */
1768
  function add_plugin_featured($plugin_slug, $res) {
1769
  // check if plugin is alredy on the list
1770
- if (is_array($res->plugins)) {
1771
  foreach ($res->plugins as $plugin) {
1772
  if ($plugin->slug == $plugin_slug) {
1773
  return $res;
@@ -1776,9 +1860,7 @@ class WP_Reset {
1776
  }
1777
 
1778
  if ($plugin_info = get_transient('wf-plugin-info-' . $plugin_slug)) {
1779
- $tmp1 = array_slice($res->plugins, 0, 2, false);
1780
- $tmp2 = array_slice($res->plugins, 2, sizeof($res->plugins) - 2, false);
1781
- $res->plugins = array_merge($tmp1, array($plugin_info), $tmp2);
1782
  } else {
1783
  $plugin_info = plugins_api('plugin_information', array(
1784
  'slug' => $plugin_slug,
@@ -1855,7 +1937,10 @@ class WP_Reset {
1855
 
1856
 
1857
  // Create plugin instance and hook things up
1858
- global $wp_reset;
1859
- $wp_reset = WP_Reset::getInstance();
1860
- add_action('plugins_loaded', array($wp_reset, 'load_textdomain'));
1861
- register_uninstall_hook(__FILE__, array('WP_Reset', 'uninstall'));
 
 
 
3
  Plugin Name: WP Reset
4
  Plugin URI: https://wpreset.com/
5
  Description: Reset the site to default installation values without modifying any files. Deletes all customizations and content.
6
+ Version: 1.50
7
  Author: WebFactory Ltd
8
  Author URI: https://www.webfactoryltd.com/
9
  Text Domain: wp-reset
10
 
11
+ Copyright 2015 - 2019 Web factory Ltd (email: wpreset@webfactoryltd.com)
12
 
13
  This program is free software; you can redistribute it and/or modify
14
  it under the terms of the GNU General Public License, version 2, as
26
 
27
  // include only file
28
  if (!defined('ABSPATH')) {
29
+ wp_die(__('Do not open this file directly.', 'wp-reset'));
30
  }
31
 
32
 
216
  function ajax_dismiss_notice() {
217
  check_ajax_referer('wp-reset_dismiss_notice');
218
 
219
+ if (!current_user_can('administrator')) {
220
+ wp_send_json_error(__('You are not allowed to run this action.', 'wp-reset'));
221
+ }
222
+
223
  $notice_name = trim(@$_GET['notice_name']);
224
  if (!$this->dismiss_notice($notice_name)) {
225
+ wp_send_json_error(__('Notice is already dismissed.', 'wp-reset'));
226
  } else {
227
  wp_send_json_success();
228
  }
268
  * @return null
269
  */
270
  function admin_enqueue_scripts($hook) {
271
+ // welcome pointer is shown on all pages except WPR to admins, until dismissed
272
  $pointers = $this->get_pointers();
273
  $dismissed_notices = $this->get_dismissed_notices();
274
 
278
  }
279
  } // foreach
280
 
281
+ if (!empty($pointers) && !$this->is_plugin_page() && current_user_can('administrator')) {
282
  $pointers['_nonce_dismiss_pointer'] = wp_create_nonce('wp-reset_dismiss_notice');
283
 
284
  wp_enqueue_style('wp-pointer');
289
  }
290
 
291
  // exit early if not on WP Reset page
292
+ if (!$this->is_plugin_page()) {
293
  return;
294
  }
295
 
296
  $options = $this->get_options();
297
 
298
+ $js_localize = array('undocumented_error' => __('An undocumented error has occurred. Please refresh the page and try again.', 'wp-reset'),
299
+ 'documented_error' => __('An error has occurred.', 'wp-reset'),
300
  'plugin_name' => __('WP Reset', 'wp-reset'),
301
  'settings_url' => admin_url('tools.php?page=wp-reset'),
302
  'icon_url' => $this->plugin_url . 'img/wp-reset-icon.png',
342
  *
343
  * @return bool
344
  */
345
+ static function is_cli_running() {
346
  if (defined('WP_CLI') && WP_CLI) {
347
  return true;
348
  } else {
453
  * @return int Number of deleted themes.
454
  */
455
  function do_delete_themes($keep_default_theme = true) {
456
+ global $wp_version;
457
+
458
+ if (version_compare($wp_version, '5.0', '<') === true) {
459
+ $default_theme = 'twentyseventeen';
460
+ } else {
461
+ $default_theme = 'twentynineteen';
462
+ }
463
+
464
  $all_themes = wp_get_themes(array('errors' => null));
465
 
466
  if (true == $keep_default_theme) {
514
  } // do_drop_custom_tables
515
 
516
 
517
+ /**
518
+ * Delete .htaccess file
519
+ *
520
+ * @return bool|WP_Error Action status.
521
+ */
522
+ function do_delete_htaccess() {
523
+ global $wp_filesystem;
524
+
525
+ if (empty($wp_filesystem)) {
526
+ require_once ABSPATH . '/wp-admin/includes/file.php';
527
+ WP_Filesystem();
528
+ }
529
+
530
+ $htaccess_path = $this->get_htaccess_path();
531
+ clearstatcache();
532
+
533
+ if (!$wp_filesystem->is_readable($htaccess_path)) {
534
+ return new WP_Error(1, 'Htaccess file does not exist; there\'s nothing to delete.');
535
+ }
536
+
537
+ if (!$wp_filesystem->is_writable($htaccess_path)) {
538
+ return new WP_Error(1, 'Htaccess file is not writable.');
539
+ }
540
+
541
+ if ($wp_filesystem->delete($htaccess_path, false, 'f')) {
542
+ return true;
543
+ } else {
544
+ return new WP_Error(1, 'Unknown error. Unable to delete htaccess file.');
545
+ }
546
+ } // do_delete_htaccess
547
+
548
+
549
+ /**
550
+ * Get .htaccess file path.
551
+ *
552
+ * @return string
553
+ */
554
+ function get_htaccess_path() {
555
+ if (!function_exists('get_home_path')) {
556
+ require_once ABSPATH . 'wp-admin/includes/file.php';
557
+ }
558
+
559
+ if ($this->is_cli_running()) {
560
+ $_SERVER['SCRIPT_FILENAME'] = ABSPATH;
561
+ }
562
+
563
+ $filepath = get_home_path() . '.htaccess';
564
+
565
+ return $filepath;
566
+ } // get_htaccess_path
567
+
568
+
569
  /**
570
  * Run one tool via AJAX call
571
  *
574
  function ajax_run_tool() {
575
  check_ajax_referer('wp-reset_run_tool');
576
 
577
+ if (!current_user_can('administrator')) {
578
+ wp_send_json_error(__('You are not allowed to run this action.', 'wp-reset'));
579
+ }
580
+
581
  $tool = trim(@$_GET['tool']);
582
  $extra_data = trim(@$_GET['extra_data']);
583
 
593
  } elseif ($tool == 'delete_uploads') {
594
  $cnt = $this->do_delete_uploads();
595
  wp_send_json_success($cnt);
596
+ } elseif ($tool == 'delete_htaccess') {
597
+ $tmp = $this->do_delete_htaccess();
598
+ if (is_wp_error($tmp)) {
599
+ wp_send_json_error($tmp->get_error_message());
600
+ } else {
601
+ wp_send_json_success($tmp);
602
+ }
603
  } elseif ($tool == 'drop_custom_tables') {
604
  $cnt = $this->do_drop_custom_tables();
605
  wp_send_json_success($cnt);
686
  if (!$current_user->ID) {
687
  $tmp = get_users(array('role' => 'administrator', 'order' => 'ASC', 'order_by' => 'ID'));
688
  if (empty($tmp[0]->user_login)) {
689
+ return new WP_Error(1, 'Reset failed. Unable to find any admin users in database.');
690
  }
691
  $current_user = $tmp[0];
692
  }
1107
  echo '<a data-btn-confirm="Delete custom tables" data-text-wait="Deleting custom tables. Please wait." data-text-confirm="All custom tables with prefix <code>' . $wpdb->prefix . '</code> will be deleted. There is NO UNDO. WP Reset will not make any backups." data-text-done="%n custom tables have been deleted." class="button button-delete' . $custom_tables_btns . '" href="#" id="drop-custom-tables">Delete (drop) custom tables</a></p>';
1108
 
1109
  echo '</div>';
1110
+
1111
+ echo '<div class="card">';
1112
+ echo '<h2>' . __('Delete .htaccess File', 'wp-reset') . '</h2>';
1113
+ echo '<p>' . __('This action deletes the .htaccess file located in <code>' . $this->get_htaccess_path() . '</code><br><b>There is NO UNDO. WP Reset does not make any backups.</b></p>', 'wp-reset');
1114
+
1115
+ echo '<p>If you need to edit .htaccess, install our free <a href="' . admin_url('plugin-install.php?s=htaccess+editor&tab=search&type=term') . '" target="_blank">WP Htaccess Editor</a> plugin. It automatically creates backups when you edit .htaccess. To create the default .htaccess file open <a href="' . admin_url('options-permalink.php') . '">Settings - Permalinks</a> and re-save settings. WordPress will recreate the file.</p>';
1116
+
1117
+ echo '<a 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 will not make any backups." data-text-done="Htaccess file has been deleted." class="button button-delete" href="#" id="delete-htaccess">Delete .htaccess file</a></p>';
1118
+
1119
+ echo '</div>';
1120
  } // tab_tools
1121
 
1122
 
1851
  */
1852
  function add_plugin_featured($plugin_slug, $res) {
1853
  // check if plugin is alredy on the list
1854
+ if (!empty($res->plugins) && is_array($res->plugins)) {
1855
  foreach ($res->plugins as $plugin) {
1856
  if ($plugin->slug == $plugin_slug) {
1857
  return $res;
1860
  }
1861
 
1862
  if ($plugin_info = get_transient('wf-plugin-info-' . $plugin_slug)) {
1863
+ array_unshift($res->plugins, $plugin_info);
 
 
1864
  } else {
1865
  $plugin_info = plugins_api('plugin_information', array(
1866
  'slug' => $plugin_slug,
1937
 
1938
 
1939
  // Create plugin instance and hook things up
1940
+ // Only if in admin - plugin has no frontend functionality
1941
+ if (is_admin() || WP_Reset::is_cli_running()) {
1942
+ global $wp_reset;
1943
+ $wp_reset = WP_Reset::getInstance();
1944
+ add_action('plugins_loaded', array($wp_reset, 'load_textdomain'));
1945
+ register_uninstall_hook(__FILE__, array('WP_Reset', 'uninstall'));
1946
+ }