[wp-trac] [WordPress Trac] #17670: PHP Notices when Attachment is accessed via wrong url via pagerewrite
WordPress Trac
wp-trac at lists.automattic.com
Wed Aug 24 19:31:55 UTC 2011
#17670: PHP Notices when Attachment is accessed via wrong url via pagerewrite
------------------------------+------------------
Reporter: dd32 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.3
Component: Warnings/Notices | Version: 3.1
Severity: normal | Resolution:
Keywords: has-patch |
------------------------------+------------------
Comment (by chrisbliss18):
Just added fix-get_page_by_path-warnings-rewrite.diff. I was chasing this
before I knew a ticket existed for it. This fixes the issue that is
affecting all child pages.
The rewrite is because I noticed that some optimizations could be made,
and since this runs on all pages when permalinks are used, efficiency
should be kept in mind.
From my testing, my supplied patch showed a ~16% decrease in execution
time as compared to the existing code when using a test set of one levels
of depth, two sets of two levels of depth, and one set of three levels of
depth. I came up with a simple fix that is very similar to 17670.4.diff,
and it improved performance by ~8%, so the rewrite showed more benefit.
The get_page_by_path-benchmark.php attachment can be run to try these
benchmarks for yourself.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/17670#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list