#18467 closed task (blessed) (fixed)

Redirect to About WordPress page after upgrade

Reported by: sparkweb Owned by: nacin
Priority: normal Milestone: 3.3
Component: Upgrade/Install Version: 3.3
Severity: normal Keywords: has-patch
Cc: mike.schroder@…, allstruck, info@…

Description

When the plugins and themes are upgraded, there's a helpful menu option to "Go To WordPress Updates Page". This is a very useful link as it allows me to get back to the updates page easily. The core upgrade, though, doesn't have such a link (only Go To Dashboard). I often update a site and it's a two (or three) step process, updating core, plugins, and themes. It would be helpful if the updates link appeared on core updates as well.

Proposed Code Change, wp-admin/update-core.php, line 65.

Old Code

show_message( '<a href="' . esc_url( self_admin_url() ) . '">' . __('Go to Dashboard') . '</a> ' );

New Code:

show_message( '<a href="' . esc_url( self_admin_url() ) . '">' . __('Go to Dashboard') . '</a> | <a href="' . self_admin_url('update-core.php') . '" title="' . esc_attr__('Go to WordPress Updates page') . '" target="_parent">' . __('Return to WordPress Updates') . '</a>' );

Link copied from wp-admin/includes/class-wp-upgrader.php line 1202

Attachments (9)

18467.patch (734 bytes) - added by SergeyBiryukov 21 months ago.
18467.2.patch (1.5 KB) - added by ocean90 18 months ago.
18467.3.patch (1.9 KB) - added by ocean90 18 months ago.
18467.4.patch (1.6 KB) - added by ocean90 18 months ago.
Don't wait until page is rendered complete, redirect as fast as we can.
18467.diff (5.6 KB) - added by nacin 18 months ago.
18467.2.diff (5.6 KB) - added by nacin 18 months ago.
Fixes bad sprintf().
18467.alt.diff (4.8 KB) - added by nacin 18 months ago.
18467.3.diff (1.9 KB) - added by nacin 18 months ago.
TwoIsOneTooMuch.patch (780 bytes) - added by ocean90 18 months ago.

Download all attachments as: .zip

Change History (52)

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 3.3
  • Type changed from enhancement to task (blessed)

I'm hijacking this ticket so we can implement redirection/linking to the new about.php screen.

  • Keywords needs-patch added; has-patch removed

@nacin: Do you actually mean "linking from the new about.php screen"? I'll have @chexee add a back-to-updates link from about.php next to the Dashboard link. She's patching it right now and will post to #18742. One thing though -- prob need a snippet to check for permissions since we're showing about.php to everyone, not just people with update caps, yeah?

  • Owner set to ocean90
  • Status changed from new to assigned

No, I mean linking and/or redirecting from the core update to about.php.

  • Version changed from 3.2.1 to 3.3

18467.2.patch
Because a PHP redirect isn't possible (header already sent output) we need some Javascript magic here. Jane and rboren are fine with this.

  • I added a simple function which hooks into admin_footer-update-core.php
  • On success WP returns a link to dashboard, which can be checked via Javascript
  • If link is there redirect too admin_url( 'about.php?afterupgrade=1' )

And we shouldn't forget to add a hook for our next releases.

  • Summary changed from Standardize Language on Core Update to Redirect to About WordPress page after upgrade

In [19441]:

Hide unrelated maintenance message on update-core when you are running the latest version, and show a link to about.php. see #18467.

In [19442]:

Redirect to about.php on update. props ocean90. see #18467.

Leaving open to see if there is a hook we can abuse for a link that can work without JS, and other minor tweaks (discussed in IRC).

Cleared for beta 4.

Had a discussion with a tester on IRC that was confused by the behavior, because during a browser lag, they attempted to click the "Go to Dashboard" link after upgrade, and the browser then redirected to about.php (making it look like the link pointed to about.php).

In this case, at least, the PHP redirect would have been helpful.

If we only want users to continue to the Welcome/about page in this case, the link could also potentially be changed to match the behavior that would otherwise happen with the redirect.

  • Cc mike.schroder@… added
  • Cc allstruck added

@nacin:
How about leaving the auto-redirect with JS, and rewriting that link to the dashboard in a more explanatory way.
e.g.:
You should be redirect to LINK automatically.

Agreeing with DH-Shredder, the link should match the redirect. And unless there's going to be a lag between the redirect no other links seem necessary.

Agreeing with OP (sparkweb) as well, it would be nice to have the ability to link elsewhere. I would propose rather than adding links that an option be created to override the location (for both the link and redirect.)

My two cents is that power users will be annoyed at always being redirected away to an informational screen. I think it would be better to have the list of links - maybe a button inviting new users to find out what's new in 3.3.

I would rather the redirect. It's pretty common in open source software to get that kind of screen after an update. See Thunderbird, Mozilla, etc. Power user or not, an orientation to what's about to be different is useful.

I have to agree with jane... might there be room for links to "what you might want to do now" on the about page?

What would you think of that sparkweb?

Last edited 18 months ago by allstruck (previous) (diff)

@allstruck: I'd be okay with that. I just want an easy way to continue with my updates if that's the path I want to take.

Just installed 3.3 beta 4 and I like the new welcome screen a lot. I think my only request would be to have the "Return to Dashboard" links on the bottom be available at the top of the page as well so scrolling to the bottom wouldn't be required.

  • Owner changed from ocean90 to nacin
  • Status changed from assigned to accepted

I've got further tweaks planned for this prior to RC1. The links and redirect will be polished a bit.

Last edited 18 months ago by nacin (previous) (diff)

allstruck: Please have in mind, that new strings can't be translated by WordPress < 3.3, without reloading the language files.

wp-admin/includes/update-core.php is the only file, which will be replaced during the upgrade and included again.

comment:23 follow-up: ↓ 26   jane18 months ago

@nacin: What tweaks were you thinking of doing?

I don't want to mar the page with links at the top. The regular navigation already provides access to the main Dashboard by way of the ever-present admin menu. Adding another link to Dashboard at top of screen would be repetitive and cluttering. That point also addresses @allweb's suggestion. We don't need a bunch of 'what do you want to do now' links -- they can get anywhere with a single click already using the left nav.

Last edited 18 months ago by jane (previous) (diff)

I think reloading the textdomain could bring us some nice improvments. We can add a info what is happing and maybe show a link for no-js.

	// Load the default text localization domain.
	$locale = get_locale();
	load_textdomain( 'default', WP_LANG_DIR . "/$locale.mo" );
Version 0, edited 18 months ago by ocean90 (next)

18467.3.patch is another approach.

  • We can add an action in update_core named _core_updated_successfully
  • Now we can hook into it and do some magic.

Don't wait until page is rendered complete, redirect as fast as we can.

comment:26 in reply to: ↑ 23   nacin18 months ago

Replying to jane:

@nacin: What tweaks were you thinking of doing?

I don't want to mar the page with links at the top. The regular navigation already provides access to the main Dashboard by way of the ever-present admin menu. Adding another link to Dashboard at top of screen would be repetitive and cluttering. That point also addresses @allweb's suggestion. We don't need a bunch of 'what do you want to do now' links -- they can get anywhere with a single click already using the left nav.

@Jane, only referring to links like 'Go to Dashboard' on the core update itself. Nothing more on the About page.

  • Keywords has-patch added; needs-patch removed

I didn't see ocean90's comments or patches until now. Nice work. :)

I will test this out, but it's very close to what I was going to try to do. Probably better.

comment:28 follow-up: ↓ 29   duck_18 months ago

If we hook into update_core() we could remove the version_compare() on $GLOBALS['wp_version']. Currently we will have to update the comparison number every version.

comment:29 in reply to: ↑ 28   nacin18 months ago

Replying to duck_:

If we hook into update_core() we could remove the version_compare() on $GLOBALS['wp_version']. Currently we will have to update the comparison number every version.

I think ocean90's idea was that this would be for 3.3 only and we would make it less hacky now, to apply for 3.3+.

Nacin is right. We should place the same (more or less) in do_core_upgrade().

One point for about.php "Return to Dashboard → Updates" isn't the right string for multisite, IMO.

nacin18 months ago

18467.diff:

  • Debug Code — Includes debugging code. Specifically, the window.location bits are commented out and files are not copied. This means your install will not be overridden with the nightly, and your in situ wp-admin/includes/update-core.php will be used.
  • Includes no-JS support – namely, a separate string. The no-JS string looks like this:

Welcome to WordPress %1$s. You will be redirected to the About WordPress screen. If not, click <a href="%s">here</a>.

  • The with-JS string looks like this:

Welcome to WordPress %1$s. <a href="%2$s">Learn more</a>.

  • As discussed with ocean90 and duck_, I made it so _redirect_to_about_wordpress() only fires when the current install is < 3.3. Once the install is 3.3, the new strings will be in the POT file, and the new code will be in place in wp-admin/update-core.php.
  • I needed to alter the return of wp_update_core() to include the *new* version number, otherwise I couldn't do the previous bullet point. This makes me second-guess the previous bullet point as unnecessary.
  • In multisite, about.php?updated now links back to the network/update-core.php file.

Thoughts?

nacin18 months ago

Fixes bad sprintf().

nacin18 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In [19524]:

Finalize the code which redirects to about.php after a core update. Only triggers on update-core.php in case wp_update_core() is called in a different context.
props ocean90 for initial patch. fixes #18467.

In [19527]:

Use GLOBALS. see #18467.

In [19529]:

Push logic into _redirect_to_about_wordpress() and be more specific about which context this runs under. see #18467.

  • Resolution fixed deleted
  • Status changed from closed to reopened

Variable collision and leftover debug.

nacin18 months ago

Looks good.

  • Resolution set to fixed
  • Status changed from reopened to closed

In [19532]:

Remove debug cruft and fix variable collision. fixes #18467.

  • Resolution fixed deleted
  • Status changed from closed to reopened

Looks good.

  • Resolution set to fixed
  • Status changed from reopened to closed

In [19535]:

Remove duplicated line. props ocean90, fixes #18467.

  • Cc info@… added
  • Resolution fixed deleted
  • Status changed from closed to reopened

After some tests I strongly suggest not to redirect if there are still plugins waiting for an update. In this case there is no time to read the about page anyway, and the extra click back to the update page is just wasting time.

  • Resolution set to fixed
  • Status changed from reopened to closed

You may open a new ticket, but I assume it will be closed quickly. For a user, the about page is not a waste of time. Plugins can wait 5-10 minutes.

Note: See TracTickets for help on using tickets.