Yoast / Yoast/duplicate-post

'Clone' quick action redirects to dashboard if WP_SITEURL and WP_HOME are different domains

Open
#461 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
53
Forks
38
Avg merge
4d 8h
Merged PRs (30d)
1

Description

  • I've searched for any related issues and avoided creating a duplicate issue.
Please give us a description of what happened

When WordPress siteurl and home are on different domains or subdomains, cloning a post via the [Clone] link on the Posts/Pages edit.php page redirects the user to the Admin Dashboard page, not back to the edit.php page, as expected.

I can consistently reproduce this issue on different WordPress sites with WP v5.9.x (PHP 8.1) through 6.8.x (PHP 8.3).

To Reproduce
Step-by-step reproduction instructions
  1. In the WP Admin UI go to Settings > General and set the values of WordPress Address (URL) and Site Address (URL) to different domains.
  2. Go to the Posts page, hover over a post entry, and then click the Clone link that appears.
  3. Post is cloned to a new draft, and then the user is redirected to the Admin Dashboard page.
Expected results
  1. Cloning an article on the Posts page should redirect back to the Posts page after the post is successfully cloned. This is the experience when the WordPress Address and Site Address are the same domain regardless of path.
Actual results
  1. Cloning an article on the Posts page when the WordPress Address and Site Address are different domains (or subdomains) results in the user getting redirected to the Admin Dashboard page.
Screenshots, screen recording, code snippet

If possible, please provide a screenshot, a screen recording or a code snippet which demonstrates the bug.

Technical info
  • If relevant, which editor is affected (or editors):
  • Block Editor
  • Gutenberg Editor
  • Classic Editor
  • Other:
  • Which browser is affected (or browsers):
  • Chrome
  • Firefox
  • Safari
  • Other: MS Edge, Brave
Used versions
  • Yoast Duplicate Post 4.5
  • WordPress 5.9.10, 6.3.2, and 6.8.3
  • PHP 8.1, 8.2, and 8.3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Clone link handling in the WordPress Posts or Pages admin screen and trace how the redirect destination is built when WordPress Address and Site Address use different domains. Reproduce the issue with different domains, then verify that cloning returns to the Posts or Pages screen instead of the Dashboard.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.