Making WordPress.org

Opened 4 years ago

Closed 10 days ago

#6531 closed defect (bug) (fixed)

Error in pagination in plugin results, loading different query

Reported by: alvarogois Owned by: obenland
Priority: normal Milestone:
Component: Plugin Directory Keywords:
Cc:

Description

I did a search for "feed" tag in plugins directory. Got this result:

​https://wordpress.org/plugins/tags/feed/​https://wordpress.org/plugins/tags/feed/

Pagination shows 18 pages. When I click the Next link or the 2 link, I get this totally different query:

​https://wordpress.org/plugins/search/page/

I should, in fact, get here:

​https://wordpress.org/plugins/tags/feed/page/2/, right?

If I execute the same kind of search but with the tag "post", it seems to be OK. I can use pagination to navigate to page 2 of results.

I tried this in Chrome (logged-in) and Firefox (not logged-in). Also, in Firefox there seems to be some issue loading site files, a lot of content is not visible (menus, text, etc.): ​https://tinyurl.com/2m9lmlon.

Thanks.

Change History (4)

#1 @Otto42
4 years ago

Basically, the feed url conflicts with some of our predefined url patterns.

Suggest we eliminate those as possible tags.

#2 @dd32
4 years ago

Does this happen to regular WordPress tag archives for the term feed? Or is it specific to WordPress.org?

#3 @dd32
4 years ago

I can confirm that this isn't coming from WordPress.org code, it appears to be a bug in Core's Canonical.

​https://core.trac.wordpress.org/browser/trunk/src/wp-includes/canonical.php?rev=53043&marks=430,437,443#L427

Filed an upstream issue: ​https://core.trac.wordpress.org/ticket/56937

Thank you for bringing this up @alvarogois.

We could patch around this on the plugin directory, this works as expected for me:
(Per upstream tickets, and past meta tickets, this also affects the rss tag and a few others, so this is not a complete solution)

// Make paginated versions of /tags/feed accessible. #core56937
add_filter( 'redirect_canonical', function( $redirect_url, $requested_url ) {
	if (
		str_contains( $requested_url, '/tags/feed/' ) &&
		! str_contains( $redirect_url, '/tags/feed/' )
	) {
		$redirect_url = str_replace( '/tags/', '/tags/feed/', $redirect_url );
	}

	return $redirect_url;
}, 1, 2 );
Last edited 4 years ago by dd32 (previous) (diff)

#4 @obenland
10 days ago

  • Owner set to obenland
  • Resolution → fixed
  • Status new → closed

In 15467:

Plugin Directory: Keep pagination on tags that look like feed endpoints

Closes ​https://github.com/WordPress/wordpress.org/pull/1125.
Fixes #6531.

Note: See TracTickets for help on using tickets.