| 1 |
<?php |
| 2 |
if (!defined('WP_UNINSTALL_PLUGIN')) exit; |
| 3 |
|
| 4 |
delete_option('photonic_options'); |
| 5 |
delete_option('photonic_authentication'); |
| 6 |
delete_option('photonic_css'); |
| 7 |
|
| 8 |
|
| 9 |
/*$url = wp_nonce_url('plugins.php?page=photonic-options-manager'); |
| 10 |
if (false === ($creds = request_filesystem_credentials($url, '', false, false))) { |
| 11 |
return true; |
| 12 |
} |
| 13 |
|
| 14 |
if (!WP_Filesystem($creds)) { |
| 15 |
request_filesystem_credentials($url, '', true, false); |
| 16 |
return true; |
| 17 |
} |
| 18 |
|
| 19 |
global $wp_filesystem; |
| 20 |
if (!is_dir(PHOTONIC_UPLOAD_DIR)) { |
| 21 |
if (!$wp_filesystem->mkdir(PHOTONIC_UPLOAD_DIR)) { |
| 22 |
echo "<div class='error'><p>Failed to create directory ".PHOTONIC_UPLOAD_DIR.". Please check your folder permissions.</p></div>"; |
| 23 |
return false; |
| 24 |
} |
| 25 |
} |
| 26 |
|
| 27 |
$filename = trailingslashit(PHOTONIC_UPLOAD_DIR).'custom-styles.css'; |
| 28 |
|
| 29 |
if (empty($custom_css)) { |
| 30 |
return false; |
| 31 |
} |
| 32 |
|
| 33 |
if (!$wp_filesystem->put_contents($filename, $custom_css, FS_CHMOD_FILE)) { |
| 34 |
echo "<div class='error'><p>Failed to save file $filename. Please check your folder permissions.</p></div>"; |
| 35 |
return false; |
| 36 |
} |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
$upload_dir = wp_upload_dir(); |
| 41 |
$photonic_dir = trailingslashit($upload_dir['basedir']).'photonic'; |
| 42 |
if (@file_exists($photonic_dir)) { |
| 43 |
WP_Filesystem_Direct::delete($upload_dir, true); |
| 44 |
} |
| 45 |
*/ |
| 46 |
|