Added PHP version
This commit is contained in:
@@ -0,0 +1,65 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
if ( ! file_exists( 'wp-content/mysql.sql' ) ) {
|
||||||
|
echo 'wp-content/mysql.sql file not found';
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$staging_domain = shell_exec( 'wp option get siteurl' );
|
||||||
|
echo shell_exec( 'wp db import ./wp-content/mysql.sql' );
|
||||||
|
|
||||||
|
$domain = shell_exec( 'wp option get siteurl' );
|
||||||
|
$search_replace = trim( $domain ) . ' ' . trim( $staging_domain );
|
||||||
|
echo shell_exec( "wp search-replace $search_replace --all-tables" );
|
||||||
|
|
||||||
|
rmdir( './wp-content/plugins/post-smtp' );
|
||||||
|
rmdir( './wp-content/plugins/wordfence' );
|
||||||
|
rmdir( './wp-content/plugins/wp-imgix*' );
|
||||||
|
|
||||||
|
$plugins = [
|
||||||
|
'wp-2fa',
|
||||||
|
'post-smtp',
|
||||||
|
'wordfence',
|
||||||
|
'wp-mail-smtp',
|
||||||
|
'wp-rocket',
|
||||||
|
'webp-express',
|
||||||
|
'wps-hide-login',
|
||||||
|
'two-factor',
|
||||||
|
'google-pagespeed-insights',
|
||||||
|
'google-captcha',
|
||||||
|
'akamai',
|
||||||
|
'akismet',
|
||||||
|
'disable-comments-rb',
|
||||||
|
'mainwp-child',
|
||||||
|
'mainwp-child-reports',
|
||||||
|
'wp-security-audit-log',
|
||||||
|
'activity-log-wp-seo',
|
||||||
|
'email-log',
|
||||||
|
'cloudflare',
|
||||||
|
'wp-test-email',
|
||||||
|
'two-factor-email-force',
|
||||||
|
'security-headers-axeweb',
|
||||||
|
'user-role-editor',
|
||||||
|
'user-switching',
|
||||||
|
'uipress',
|
||||||
|
'autoupdater',
|
||||||
|
'all-in-one-wp-migration',
|
||||||
|
'wp-file-manager',
|
||||||
|
'updraftplus',
|
||||||
|
'wp-smushit',
|
||||||
|
'akismet',
|
||||||
|
'leadin',
|
||||||
|
'clickcease-click-fraud-protection',
|
||||||
|
'gtm-server-side',
|
||||||
|
'contact-form-cfdb-7',
|
||||||
|
'contact-form-7-honeypot',
|
||||||
|
'neverbounce-hubspot',
|
||||||
|
'hotjar',
|
||||||
|
'insert-headers-and-footers',
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ( $plugins as $plugin ) {
|
||||||
|
echo shell_exec( "wp plugin deactivate $plugin" );
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user