#14382 closed defect (bug) (invalid)
extra pages loading unnecessarily
Reported by: | zengy | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | major | Version: | 3.0 |
Component: | Rewrite Rules | Keywords: | regression |
Focuses: | Cc: |
Description (last modified by )
I have a WP3 issue that I came across and I thought it should be posted here. I apologize if this has been posted previously. Please let me know if this issue exists as a current known bug.
I am coding a plugin that needs to do something on 'wp_head'. I was noticing that it was executing my code twice. I am now using error_log() to display the post ID and it is displaying the ID of the page I am loading plus another page ID.
This only happens when loading pages that have subpages associated with them. This bug occurs when a custom permalink structure is chosen. It does not happen when using the default permalink structure.
Here are steps to reproduce this issue:
1) Create a new WP3 site and create a .htaccess file.
2) Install and activate this plugin:
<?php /* * Plugin Name: Post ID Test */ function display_post_id() { global $post; error_log('post id: ' . $post->ID . ' | post title: ' . $post->post_title); } add_action('wp_head', 'display_post_id'); ?>
3) Create the following page hierarchy:
Page 1 Page 1.1 Page 1.2 Page 2
4) Change the permalink settings to "Day and Name".
5) Visit the front end for Page 2. Your error log will be something like this:
[21-Jul-2010 19:59:04] post id: 10 | post title: Page 2
6) Now visit the front end for Page 1. Your error log will be something like this:
[21-Jul-2010 20:00:46] post id: 4 | post title: Page 1 [21-Jul-2010 20:00:47] post id: 6 | post title: Page 1.1
7) Page 1.1 generates the following:
[21-Jul-2010 20:00:58] post id: 6 | post title: Page 1.1 [21-Jul-2010 20:00:58] post id: 8 | post title: Page 1.2
I tried this in W 2.9.2 and the issue does not exist.
Change History (25)
#4
in reply to:
↑ 2
@
14 years ago
Replying to scribu:
This is probably a theme issue. Does it happen with Twentyten also?
I thought it may have been a theme issue as well, but it isn't. It happens in Twentyten as well. To make sure, I tested this with a new install of WP3.
#7
@
14 years ago
- Component changed from Query to Rewrite Rules
- Keywords regression added; reporter-feedback removed
- Milestone changed from Awaiting Review to 3.1
Bug confirmed. The backtrace is identical in both cases.
#10
@
14 years ago
Glad to see this is happening for you as well. I have a project that is broken currently due to this bug. Is there any early insight as to what might be causing this? If so, I can go make a patch to the WP core to fix it for now.
I am using MAMP.
#15
follow-up:
↓ 16
@
14 years ago
I cant reproduce this.
Have you disabled all plugins?
What widgets do you have active?
Do the posts have anything in them other than Text? Images? Links?
Beef up the code a bit:
function display_post_id() { global $post; error_log('post id: ' . $post->ID . ' | post title: ' . $post->post_title . ' | Time:' . $_SERVER['REQUEST_TIME'] . ' | UserAgent:' . $_SERVER['HTTP_USER_AGENT']); } add_action('wp_head', 'display_post_id');
See if the User agent reveals anything, If its "WordPress.*" then its likely a HTTP callback, if its the browser, It could be a HTTP Accelerator which caches pages you're likely to visit
#16
in reply to:
↑ 15
@
14 years ago
OK, odd. Now I am not able to replicate it. I am wondering if this was some error in Apache?
#18
@
14 years ago
Still there:
post id: 747 | post title: Page 1 | Time:1280697910 | UserAgent:Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100723 Ubuntu/10.04 (lucid) Firefox/3.6.8 post id: 749 | post title: Page 1.1 | Time:1280697911 | UserAgent:Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100723 Ubuntu/10.04 (lucid) Firefox/3.6.8
#19
@
14 years ago
Just noticed that the problem does not appear if I use curl from the command line. I think Firefox prefetches the URL pointed to by the <link rel='next'> tag.
#20
@
14 years ago
- Resolution set to fixed
- Status changed from new to closed
Also, the issue doesn not appear in Chrome.
#22
@
14 years ago
- Milestone 3.1 deleted
- Resolution set to invalid
- Status changed from reopened to closed
I don't think there's much we can do here.
If somebody does comes up with a patch for this, feel free to reopen.
This is probably a theme issue. Does it happen with Twentyten also?