# photonic/2.29/uninstall.php

Photonic Gallery &amp; Lightbox for Flickr, SmugMug &amp; Others, version 2.29. 46 lines.

- Page: https://pluginprobe.com/plugins/photonic/2.29/code/uninstall.php
- Raw: https://pluginprobe.com/plugins/photonic/2.29/raw/uninstall.php
- Modified: 2019-08-21T23:34:38+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/photonic/2.29/code/uninstall.php#L10-L20`.

```php
<?php
if (!defined('WP_UNINSTALL_PLUGIN')) exit;

delete_option('photonic_options');
delete_option('photonic_authentication');
delete_option('photonic_css');


/*$url = wp_nonce_url('plugins.php?page=photonic-options-manager');
if (false === ($creds = request_filesystem_credentials($url, '', false, false))) {
	return true;
}

if (!WP_Filesystem($creds)) {
	request_filesystem_credentials($url, '', true, false);
	return true;
}

global $wp_filesystem;
if (!is_dir(PHOTONIC_UPLOAD_DIR)) {
	if (!$wp_filesystem->mkdir(PHOTONIC_UPLOAD_DIR)) {
		echo "<div class='error'><p>Failed to create directory ".PHOTONIC_UPLOAD_DIR.". Please check your folder permissions.</p></div>";
		return false;
	}
}

$filename = trailingslashit(PHOTONIC_UPLOAD_DIR).'custom-styles.css';

if (empty($custom_css)) {
	return false;
}

if (!$wp_filesystem->put_contents($filename, $custom_css, FS_CHMOD_FILE)) {
	echo "<div class='error'><p>Failed to save file $filename. Please check your folder permissions.</p></div>";
	return false;
}



$upload_dir = wp_upload_dir();
$photonic_dir = trailingslashit($upload_dir['basedir']).'photonic';
if (@file_exists($photonic_dir)) {
	WP_Filesystem_Direct::delete($upload_dir, true);
}
*/

```
