Debug wp_redirect | Scott Kingsley Clark | debug,redirects

Description

Important: It is not recommended you leave debugging enabled when you’re done, the debug information exposes file paths of files as well as PHP arguments passed into functions from the PHP debug_backtrace() which may contain sensitive information.

This is useful for those times when you have a lot of plugins and theme functions interacting and you just need to figure out what / where it’s redirecting.

This plugin outputs information about each wp_redirect() call done on the front of a site.

USAGE: ENABLING WITH THE SETTING

You can enable redirect debugging by going to Settings > Debug wp_redirect() on your site or in your network settings (if network activated). You have the option to enable debugging for frontend requests and/or admin dashboard requests. You also have the ability to only show debugging if the person is logged in or is an admin.

If you encounter problems with this plugin blocking redirects you need for logging in or being able to disable the redirect, simply rename the plugin or define this in your wp-config.php file: define( 'DEBUG_WP_REDIRECT', false );

USAGE: ENABLING THROUGH WP-CONFIG.PHP

You can define constants in your wp-config.php file to enable redirect handling for frontend / admin dashboard requests. Constants override any options set in the admin settings page.

  • To enable redirect debugging on the frontend of a site: define( 'DEBUG_WP_REDIRECT', true );
  • To enable redirect debugging in the admin dashboard of a site: define( 'DEBUG_WP_REDIRECT_ADMIN', true );
  • To only show redirect debugging to logged in admins of a site: define( 'DEBUG_WP_REDIRECT_LOGGED_IN_ADMIN', true );
  • To only show redirect debugging to logged in users of a site: define( 'DEBUG_WP_REDIRECT_LOGGED_IN', true );

USAGE: ENABLING DEBUGGING THROUGH PHP IN YOUR OWN CODE

You can programmatically enable/disable debugging when you have your own code you want to start/stop debugging after a certain point.

These functions will start/stop debugging the redirects whether it’s on a frontend or admin dashboard request.

  • Enable debugging: debug_wp_redirect_enable()
  • Disable debugging: debug_wp_redirect_disable()

CONTRIBUTE TO MAKE THIS PLUGIN BETTER

You can help to make this plugin better through GitHub or sponsor my time.

Installation

  1. Unpack the entire contents of this plugin zip file into your wp-content/plugins/ folder locally
  2. Upload to your site
  3. Navigate to wp-admin/plugins.php on your site (your WP Admin plugin page)
  4. Activate this plugin

OR you can just install it with WordPress by going to Plugins >> Add New >> and type this plugin’s name

Plugin author

Scott Kingsley Clark

Plugin official website address

https://wordpress.org/plugins/debug-wp-redirect/
If you encounter problems in using the Debug wp_redirect plugin, you can comment below, and I will try my best to help you solve the problem

Leave a Comment

Your email address will not be published. Required fields are marked *