| 1 |
<?php |
| 2 |
/* |
| 3 |
This program is free software; you can redistribute it and/or |
| 4 |
modify it under the terms of the GNU General Public License |
| 5 |
as published by the Free Software Foundation; either version 2 |
| 6 |
of the License, or (at your option) any later version. |
| 7 |
|
| 8 |
This program is distributed in the hope that it will be useful, |
| 9 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 |
GNU General Public License for more details. |
| 12 |
|
| 13 |
You should have received a copy of the GNU General Public License |
| 14 |
along with this program; if not, write to the Free Software |
| 15 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 16 |
|
| 17 |
Copyright 2017 Buttonizer |
| 18 |
*/ |
| 19 |
|
| 20 |
namespace Buttonizer\Admin; |
| 21 |
|
| 22 |
# No script kiddies |
| 23 |
defined( 'ABSPATH' ) or die('No script kiddies please!'); |
| 24 |
|
| 25 |
class ResetButtonizer { |
| 26 |
|
| 27 |
public function __construct() { |
| 28 |
|
| 29 |
if(isset($_GET['realReset']) && $_GET['realReset'] == md5(BUTTONIZER_DIR)) { |
| 30 |
$this->reset(); |
| 31 |
|
| 32 |
echo '<h1>Bibbidi Bobbidi Boo!</h1>'; |
| 33 |
|
| 34 |
echo '<h2>The magic happened! Have fun with a clean Buttonizer :)</h2>'; |
| 35 |
}else{ |
| 36 |
echo '<p><b>What happens when I click the cool red button at the right side?</b><br /> |
| 37 |
What will happen is that the plugin will get a \'reset\'. All changes to Buttonizer will get reversed. From then you can start all-over again.</p>'; |
| 38 |
|
| 39 |
echo '<p> </p>'; |
| 40 |
|
| 41 |
echo '<p><b>Why would I do that?</b><br /> |
| 42 |
There can be many reasons to use the <b>red button</b>. One could be, you ruined the Buttonizer buttons, the settings, categories and you almost blew up your computer. Then you can use it. Or if you want to try it.</p>'; |
| 43 |
|
| 44 |
echo '<p> </p>'; |
| 45 |
|
| 46 |
echo '<p><b>What about my license?</b><br /> |
| 47 |
The license will not be touched. This button does only reset & remove: <ul> |
| 48 |
<li>- the Buttonizer buttons</li> |
| 49 |
<li>- the opening hours</li> |
| 50 |
<li>- general settings</li> |
| 51 |
<li>- page categories</li> |
| 52 |
</ul></p>'; |
| 53 |
|
| 54 |
echo '<p> </p>'; |
| 55 |
|
| 56 |
echo '<p><b>Okay, and then?</b><br /> |
| 57 |
Then Buttonizer will get to the default values again. Like you just installed Buttonizer. Nothing more, nothing less. Everything back to normal.</p>'; |
| 58 |
|
| 59 |
} |
| 60 |
} |
| 61 |
|
| 62 |
// Reset |
| 63 |
private function reset() { |
| 64 |
global $oButtonizerMaintain; |
| 65 |
|
| 66 |
update_option('buttonizer_buttons', ''); |
| 67 |
update_option('buttonizer_opening_settings', ''); |
| 68 |
update_option('buttonizer_general_settings', ''); |
| 69 |
update_option('buttonizer_page_categories', ''); |
| 70 |
|
| 71 |
$oButtonizerMaintain->pluginActivate(); |
| 72 |
} |
| 73 |
} |
| 74 |
|