Enabling Debugging/Logging for WPSiteSync

Often times when we’re working on issues with WPSiteSync, we need to ask customers to enable some debug logging so we can get a better idea of what’s going on. This article will walk you through the steps to do this.

First off, because WPSiteSync runs on both the Source site (where you’re syncing Content from) and Target site (where you’re syncing Content to), we may need to enable logging functions on both sites. If you’re experiencing authentication problems (getting the “Unable to Authenticate on Target site” message), you may only need to follow these steps on your Target site. But when in doubt, it’s best to do both.

Edit your wp-config.php file

1. Make a backup copy of your wp-config.php file by downloading this to your local machine.

2. Look for a line in the file that reads:

/* That's all, stop editing! Happy blogging. */

Just above this line, enter the following:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);

You may already have a define('WP_DEBUG', false);, or a define('WP_DEBUG_LOG', false);. Please make sure you only have one as duplicates will cause problems.

Save the changes you’ve made to the file. Then load the front page of your web site in your browser. If you see anything “strange” or see a completely white page, this indicates an error caused by something you missed in following the instructions. You will need to restore the wp-config.php file from your backup and try again.

Doing this will enable the logging features of WPSiteSync.

3. Try to reproduce the problem. If you are experiencing authentication problems, modifying the wp-config.php file on your Target and then re-entering your credentials from the Source site is all you need to do.

4. Next, locate the log file on the site. This is located in the wp-content/plugins/wpsitesynccontent/~log.txt file. Using your FTP client, download this to your local machine. Rename this file to one of either source~log.txt or target~log.txt, depending on which site you downloaded this from. This will help us to differentiate which log file is which while we’re evaluating them. Repeat this for both sites if you’re sending both log files, renaming the files as appropriate.

5. Next, check for general WordPress errors. The WP_DEBUG_LOG define enables WordPress’s error logging. These errors are placed in a wp-content/debug.log file. Using your FTP client again, download this to your local machine. Rename this file to one of either source~debug.log or target~debug.log so we know which site it came from. If you do not find this file, don’t worry. That just means there were no errors found and therefore nothing logged. Repeat this for both sites if you’re sending both log files, renaming the files as appropriate.

5. The last step is to send the files to us via our Support Page.

Once you’ve sent the files, you could replace the wp-config.php files from your backup to turn off debugging/logging. The log file in the WPSiteSync directory is protected from being downloaded but if you want to be extra careful, you can remove this file as well.

Being the Product Architect at ServerPress, LLC, Dave brings 35+ years of experience bridging traditional architecture with innovative Workflow solutions. Creator of WPSiteSync, among many other products, he loves pushing technology to the limit. His motto: No coffee. No code.