For your plugins, do not store any data under the data folder in a folder name like your plugin. This folder will be delete during your plugin upgrade and plugin upload
Text Formatted Code
// Extract the tarball to data so we can get the $pi_name name from admin/install.php
$archive->unpack($_CONF['path'] . 'data/',
array($dirname . '/admin/install.php'));
$plugin_inst = $_CONF['path'] . 'data/' . $dirname . '/admin/install.php';
$fdata = '';
$fhandle = @fopen($plugin_inst, 'r');
if ($fhandle) {
$fdata = fread($fhandle, filesize($plugin_inst));
fclose($fhandle);
}
// Remove the plugin from data/
require_once 'System.php';
@System::rm('-rf ' . $_CONF['path'] . 'data/' . $dirname);