Version Description
Download this release
Release Info
Developer | WebFactory |
Plugin | WP Reset – Fastest WordPress Reset Plugin |
Version | 1.65 |
Comparing to | |
See all releases |
Code changes from version 1.60 to 1.65
- css/wp-reset.css +14 -50
- js/wp-reset.js +25 -0
- readme.txt +7 -3
- wp-reset.php +17 -29
css/wp-reset.css
CHANGED
@@ -99,20 +99,28 @@
|
|
99 |
animation: spin 1.5s linear infinite;
|
100 |
}
|
101 |
|
|
|
|
|
|
|
|
|
102 |
.tools_page_wp-reset .notice-error {
|
103 |
-
border-color: #dd3036;
|
|
|
|
|
|
|
|
|
104 |
}
|
105 |
|
106 |
.tools_page_wp-reset .toggle-card {
|
107 |
position: absolute;
|
108 |
-
right:
|
109 |
top: 2.2em;
|
110 |
text-decoration: none;
|
111 |
}
|
112 |
|
113 |
.tools_page_wp-reset .card {
|
114 |
-
padding: 1em
|
115 |
-
width:
|
116 |
}
|
117 |
|
118 |
.tools_page_wp-reset .card.collapsed p,
|
@@ -660,50 +668,6 @@
|
|
660 |
text-indent: -21px;
|
661 |
}
|
662 |
|
663 |
-
|
664 |
-
background-color: #
|
665 |
-
border: 2px solid transparent;
|
666 |
-
margin-bottom: 20px;
|
667 |
-
}
|
668 |
-
|
669 |
-
.product-hunt .wpr-dismiss-notice {
|
670 |
-
position: absolute;
|
671 |
-
right: 0.9em;
|
672 |
-
top: 0.5em;
|
673 |
-
text-decoration: none;
|
674 |
-
color: white;
|
675 |
-
}
|
676 |
-
|
677 |
-
.product-hunt .wpr-dismiss-notice:hover {
|
678 |
-
color: #666;
|
679 |
-
}
|
680 |
-
|
681 |
-
.product-hunt b {
|
682 |
-
font-weight: bolder;
|
683 |
-
}
|
684 |
-
|
685 |
-
.product-hunt h2 {
|
686 |
-
display: inline-block;
|
687 |
-
color: white;
|
688 |
-
padding-left: 20px;
|
689 |
-
width: calc(100% - 100px);
|
690 |
-
vertical-align: top;
|
691 |
-
}
|
692 |
-
|
693 |
-
.product-hunt a {
|
694 |
-
text-decoration: none;
|
695 |
-
cursor: pointer;
|
696 |
-
}
|
697 |
-
|
698 |
-
.product-hunt a:focus {
|
699 |
-
box-shadow: none;
|
700 |
-
}
|
701 |
-
|
702 |
-
.product-hunt:hover {
|
703 |
-
border: 2px solid #666;
|
704 |
-
}
|
705 |
-
|
706 |
-
.product-hunt img {
|
707 |
-
height: auto;
|
708 |
-
width: 70px;
|
709 |
}
|
99 |
animation: spin 1.5s linear infinite;
|
100 |
}
|
101 |
|
102 |
+
.tools_page_wp-reset .card.notice-wrapper {
|
103 |
+
max-width: 600px;
|
104 |
+
}
|
105 |
+
|
106 |
.tools_page_wp-reset .notice-error {
|
107 |
+
border-top-color: #dd3036;
|
108 |
+
}
|
109 |
+
|
110 |
+
.tools_page_wp-reset .notice-info {
|
111 |
+
border-top-color: #0085ba;
|
112 |
}
|
113 |
|
114 |
.tools_page_wp-reset .toggle-card {
|
115 |
position: absolute;
|
116 |
+
right: 1em;
|
117 |
top: 2.2em;
|
118 |
text-decoration: none;
|
119 |
}
|
120 |
|
121 |
.tools_page_wp-reset .card {
|
122 |
+
padding: 1em 1em 1em 1em;
|
123 |
+
max-width: 560px;
|
124 |
}
|
125 |
|
126 |
.tools_page_wp-reset .card.collapsed p,
|
668 |
text-indent: -21px;
|
669 |
}
|
670 |
|
671 |
+
#wpfooter {
|
672 |
+
background-color: #ffffff;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
673 |
}
|
js/wp-reset.js
CHANGED
@@ -15,6 +15,21 @@ jQuery(document).ready(function($) {
|
|
15 |
})
|
16 |
.show();
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
// delete transients
|
19 |
$('.tools_page_wp-reset').on('click', '#delete-transients', 'click', function(e) {
|
20 |
e.preventDefault();
|
@@ -614,3 +629,13 @@ function wpr_fix_dialog_close(event, ui) {
|
|
614 |
jQuery('#' + event.target.id).dialog('close');
|
615 |
});
|
616 |
} // wpr_fix_dialog_close
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
})
|
16 |
.show();
|
17 |
|
18 |
+
// helper for swithcing tabs & linking anchors in different tabs
|
19 |
+
$('.tools_page_wp-reset').on('click', '.change-tab', function(e) {
|
20 |
+
e.preventDefault();
|
21 |
+
|
22 |
+
$('#wp-reset-tabs').tabs('option', 'active', $(this).data('tab'));
|
23 |
+
|
24 |
+
// get the link anchor and scroll to it
|
25 |
+
target = this.href.split('#')[1];
|
26 |
+
if (target) {
|
27 |
+
$.scrollTo('#' + target, 500, {offset: {top:-50, left:0}});
|
28 |
+
}
|
29 |
+
|
30 |
+
return false;
|
31 |
+
}); // jump to tab/anchor helper
|
32 |
+
|
33 |
// delete transients
|
34 |
$('.tools_page_wp-reset').on('click', '#delete-transients', 'click', function(e) {
|
35 |
e.preventDefault();
|
629 |
jQuery('#' + event.target.id).dialog('close');
|
630 |
});
|
631 |
} // wpr_fix_dialog_close
|
632 |
+
|
633 |
+
|
634 |
+
/**
|
635 |
+
* Copyright (c) 2007 Ariel Flesler - aflesler ○ gmail • com | https://github.com/flesler
|
636 |
+
* Licensed under MIT
|
637 |
+
* @author Ariel Flesler
|
638 |
+
* @version 2.1.2
|
639 |
+
*/
|
640 |
+
;(function(f){"use strict";"function"===typeof define&&define.amd?define(["jquery"],f):"undefined"!==typeof module&&module.exports?module.exports=f(require("jquery")):f(jQuery)})(function($){"use strict";function n(a){return!a.nodeName||-1!==$.inArray(a.nodeName.toLowerCase(),["iframe","#document","html","body"])}function h(a){return $.isFunction(a)||$.isPlainObject(a)?a:{top:a,left:a}}var p=$.scrollTo=function(a,d,b){return $(window).scrollTo(a,d,b)};p.defaults={axis:"xy",duration:0,limit:!0};$.fn.scrollTo=function(a,d,b){"object"=== typeof d&&(b=d,d=0);"function"===typeof b&&(b={onAfter:b});"max"===a&&(a=9E9);b=$.extend({},p.defaults,b);d=d||b.duration;var u=b.queue&&1<b.axis.length;u&&(d/=2);b.offset=h(b.offset);b.over=h(b.over);return this.each(function(){function k(a){var k=$.extend({},b,{queue:!0,duration:d,complete:a&&function(){a.call(q,e,b)}});r.animate(f,k)}if(null!==a){var l=n(this),q=l?this.contentWindow||window:this,r=$(q),e=a,f={},t;switch(typeof e){case "number":case "string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(e)){e= h(e);break}e=l?$(e):$(e,q);case "object":if(e.length===0)return;if(e.is||e.style)t=(e=$(e)).offset()}var v=$.isFunction(b.offset)&&b.offset(q,e)||b.offset;$.each(b.axis.split(""),function(a,c){var d="x"===c?"Left":"Top",m=d.toLowerCase(),g="scroll"+d,h=r[g](),n=p.max(q,c);t?(f[g]=t[m]+(l?0:h-r.offset()[m]),b.margin&&(f[g]-=parseInt(e.css("margin"+d),10)||0,f[g]-=parseInt(e.css("border"+d+"Width"),10)||0),f[g]+=v[m]||0,b.over[m]&&(f[g]+=e["x"===c?"width":"height"]()*b.over[m])):(d=e[m],f[g]=d.slice&& "%"===d.slice(-1)?parseFloat(d)/100*n:d);b.limit&&/^\d+$/.test(f[g])&&(f[g]=0>=f[g]?0:Math.min(f[g],n));!a&&1<b.axis.length&&(h===f[g]?f={}:u&&(k(b.onAfterFirst),f={}))});k(b.onAfter)}})};p.max=function(a,d){var b="x"===d?"Width":"Height",h="scroll"+b;if(!n(a))return a[h]-$(a)[b.toLowerCase()]();var b="client"+b,k=a.ownerDocument||a.document,l=k.documentElement,k=k.body;return Math.max(l[h],k[h])-Math.min(l[b],k[b])};$.Tween.propHooks.scrollLeft=$.Tween.propHooks.scrollTop={get:function(a){return $(a.elem)[a.prop]()}, set:function(a){var d=this.get(a);if(a.options.interrupt&&a._last&&a._last!==d)return $(a.elem).stop();var b=Math.round(a.now);d!==b&&($(a.elem)[a.prop](b),a._last=this.get(a))}};return p});
|
641 |
+
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== WP Reset - Best WordPress Reset Plugin ===
|
2 |
-
Tags: wordpress reset, reset
|
3 |
-
Contributors: WebFactory, wpreset, googlemapswidget,
|
4 |
Requires at least: 4.0
|
5 |
Requires PHP: 5.2
|
6 |
Tested up to: 5.2
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -103,6 +103,10 @@ Or if needed, upload manually;
|
|
103 |
|
104 |
== Changelog ==
|
105 |
|
|
|
|
|
|
|
|
|
106 |
= v1.60 =
|
107 |
* 2019/04/15
|
108 |
* bug fixes
|
1 |
=== WP Reset - Best WordPress Reset Plugin ===
|
2 |
+
Tags: wordpress reset, reset database, reset wordpress database, reset, advanced wordpress reset, restart wordpress, clean wordpress, default wordpress, reset wp, wp reset, developer, wp-cli
|
3 |
+
Contributors: WebFactory, wpreset, googlemapswidget, underconstructionpage
|
4 |
Requires at least: 4.0
|
5 |
Requires PHP: 5.2
|
6 |
Tested up to: 5.2
|
7 |
+
Stable tag: 1.65
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
103 |
|
104 |
== Changelog ==
|
105 |
|
106 |
+
= v1.65 =
|
107 |
+
* 2019/07/15
|
108 |
+
* bug fixes
|
109 |
+
|
110 |
= v1.60 =
|
111 |
* 2019/04/15
|
112 |
* bug fixes
|
wp-reset.php
CHANGED
@@ -3,7 +3,7 @@
|
|
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.
|
7 |
Author: WebFactory Ltd
|
8 |
Author URI: https://www.webfactoryltd.com/
|
9 |
Text Domain: wp-reset
|
@@ -606,6 +606,8 @@ class WP_Reset
|
|
606 |
|
607 |
$count = $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE '\_transient\_%' OR option_name LIKE '\_site\_transient\_%'");
|
608 |
|
|
|
|
|
609 |
do_action('wp_reset_delete_transients', $count);
|
610 |
|
611 |
return $count;
|
@@ -1252,8 +1254,8 @@ class WP_Reset
|
|
1252 |
|
1253 |
// ask for review
|
1254 |
// disabled due to survey
|
1255 |
-
if (
|
1256 |
-
echo '<div class="card notice-wrapper">';
|
1257 |
echo '<h2>' . __('Please help us keep the plugin free & up-to-date', 'wp-reset') . '</h2>';
|
1258 |
echo '<p>' . __('If you use & enjoy WP Reset, <b>please rate it on WordPress.org</b>. It only takes a second and helps us keep the plugin free and maintained. Thank you!', 'wp-reset') . '</p>';
|
1259 |
echo '<p><a class="button-primary button" title="' . __('Rate WP Reset', 'wp-reset') . '" target="_blank" href="https://wordpress.org/support/plugin/wp-reset/reviews/#new-post">' . __('Help keep the plugin free - rate it!', 'wp-reset') . '</a> <a href="#" class="wpr-dismiss-notice dismiss-notice-rate" data-notice="rate">' . __('I\'ve already rated it', 'wp-reset') . '</a></p>';
|
@@ -1272,22 +1274,6 @@ class WP_Reset
|
|
1272 |
$notice_shown = true;
|
1273 |
}
|
1274 |
|
1275 |
-
// Product Hunt banner
|
1276 |
-
if (
|
1277 |
-
false
|
1278 |
-
&& false == $this->get_dismissed_notices('product-hunt')
|
1279 |
-
&& current_time('mysql', false) >= '2019-04-26'
|
1280 |
-
&& current_time('mysql', false) <= '2019-05-03'
|
1281 |
-
) {
|
1282 |
-
echo '<div class="card notice-wrapper product-hunt"><a title="Check out WP Reset on Product Hunt" href="' . $this->generate_web_link('ph-banner', '/product-hunt-redirect/') . '" target="_blank">';
|
1283 |
-
echo '<img src="' . $this->plugin_url . '/img/product-hunt.png" title="Check out WP Reset on Product Hunt" alt="Check out WP Reset on Product Hunt"> ';
|
1284 |
-
echo '<h2>' . __('We\'re on <b>Product Hunt</b> this week! Come check out your favorite dev tool & show support ;) <i>Thanks!</i>', 'wp-reset') . '</h2>';
|
1285 |
-
echo '</a>';
|
1286 |
-
echo '<a href="#" title="Dismiss notice" class="wpr-dismiss-notice dismiss-notice" data-notice="product-hunt"><span class="dashicons dashicons-no"></span></a>';
|
1287 |
-
echo '</div>';
|
1288 |
-
$notice_shown = true;
|
1289 |
-
}
|
1290 |
-
|
1291 |
// tabs
|
1292 |
echo '<div id="wp-reset-tabs" class' . __('="', 'wp-reset') . 'ui-tabs">';
|
1293 |
|
@@ -1424,8 +1410,10 @@ class WP_Reset
|
|
1424 |
|
1425 |
echo '<b class="green">' . __('Resetting will not delete:', 'wp-reset') . '</b>';
|
1426 |
echo '<ul class="plain-list">';
|
1427 |
-
echo '<li>' . __('media files - they\'ll remain in the <i>wp-uploads</i> folder but will no longer be listed under Media', 'wp-reset')
|
1428 |
-
echo '<
|
|
|
|
|
1429 |
echo '<li>' . __('site title, WordPress address, site address, site language and search engine visibility settings', 'wp-reset') . '</li>';
|
1430 |
echo '<li>' . sprintf(__('logged in user "%s" will be restored with the current password', 'wp-reset'), $current_user->user_login) . '</li>';
|
1431 |
echo '</ul>';
|
@@ -1489,7 +1477,7 @@ class WP_Reset
|
|
1489 |
private function tab_tools()
|
1490 |
{
|
1491 |
echo '<div class="card">';
|
1492 |
-
echo '<h2>' . __('Delete Transients', 'wp-reset') . '</h2>';
|
1493 |
echo '<p>' . __('All transient related database entries will be deleted. Including expired and non-expired transients, and orphaned transient timeout entries.<br><b>There is NO UNDO. WP Reset does not make any backups.</b>', 'wp-reset') . '</p>';
|
1494 |
echo '<p><a 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. There is NO UNDO. WP Reset will not make any backups." 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></p>';
|
1495 |
echo '</div>';
|
@@ -1498,7 +1486,7 @@ class WP_Reset
|
|
1498 |
$upload_dir['basedir'] = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $upload_dir['basedir']);
|
1499 |
|
1500 |
echo '<div class="card">';
|
1501 |
-
echo '<h2>' . __('Clean Uploads Folder', 'wp-reset') . '</h2>';
|
1502 |
echo '<p>' . __('All files in <code>' . $upload_dir['basedir'] . '</code> folder will be deleted. Including folders and subfolders, and files in subfolders. Files associated with <a href="' . admin_url('upload.php') . '">media</a> entries will be deleted too.<br><b>There is NO UNDO. WP Reset does not make any backups.</b>', 'wp-reset') . '</p>';
|
1503 |
if (false != $upload_dir['error']) {
|
1504 |
echo '<p><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>';
|
@@ -1508,7 +1496,7 @@ class WP_Reset
|
|
1508 |
echo '</div>';
|
1509 |
|
1510 |
echo '<div class="card">';
|
1511 |
-
echo '<h2>' . __('Reset Theme Options', 'wp-reset') . '</h2>';
|
1512 |
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><b>There is NO UNDO. WP Reset does not make any backups.</b>', 'wp-reset') . '</p>';
|
1513 |
echo '<p><a 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. There is NO UNDO. WP Reset will not make any backups." 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></p>';
|
1514 |
echo '</div>';
|
@@ -1516,13 +1504,13 @@ class WP_Reset
|
|
1516 |
$theme = wp_get_theme();
|
1517 |
|
1518 |
echo '<div class="card">';
|
1519 |
-
echo '<h2>' . __('Delete Themes', 'wp-reset') . '</h2>';
|
1520 |
echo '<p>' . __('All themes will be deleted. Including the currently active theme - ' . $theme->get('Name') . '.<br><b>There is NO UNDO. WP Reset does not make any backups.</b>', 'wp-reset') . '</p>';
|
1521 |
echo '<p><a 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 will not make any 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>';
|
1522 |
echo '</div>';
|
1523 |
|
1524 |
echo '<div class="card">';
|
1525 |
-
echo '<h2>' . __('Delete Plugins', 'wp-reset') . '</h2>';
|
1526 |
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 backups.</b>', 'wp-reset') . '</p>';
|
1527 |
echo '<p><a 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 will not make any 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>';
|
1528 |
echo '</div>';
|
@@ -1531,7 +1519,7 @@ class WP_Reset
|
|
1531 |
$custom_tables = $this->get_custom_tables();
|
1532 |
|
1533 |
echo '<div class="card">';
|
1534 |
-
echo '<h2>' . __('Empty or Delete Custom Tables', 'wp-reset') . '</h2>';
|
1535 |
echo '<p>' . __('This action affects only custom tables with <code>' . $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><b>There is NO UNDO. WP Reset does not make any backups.</b></p>', 'wp-reset');
|
1536 |
if ($custom_tables) {
|
1537 |
echo '<p>' . __('The following ' . sizeof($custom_tables) . ' custom tables are affected by this tool: ');
|
@@ -1553,7 +1541,7 @@ class WP_Reset
|
|
1553 |
echo '</div>';
|
1554 |
|
1555 |
echo '<div class="card">';
|
1556 |
-
echo '<h2>' . __('Delete .htaccess File', 'wp-reset') . '</h2>';
|
1557 |
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');
|
1558 |
|
1559 |
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>';
|
@@ -1625,7 +1613,7 @@ class WP_Reset
|
|
1625 |
echo '<div class="card" id="card-snapshots">';
|
1626 |
echo '<a class="toggle-card" href="#" title="' . __('Collapse / expand box', 'wp-reset') . '"><span class="dashicons dashicons-arrow-up-alt2"></span></a>';
|
1627 |
echo '<h2>' . __('Database Snapshots', 'wp-reset') . '</h2>';
|
1628 |
-
echo '<p>A snapshot is a copy of all WP database tables, standard and custom ones, saved in your database. Files are not saved or included in snapshots in any way.<br>
|
1629 |
Snapshots are primarily a development tool. Although they can be used for backups (and downloaded), we suggest finding a more suitable tool for live sites, such as <a href="https://wordpress.org/plugins/updraftplus/" target="_blank">UpdraftPlus</a>. Use snapshots to find out what changes a plugin made to your database or to quickly restore the dev environment after testing database related changes.<br>Restoring a snapshot does not affect other snapshots, or WP Reset settings.</p>';
|
1630 |
|
1631 |
$table_status = $wpdb->get_results('SHOW TABLE STATUS');
|
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.65
|
7 |
Author: WebFactory Ltd
|
8 |
Author URI: https://www.webfactoryltd.com/
|
9 |
Text Domain: wp-reset
|
606 |
|
607 |
$count = $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE '\_transient\_%' OR option_name LIKE '\_site\_transient\_%'");
|
608 |
|
609 |
+
wp_cache_flush();
|
610 |
+
|
611 |
do_action('wp_reset_delete_transients', $count);
|
612 |
|
613 |
return $count;
|
1254 |
|
1255 |
// ask for review
|
1256 |
// disabled due to survey
|
1257 |
+
if ((!empty($meta['reset_count']) || !empty($snapshots)) && false === $notice_shown && false == $this->get_dismissed_notices('rate')) {
|
1258 |
+
echo '<div class="card notice-wrapper notice-info">';
|
1259 |
echo '<h2>' . __('Please help us keep the plugin free & up-to-date', 'wp-reset') . '</h2>';
|
1260 |
echo '<p>' . __('If you use & enjoy WP Reset, <b>please rate it on WordPress.org</b>. It only takes a second and helps us keep the plugin free and maintained. Thank you!', 'wp-reset') . '</p>';
|
1261 |
echo '<p><a class="button-primary button" title="' . __('Rate WP Reset', 'wp-reset') . '" target="_blank" href="https://wordpress.org/support/plugin/wp-reset/reviews/#new-post">' . __('Help keep the plugin free - rate it!', 'wp-reset') . '</a> <a href="#" class="wpr-dismiss-notice dismiss-notice-rate" data-notice="rate">' . __('I\'ve already rated it', 'wp-reset') . '</a></p>';
|
1274 |
$notice_shown = true;
|
1275 |
}
|
1276 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1277 |
// tabs
|
1278 |
echo '<div id="wp-reset-tabs" class' . __('="', 'wp-reset') . 'ui-tabs">';
|
1279 |
|
1410 |
|
1411 |
echo '<b class="green">' . __('Resetting will not delete:', 'wp-reset') . '</b>';
|
1412 |
echo '<ul class="plain-list">';
|
1413 |
+
echo '<li>' . __('media files - they\'ll remain in the <i>wp-uploads</i> folder but will no longer be listed under Media', 'wp-reset');
|
1414 |
+
echo __('; use the <a href="#clean-uploads-folder" data-tab="1" class="change-tab">Clean Uploads Folder</a> tool to remove media files', 'wp-reset') . '</li>';
|
1415 |
+
echo '<li>' . __('no files are touched; plugins, themes, uploads - everything stays', 'wp-reset');
|
1416 |
+
echo __('; if needed use the <a href="#delete-themes" class="change-tab" data-tab="1">Delete Themes</a> & <a href="#delete-plugins" class="change-tab" data-tab="1">Delete Plugins</a> tools', 'wp-reset') . '</li>';
|
1417 |
echo '<li>' . __('site title, WordPress address, site address, site language and search engine visibility settings', 'wp-reset') . '</li>';
|
1418 |
echo '<li>' . sprintf(__('logged in user "%s" will be restored with the current password', 'wp-reset'), $current_user->user_login) . '</li>';
|
1419 |
echo '</ul>';
|
1477 |
private function tab_tools()
|
1478 |
{
|
1479 |
echo '<div class="card">';
|
1480 |
+
echo '<h2 id="delete-transients">' . __('Delete Transients', 'wp-reset') . '</h2>';
|
1481 |
echo '<p>' . __('All transient related database entries will be deleted. Including expired and non-expired transients, and orphaned transient timeout entries.<br><b>There is NO UNDO. WP Reset does not make any backups.</b>', 'wp-reset') . '</p>';
|
1482 |
echo '<p><a 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. There is NO UNDO. WP Reset will not make any backups." 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></p>';
|
1483 |
echo '</div>';
|
1486 |
$upload_dir['basedir'] = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $upload_dir['basedir']);
|
1487 |
|
1488 |
echo '<div class="card">';
|
1489 |
+
echo '<h2 id="clean-uploads-folder">' . __('Clean Uploads Folder', 'wp-reset') . '</h2>';
|
1490 |
echo '<p>' . __('All files in <code>' . $upload_dir['basedir'] . '</code> folder will be deleted. Including folders and subfolders, and files in subfolders. Files associated with <a href="' . admin_url('upload.php') . '">media</a> entries will be deleted too.<br><b>There is NO UNDO. WP Reset does not make any backups.</b>', 'wp-reset') . '</p>';
|
1491 |
if (false != $upload_dir['error']) {
|
1492 |
echo '<p><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>';
|
1496 |
echo '</div>';
|
1497 |
|
1498 |
echo '<div class="card">';
|
1499 |
+
echo '<h2 id="reset-theme-options">' . __('Reset Theme Options', 'wp-reset') . '</h2>';
|
1500 |
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><b>There is NO UNDO. WP Reset does not make any backups.</b>', 'wp-reset') . '</p>';
|
1501 |
echo '<p><a 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. There is NO UNDO. WP Reset will not make any backups." 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></p>';
|
1502 |
echo '</div>';
|
1504 |
$theme = wp_get_theme();
|
1505 |
|
1506 |
echo '<div class="card">';
|
1507 |
+
echo '<h2 id="delete-themes">' . __('Delete Themes', 'wp-reset') . '</h2>';
|
1508 |
echo '<p>' . __('All themes will be deleted. Including the currently active theme - ' . $theme->get('Name') . '.<br><b>There is NO UNDO. WP Reset does not make any backups.</b>', 'wp-reset') . '</p>';
|
1509 |
echo '<p><a 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 will not make any 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>';
|
1510 |
echo '</div>';
|
1511 |
|
1512 |
echo '<div class="card">';
|
1513 |
+
echo '<h2 id="delete-plugins">' . __('Delete Plugins', 'wp-reset') . '</h2>';
|
1514 |
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 backups.</b>', 'wp-reset') . '</p>';
|
1515 |
echo '<p><a 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 will not make any 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>';
|
1516 |
echo '</div>';
|
1519 |
$custom_tables = $this->get_custom_tables();
|
1520 |
|
1521 |
echo '<div class="card">';
|
1522 |
+
echo '<h2 id="empty-delete-custom-tables">' . __('Empty or Delete Custom Tables', 'wp-reset') . '</h2>';
|
1523 |
echo '<p>' . __('This action affects only custom tables with <code>' . $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><b>There is NO UNDO. WP Reset does not make any backups.</b></p>', 'wp-reset');
|
1524 |
if ($custom_tables) {
|
1525 |
echo '<p>' . __('The following ' . sizeof($custom_tables) . ' custom tables are affected by this tool: ');
|
1541 |
echo '</div>';
|
1542 |
|
1543 |
echo '<div class="card">';
|
1544 |
+
echo '<h2 id="delete-htaccess-file">' . __('Delete .htaccess File', 'wp-reset') . '</h2>';
|
1545 |
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');
|
1546 |
|
1547 |
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>';
|
1613 |
echo '<div class="card" id="card-snapshots">';
|
1614 |
echo '<a class="toggle-card" href="#" title="' . __('Collapse / expand box', 'wp-reset') . '"><span class="dashicons dashicons-arrow-up-alt2"></span></a>';
|
1615 |
echo '<h2>' . __('Database Snapshots', 'wp-reset') . '</h2>';
|
1616 |
+
echo '<p>A snapshot is a copy of all WP database tables, standard and custom ones, saved in your database. Files are not saved or included in snapshots in any way. <a href="https://www.youtube.com/watch?v=xBfMmS12vMY" target="_blank">Watch a short video</a> overview and tutorial about Snapshots.<br>
|
1617 |
Snapshots are primarily a development tool. Although they can be used for backups (and downloaded), we suggest finding a more suitable tool for live sites, such as <a href="https://wordpress.org/plugins/updraftplus/" target="_blank">UpdraftPlus</a>. Use snapshots to find out what changes a plugin made to your database or to quickly restore the dev environment after testing database related changes.<br>Restoring a snapshot does not affect other snapshots, or WP Reset settings.</p>';
|
1618 |
|
1619 |
$table_status = $wpdb->get_results('SHOW TABLE STATUS');
|