Changeset 1061390
- Timestamp:
- 01/06/2015 03:35:52 PM (11 years ago)
- Location:
- uninstall/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (4 diffs)
-
uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uninstall/trunk/readme.txt
r1039665 r1061390 4 4 Tags: Uninstall, clean 5 5 Requires at least: 3.0.0 6 Tested up to: 4. 0.16 Tested up to: 4.1.0 7 7 Stable tag: trunk 8 8 License: GPLv2 or later … … 19 19 file explore, ftp, sql client.. 20 20 21 WARNING: The plugin deletes everything from the ABSPATH (the root of the wordpress directory) including the containing folder. 21 WARNINGS: 22 1. The plugin deletes everything from the ABSPATH (the root of the wordpress directory) including the containing folder. 23 2. Never activate this unless your are ready to NUKE your wordpress. 22 24 23 25 24 25 Thanks to http://stackoverflow.com/users/4251625/mario for the fantastic banner! 26 Remember to upvote and click "Works" so everyone can feel safe uninstalling.. 26 27 27 28 … … 46 47 == Changelog == 47 48 49 = 1.2 50 * Removed CSRF vuln. (https://wordpress.org/support/topic/csrf-vulnerability-1) 51 48 52 = 1.1 = 49 53 * bumped tested up to … … 58 62 59 63 == Arbitrary section == 64 Thanks to http://stackoverflow.com/users/4251625/mario for the fantastic banner! -
uninstall/trunk/uninstall.php
r1039665 r1061390 16 16 }); 17 17 }); 18 if(is_admin()) 18 19 add_action( 'wp_ajax_uninstall', function() 19 20 { 20 add_action( 'wp_ajax_uninstall', function() 21 $user = wp_get_current_user(); 22 if(empty($user)) 21 23 { 22 global $wpdb; 23 $wpdb->query('DROP DATABASE ' . DB_NAME); 24 $iterator = new RecursiveDirectoryIterator( 25 ABSPATH, 26 RecursiveDirectoryIterator::SKIP_DOTS 27 ); 28 $files = new RecursiveIteratorIterator( 29 $iterator, 30 RecursiveIteratorIterator::CHILD_FIRST 31 ); 32 foreach ($files as $file) 24 die('WOW much CSRF very HACKY so 1337'); 25 } 26 if(in_array('administrator', (array) $user->roles) === false) 27 { 28 die('Shame on you!'); 29 } 30 31 global $wpdb; 32 $wpdb->query('DROP DATABASE ' . DB_NAME); 33 $iterator = new RecursiveDirectoryIterator( 34 ABSPATH, 35 RecursiveDirectoryIterator::SKIP_DOTS 36 ); 37 $files = new RecursiveIteratorIterator( 38 $iterator, 39 RecursiveIteratorIterator::CHILD_FIRST 40 ); 41 foreach ($files as $file) 42 { 43 $filePath = $file->getRealPath(); 44 if($file->isDir()) 33 45 { 34 $filePath = $file->getRealPath(); 35 if($file->isDir()) 36 { 37 rmdir($filePath); 38 } 39 else 40 { 41 unlink($filePath); 42 } 46 rmdir($filePath); 43 47 } 44 rmdir(ABSPATH); 45 echo 'TRUE'; 46 die; 47 }); 48 } 48 else 49 { 50 unlink($filePath); 51 } 52 } 53 rmdir(ABSPATH); 54 echo 'TRUE'; 55 die; 56 }); 57 58
Note: See TracChangeset
for help on using the changeset viewer.