fix/86: Display notice with vertices that cause a redirect cycle/loop #341
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #86
Closes #87
Description of the Change
In PR #336, we use DFS to bring down the cycle detection time from
O(n^2)
toO(V+E)
. We also returned as soon as the first cycle was detected.In this PR, we make small adjustments to record all detected cycles by not returning early and then display the "Redirect To" values that cause cycles in a warning notice.
This PR also sets the default value of the filter
srm_check_for_possible_redirect_loops
totrue
as there is no negative performance hit and also helps to detect a redirect loop during the time of creating redirects.How to test the Change
srm_max_redirects
number to something more than 10,000.wp transient delete --all
/wp-admin/edit.php?post_type=redirect_rule
Changelog Entry
Credits
Props @joshbetz @nicoladj77 @Sidsector9
Checklist: