mirror of
https://github.com/mainwp/mainwp-child.git
synced 2025-09-05 09:19:53 +08:00
This commit is contained in:
parent
dbc3a3ffb6
commit
27db6e70e8
4 changed files with 54 additions and 4 deletions
|
@ -11,7 +11,7 @@ include_once(ABSPATH . '/wp-admin/includes/plugin.php');
|
|||
|
||||
class MainWPChild
|
||||
{
|
||||
private $version = '2.0.6';
|
||||
private $version = '2.0.7';
|
||||
private $update_version = '1.0';
|
||||
|
||||
private $callableFunctions = array(
|
||||
|
@ -1816,6 +1816,20 @@ class MainWPChild
|
|||
$excludes[] = str_replace(ABSPATH, '', $uploadDir);
|
||||
$excludes[] = str_replace(ABSPATH, '', WP_CONTENT_DIR) . '/object-cache.php';
|
||||
|
||||
$uname = @posix_uname();
|
||||
if (is_array($uname) && isset($uname['nodename']))
|
||||
{
|
||||
if (stristr($uname['nodename'], 'hostgator'))
|
||||
{
|
||||
if (!isset($_POST['file_descriptors']) || $_POST['file_descriptors'] == 0 || $_POST['file_descriptors'] > 1000)
|
||||
{
|
||||
$_POST['file_descriptors'] = 1000;
|
||||
}
|
||||
$_POST['file_descriptors_auto'] = 0;
|
||||
$_POST['loadFilesBeforeZip'] = false;
|
||||
}
|
||||
}
|
||||
|
||||
$file_descriptors = (isset($_POST['file_descriptors']) ? $_POST['file_descriptors'] : 0);
|
||||
$file_descriptors_auto = (isset($_POST['file_descriptors_auto']) ? $_POST['file_descriptors_auto'] : 0);
|
||||
if ($file_descriptors_auto == 1)
|
||||
|
|
|
@ -240,11 +240,19 @@ class MainWPCloneInstall
|
|||
$tableName = '';
|
||||
$wpdb->query('SET foreign_key_checks = 0');
|
||||
$handle = @fopen(WP_CONTENT_DIR . '/dbBackup.sql', 'r');
|
||||
|
||||
$lastRun = 0;
|
||||
if ($handle)
|
||||
{
|
||||
$readline = '';
|
||||
while (($line = fgets($handle, 81920)) !== false)
|
||||
{
|
||||
if (time() - $lastRun > 20)
|
||||
{
|
||||
@set_time_limit(0); //reset timer..
|
||||
$lastRun = time();
|
||||
}
|
||||
|
||||
$readline .= $line;
|
||||
if (!stristr($line, ";\n") && !feof($handle)) continue;
|
||||
|
||||
|
@ -559,12 +567,14 @@ class MainWPCloneInstall
|
|||
|
||||
return $this->archiver->extractTo(ABSPATH);
|
||||
}
|
||||
else if ($this->checkWPZip())
|
||||
else if ((filesize($this->file) >= 50000000) && $this->checkWPZip())
|
||||
return $this->extractWPZipBackup();
|
||||
else if ($this->checkZipConsole())
|
||||
return $this->extractZipConsoleBackup();
|
||||
else if ($this->checkZipSupport())
|
||||
return $this->extractZipBackup();
|
||||
else if ((filesize($this->file) < 50000000) && $this->checkWPZip())
|
||||
return $this->extractWPZipBackup();
|
||||
else
|
||||
return $this->extractZipPclBackup();
|
||||
}
|
||||
|
@ -591,6 +601,32 @@ class MainWPCloneInstall
|
|||
{
|
||||
MainWPHelper::getWPFilesystem();
|
||||
global $wp_filesystem;
|
||||
|
||||
//First check if there is a database backup in the zip file, these can be very large and the wordpress unzip_file can not handle these!
|
||||
// if ($this->checkZipSupport())
|
||||
// {
|
||||
// return $this->extractZipBackup();
|
||||
// $zip = new ZipArchive();
|
||||
// $zipRes = $zip->open($this->file);
|
||||
// if ($zipRes)
|
||||
// {
|
||||
// $stats = $zip->statName('wp-content/dbBackup.sql');
|
||||
//
|
||||
// @$zip->extractTo(ABSPATH);
|
||||
//
|
||||
// $zip->deleteName('wp-content/dbBackup.sql');
|
||||
// $zip->deleteName('clone');
|
||||
// $zip->close();
|
||||
//
|
||||
// $zip->close();
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return $this->extractZipPclBackup();
|
||||
// }
|
||||
|
||||
|
||||
$tmpdir = ABSPATH;
|
||||
if (($wp_filesystem->method == 'ftpext') && defined('FTP_BASE'))
|
||||
{
|
||||
|
|
|
@ -144,7 +144,7 @@ class MainWPHelper
|
|||
//Search for all the images added to the new post
|
||||
//some images have a href tag to click to navigate to the image.. we need to replace this too
|
||||
$foundMatches = preg_match_all('/(<a[^>]+href=\"(.*?)\"[^>]*>)?(<img[^>\/]*src=\"((.*?)(png|gif|jpg|jpeg))\")/ix', $new_post['post_content'], $matches, PREG_SET_ORDER);
|
||||
if (($foundMatches > 0 || ($is_robot_post && $wpr_options['wpr_save_images'] == "Yes")) && (!$is_ezine_post))
|
||||
if (($foundMatches > 0 || ($is_robot_post && isset($wpr_options['wpr_save_images']) && $wpr_options['wpr_save_images'] == "Yes")) && (!$is_ezine_post))
|
||||
{
|
||||
//We found images, now to download them so we can start balbal
|
||||
foreach ($matches as $match)
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
Description: Child Plugin for MainWP. The plugin is used so the installed blog can be securely managed remotely by your network. Plugin documentation and options can be found here http://docs.mainwp.com
|
||||
Author: MainWP
|
||||
Author URI: http://mainwp.com
|
||||
Version: 2.0.7-beta
|
||||
Version: 2.0.7
|
||||
*/
|
||||
header('X-Frame-Options: ALLOWALL');
|
||||
//header('X-Frame-Options: GOFORIT');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue