public static function CheckInstallation()
{
global $mf_domain;
if (!empty($_GET['page']) && stripos($_GET['page'], "mf") === false && $_GET['page'] != "RCCWP_OptionsPage.php" && !isset($_GET['custom-write-panel-id'])) {
return;
}
$dir_list = "";
$dir_list2 = "";
wp_mkdir_p(MF_UPLOAD_FILES_DIR);
wp_mkdir_p(MF_CACHE_DIR);
wp_mkdir_p(MF_GET_CACHE_DIR);
// Giving full rights to folders. thanks Akis Kesoglou
if (!is_dir(MF_CACHE_DIR)) {
$dir_list2 .= "<li>" . MF_CACHE_DIR . "</li>";
} elseif (!is_writable(MF_CACHE_DIR)) {
$dir_list .= "<li>" . MF_CACHE_DIR . "</li>";
}
if (!is_dir(MF_UPLOAD_FILES_DIR)) {
$dir_list2 .= "<li>" . MF_UPLOAD_FILES_DIR . "</li>";
} elseif (!is_writable(MF_UPLOAD_FILES_DIR)) {
$dir_list .= "<li>" . MF_UPLOAD_FILES_DIR . "</li>";
}
if ($dir_list2 != "") {
echo "<div id='magic-fields-install-error-message' class='error'><p><strong>" . __('Magic Fields is not ready yet.', $mf_domain) . "</strong> " . __('must create the following folders (and must chmod 777):', $mf_domain) . "</p><ul>";
echo $dir_list2;
echo "</ul></div>";
}
if ($dir_list != "") {
echo "<div id='magic-fields-install-error-message-2' class='error'><p><strong>" . __('Magic Fields is not ready yet.', $mf_domain) . "</strong> " . __('The following folders must be writable (usually chmod 777 is neccesary):', $mf_domain) . "</p><ul>";
echo $dir_list;
echo "</ul></div>";
}
}