Пример #1
0
                    continue;
                }
                $trouble[] = 'A URL found in one or more locations in wp-config.php was not migrated as it was either not recognized or in an unrecognized location in the file: "' . htmlentities($match) . '".';
            }
            if (false !== stristr($config_contents, 'COOKIE_DOMAIN')) {
                // Found cookie domain.
                $trouble[] = 'Cookie domain set in wp-config.php file and has not been updated. You may need to manualy update this.';
            }
        }
    }
    if (!file_exists(ABSPATH . '.htaccess')) {
        $trouble[] = 'Warning only: .htaccess file not found in WordPress root. This is used for permalinks on servers which support it. If needed or URLs result in a 404 you may regenerate this file by logging into the wp-admin & navigating to Settings: Permalinks and clicking "Save".';
    }
    if (count($trouble) > 0) {
        pb_backupbuddy::status('warning', 'Potential problems that may need your attention: ' . implode('; ', $trouble));
    } else {
        pb_backupbuddy::status('details', 'No potential problems detected.');
    }
    return $trouble;
}
// End trouble_scan().
if ($mode == 'html') {
    pb_backupbuddy::load_view('html_5', $data);
} else {
    // API mode.
    $result = migrate_database();
    if ($result === true) {
        migrate_wp_config();
        verify_database();
    }
}
Пример #2
0
<?php 
echo '<div class="wrap">';
rename_htaccess_temp_back();
// Rename .htaccess.bb_temp back to .htaccess.
echo pb_backupbuddy::$classes['import']->status_box('Migrating database content with ImportBuddy v' . pb_backupbuddy::$options['bb_version'] . '... Powered by BackupBuddy.');
echo '<div id="pb_importbuddy_working"><img src="' . pb_backupbuddy::plugin_url() . '/images/loading_large.gif" title="Working... Please wait as this may take a moment..."></div>';
pb_backupbuddy::flush();
$result = migrate_database();
verify_database();
// Remove any temporary .maintenance file created by ImportBuddy.
scrub_maintenance_file();
// Remove any temporary index.htm file created by ImportBuddy.
scrub_index_file();
echo '<script type="text/javascript">jQuery("#pb_importbuddy_working").hide();</script>';
if (true === $result) {
    $wpconfig_result = migrate_wp_config();
    if ($wpconfig_result !== true) {
        pb_backupbuddy::alert('Error: Unable to update wp-config.php file. Verify write permissions for the wp-config.php file then refresh this page. You may manually update your wp-config.php file by changing it to the following:<textarea readonly="readonly" style="width: 80%;">' . $wpconfig_result . '</textarea>');
    }
    pb_backupbuddy::status('message', 'Import complete!');
    echo '<h3>Imported Site: <a href="' . pb_backupbuddy::$options['home'] . '" target="_new">' . pb_backupbuddy::$options['home'] . '</a></h3>';
    echo '<img src="' . pb_backupbuddy::plugin_url() . '/images/bullet_error.png" style="float: left;"><div style="margin-left: 20px;"><b>Verify site functionality then proceed to the next step below</b> to cleanup the backup ZIP file, importbuddy.php, and other temporary files. You may view your entire import log for providing to support by clicking the "View Import Log" button below.</div>';
    echo '<form action="?step=6" method=post>';
    echo '<input type="hidden" name="pass_hash" id="pass_hash" value="' . htmlspecialchars(pb_backupbuddy::_POST('pass_hash')) . '">';
    echo '<input type="hidden" name="options" value="' . htmlspecialchars(serialize(pb_backupbuddy::$options)) . '" />';
    // Scan for 'trouble' such as a remaining .maintenance file, index.htm, index.html, missing wp-config.php, missing .htaccess, etc etc.
    $trouble = trouble_scan();
    if (count($trouble) > 0) {
        echo '<br>';
        $trouble_text = '';
        foreach ($trouble as $this_trouble) {