Skip to content

Developer Debug Mode

Justin Sternberg edited this page Nov 1, 2016 · 5 revisions

The GatherContent WordPress plugin has a somewhat hidden developer debug feature intended for deeper debugging of issues with the plugin. If you are not familiar with PHP and debugging in PHP and Javascript, this mode is not recommended for you (rather, you should hit us up in the support forums).

The Debug Mode can be enabled two ways:

1) wp-config.php constant

The first method is to simply add define( 'GATHERCONTENT_DEBUG_MODE', true ); to your WordPress wp-config.php file. By doing so, the debug mode will always be on. We recommend you only do so when needing to debug or on a staging/test/development server.

2) Special URL query string

The second method is through a query string and is meant for remote debugging when you do not have access to the ftp access to the server.

Once enabled via this second method, debug mode will be enabled for 24hrs and then be disabled again automatically. This is for a few reasons. The debug mode adds additional options to the GatherContent settings page (<SITE_URL>/wp-admin/admin.php?page=gathercontent-import), which should not be generally available. The plugin also logs data to a log file (in wp-content/gathercontent-debug.log), and disabling after 24hrs will keep this log file from growing too large.

The following instructions will define how to enable via the special URL query string:

To enable:

  1. Enter your site's admin url followed by the query string, ?gathercontent_debug_mode=<MM-DD-YYYY>. (if the date is October 19, 2016, that url would look like <SITE_URL>/wp-admin/?gathercontent_debug_mode=10-19-2016)
  2. This will output a notice in your dashboard stating if the debug mode was enabled.
  3. Visit the GatherContent settings page, <SITE_URL>/wp-admin/admin.php?page=gathercontent-import

To disable:

Visit the GatherContent settings page and check the "Disable Debug Mode?" option and save changes, or go to <SITE_URL>/wp-admin/?gathercontent_debug_mode=0.

What happens in debug mode

  • Adds settings to the GatherContent settings page. You should see a section near the bottom titled, "Debug Mode". Options include:
    • Reviewing/deleting stuck sync statuses.
    • Viewing/deleting the GatherContent debug log file.
    • Disable debug mode.
  • Logs requests to the GatherContent API.
  • Logs GatherContent sync results.
  • Enables the plugin's script_debug mode (the same as having the constant SCRIPT_DEBUG set in your wp-config.php file).