WordPress Database Reset - Version 3.16

Version Description

  • 2020/09/01
  • fixed an issue with select tables element
Download this release

Release Info

Developer WebFactory
Plugin Icon 128x128 WordPress Database Reset
Version 3.16
Comparing to
See all releases

Code changes from version 3.15 to 3.16

assets/js/bsmselect.js CHANGED
@@ -4,10 +4,10 @@
4
  * based on Alternate Select Multiple (asmSelect) 1.0.4a beta (http://www.ryancramer.com/projects/asmselect/)
5
  *
6
  * Copyright (c) 2009 by Ryan Cramer - http://www.ryancramer.com
7
- * Copyright (c) 2010 by Victor Berchet - http://www.github.com/vicb
8
  *
9
  * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
10
  *
11
- * bsmSelect version: v1.4.3 - 2011-05-05
12
  */
13
- !function(a){function b(b,c){this.$original=a(b),this.buildingSelect=!1,this.ieClick=!1,this.ignoreOriginalChangeEvent=!1,this.options=c,this.buildDom()}b.prototype={generateUid:function(a){return this.uid=this.options.containerClass+a},buildDom:function(){var b=this,c=this.options;"original"===c.addItemTarget&&a("option",this.$original).each(function(b,c){null===a(c).data("bsm-order")&&a(c).data("bsm-order",b)});for(var d=0;a("#"+this.generateUid(d)).size();d++);this.$select=a("<select>",{"class":c.selectClass,name:c.selectClass+this.uid,id:c.selectClass+this.uid,change:a.proxy(this.selectChangeEvent,this),click:a.proxy(this.selectClickEvent,this)}),this.$list=a.isFunction(c.listType)?c.listType(this.$original):a("<"+c.listType+">",{id:c.listClass+this.uid}),this.$list.addClass(c.listClass),this.$container=a("<div>",{"class":c.containerClass,id:this.uid}),this.buildSelect(),this.$original.change(a.proxy(this.originalChangeEvent,this)).wrap(this.$container).before(this.$select),this.$list.parent().length||this.$original.before(this.$list),this.$original.attr("id")&&a("label[for="+this.$original.attr("id")+"]").attr("for",this.$select.attr("id")),this.$list.delegate("."+c.removeClass,"click",function(){return b.dropListItem(a(this).closest("li")),!1}),a.each(c.plugins,function(){this.init(b)})},selectChangeEvent:function(){if(!(a.browser.msie&&a.browser.version<7)||this.ieClick){var b=a("option:selected:eq(0)",this.$select);b.data("orig-option")&&(this.addListItem(b),this.triggerOriginalChange(b.data("orig-option"),"add")),this.ieClick=!1}},selectClickEvent:function(){this.ieClick=!0},originalChangeEvent:function(){this.ignoreOriginalChangeEvent?this.ignoreOriginalChangeEvent=!1:(this.buildSelect(),a.browser.opera&&this.$list.hide().show())},buildSelect:function(){var b=this;this.buildingSelect=!0,this.$select.empty().prepend(a('<option value=""></option>').text(this.$original.attr("title")||this.options.title)),this.$list.empty(),this.$original.children().each(function(){a(this).is("option")?b.addSelectOption(b.$select,a(this)):a(this).is("optgroup")&&b.addSelectOptionGroup(b.$select,a(this))}),this.options.debugMode||this.$original.hide(),this.selectFirstItem(),this.buildingSelect=!1},addSelectOption:function(b,c){var d=a("<option>",{text:c.text(),val:c.val()}).appendTo(b).data("orig-option",c),e=c.is(":selected"),f=c.is(":disabled");c.data("bsm-option",d),e&&!f?(this.addListItem(d),this.disableSelectOption(d)):!e&&f&&this.disableSelectOption(d)},addSelectOptionGroup:function(b,c){var d=this,e=a("<optgroup>",{label:c.attr("label")}).appendTo(b);c.is(":disabled")&&e.attr("disabled","disabled"),a("option",c).each(function(){d.addSelectOption(e,a(this))})},selectFirstItem:function(){a("option:eq(0)",this.$select).attr("selected","selected")},disableSelectOption:function(b){b.addClass(this.options.optionDisabledClass).removeAttr("selected").attr("disabled","disabled").toggle(!this.options.hideWhenAdded),a.browser.msie&&a.browser.version<8&&this.$select.hide().show()},enableSelectOption:function(b){b.removeClass(this.options.optionDisabledClass).removeAttr("disabled").toggle(!this.options.hideWhenAdded),a.browser.msie&&a.browser.version<8&&this.$select.hide().show()},addListItem:function(b){var c,d=b.data("orig-option"),e=this.options;if(d){if(!this.buildingSelect){if(d.is(":selected"))return;d.attr("selected","selected")}switch(c=a("<li>",{"class":e.listItemClass}).append(a("<span>",{"class":e.listItemLabelClass,html:e.extractLabel(b,e)})).append(a("<a>",{href:"#","class":e.removeClass,html:e.removeLabel})).data("bsm-option",b),this.disableSelectOption(b.data("item",c)),e.addItemTarget){case"bottom":this.$list.append(c.hide());break;case"original":var f=d.data("bsm-order"),g=!1;a("."+e.listItemClass,this.$list).each(function(){return f<a(this).data("bsm-option").data("orig-option").data("bsm-order")?(c.hide().insertBefore(this),g=!0,!1):void 0}),g||this.$list.append(c.hide());break;default:this.$list.prepend(c.hide())}this.buildingSelect?a.bsmSelect.effects.show(c):(e.showEffect(c),e.highlightEffect(this.$select,c,e.highlightAddedLabel,this.options),this.selectFirstItem())}},dropListItem:function(b){var c=b.data("bsm-option"),d=this.options;c.removeData("item").data("orig-option").removeAttr("selected"),(this.buildingSelect?a.bsmSelect.effects.remove:d.hideEffect)(b),this.enableSelectOption(c),d.highlightEffect(this.$select,b,d.highlightRemovedLabel,d),this.triggerOriginalChange(c.data("orig-option"),"drop")},triggerOriginalChange:function(a,b){this.ignoreOriginalChangeEvent=!0,this.$original.trigger("change",[{option:a,value:a.val(),item:a.data("bsm-option").data("item"),type:b}])}},a.fn.bsmSelect=function(c){var d=a.extend({},a.bsmSelect.conf,c);return this.each(function(){var c=a(this).data("bsmSelect");c||(c=new b(a(this),d),a(this).data("bsmSelect",c))})},a.bsmSelect={},a.extend(a.bsmSelect,{effects:{show:function(a){a.show()},remove:function(a){a.remove()},highlight:function(b,c,d,e){var f,g=b.attr("id")+e.highlightClass;a("#"+g).remove(),f=a("<span>",{"class":e.highlightClass,id:g,html:d+c.children("."+e.listItemLabelClass).first().text()}).hide(),b.after(f.fadeIn("fast").delay(50).fadeOut("slow",function(){a(this).remove()}))},verticalListAdd:function(b){b.animate({opacity:"show",height:"show"},100,function(){a(this).animate({height:"+=2px"},100,function(){a(this).animate({height:"-=2px"},100)})})},verticalListRemove:function(b){b.animate({opacity:"hide",height:"hide"},100,function(){a(this).prev("li").animate({height:"-=2px"},100,function(){a(this).animate({height:"+=2px"},100)}),a(this).remove()})}},plugins:{}}),a.bsmSelect.conf={listType:"ol",showEffect:a.bsmSelect.effects.show,hideEffect:a.bsmSelect.effects.remove,highlightEffect:a.noop,addItemTarget:"bottom",hideWhenAdded:!1,debugMode:!1,title:"Select...",removeLabel:"remove",highlightAddedLabel:"Added: ",highlightRemovedLabel:"Removed: ",extractLabel:function(a){return a.html()},plugins:[],containerClass:"bsmContainer",selectClass:"bsmSelect",optionDisabledClass:"bsmOptionDisabled",listClass:"bsmList",listItemClass:"bsmListItem",listItemLabelClass:"bsmListItemLabel",removeClass:"bsmListItemRemove",highlightClass:"bsmHighlight"}}(jQuery);
4
  * based on Alternate Select Multiple (asmSelect) 1.0.4a beta (http://www.ryancramer.com/projects/asmselect/)
5
  *
6
  * Copyright (c) 2009 by Ryan Cramer - http://www.ryancramer.com
7
+ * Copyright (c) 2010-2013 by Victor Berchet - http://www.github.com/vicb
8
  *
9
  * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
10
  *
11
+ * bsmSelect version: v1.4.7 - 2013-12-19
12
  */
13
+ !function(t){function e(e,i){this.$original=t(e),this.buildingSelect=!1,this.ieClick=!1,this.ignoreOriginalChangeEvent=!1,this.options=i,this.buildDom()}e.prototype={generateUid:function(t){return this.uid=this.options.containerClass+t},buildDom:function(){var e=this,i=this.options;"original"===i.addItemTarget&&t("option",this.$original).each(function(e,i){void 0===t(i).data("bsm-order")&&t(i).data("bsm-order",e)});for(var s=0;t("#"+this.generateUid(s)).size();s++);this.$select=t("<select>",{class:i.selectClass,id:i.selectClass+this.uid,change:t.proxy(this.selectChangeEvent,this),click:t.proxy(this.selectClickEvent,this)}),this.$list=t.isFunction(i.listType)?i.listType(this.$original):t("<"+i.listType+">",{id:i.listClass+this.uid}),this.$list.addClass(i.listClass),this.$container=t("<div>",{class:i.containerClass,id:this.uid}),this.buildSelect(),this.$original.change(t.proxy(this.originalChangeEvent,this)).wrap(this.$container).before(this.$select),this.$list.parent().length||this.$original.before(this.$list),this.$original.attr("id")&&t("label[for='"+this.$original.attr("id")+"']").attr("for",this.$select.attr("id")),this.$list.delegate("."+i.removeClass,"click",function(){return e.dropListItem(t(this).closest("li")),!1}),t.each(i.plugins,function(){this.init(e)})},selectChangeEvent:function(){if(!(t.browser&&t.browser.msie&&t.browser.version<7)||this.ieClick){var e=t("option:selected:eq(0)",this.$select);e.data("orig-option")&&0==this.triggerOriginalChange(e.data("orig-option"),"add")&&this.addListItem(e),this.ieClick=!1}},selectClickEvent:function(){this.ieClick=!0},originalChangeEvent:function(){this.ignoreOriginalChangeEvent?this.ignoreOriginalChangeEvent=!1:(this.buildSelect(),t.browser&&t.browser.opera&&this.$list.hide().show())},buildSelect:function(){var e=this;this.buildingSelect=!0,this.$select.empty().prepend(t('<option value=""></option>').text(this.$original.attr("title")||this.options.title)),this.$list.empty(),this.$original.children().each(function(){t(this).is("option")?e.addSelectOption(e.$select,t(this)):t(this).is("optgroup")&&e.addSelectOptionGroup(e.$select,t(this))}),this.options.debugMode||this.$original.hide(),this.selectFirstItem(),this.buildingSelect=!1},addSelectOption:function(e,i){var s=t("<option>",{text:i.text(),val:i.val()}).appendTo(e).data("orig-option",i),o=i.is(":selected"),a=i.is(":disabled");i.data("bsm-option",s),o&&!a?(this.addListItem(s),this.disableSelectOption(s)):!o&&a&&this.disableSelectOption(s)},addSelectOptionGroup:function(e,i){var s=this,o=t("<optgroup>",{label:i.attr("label")}).appendTo(e);i.is(":disabled")&&o.attr("disabled","disabled"),t("option",i).each(function(){s.addSelectOption(o,t(this))})},selectFirstItem:function(){t("option:eq(0)",this.$select).attr("selected","selected")},disableSelectOption:function(e){e.addClass(this.options.optionDisabledClass).removeAttr("selected").attr("disabled","disabled").toggle(!this.options.hideWhenAdded),t.browser&&t.browser.msie&&t.browser.version<8&&this.$select.hide().show()},enableSelectOption:function(e){e.removeClass(this.options.optionDisabledClass).removeAttr("disabled").toggle(!this.options.hideWhenAdded),t.browser&&t.browser.msie&&t.browser.version<8&&this.$select.hide().show()},addListItem:function(e){var i,s=e.data("orig-option"),o=this.options;if(s){if(!this.buildingSelect){if(s.is(":selected"))return;s.attr("selected","selected")}switch(i=t("<li>",{class:o.listItemClass}).append(t("<span>",{class:o.listItemLabelClass,html:o.extractLabel(e,o)})).append(t("<a>",{href:"#",class:o.removeClass,html:o.removeLabel})).data("bsm-option",e),this.disableSelectOption(e.data("item",i)),o.addItemTarget){case"bottom":this.$list.append(i.hide());break;case"original":var a=s.data("bsm-order"),l=!1;this.$list.children().each(function(){if(a<t(this).data("bsm-option").data("orig-option").data("bsm-order"))return i.hide().insertBefore(this),l=!0,!1}),l||this.$list.append(i.hide());break;default:this.$list.prepend(i.hide())}this.buildingSelect?t.bsmSelect.effects.show(i):(o.showEffect(i),o.highlightEffect(this.$select,i,o.highlightAddedLabel,this.options),this.selectFirstItem())}},dropListItem:function(e){var i=e.data("bsm-option"),s=this.options;0==this.triggerOriginalChange(i.data("orig-option"),"drop")&&(i.removeData("item").data("orig-option").removeAttr("selected"),(this.buildingSelect?t.bsmSelect.effects.remove:s.hideEffect)(e),this.enableSelectOption(i),s.highlightEffect(this.$select,e,s.highlightRemovedLabel,s))},triggerOriginalChange:function(e,i){var s=t.Event("change");return this.ignoreOriginalChangeEvent=!0,this.$original.trigger(s,[{option:e,value:e.val(),item:e.data("bsm-option").data("item"),type:i}]),s.isDefaultPrevented()}},t.fn.bsmSelect=function(i){var s=t.extend({},t.bsmSelect.conf,i);return this.each(function(){var i=t(this).data("bsmSelect");i||(i=new e(t(this),s),t(this).data("bsmSelect",i))})},t.bsmSelect={},t.extend(t.bsmSelect,{effects:{show:function(t){t.show()},remove:function(t){t.remove()},highlight:function(e,i,s,o){var a,l=e.attr("id")+o.highlightClass;t("#"+l).remove(),a=t("<span>",{class:o.highlightClass,id:l,html:s+i.children("."+o.listItemLabelClass).first().text()}).hide(),e.after(a.fadeIn("fast").delay(50).fadeOut("slow",function(){t(this).remove()}))},verticalListAdd:function(e){e.animate({opacity:"show",height:"show"},100,function(){t(this).animate({height:"+=2px"},100,function(){t(this).animate({height:"-=2px"},100)})})},verticalListRemove:function(e){e.animate({opacity:"hide",height:"hide"},100,function(){t(this).prev("li").animate({height:"-=2px"},100,function(){t(this).animate({height:"+=2px"},100)}),t(this).remove()})}},plugins:{}}),t.bsmSelect.conf={listType:"ol",showEffect:t.bsmSelect.effects.show,hideEffect:t.bsmSelect.effects.remove,highlightEffect:t.noop,addItemTarget:"bottom",hideWhenAdded:!1,debugMode:!1,title:"Select...",removeLabel:"remove",highlightAddedLabel:"Added: ",highlightRemovedLabel:"Removed: ",extractLabel:function(t){return t.html()},plugins:[],containerClass:"bsmContainer",selectClass:"bsmSelect",optionDisabledClass:"bsmOptionDisabled",listClass:"bsmList",listItemClass:"bsmListItem",listItemLabelClass:"bsmListItemLabel",removeClass:"bsmListItemRemove",highlightClass:"bsmHighlight"}}(jQuery);
class-db-reset-admin.php CHANGED
@@ -62,6 +62,7 @@ if (!class_exists('DB_Reset_Admin')) :
62
  add_action('admin_action_install_wpr', array($this, 'install_wpr'));
63
 
64
  add_filter('install_plugins_table_api_args_featured', array($this, 'featured_plugins_tab'));
 
65
  add_filter('plugin_action_links_' . plugin_basename(DB_RESET_FILE), array($this, 'plugin_action_links'));
66
  add_filter('plugin_row_meta', array($this, 'plugin_meta_links'), 10, 2);
67
  add_filter('admin_footer_text', array($this, 'admin_footer_text'));
@@ -122,10 +123,9 @@ if (!class_exists('DB_Reset_Admin')) :
122
  {
123
  remove_filter('plugins_api_result', array($this, 'plugins_api_result'), 10, 3);
124
 
125
- $res = $this->add_plugin_favs('eps-301-redirects', $res);
126
- $res = $this->add_plugin_favs('wp-htaccess-editor', $res);
127
  $res = $this->add_plugin_favs('under-construction-page', $res);
128
  $res = $this->add_plugin_favs('simple-author-box', $res);
 
129
 
130
  return $res;
131
  } // plugins_api_result
62
  add_action('admin_action_install_wpr', array($this, 'install_wpr'));
63
 
64
  add_filter('install_plugins_table_api_args_featured', array($this, 'featured_plugins_tab'));
65
+ add_filter('install_plugins_table_api_args_recommended', array($this, 'featured_plugins_tab'));
66
  add_filter('plugin_action_links_' . plugin_basename(DB_RESET_FILE), array($this, 'plugin_action_links'));
67
  add_filter('plugin_row_meta', array($this, 'plugin_meta_links'), 10, 2);
68
  add_filter('admin_footer_text', array($this, 'admin_footer_text'));
123
  {
124
  remove_filter('plugins_api_result', array($this, 'plugins_api_result'), 10, 3);
125
 
 
 
126
  $res = $this->add_plugin_favs('under-construction-page', $res);
127
  $res = $this->add_plugin_favs('simple-author-box', $res);
128
+ $res = $this->add_plugin_favs('eps-301-redirects', $res);
129
 
130
  return $res;
131
  } // plugins_api_result
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === WP Database Reset ===
2
- Contributors: WebFactory, wpreset, underconstructionpage, googlemapswidget
3
  Tags: database, reset, restore, database reset, wp reset, developer, development
4
  Requires at least: 4.2
5
  Requires PHP: 5.2
6
- Tested up to: 5.4
7
- Stable tag: 3.15
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -65,6 +65,10 @@ WP Database Reset was originally developed in October 2011 by <a href="https://g
65
 
66
  == Changelog ==
67
 
 
 
 
 
68
  = 3.15 =
69
  * 2020/01/14
70
  * security fixes - thanks to Chloe from Wordfence
1
  === WP Database Reset ===
2
+ Contributors: WebFactory
3
  Tags: database, reset, restore, database reset, wp reset, developer, development
4
  Requires at least: 4.2
5
  Requires PHP: 5.2
6
+ Tested up to: 5.5
7
+ Stable tag: 3.16
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
65
 
66
  == Changelog ==
67
 
68
+ = 3.16 =
69
+ * 2020/09/01
70
+ * fixed an issue with select tables element
71
+
72
  = 3.15 =
73
  * 2020/01/14
74
  * security fixes - thanks to Chloe from Wordfence
views/index.php CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  <div class="wrap card">
2
  <h1><?php _e( 'Database Reset', 'wordpress-database-reset' ) ?></h1>
3
 
@@ -15,19 +20,15 @@
15
  <p>Like the plugin? Please <a href="https://wordpress.org/support/plugin/wordpress-database-reset/reviews/#new-post" target="_blank">rate it &starf;&starf;&starf;&starf;&starf;</a>. It's what keeps it free &amp; maintained.<br><b>Thank you!</b></p>
16
  </div>
17
 
18
- <div class="wrap card" id="wp-reset-ad">
19
- <a href="#" class="open-wpr-upsell"><img src="<?php echo plugins_url( 'assets/images/wp-reset-icon.png', DB_RESET_FILE ); ?>" alt="WP Reset - used on +200,000 sites" title="WP Reset - used on +200,000 sites"></a>
20
- <p>Need more control? Reset theme options, media files, transients or <em>.htaccess</em> file? Delete all uploads, plugins and themes? Or create database snapshots and restore them with one click? <a href="#" class="open-wpr-upsell">Install the free WP Reset plugin</a>. It's used on <b>+200,000 sites daily</b>!</p>
21
- </div>
22
-
23
  <div id="wpr-upsell-dialog" style="display: none;" title="WP Reset">
24
  <span class="ui-helper-hidden-accessible"><input type="text"/></span>
25
  <div style="padding: 20px; font-size: 15px;">
26
  <ul>
27
- <li>Free plugin used on +200,000 sites</li>
28
  <li>Simple &amp; easy to use with clear instructions</li>
 
29
  <li>Use it to quickly reset any data in WordPress</li>
30
- <li>Extremely usefull for cleaning demo data from themes &amp; plugins</li>
31
  <li>Create Database Snapshot to revert WP to previous states with 1 click</li>
32
  <li>Compare current &amp; previous snapshots to see changes done by plugins</li>
33
  </ul>
1
+ <div class="wrap card" id="wp-reset-ad">
2
+ <a href="#" class="open-wpr-upsell"><img src="<?php echo plugins_url( 'assets/images/wp-reset-icon.png', DB_RESET_FILE ); ?>" alt="WP Reset - used on +200,000 sites" title="WP Reset - used on +200,000 sites"></a>
3
+ <p>Need more control over what gets reset? Automatic backups when you reset or when WordPress updates something without asking you? <a href="#" class="open-wpr-upsell">Install the free WP Reset plugin</a>. It's used on <b>+250,000 sites daily</b>!</p>
4
+ </div>
5
+
6
  <div class="wrap card">
7
  <h1><?php _e( 'Database Reset', 'wordpress-database-reset' ) ?></h1>
8
 
20
  <p>Like the plugin? Please <a href="https://wordpress.org/support/plugin/wordpress-database-reset/reviews/#new-post" target="_blank">rate it &starf;&starf;&starf;&starf;&starf;</a>. It's what keeps it free &amp; maintained.<br><b>Thank you!</b></p>
21
  </div>
22
 
 
 
 
 
 
23
  <div id="wpr-upsell-dialog" style="display: none;" title="WP Reset">
24
  <span class="ui-helper-hidden-accessible"><input type="text"/></span>
25
  <div style="padding: 20px; font-size: 15px;">
26
  <ul>
27
+ <li>Free plugin used on +250,000 sites</li>
28
  <li>Simple &amp; easy to use with clear instructions</li>
29
+ <li>Automatically creates a snapshot on every plugin &amp; theme update</li>
30
  <li>Use it to quickly reset any data in WordPress</li>
31
+ <li>Extremely useful for cleaning demo data from themes &amp; plugins</li>
32
  <li>Create Database Snapshot to revert WP to previous states with 1 click</li>
33
  <li>Compare current &amp; previous snapshots to see changes done by plugins</li>
34
  </ul>
wp-reset.php CHANGED
@@ -3,14 +3,14 @@
3
  Plugin Name: WP Database Reset
4
  Plugin URI: https://wordpress.org/plugins/wordpress-database-reset/
5
  Description: Reset all or some WP database tables back to their original state.
6
- Version: 3.15
7
  Author: WebFactory Ltd
8
  Author URI: https://www.webfactoryltd.com/
9
  License: GNU General Public License
10
  Text-domain: wordpress-database-reset
11
  */
12
 
13
- define( 'DB_RESET_VERSION', '3.15' );
14
  define( 'DB_RESET_PATH', dirname( __FILE__ ) );
15
  define( 'DB_RESET_NAME', basename( DB_RESET_PATH ) );
16
  define( 'DB_RESET_FILE', __FILE__ );
3
  Plugin Name: WP Database Reset
4
  Plugin URI: https://wordpress.org/plugins/wordpress-database-reset/
5
  Description: Reset all or some WP database tables back to their original state.
6
+ Version: 3.16
7
  Author: WebFactory Ltd
8
  Author URI: https://www.webfactoryltd.com/
9
  License: GNU General Public License
10
  Text-domain: wordpress-database-reset
11
  */
12
 
13
+ define( 'DB_RESET_VERSION', '3.16' );
14
  define( 'DB_RESET_PATH', dirname( __FILE__ ) );
15
  define( 'DB_RESET_NAME', basename( DB_RESET_PATH ) );
16
  define( 'DB_RESET_FILE', __FILE__ );