[wp-trac] [WordPress Trac] #18385: Canonical redirections not suited for Queries with multiple query vars and "pretty permalinks" in general

WordPress Trac wp-trac at lists.automattic.com
Fri Aug 12 09:05:04 UTC 2011


#18385: Canonical redirections not suited for Queries with multiple query vars and
"pretty permalinks" in general
-------------------------+-----------------------------
 Reporter:  dd32         |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Canonical    |    Version:  3.2
 Severity:  normal       |   Keywords:  dev-feedback
-------------------------+-----------------------------
 When the Canonical code was originally written, it served it's purpose
 quite well. However, over the years the number of Query vars which can be
 used to access content via has increased, and so have the number of
 archive views. This has lead to increased complexity in the Taxonomy
 canonical code which has needlessly caused bugs.

 What I'm proposing, is that it might be time to lay to rest the current
 `if.. elseif.. elseif..` style checks, It's not possible for 1 if branch
 to handle every single access point without duplicating another branch.

 As a result, I've put a half-finished together alternate version of
 Canonical, It's based on tallying up which query vars have been
 used/accounted for and removing any duplicates.. It's certainly not the
 best, but it's fairing better with the unit tests so far.

 {{{
 Unit Testing: http://unit-tests.trac.wordpress.org/browser/wp-
 testcase/test_includes_canonical.php
 Before: FF.......FFFF..FFF.....F......FFFFFF.F....F.....FF....FF...
  After: FF...........FFF..................FF..................F....
 }}}

 It's a work in progress, but it's worth considering IMO.

 Attaching a diff, and the full file (since the diff is going to be rather
 unreadable in some sections)

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18385>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list