Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fast follow: Redirections of deprecated site editor URLs. #68971

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

peterwilsoncc
Copy link
Contributor

@peterwilsoncc peterwilsoncc commented Jan 30, 2025

What?

Follow up to #67199
Incorporating changes in WordPress/wordpress-develop#7903
See https://core.trac.wordpress.org/ticket/62585
See #67199

  • Adds docblock to gutenberg_get_site_editor_redirection()
  • Uses wp_safe_redirect()
  • Uses temporary redirect instead of a 301

Why?

Bringing suggested changes from WordPress/wordpress-develop#7903 to the plugin

  • Docblocks are good
  • For redirects within WP it's best to use safe redirects to validate the destination
  • Logged in and logged out users will be redirected to different locations, so 302 redirects are needed to ensure the browser doesn't cache an incorrect destination

How?

As above.

Testing Instructions

  1. Log in to WP
  2. Visit a deprecated site editor URL
  3. Ensure it redirects to the expected location
  4. [Repeat for multiple deprecated URLs]
  5. Log out of WP
  6. Visit a deprecated site editor URL
  7. Ensure it redirects to the login screen rather than the new URL

If you've tested the redirection of site editor URLs in the past, your browser may have the permanent redirects cached. If that is the case, you will need to test in a browser you don't usually use.

Testing Instructions for Keyboard

N/A

Screenshots or screencast

N/A

@peterwilsoncc peterwilsoncc added the [Type] Code Quality Issues or PRs that relate to code quality label Jan 30, 2025
@peterwilsoncc peterwilsoncc self-assigned this Jan 30, 2025
@peterwilsoncc peterwilsoncc marked this pull request as ready for review January 30, 2025 23:54
Copy link

github-actions bot commented Jan 30, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: peterwilsoncc <[email protected]>
Co-authored-by: Mamaduka <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link

Flaky tests detected in 6ec9aca.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/13063322070
📝 Reported issues:

Copy link
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @peterwilsoncc!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants