|
|
@ -14,7 +14,19 @@ echo shell_exec( 'wp db import ./wp-content/mysql.sql' ); |
|
|
|
|
|
|
|
|
$domain = shell_exec( 'wp option get siteurl' ); |
|
|
$domain = shell_exec( 'wp option get siteurl' ); |
|
|
$search_replace = trim( $domain ) . ' ' . trim( $staging_domain ); |
|
|
$search_replace = trim( $domain ) . ' ' . trim( $staging_domain ); |
|
|
echo shell_exec( "wp search-replace $search_replace --all-tables" ); |
|
|
|
|
|
|
|
|
// Replace the domain in the database. |
|
|
|
|
|
echo "--------------------------------"; |
|
|
|
|
|
echo "Performing search and replace:"; |
|
|
|
|
|
echo "wp search-replace $search_replace --all-tables"; |
|
|
|
|
|
echo "--------------------------------"; |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
echo shell_exec( "wp search-replace $search_replace --all-tables" ); |
|
|
|
|
|
} catch ( Exception $e ) { |
|
|
|
|
|
echo "Error: " . $e->getMessage(); |
|
|
|
|
|
exit( 1 ); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
rmdir( './wp-content/plugins/post-smtp' ); |
|
|
rmdir( './wp-content/plugins/post-smtp' ); |
|
|
rmdir( './wp-content/plugins/wordfence' ); |
|
|
rmdir( './wp-content/plugins/wordfence' ); |
|
|
|