/** * Gets the system checks which are not required * @return array An array of system checks */ public static function GetChecks() { $checks = array(); //WEB SERVER $web_test1 = false; foreach ($GLOBALS['DUPLICATOR_SERVER_LIST'] as $value) { if (stristr($_SERVER['SERVER_SOFTWARE'], $value)) { $web_test1 = true; break; } } $checks['SRV']['WEB']['model'] = $web_test1; $checks['SRV']['WEB']['ALL'] = $web_test1 ? 'Good' : 'Warn'; //PHP SETTINGS $php_test1 = ini_get("open_basedir"); $php_test1 = empty($php_test1) ? true : false; $php_test2 = ini_get("max_execution_time"); $php_test2 = $php_test2 > DUPLICATOR_SCAN_TIMEOUT || (strcmp($php_test2, 'Off') == 0 || $php_test2 == 0) ? true : false; $php_test3 = function_exists('mysqli_connect'); $checks['SRV']['PHP']['openbase'] = $php_test1; $checks['SRV']['PHP']['maxtime'] = $php_test2; $checks['SRV']['PHP']['mysqli'] = $php_test3; $checks['SRV']['PHP']['ALL'] = $php_test1 && $php_test2 && $php_test3 ? 'Good' : 'Warn'; //WORDPRESS SETTINGS global $wp_version; $wp_test1 = version_compare($wp_version, DUPLICATOR_SCAN_MIN_WP) >= 0 ? true : false; //Core Files $files = array(); $files['wp-config.php'] = file_exists(DUP_Util::SafePath(DUPLICATOR_WPROOTPATH . '/wp-config.php')); $wp_test2 = $files['wp-config.php']; //Cache $Package = DUP_Package::GetActive(); $cache_path = DUP_Util::SafePath(WP_CONTENT_DIR) . '/cache'; $dirEmpty = DUP_Util::IsDirectoryEmpty($cache_path); $dirSize = DUP_Util::GetDirectorySize($cache_path); $cach_filtered = in_array($cache_path, explode(';', $Package->Archive->FilterDirs)); $wp_test3 = $cach_filtered || $dirEmpty || $dirSize < DUPLICATOR_SCAN_CACHESIZE ? true : false; $checks['SRV']['WP']['version'] = $wp_test1; $checks['SRV']['WP']['core'] = $wp_test2; $checks['SRV']['WP']['cache'] = $wp_test3; $checks['SRV']['WP']['ALL'] = $wp_test1 && $wp_test2 && $wp_test3 ? 'Good' : 'Warn'; return $checks; }
/** * Gets the system checks which are not required * @return array An array of system checks */ public static function GetChecks() { $checks = array(); //CHK-SRV-100: PHP SETTINGS $php_test1 = ini_get("open_basedir"); $php_test1 = empty($php_test1) ? true : false; $php_test2 = ini_get("max_execution_time"); $php_test2 = $php_test2 > DUPLICATOR_SCAN_TIMEOUT || strcmp($php_test2, 'Off') == 0 || $php_test2 == 0 ? 'Good' : 'Warn'; $checks['CHK-SRV-100'] = $php_test1 && $php_test2 ? 'Good' : 'Warn'; //CHK-SRV-101: WORDPRESS SETTINGS //Version global $wp_version; $version_test = version_compare($wp_version, DUPLICATOR_SCAN_MIN_WP) >= 0 ? true : false; //Cache $Package = DUP_Package::GetActive(); $cache_path = DUP_Util::SafePath(WP_CONTENT_DIR) . '/cache'; $dirEmpty = DUP_Util::IsDirectoryEmpty($cache_path); $dirSize = DUP_Util::GetDirectorySize($cache_path); $cach_filtered = in_array($cache_path, explode(';', $Package->Archive->FilterDirs)); $cache_test = $cach_filtered || $dirEmpty || $dirSize < DUPLICATOR_SCAN_CACHESIZE ? true : false; //Core Files $files = array(); $files['wp-config.php'] = file_exists(DUP_Util::SafePath(DUPLICATOR_WPROOTPATH . '/wp-config.php')); $files_test = $files['wp-config.php']; $checks['CHK-SRV-101'] = $files_test && $cache_test && $version_test ? 'Good' : 'Warn'; //CHK-SRV-102: WEB SERVER $servers = $GLOBALS['DUPLICATOR_SERVER_LIST']; $test = false; foreach ($servers as $value) { if (stristr($_SERVER['SERVER_SOFTWARE'], $value)) { $test = true; break; } } $checks['CHK-SRV-102'] = $test ? 'Good' : 'Warn'; //RESULTS $result = in_array('Warn', $checks); $checks['Success'] = !$result; return $checks; }
public function GetServerChecks() { $dup_checks = array(); //CHK-SRV-100 $test = ini_get("open_basedir"); $dup_checks['CHK-SRV-100'] = empty($test) ? 'Good' : 'Warn'; //CHK-SRV-101 $cache_path = DUP_Util::SafePath(WP_CONTENT_DIR) . '/cache'; $dirEmpty = DUP_Util::IsDirectoryEmpty($cache_path); $dirSize = DUP_Util::GetDirectorySize($cache_path); //50K $dup_checks['CHK-SRV-101'] = $dirEmpty || $dirSize < 50000 ? 'Good' : 'Warn'; //CHK-SRV-102 $test = ini_get("max_execution_time"); $dup_checks['CHK-SRV-102'] = $test > DUPLICATOR_SCAN_TIMEOUT || strcmp($test, 'Off') == 0 || $test == 0 ? 'Good' : 'Warn'; //RESULTS $result = in_array('Warn', $dup_checks); $dup_checks['Success'] = !$result; return $dup_checks; }