[wp-trac] [WordPress Trac] #64538: memoize wp_normalize_path

WordPress Trac noreply at wordpress.org
Sat Jan 24 04:18:58 UTC 2026


#64538: memoize wp_normalize_path
--------------------------------------+--------------------------
 Reporter:  josephscott               |       Owner:  (none)
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  7.0
Component:  General                   |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  performance
--------------------------------------+--------------------------
Changes (by dmsnell):

 * focuses:   => performance


Comment:

 @josephscott great work. this seems a bit non-controversial now,
 especially with the limited impact of the cache.

 linking here for posterity’s sake, I have proposed an update to
 `wp_normalize_path()` that removes the PCRE calls //and// eliminates the
 call to `stream_get_wrappers()`.

 In my little investigation is seems almost like a defect that we are using
 that function to determine if a path specifies a stream or not, because
 paths with valid stream schemes/protocols should definitely be retained
 even if the running PHP instance doesn’t happen to be aware of them.

 if a path is provided as `git+ssh://github.com/wordpress/wordpress-
 develop.git`, for example, it should //not// be transformed into
 `git+ssh:/github.com/...`, which is what the legacy code does. I think it
 would be good to consider eliminating the call to `wp_is_stream()`
 entirely regardless of what we do.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64538#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list