topdown / VVV-Dashboard

Dashboard for Varying Vagrant Vagrants https://github.com/Varying-Vagrant-Vagrants/VVV
253 stars 40 forks source link

WP DEBUG not showing from Duplicator Imported SItes #35

Open neilgee opened 8 years ago

neilgee commented 8 years ago

I sometimes use Duplicator packages to import sites into a blank VVV created site but after the import even though the wp-config.php file is present and _WPDEBUG is defined the VVV-Dashboard declares it as not installed.

Any workarounds for this?

topdown commented 8 years ago

Couple things, What version of the VVV Dashboard are you using? Do a pull to make sure you are using the latest 0.1.7 which has a ton of changes for loading hosts. Make sure you Purge the hosts after. I assume you purged the host cache?

Could you give me detailed instructions of the process you use including creating the blank VVV site. This will allow me to use your exact process to debug the issue. Thanks

neilgee commented 8 years ago

Using VVV Dashboard 0.1.7, yes I have purged the hosts cache.

How I am creating sites normally is with Variable VVV and that all works fine, but If i create a blank site with a blank db using vv create blank-with-db and then bring in a Duplicator package by running its installer.php script the site comes in fine but in VVV Dashboard it says the debug mode is not installed.

topdown commented 8 years ago

OK, I will test that process and get back to you. Thanks.

topdown commented 8 years ago

Ok, so using this process causes some issues, but not just with VVV Dashboard, but it will break vagrant up also because it will not run the correct procedures on the new blank site because the vvv-init.sh is not right. Its fairly easy to fix.

When you use a plugin like Duplicator and/or create a blank site, you have to modify the vvv-init.sh file. Also for all features of VVV Dashboard to work you need a wp-cli.yml file.

If you look at another WP site created with vv create and compare the root folder you will see the changes and missing items. But here is a breakdown

Go to your VVV/www/your_site folder Create a file named wp-cli.yml in it put path: htdocs No new lines or trailing white space.

Then open that sites vvv-init.sh in an editor You need to make it look like this, changing blank/htdocs...' to the correct path --dbname="blank" to the correct database and --url=blank.dev to the correct URL and if any of the other database creds are not correct, Eg. --dbuser=wp --dbpass=wp

if [ ! -d "htdocs/wp-admin" ]; then
    echo 'Installing WordPress (release version) in blank/htdocs...'
    if [ ! -d "./htdocs" ]; then
        mkdir ./htdocs
    fi
    cd ./htdocs
    wp core download --locale=en_US --allow-root 
    wp core config --dbname="blank" --dbuser=wp --dbpass=wp --dbhost="localhost" --dbprefix=wp_ --locale=en_US --allow-root --extra-php <<PHP
define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', false);
define('WP_DEBUG_LOG', true);
define('SCRIPT_DEBUG', true);
define('JETPACK_DEV_DEBUG', true);
PHP
    wp core install --url=blank.dev --title="blank" --admin_user=admin --admin_password=password --admin_email=admin@localhost.dev --allow-root

    cd -
fi

Purge the hosts and you should see it working properly now. Vagrant should also properly do backups and provisions for this site now also.

neilgee commented 8 years ago

Many thanks for the detailed response Jeff, I will be setting a few up like this in the next few days and will try it out.

topdown commented 8 years ago

@neilgee did you get this working?

neilgee commented 8 years ago

Hi Jeff, I tried a couple of times on 2 different sites but Dashboard still declares the debug as Not Installed - I have purged all caches and run a vagrant halt and vagrant up

I have changed both wp-cli.yml and vvv-init.sh as in your snippet, example below...

if [ ! -d "htdocs/wp-admin" ]; then
    echo 'Installing WordPress (release version) in ludwina2/htdocs...'
    if [ ! -d "./htdocs" ]; then
        mkdir ./htdocs
    fi
    cd ./htdocs
    wp core download --locale=en_US --allow-root
    wp core config --dbname="ludwina2" --dbuser=wp --dbpass=wp --dbhost="localhost" --dbprefix=wp_ --locale=en_US --allow-root --extra-php <<PHP
define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', false);
define('WP_DEBUG_LOG', true);
define('SCRIPT_DEBUG', true);
define('JETPACK_DEV_DEBUG', true);
PHP
    wp core install --url=ludwina2.dev --title="blank" --admin_user=admin --admin_password=password --admin_email=admin@localhost.dev --allow-root

    cd -
fi
topdown commented 8 years ago

Weird, your whole import process worked for me. Just out of curiosity, and I believe I check for both. But could you see if define('WP_DEBUG', true); in your wp-config.php is using single quotes or double?

neilgee commented 8 years ago

Singles

define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', false);
define('WP_DEBUG_LOG', true);
define('SCRIPT_DEBUG', true);
define('JETPACK_DEV_DEBUG', true);